%3 1. model.ad_reporting.ad_reporting__account_report 1. model.ad_reporting.ad_reporting__account_report 2. model.ad_reporting.ad_reporting__ad_group_report 2. model.ad_reporting.ad_reporting__ad_group_report 3. model.ad_reporting.ad_reporting__ad_report 3. model.ad_reporting.ad_reporting__ad_report 4. model.ad_reporting.ad_reporting__campaign_report 4. model.ad_reporting.ad_reporting__campaign_report 5. model.ad_reporting.ad_reporting__keyword_report 5. model.ad_reporting.ad_reporting__keyword_report 6. model.ad_reporting.ad_reporting__search_report 6. model.ad_reporting.ad_reporting__search_report 7. model.ad_reporting.ad_reporting__url_report 7. model.ad_reporting.ad_reporting__url_report 8. model.ad_reporting.int_ad_reporting__account_report 8. model.ad_reporting.int_ad_reporting__account_report 8. model.ad_reporting.int_ad_reporting__account_report->1. model.ad_reporting.ad_reporting__account_report 9. model.ad_reporting.int_ad_reporting__ad_group_report 9. model.ad_reporting.int_ad_reporting__ad_group_report 9. model.ad_reporting.int_ad_reporting__ad_group_report->2. model.ad_reporting.ad_reporting__ad_group_report 10. model.ad_reporting.int_ad_reporting__ad_report 10. model.ad_reporting.int_ad_reporting__ad_report 10. model.ad_reporting.int_ad_reporting__ad_report->3. model.ad_reporting.ad_reporting__ad_report 11. model.ad_reporting.int_ad_reporting__campaign_report 11. model.ad_reporting.int_ad_reporting__campaign_report 11. model.ad_reporting.int_ad_reporting__campaign_report->4. model.ad_reporting.ad_reporting__campaign_report 12. model.ad_reporting.int_ad_reporting__keyword_report 12. model.ad_reporting.int_ad_reporting__keyword_report 12. model.ad_reporting.int_ad_reporting__keyword_report->5. model.ad_reporting.ad_reporting__keyword_report 13. model.ad_reporting.int_ad_reporting__search_report 13. model.ad_reporting.int_ad_reporting__search_report 13. model.ad_reporting.int_ad_reporting__search_report->6. model.ad_reporting.ad_reporting__search_report 14. model.ad_reporting.int_ad_reporting__url_report 14. model.ad_reporting.int_ad_reporting__url_report 14. model.ad_reporting.int_ad_reporting__url_report->7. model.ad_reporting.ad_reporting__url_report 15. model.ad_reporting.metricflow_time_spine 15. model.ad_reporting.metricflow_time_spine 16. model.amazon_ads.amazon_ads__account_report 16. model.amazon_ads.amazon_ads__account_report 16. model.amazon_ads.amazon_ads__account_report->8. model.ad_reporting.int_ad_reporting__account_report 17. model.amazon_ads.amazon_ads__ad_group_report 17. model.amazon_ads.amazon_ads__ad_group_report 17. model.amazon_ads.amazon_ads__ad_group_report->9. model.ad_reporting.int_ad_reporting__ad_group_report 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report->10. model.ad_reporting.int_ad_reporting__ad_report 19. model.amazon_ads.amazon_ads__campaign_report 19. model.amazon_ads.amazon_ads__campaign_report 19. model.amazon_ads.amazon_ads__campaign_report->11. model.ad_reporting.int_ad_reporting__campaign_report 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report->12. model.ad_reporting.int_ad_reporting__keyword_report 21. model.amazon_ads.amazon_ads__portfolio_report 21. model.amazon_ads.amazon_ads__portfolio_report 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report->13. model.ad_reporting.int_ad_reporting__search_report 23. model.amazon_ads.int_amazon_ads__portfolio_history 23. model.amazon_ads.int_amazon_ads__portfolio_history 23. model.amazon_ads.int_amazon_ads__portfolio_history->17. model.amazon_ads.amazon_ads__ad_group_report 23. model.amazon_ads.int_amazon_ads__portfolio_history->18. model.amazon_ads.amazon_ads__ad_report 23. model.amazon_ads.int_amazon_ads__portfolio_history->19. model.amazon_ads.amazon_ads__campaign_report 23. model.amazon_ads.int_amazon_ads__portfolio_history->20. model.amazon_ads.amazon_ads__keyword_report 23. model.amazon_ads.int_amazon_ads__portfolio_history->22. model.amazon_ads.amazon_ads__search_report 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history->17. model.amazon_ads.amazon_ads__ad_group_report 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history->18. model.amazon_ads.amazon_ads__ad_report 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history->20. model.amazon_ads.amazon_ads__keyword_report 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history->22. model.amazon_ads.amazon_ads__search_report 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp->24. model.amazon_ads_source.stg_amazon_ads__ad_group_history 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report->17. model.amazon_ads.amazon_ads__ad_group_report 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp->26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report->18. model.amazon_ads.amazon_ads__ad_report 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp->28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report 30. model.amazon_ads_source.stg_amazon_ads__campaign_history 30. model.amazon_ads_source.stg_amazon_ads__campaign_history 30. model.amazon_ads_source.stg_amazon_ads__campaign_history->16. model.amazon_ads.amazon_ads__account_report 30. model.amazon_ads_source.stg_amazon_ads__campaign_history->17. model.amazon_ads.amazon_ads__ad_group_report 30. model.amazon_ads_source.stg_amazon_ads__campaign_history->18. model.amazon_ads.amazon_ads__ad_report 30. model.amazon_ads_source.stg_amazon_ads__campaign_history->19. model.amazon_ads.amazon_ads__campaign_report 30. model.amazon_ads_source.stg_amazon_ads__campaign_history->20. model.amazon_ads.amazon_ads__keyword_report 30. model.amazon_ads_source.stg_amazon_ads__campaign_history->21. model.amazon_ads.amazon_ads__portfolio_report 30. model.amazon_ads_source.stg_amazon_ads__campaign_history->22. model.amazon_ads.amazon_ads__search_report 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp->30. model.amazon_ads_source.stg_amazon_ads__campaign_history 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report->16. model.amazon_ads.amazon_ads__account_report 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report->19. model.amazon_ads.amazon_ads__campaign_report 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report->21. model.amazon_ads.amazon_ads__portfolio_report 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp->32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report 34. model.amazon_ads_source.stg_amazon_ads__keyword_history 34. model.amazon_ads_source.stg_amazon_ads__keyword_history 34. model.amazon_ads_source.stg_amazon_ads__keyword_history->20. model.amazon_ads.amazon_ads__keyword_report 34. model.amazon_ads_source.stg_amazon_ads__keyword_history->22. model.amazon_ads.amazon_ads__search_report 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp->34. model.amazon_ads_source.stg_amazon_ads__keyword_history 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history->21. model.amazon_ads.amazon_ads__portfolio_report 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history->23. model.amazon_ads.int_amazon_ads__portfolio_history 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp->36. model.amazon_ads_source.stg_amazon_ads__portfolio_history 38. model.amazon_ads_source.stg_amazon_ads__product_ad_history 38. model.amazon_ads_source.stg_amazon_ads__product_ad_history 38. model.amazon_ads_source.stg_amazon_ads__product_ad_history->18. model.amazon_ads.amazon_ads__ad_report 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp->38. model.amazon_ads_source.stg_amazon_ads__product_ad_history 40. model.amazon_ads_source.stg_amazon_ads__profile 40. model.amazon_ads_source.stg_amazon_ads__profile 40. model.amazon_ads_source.stg_amazon_ads__profile->16. model.amazon_ads.amazon_ads__account_report 40. model.amazon_ads_source.stg_amazon_ads__profile->17. model.amazon_ads.amazon_ads__ad_group_report 40. model.amazon_ads_source.stg_amazon_ads__profile->18. model.amazon_ads.amazon_ads__ad_report 40. model.amazon_ads_source.stg_amazon_ads__profile->19. model.amazon_ads.amazon_ads__campaign_report 40. model.amazon_ads_source.stg_amazon_ads__profile->20. model.amazon_ads.amazon_ads__keyword_report 40. model.amazon_ads_source.stg_amazon_ads__profile->21. model.amazon_ads.amazon_ads__portfolio_report 40. model.amazon_ads_source.stg_amazon_ads__profile->22. model.amazon_ads.amazon_ads__search_report 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp->40. model.amazon_ads_source.stg_amazon_ads__profile 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report->22. model.amazon_ads.amazon_ads__search_report 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp->42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report->20. model.amazon_ads.amazon_ads__keyword_report 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp->44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report 46. model.apple_search_ads.apple_search_ads__ad_group_report 46. model.apple_search_ads.apple_search_ads__ad_group_report 46. model.apple_search_ads.apple_search_ads__ad_group_report->9. model.ad_reporting.int_ad_reporting__ad_group_report 47. model.apple_search_ads.apple_search_ads__ad_report 47. model.apple_search_ads.apple_search_ads__ad_report 47. model.apple_search_ads.apple_search_ads__ad_report->10. model.ad_reporting.int_ad_reporting__ad_report 48. model.apple_search_ads.apple_search_ads__campaign_report 48. model.apple_search_ads.apple_search_ads__campaign_report 48. model.apple_search_ads.apple_search_ads__campaign_report->11. model.ad_reporting.int_ad_reporting__campaign_report 49. model.apple_search_ads.apple_search_ads__keyword_report 49. model.apple_search_ads.apple_search_ads__keyword_report 49. model.apple_search_ads.apple_search_ads__keyword_report->12. model.ad_reporting.int_ad_reporting__keyword_report 50. model.apple_search_ads.apple_search_ads__organization_report 50. model.apple_search_ads.apple_search_ads__organization_report 50. model.apple_search_ads.apple_search_ads__organization_report->8. model.ad_reporting.int_ad_reporting__account_report 51. model.apple_search_ads.apple_search_ads__search_term_report 51. model.apple_search_ads.apple_search_ads__search_term_report 51. model.apple_search_ads.apple_search_ads__search_term_report->13. model.ad_reporting.int_ad_reporting__search_report 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history->46. model.apple_search_ads.apple_search_ads__ad_group_report 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history->47. model.apple_search_ads.apple_search_ads__ad_report 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history->49. model.apple_search_ads.apple_search_ads__keyword_report 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp->52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report->46. model.apple_search_ads.apple_search_ads__ad_group_report 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp->54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report 56. model.apple_search_ads_source.stg_apple_search_ads__ad_history 56. model.apple_search_ads_source.stg_apple_search_ads__ad_history 56. model.apple_search_ads_source.stg_apple_search_ads__ad_history->47. model.apple_search_ads.apple_search_ads__ad_report 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp->56. model.apple_search_ads_source.stg_apple_search_ads__ad_history 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report->47. model.apple_search_ads.apple_search_ads__ad_report 59. model.apple_search_ads_source.stg_apple_search_ads__ad_report_tmp 59. model.apple_search_ads_source.stg_apple_search_ads__ad_report_tmp 59. model.apple_search_ads_source.stg_apple_search_ads__ad_report_tmp->58. model.apple_search_ads_source.stg_apple_search_ads__ad_report 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history->46. model.apple_search_ads.apple_search_ads__ad_group_report 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history->47. model.apple_search_ads.apple_search_ads__ad_report 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history->48. model.apple_search_ads.apple_search_ads__campaign_report 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history->49. model.apple_search_ads.apple_search_ads__keyword_report 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history->50. model.apple_search_ads.apple_search_ads__organization_report 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history->51. model.apple_search_ads.apple_search_ads__search_term_report 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp->60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report->48. model.apple_search_ads.apple_search_ads__campaign_report 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report->50. model.apple_search_ads.apple_search_ads__organization_report 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp->62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history->49. model.apple_search_ads.apple_search_ads__keyword_report 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp->64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report->49. model.apple_search_ads.apple_search_ads__keyword_report 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp->66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report 68. model.apple_search_ads_source.stg_apple_search_ads__organization 68. model.apple_search_ads_source.stg_apple_search_ads__organization 68. model.apple_search_ads_source.stg_apple_search_ads__organization->46. model.apple_search_ads.apple_search_ads__ad_group_report 68. model.apple_search_ads_source.stg_apple_search_ads__organization->47. model.apple_search_ads.apple_search_ads__ad_report 68. model.apple_search_ads_source.stg_apple_search_ads__organization->48. model.apple_search_ads.apple_search_ads__campaign_report 68. model.apple_search_ads_source.stg_apple_search_ads__organization->49. model.apple_search_ads.apple_search_ads__keyword_report 68. model.apple_search_ads_source.stg_apple_search_ads__organization->50. model.apple_search_ads.apple_search_ads__organization_report 68. model.apple_search_ads_source.stg_apple_search_ads__organization->51. model.apple_search_ads.apple_search_ads__search_term_report 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp->68. model.apple_search_ads_source.stg_apple_search_ads__organization 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report->51. model.apple_search_ads.apple_search_ads__search_term_report 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp->70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report 72. model.facebook_ads.facebook_ads__account_report 72. model.facebook_ads.facebook_ads__account_report 72. model.facebook_ads.facebook_ads__account_report->8. model.ad_reporting.int_ad_reporting__account_report 73. model.facebook_ads.facebook_ads__ad_report 73. model.facebook_ads.facebook_ads__ad_report 73. model.facebook_ads.facebook_ads__ad_report->10. model.ad_reporting.int_ad_reporting__ad_report 74. model.facebook_ads.facebook_ads__ad_set_report 74. model.facebook_ads.facebook_ads__ad_set_report 74. model.facebook_ads.facebook_ads__ad_set_report->9. model.ad_reporting.int_ad_reporting__ad_group_report 75. model.facebook_ads.facebook_ads__campaign_report 75. model.facebook_ads.facebook_ads__campaign_report 75. model.facebook_ads.facebook_ads__campaign_report->11. model.ad_reporting.int_ad_reporting__campaign_report 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report->14. model.ad_reporting.int_ad_reporting__url_report 77. model.facebook_ads.facebook_ads__url_tags 77. model.facebook_ads.facebook_ads__url_tags 78. model.facebook_ads.int_facebook_ads__creative_history 78. model.facebook_ads.int_facebook_ads__creative_history 77. model.facebook_ads.facebook_ads__url_tags->78. model.facebook_ads.int_facebook_ads__creative_history 78. model.facebook_ads.int_facebook_ads__creative_history->76. model.facebook_ads.facebook_ads__url_report 79. model.facebook_ads_source.stg_facebook_ads__account_history 79. model.facebook_ads_source.stg_facebook_ads__account_history 79. model.facebook_ads_source.stg_facebook_ads__account_history->72. model.facebook_ads.facebook_ads__account_report 79. model.facebook_ads_source.stg_facebook_ads__account_history->73. model.facebook_ads.facebook_ads__ad_report 79. model.facebook_ads_source.stg_facebook_ads__account_history->74. model.facebook_ads.facebook_ads__ad_set_report 79. model.facebook_ads_source.stg_facebook_ads__account_history->75. model.facebook_ads.facebook_ads__campaign_report 79. model.facebook_ads_source.stg_facebook_ads__account_history->76. model.facebook_ads.facebook_ads__url_report 80. model.facebook_ads_source.stg_facebook_ads__account_history_tmp 80. model.facebook_ads_source.stg_facebook_ads__account_history_tmp 80. model.facebook_ads_source.stg_facebook_ads__account_history_tmp->79. model.facebook_ads_source.stg_facebook_ads__account_history 81. model.facebook_ads_source.stg_facebook_ads__ad_history 81. model.facebook_ads_source.stg_facebook_ads__ad_history 81. model.facebook_ads_source.stg_facebook_ads__ad_history->73. model.facebook_ads.facebook_ads__ad_report 81. model.facebook_ads_source.stg_facebook_ads__ad_history->74. model.facebook_ads.facebook_ads__ad_set_report 81. model.facebook_ads_source.stg_facebook_ads__ad_history->75. model.facebook_ads.facebook_ads__campaign_report 81. model.facebook_ads_source.stg_facebook_ads__ad_history->76. model.facebook_ads.facebook_ads__url_report 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp->81. model.facebook_ads_source.stg_facebook_ads__ad_history 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history->73. model.facebook_ads.facebook_ads__ad_report 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history->74. model.facebook_ads.facebook_ads__ad_set_report 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history->76. model.facebook_ads.facebook_ads__url_report 84. model.facebook_ads_source.stg_facebook_ads__ad_set_history_tmp 84. model.facebook_ads_source.stg_facebook_ads__ad_set_history_tmp 84. model.facebook_ads_source.stg_facebook_ads__ad_set_history_tmp->83. model.facebook_ads_source.stg_facebook_ads__ad_set_history 85. model.facebook_ads_source.stg_facebook_ads__basic_ad 85. model.facebook_ads_source.stg_facebook_ads__basic_ad 85. model.facebook_ads_source.stg_facebook_ads__basic_ad->72. model.facebook_ads.facebook_ads__account_report 85. model.facebook_ads_source.stg_facebook_ads__basic_ad->73. model.facebook_ads.facebook_ads__ad_report 85. model.facebook_ads_source.stg_facebook_ads__basic_ad->74. model.facebook_ads.facebook_ads__ad_set_report 85. model.facebook_ads_source.stg_facebook_ads__basic_ad->75. model.facebook_ads.facebook_ads__campaign_report 85. model.facebook_ads_source.stg_facebook_ads__basic_ad->76. model.facebook_ads.facebook_ads__url_report 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp->85. model.facebook_ads_source.stg_facebook_ads__basic_ad 87. model.facebook_ads_source.stg_facebook_ads__campaign_history 87. model.facebook_ads_source.stg_facebook_ads__campaign_history 87. model.facebook_ads_source.stg_facebook_ads__campaign_history->73. model.facebook_ads.facebook_ads__ad_report 87. model.facebook_ads_source.stg_facebook_ads__campaign_history->74. model.facebook_ads.facebook_ads__ad_set_report 87. model.facebook_ads_source.stg_facebook_ads__campaign_history->75. model.facebook_ads.facebook_ads__campaign_report 87. model.facebook_ads_source.stg_facebook_ads__campaign_history->76. model.facebook_ads.facebook_ads__url_report 88. model.facebook_ads_source.stg_facebook_ads__campaign_history_tmp 88. model.facebook_ads_source.stg_facebook_ads__campaign_history_tmp 88. model.facebook_ads_source.stg_facebook_ads__campaign_history_tmp->87. model.facebook_ads_source.stg_facebook_ads__campaign_history 89. model.facebook_ads_source.stg_facebook_ads__creative_history 89. model.facebook_ads_source.stg_facebook_ads__creative_history 89. model.facebook_ads_source.stg_facebook_ads__creative_history->77. model.facebook_ads.facebook_ads__url_tags 89. model.facebook_ads_source.stg_facebook_ads__creative_history->78. model.facebook_ads.int_facebook_ads__creative_history 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp->89. model.facebook_ads_source.stg_facebook_ads__creative_history 91. model.google_ads.google_ads__account_report 91. model.google_ads.google_ads__account_report 91. model.google_ads.google_ads__account_report->8. model.ad_reporting.int_ad_reporting__account_report 92. model.google_ads.google_ads__ad_group_report 92. model.google_ads.google_ads__ad_group_report 92. model.google_ads.google_ads__ad_group_report->9. model.ad_reporting.int_ad_reporting__ad_group_report 93. model.google_ads.google_ads__ad_report 93. model.google_ads.google_ads__ad_report 93. model.google_ads.google_ads__ad_report->10. model.ad_reporting.int_ad_reporting__ad_report 94. model.google_ads.google_ads__campaign_report 94. model.google_ads.google_ads__campaign_report 94. model.google_ads.google_ads__campaign_report->11. model.ad_reporting.int_ad_reporting__campaign_report 95. model.google_ads.google_ads__keyword_report 95. model.google_ads.google_ads__keyword_report 95. model.google_ads.google_ads__keyword_report->12. model.ad_reporting.int_ad_reporting__keyword_report 96. model.google_ads.google_ads__url_report 96. model.google_ads.google_ads__url_report 96. model.google_ads.google_ads__url_report->14. model.ad_reporting.int_ad_reporting__url_report 97. model.google_ads_source.stg_google_ads__account_history 97. model.google_ads_source.stg_google_ads__account_history 97. model.google_ads_source.stg_google_ads__account_history->91. model.google_ads.google_ads__account_report 97. model.google_ads_source.stg_google_ads__account_history->92. model.google_ads.google_ads__ad_group_report 97. model.google_ads_source.stg_google_ads__account_history->93. model.google_ads.google_ads__ad_report 97. model.google_ads_source.stg_google_ads__account_history->94. model.google_ads.google_ads__campaign_report 97. model.google_ads_source.stg_google_ads__account_history->95. model.google_ads.google_ads__keyword_report 97. model.google_ads_source.stg_google_ads__account_history->96. model.google_ads.google_ads__url_report 98. model.google_ads_source.stg_google_ads__account_history_tmp 98. model.google_ads_source.stg_google_ads__account_history_tmp 98. model.google_ads_source.stg_google_ads__account_history_tmp->97. model.google_ads_source.stg_google_ads__account_history 99. model.google_ads_source.stg_google_ads__account_stats 99. model.google_ads_source.stg_google_ads__account_stats 99. model.google_ads_source.stg_google_ads__account_stats->91. model.google_ads.google_ads__account_report 100. model.google_ads_source.stg_google_ads__account_stats_tmp 100. model.google_ads_source.stg_google_ads__account_stats_tmp 100. model.google_ads_source.stg_google_ads__account_stats_tmp->99. model.google_ads_source.stg_google_ads__account_stats 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history->95. model.google_ads.google_ads__keyword_report 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp->101. model.google_ads_source.stg_google_ads__ad_group_criterion_history 103. model.google_ads_source.stg_google_ads__ad_group_history 103. model.google_ads_source.stg_google_ads__ad_group_history 103. model.google_ads_source.stg_google_ads__ad_group_history->92. model.google_ads.google_ads__ad_group_report 103. model.google_ads_source.stg_google_ads__ad_group_history->93. model.google_ads.google_ads__ad_report 103. model.google_ads_source.stg_google_ads__ad_group_history->95. model.google_ads.google_ads__keyword_report 103. model.google_ads_source.stg_google_ads__ad_group_history->96. model.google_ads.google_ads__url_report 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp->103. model.google_ads_source.stg_google_ads__ad_group_history 105. model.google_ads_source.stg_google_ads__ad_group_stats 105. model.google_ads_source.stg_google_ads__ad_group_stats 105. model.google_ads_source.stg_google_ads__ad_group_stats->92. model.google_ads.google_ads__ad_group_report 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp->105. model.google_ads_source.stg_google_ads__ad_group_stats 107. model.google_ads_source.stg_google_ads__ad_history 107. model.google_ads_source.stg_google_ads__ad_history 107. model.google_ads_source.stg_google_ads__ad_history->93. model.google_ads.google_ads__ad_report 107. model.google_ads_source.stg_google_ads__ad_history->96. model.google_ads.google_ads__url_report 108. model.google_ads_source.stg_google_ads__ad_history_tmp 108. model.google_ads_source.stg_google_ads__ad_history_tmp 108. model.google_ads_source.stg_google_ads__ad_history_tmp->107. model.google_ads_source.stg_google_ads__ad_history 109. model.google_ads_source.stg_google_ads__ad_stats 109. model.google_ads_source.stg_google_ads__ad_stats 109. model.google_ads_source.stg_google_ads__ad_stats->93. model.google_ads.google_ads__ad_report 109. model.google_ads_source.stg_google_ads__ad_stats->96. model.google_ads.google_ads__url_report 110. model.google_ads_source.stg_google_ads__ad_stats_tmp 110. model.google_ads_source.stg_google_ads__ad_stats_tmp 110. model.google_ads_source.stg_google_ads__ad_stats_tmp->109. model.google_ads_source.stg_google_ads__ad_stats 111. model.google_ads_source.stg_google_ads__campaign_history 111. model.google_ads_source.stg_google_ads__campaign_history 111. model.google_ads_source.stg_google_ads__campaign_history->92. model.google_ads.google_ads__ad_group_report 111. model.google_ads_source.stg_google_ads__campaign_history->93. model.google_ads.google_ads__ad_report 111. model.google_ads_source.stg_google_ads__campaign_history->94. model.google_ads.google_ads__campaign_report 111. model.google_ads_source.stg_google_ads__campaign_history->95. model.google_ads.google_ads__keyword_report 111. model.google_ads_source.stg_google_ads__campaign_history->96. model.google_ads.google_ads__url_report 112. model.google_ads_source.stg_google_ads__campaign_history_tmp 112. model.google_ads_source.stg_google_ads__campaign_history_tmp 112. model.google_ads_source.stg_google_ads__campaign_history_tmp->111. model.google_ads_source.stg_google_ads__campaign_history 113. model.google_ads_source.stg_google_ads__campaign_stats 113. model.google_ads_source.stg_google_ads__campaign_stats 113. model.google_ads_source.stg_google_ads__campaign_stats->94. model.google_ads.google_ads__campaign_report 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp->113. model.google_ads_source.stg_google_ads__campaign_stats 115. model.google_ads_source.stg_google_ads__keyword_stats 115. model.google_ads_source.stg_google_ads__keyword_stats 115. model.google_ads_source.stg_google_ads__keyword_stats->95. model.google_ads.google_ads__keyword_report 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp->115. model.google_ads_source.stg_google_ads__keyword_stats 117. model.linkedin.linkedin_ads__account_report 117. model.linkedin.linkedin_ads__account_report 117. model.linkedin.linkedin_ads__account_report->8. model.ad_reporting.int_ad_reporting__account_report 118. model.linkedin.linkedin_ads__campaign_group_report 118. model.linkedin.linkedin_ads__campaign_group_report 118. model.linkedin.linkedin_ads__campaign_group_report->11. model.ad_reporting.int_ad_reporting__campaign_report 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report->9. model.ad_reporting.int_ad_reporting__ad_group_report 120. model.linkedin.linkedin_ads__creative_report 120. model.linkedin.linkedin_ads__creative_report 120. model.linkedin.linkedin_ads__creative_report->10. model.ad_reporting.int_ad_reporting__ad_report 121. model.linkedin.linkedin_ads__url_report 121. model.linkedin.linkedin_ads__url_report 121. model.linkedin.linkedin_ads__url_report->14. model.ad_reporting.int_ad_reporting__url_report 122. model.linkedin_source.stg_linkedin_ads__account_history 122. model.linkedin_source.stg_linkedin_ads__account_history 122. model.linkedin_source.stg_linkedin_ads__account_history->117. model.linkedin.linkedin_ads__account_report 122. model.linkedin_source.stg_linkedin_ads__account_history->118. model.linkedin.linkedin_ads__campaign_group_report 122. model.linkedin_source.stg_linkedin_ads__account_history->119. model.linkedin.linkedin_ads__campaign_report 122. model.linkedin_source.stg_linkedin_ads__account_history->120. model.linkedin.linkedin_ads__creative_report 122. model.linkedin_source.stg_linkedin_ads__account_history->121. model.linkedin.linkedin_ads__url_report 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp->122. model.linkedin_source.stg_linkedin_ads__account_history 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign->117. model.linkedin.linkedin_ads__account_report 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign->118. model.linkedin.linkedin_ads__campaign_group_report 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign->119. model.linkedin.linkedin_ads__campaign_report 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp->124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative->120. model.linkedin.linkedin_ads__creative_report 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative->121. model.linkedin.linkedin_ads__url_report 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp->126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history->118. model.linkedin.linkedin_ads__campaign_group_report 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history->119. model.linkedin.linkedin_ads__campaign_report 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history->120. model.linkedin.linkedin_ads__creative_report 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history->121. model.linkedin.linkedin_ads__url_report 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp->128. model.linkedin_source.stg_linkedin_ads__campaign_group_history 130. model.linkedin_source.stg_linkedin_ads__campaign_history 130. model.linkedin_source.stg_linkedin_ads__campaign_history 130. model.linkedin_source.stg_linkedin_ads__campaign_history->117. model.linkedin.linkedin_ads__account_report 130. model.linkedin_source.stg_linkedin_ads__campaign_history->118. model.linkedin.linkedin_ads__campaign_group_report 130. model.linkedin_source.stg_linkedin_ads__campaign_history->119. model.linkedin.linkedin_ads__campaign_report 130. model.linkedin_source.stg_linkedin_ads__campaign_history->120. model.linkedin.linkedin_ads__creative_report 130. model.linkedin_source.stg_linkedin_ads__campaign_history->121. model.linkedin.linkedin_ads__url_report 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp->130. model.linkedin_source.stg_linkedin_ads__campaign_history 132. model.linkedin_source.stg_linkedin_ads__creative_history 132. model.linkedin_source.stg_linkedin_ads__creative_history 132. model.linkedin_source.stg_linkedin_ads__creative_history->120. model.linkedin.linkedin_ads__creative_report 132. model.linkedin_source.stg_linkedin_ads__creative_history->121. model.linkedin.linkedin_ads__url_report 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp->132. model.linkedin_source.stg_linkedin_ads__creative_history 134. model.microsoft_ads.microsoft_ads__account_report 134. model.microsoft_ads.microsoft_ads__account_report 134. model.microsoft_ads.microsoft_ads__account_report->8. model.ad_reporting.int_ad_reporting__account_report 135. model.microsoft_ads.microsoft_ads__ad_group_report 135. model.microsoft_ads.microsoft_ads__ad_group_report 135. model.microsoft_ads.microsoft_ads__ad_group_report->9. model.ad_reporting.int_ad_reporting__ad_group_report 136. model.microsoft_ads.microsoft_ads__ad_report 136. model.microsoft_ads.microsoft_ads__ad_report 136. model.microsoft_ads.microsoft_ads__ad_report->10. model.ad_reporting.int_ad_reporting__ad_report 137. model.microsoft_ads.microsoft_ads__campaign_report 137. model.microsoft_ads.microsoft_ads__campaign_report 137. model.microsoft_ads.microsoft_ads__campaign_report->11. model.ad_reporting.int_ad_reporting__campaign_report 138. model.microsoft_ads.microsoft_ads__keyword_report 138. model.microsoft_ads.microsoft_ads__keyword_report 138. model.microsoft_ads.microsoft_ads__keyword_report->12. model.ad_reporting.int_ad_reporting__keyword_report 139. model.microsoft_ads.microsoft_ads__search_report 139. model.microsoft_ads.microsoft_ads__search_report 139. model.microsoft_ads.microsoft_ads__search_report->13. model.ad_reporting.int_ad_reporting__search_report 140. model.microsoft_ads.microsoft_ads__url_report 140. model.microsoft_ads.microsoft_ads__url_report 140. model.microsoft_ads.microsoft_ads__url_report->14. model.ad_reporting.int_ad_reporting__url_report 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report->134. model.microsoft_ads.microsoft_ads__account_report 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp->141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report 143. model.microsoft_ads_source.stg_microsoft_ads__account_history 143. model.microsoft_ads_source.stg_microsoft_ads__account_history 143. model.microsoft_ads_source.stg_microsoft_ads__account_history->134. model.microsoft_ads.microsoft_ads__account_report 143. model.microsoft_ads_source.stg_microsoft_ads__account_history->135. model.microsoft_ads.microsoft_ads__ad_group_report 143. model.microsoft_ads_source.stg_microsoft_ads__account_history->136. model.microsoft_ads.microsoft_ads__ad_report 143. model.microsoft_ads_source.stg_microsoft_ads__account_history->137. model.microsoft_ads.microsoft_ads__campaign_report 143. model.microsoft_ads_source.stg_microsoft_ads__account_history->138. model.microsoft_ads.microsoft_ads__keyword_report 143. model.microsoft_ads_source.stg_microsoft_ads__account_history->139. model.microsoft_ads.microsoft_ads__search_report 143. model.microsoft_ads_source.stg_microsoft_ads__account_history->140. model.microsoft_ads.microsoft_ads__url_report 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp->143. model.microsoft_ads_source.stg_microsoft_ads__account_history 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report->136. model.microsoft_ads.microsoft_ads__ad_report 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report->140. model.microsoft_ads.microsoft_ads__url_report 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp->145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report->135. model.microsoft_ads.microsoft_ads__ad_group_report 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp->147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history->135. model.microsoft_ads.microsoft_ads__ad_group_report 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history->136. model.microsoft_ads.microsoft_ads__ad_report 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history->138. model.microsoft_ads.microsoft_ads__keyword_report 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history->139. model.microsoft_ads.microsoft_ads__search_report 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history->140. model.microsoft_ads.microsoft_ads__url_report 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp->149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history->136. model.microsoft_ads.microsoft_ads__ad_report 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history->138. model.microsoft_ads.microsoft_ads__keyword_report 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history->139. model.microsoft_ads.microsoft_ads__search_report 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history->140. model.microsoft_ads.microsoft_ads__url_report 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp->151. model.microsoft_ads_source.stg_microsoft_ads__ad_history 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report->137. model.microsoft_ads.microsoft_ads__campaign_report 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp->153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history->135. model.microsoft_ads.microsoft_ads__ad_group_report 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history->136. model.microsoft_ads.microsoft_ads__ad_report 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history->137. model.microsoft_ads.microsoft_ads__campaign_report 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history->138. model.microsoft_ads.microsoft_ads__keyword_report 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history->139. model.microsoft_ads.microsoft_ads__search_report 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history->140. model.microsoft_ads.microsoft_ads__url_report 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp->155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report->138. model.microsoft_ads.microsoft_ads__keyword_report 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp->157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history->138. model.microsoft_ads.microsoft_ads__keyword_report 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history->139. model.microsoft_ads.microsoft_ads__search_report 160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp 160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp 160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp->159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report->139. model.microsoft_ads.microsoft_ads__search_report 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp->161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report 163. model.pinterest.pinterest_ads__ad_group_report 163. model.pinterest.pinterest_ads__ad_group_report 163. model.pinterest.pinterest_ads__ad_group_report->9. model.ad_reporting.int_ad_reporting__ad_group_report 164. model.pinterest.pinterest_ads__advertiser_report 164. model.pinterest.pinterest_ads__advertiser_report 164. model.pinterest.pinterest_ads__advertiser_report->8. model.ad_reporting.int_ad_reporting__account_report 165. model.pinterest.pinterest_ads__campaign_report 165. model.pinterest.pinterest_ads__campaign_report 165. model.pinterest.pinterest_ads__campaign_report->11. model.ad_reporting.int_ad_reporting__campaign_report 166. model.pinterest.pinterest_ads__keyword_report 166. model.pinterest.pinterest_ads__keyword_report 166. model.pinterest.pinterest_ads__keyword_report->12. model.ad_reporting.int_ad_reporting__keyword_report 167. model.pinterest.pinterest_ads__pin_promotion_report 167. model.pinterest.pinterest_ads__pin_promotion_report 167. model.pinterest.pinterest_ads__pin_promotion_report->10. model.ad_reporting.int_ad_reporting__ad_report 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report->14. model.ad_reporting.int_ad_reporting__url_report 169. model.pinterest_source.stg_pinterest_ads__ad_group_history 169. model.pinterest_source.stg_pinterest_ads__ad_group_history 169. model.pinterest_source.stg_pinterest_ads__ad_group_history->163. model.pinterest.pinterest_ads__ad_group_report 169. model.pinterest_source.stg_pinterest_ads__ad_group_history->166. model.pinterest.pinterest_ads__keyword_report 169. model.pinterest_source.stg_pinterest_ads__ad_group_history->167. model.pinterest.pinterest_ads__pin_promotion_report 169. model.pinterest_source.stg_pinterest_ads__ad_group_history->168. model.pinterest.pinterest_ads__url_report 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp->169. model.pinterest_source.stg_pinterest_ads__ad_group_history 171. model.pinterest_source.stg_pinterest_ads__ad_group_report 171. model.pinterest_source.stg_pinterest_ads__ad_group_report 171. model.pinterest_source.stg_pinterest_ads__ad_group_report->163. model.pinterest.pinterest_ads__ad_group_report 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp->171. model.pinterest_source.stg_pinterest_ads__ad_group_report 173. model.pinterest_source.stg_pinterest_ads__advertiser_history 173. model.pinterest_source.stg_pinterest_ads__advertiser_history 173. model.pinterest_source.stg_pinterest_ads__advertiser_history->163. model.pinterest.pinterest_ads__ad_group_report 173. model.pinterest_source.stg_pinterest_ads__advertiser_history->164. model.pinterest.pinterest_ads__advertiser_report 173. model.pinterest_source.stg_pinterest_ads__advertiser_history->165. model.pinterest.pinterest_ads__campaign_report 173. model.pinterest_source.stg_pinterest_ads__advertiser_history->166. model.pinterest.pinterest_ads__keyword_report 173. model.pinterest_source.stg_pinterest_ads__advertiser_history->167. model.pinterest.pinterest_ads__pin_promotion_report 173. model.pinterest_source.stg_pinterest_ads__advertiser_history->168. model.pinterest.pinterest_ads__url_report 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp->173. model.pinterest_source.stg_pinterest_ads__advertiser_history 175. model.pinterest_source.stg_pinterest_ads__advertiser_report 175. model.pinterest_source.stg_pinterest_ads__advertiser_report 175. model.pinterest_source.stg_pinterest_ads__advertiser_report->164. model.pinterest.pinterest_ads__advertiser_report 176. model.pinterest_source.stg_pinterest_ads__advertiser_report_tmp 176. model.pinterest_source.stg_pinterest_ads__advertiser_report_tmp 176. model.pinterest_source.stg_pinterest_ads__advertiser_report_tmp->175. model.pinterest_source.stg_pinterest_ads__advertiser_report 177. model.pinterest_source.stg_pinterest_ads__campaign_history 177. model.pinterest_source.stg_pinterest_ads__campaign_history 177. model.pinterest_source.stg_pinterest_ads__campaign_history->163. model.pinterest.pinterest_ads__ad_group_report 177. model.pinterest_source.stg_pinterest_ads__campaign_history->165. model.pinterest.pinterest_ads__campaign_report 177. model.pinterest_source.stg_pinterest_ads__campaign_history->166. model.pinterest.pinterest_ads__keyword_report 177. model.pinterest_source.stg_pinterest_ads__campaign_history->167. model.pinterest.pinterest_ads__pin_promotion_report 177. model.pinterest_source.stg_pinterest_ads__campaign_history->168. model.pinterest.pinterest_ads__url_report 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp->177. model.pinterest_source.stg_pinterest_ads__campaign_history 179. model.pinterest_source.stg_pinterest_ads__campaign_report 179. model.pinterest_source.stg_pinterest_ads__campaign_report 179. model.pinterest_source.stg_pinterest_ads__campaign_report->165. model.pinterest.pinterest_ads__campaign_report 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp->179. model.pinterest_source.stg_pinterest_ads__campaign_report 181. model.pinterest_source.stg_pinterest_ads__keyword_history 181. model.pinterest_source.stg_pinterest_ads__keyword_history 181. model.pinterest_source.stg_pinterest_ads__keyword_history->166. model.pinterest.pinterest_ads__keyword_report 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp->181. model.pinterest_source.stg_pinterest_ads__keyword_history 183. model.pinterest_source.stg_pinterest_ads__keyword_report 183. model.pinterest_source.stg_pinterest_ads__keyword_report 183. model.pinterest_source.stg_pinterest_ads__keyword_report->166. model.pinterest.pinterest_ads__keyword_report 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp->183. model.pinterest_source.stg_pinterest_ads__keyword_report 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history->167. model.pinterest.pinterest_ads__pin_promotion_report 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history->168. model.pinterest.pinterest_ads__url_report 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report->167. model.pinterest.pinterest_ads__pin_promotion_report 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report->168. model.pinterest.pinterest_ads__url_report 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp->187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report 189. model.reddit_ads.reddit_ads__account_report 189. model.reddit_ads.reddit_ads__account_report 189. model.reddit_ads.reddit_ads__account_report->8. model.ad_reporting.int_ad_reporting__account_report 190. model.reddit_ads.reddit_ads__ad_group_report 190. model.reddit_ads.reddit_ads__ad_group_report 190. model.reddit_ads.reddit_ads__ad_group_report->9. model.ad_reporting.int_ad_reporting__ad_group_report 191. model.reddit_ads.reddit_ads__ad_report 191. model.reddit_ads.reddit_ads__ad_report 191. model.reddit_ads.reddit_ads__ad_report->10. model.ad_reporting.int_ad_reporting__ad_report 192. model.reddit_ads.reddit_ads__campaign_report 192. model.reddit_ads.reddit_ads__campaign_report 192. model.reddit_ads.reddit_ads__campaign_report->11. model.ad_reporting.int_ad_reporting__campaign_report 193. model.reddit_ads.reddit_ads__url_report 193. model.reddit_ads.reddit_ads__url_report 193. model.reddit_ads.reddit_ads__url_report->14. model.ad_reporting.int_ad_reporting__url_report 194. model.reddit_ads_source.stg_reddit_ads__account 194. model.reddit_ads_source.stg_reddit_ads__account 194. model.reddit_ads_source.stg_reddit_ads__account->189. model.reddit_ads.reddit_ads__account_report 194. model.reddit_ads_source.stg_reddit_ads__account->190. model.reddit_ads.reddit_ads__ad_group_report 194. model.reddit_ads_source.stg_reddit_ads__account->191. model.reddit_ads.reddit_ads__ad_report 194. model.reddit_ads_source.stg_reddit_ads__account->192. model.reddit_ads.reddit_ads__campaign_report 194. model.reddit_ads_source.stg_reddit_ads__account->193. model.reddit_ads.reddit_ads__url_report 195. model.reddit_ads_source.stg_reddit_ads__account_report 195. model.reddit_ads_source.stg_reddit_ads__account_report 195. model.reddit_ads_source.stg_reddit_ads__account_report->189. model.reddit_ads.reddit_ads__account_report 196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp 196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp 196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp->195. model.reddit_ads_source.stg_reddit_ads__account_report 197. model.reddit_ads_source.stg_reddit_ads__account_tmp 197. model.reddit_ads_source.stg_reddit_ads__account_tmp 197. model.reddit_ads_source.stg_reddit_ads__account_tmp->194. model.reddit_ads_source.stg_reddit_ads__account 198. model.reddit_ads_source.stg_reddit_ads__ad 198. model.reddit_ads_source.stg_reddit_ads__ad 198. model.reddit_ads_source.stg_reddit_ads__ad->191. model.reddit_ads.reddit_ads__ad_report 198. model.reddit_ads_source.stg_reddit_ads__ad->193. model.reddit_ads.reddit_ads__url_report 199. model.reddit_ads_source.stg_reddit_ads__ad_group 199. model.reddit_ads_source.stg_reddit_ads__ad_group 199. model.reddit_ads_source.stg_reddit_ads__ad_group->190. model.reddit_ads.reddit_ads__ad_group_report 199. model.reddit_ads_source.stg_reddit_ads__ad_group->191. model.reddit_ads.reddit_ads__ad_report 199. model.reddit_ads_source.stg_reddit_ads__ad_group->193. model.reddit_ads.reddit_ads__url_report 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report->190. model.reddit_ads.reddit_ads__ad_group_report 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp->200. model.reddit_ads_source.stg_reddit_ads__ad_group_report 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp->199. model.reddit_ads_source.stg_reddit_ads__ad_group 203. model.reddit_ads_source.stg_reddit_ads__ad_report 203. model.reddit_ads_source.stg_reddit_ads__ad_report 203. model.reddit_ads_source.stg_reddit_ads__ad_report->191. model.reddit_ads.reddit_ads__ad_report 203. model.reddit_ads_source.stg_reddit_ads__ad_report->193. model.reddit_ads.reddit_ads__url_report 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp->203. model.reddit_ads_source.stg_reddit_ads__ad_report 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp->198. model.reddit_ads_source.stg_reddit_ads__ad 206. model.reddit_ads_source.stg_reddit_ads__campaign 206. model.reddit_ads_source.stg_reddit_ads__campaign 206. model.reddit_ads_source.stg_reddit_ads__campaign->190. model.reddit_ads.reddit_ads__ad_group_report 206. model.reddit_ads_source.stg_reddit_ads__campaign->191. model.reddit_ads.reddit_ads__ad_report 206. model.reddit_ads_source.stg_reddit_ads__campaign->192. model.reddit_ads.reddit_ads__campaign_report 206. model.reddit_ads_source.stg_reddit_ads__campaign->193. model.reddit_ads.reddit_ads__url_report 207. model.reddit_ads_source.stg_reddit_ads__campaign_report 207. model.reddit_ads_source.stg_reddit_ads__campaign_report 207. model.reddit_ads_source.stg_reddit_ads__campaign_report->192. model.reddit_ads.reddit_ads__campaign_report 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp->207. model.reddit_ads_source.stg_reddit_ads__campaign_report 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp->206. model.reddit_ads_source.stg_reddit_ads__campaign 210. model.snapchat_ads.snapchat_ads__account_report 210. model.snapchat_ads.snapchat_ads__account_report 210. model.snapchat_ads.snapchat_ads__account_report->8. model.ad_reporting.int_ad_reporting__account_report 211. model.snapchat_ads.snapchat_ads__ad_report 211. model.snapchat_ads.snapchat_ads__ad_report 211. model.snapchat_ads.snapchat_ads__ad_report->10. model.ad_reporting.int_ad_reporting__ad_report 212. model.snapchat_ads.snapchat_ads__ad_squad_report 212. model.snapchat_ads.snapchat_ads__ad_squad_report 212. model.snapchat_ads.snapchat_ads__ad_squad_report->9. model.ad_reporting.int_ad_reporting__ad_group_report 213. model.snapchat_ads.snapchat_ads__campaign_report 213. model.snapchat_ads.snapchat_ads__campaign_report 213. model.snapchat_ads.snapchat_ads__campaign_report->11. model.ad_reporting.int_ad_reporting__campaign_report 214. model.snapchat_ads.snapchat_ads__creative_history_prep 214. model.snapchat_ads.snapchat_ads__creative_history_prep 214. model.snapchat_ads.snapchat_ads__creative_history_prep->211. model.snapchat_ads.snapchat_ads__ad_report 215. model.snapchat_ads.snapchat_ads__url_report 215. model.snapchat_ads.snapchat_ads__url_report 214. model.snapchat_ads.snapchat_ads__creative_history_prep->215. model.snapchat_ads.snapchat_ads__url_report 215. model.snapchat_ads.snapchat_ads__url_report->14. model.ad_reporting.int_ad_reporting__url_report 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history->210. model.snapchat_ads.snapchat_ads__account_report 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history->211. model.snapchat_ads.snapchat_ads__ad_report 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history->212. model.snapchat_ads.snapchat_ads__ad_squad_report 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history->213. model.snapchat_ads.snapchat_ads__campaign_report 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history->215. model.snapchat_ads.snapchat_ads__url_report 217. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history_tmp 217. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history_tmp 217. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history_tmp->216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history->210. model.snapchat_ads.snapchat_ads__account_report 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history->211. model.snapchat_ads.snapchat_ads__ad_report 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history->215. model.snapchat_ads.snapchat_ads__url_report 219. model.snapchat_ads_source.stg_snapchat_ads__ad_history_tmp 219. model.snapchat_ads_source.stg_snapchat_ads__ad_history_tmp 219. model.snapchat_ads_source.stg_snapchat_ads__ad_history_tmp->218. model.snapchat_ads_source.stg_snapchat_ads__ad_history 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report->210. model.snapchat_ads.snapchat_ads__account_report 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report->211. model.snapchat_ads.snapchat_ads__ad_report 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report->215. model.snapchat_ads.snapchat_ads__url_report 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp->220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history->210. model.snapchat_ads.snapchat_ads__account_report 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history->212. model.snapchat_ads.snapchat_ads__ad_squad_report 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history->215. model.snapchat_ads.snapchat_ads__url_report 223. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history_tmp 223. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history_tmp 223. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history_tmp->222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report->212. model.snapchat_ads.snapchat_ads__ad_squad_report 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp->224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history->210. model.snapchat_ads.snapchat_ads__account_report 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history->212. model.snapchat_ads.snapchat_ads__ad_squad_report 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history->213. model.snapchat_ads.snapchat_ads__campaign_report 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history->215. model.snapchat_ads.snapchat_ads__url_report 227. model.snapchat_ads_source.stg_snapchat_ads__campaign_history_tmp 227. model.snapchat_ads_source.stg_snapchat_ads__campaign_history_tmp 227. model.snapchat_ads_source.stg_snapchat_ads__campaign_history_tmp->226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report->213. model.snapchat_ads.snapchat_ads__campaign_report 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp->228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report 230. model.snapchat_ads_source.stg_snapchat_ads__creative_history 230. model.snapchat_ads_source.stg_snapchat_ads__creative_history 230. model.snapchat_ads_source.stg_snapchat_ads__creative_history->214. model.snapchat_ads.snapchat_ads__creative_history_prep 231. model.snapchat_ads_source.stg_snapchat_ads__creative_history_tmp 231. model.snapchat_ads_source.stg_snapchat_ads__creative_history_tmp 231. model.snapchat_ads_source.stg_snapchat_ads__creative_history_tmp->230. model.snapchat_ads_source.stg_snapchat_ads__creative_history 232. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history 232. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history 232. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history->214. model.snapchat_ads.snapchat_ads__creative_history_prep 233. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history_tmp 233. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history_tmp 233. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history_tmp->232. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report->9. model.ad_reporting.int_ad_reporting__ad_group_report 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report->10. model.ad_reporting.int_ad_reporting__ad_report 236. model.tiktok_ads.tiktok_ads__advertiser_report 236. model.tiktok_ads.tiktok_ads__advertiser_report 236. model.tiktok_ads.tiktok_ads__advertiser_report->8. model.ad_reporting.int_ad_reporting__account_report 237. model.tiktok_ads.tiktok_ads__campaign_report 237. model.tiktok_ads.tiktok_ads__campaign_report 237. model.tiktok_ads.tiktok_ads__campaign_report->11. model.ad_reporting.int_ad_reporting__campaign_report 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report->14. model.ad_reporting.int_ad_reporting__url_report 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history->234. model.tiktok_ads.tiktok_ads__ad_group_report 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history->235. model.tiktok_ads.tiktok_ads__ad_report 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history->238. model.tiktok_ads.tiktok_ads__url_report 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly->234. model.tiktok_ads.tiktok_ads__ad_group_report 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history->235. model.tiktok_ads.tiktok_ads__ad_report 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history->236. model.tiktok_ads.tiktok_ads__advertiser_report 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history->238. model.tiktok_ads.tiktok_ads__url_report 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly->235. model.tiktok_ads.tiktok_ads__ad_report 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly->236. model.tiktok_ads.tiktok_ads__advertiser_report 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly->238. model.tiktok_ads.tiktok_ads__url_report 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser->234. model.tiktok_ads.tiktok_ads__ad_group_report 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser->235. model.tiktok_ads.tiktok_ads__ad_report 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser->236. model.tiktok_ads.tiktok_ads__advertiser_report 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser->237. model.tiktok_ads.tiktok_ads__campaign_report 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser->238. model.tiktok_ads.tiktok_ads__url_report 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp->247. model.tiktok_ads_source.stg_tiktok_ads__advertiser 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history->234. model.tiktok_ads.tiktok_ads__ad_group_report 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history->235. model.tiktok_ads.tiktok_ads__ad_report 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history->237. model.tiktok_ads.tiktok_ads__campaign_report 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history->238. model.tiktok_ads.tiktok_ads__url_report 250. model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp 250. model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp 250. model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp->249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly->237. model.tiktok_ads.tiktok_ads__campaign_report 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly 253. model.twitter_ads.twitter_ads__account_report 253. model.twitter_ads.twitter_ads__account_report 253. model.twitter_ads.twitter_ads__account_report->8. model.ad_reporting.int_ad_reporting__account_report 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report->11. model.ad_reporting.int_ad_reporting__campaign_report 255. model.twitter_ads.twitter_ads__keyword_report 255. model.twitter_ads.twitter_ads__keyword_report 255. model.twitter_ads.twitter_ads__keyword_report->12. model.ad_reporting.int_ad_reporting__keyword_report 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report->9. model.ad_reporting.int_ad_reporting__ad_group_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report->10. model.ad_reporting.int_ad_reporting__ad_report 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report->14. model.ad_reporting.int_ad_reporting__url_report 259. model.twitter_ads_source.stg_twitter_ads__account_history 259. model.twitter_ads_source.stg_twitter_ads__account_history 259. model.twitter_ads_source.stg_twitter_ads__account_history->253. model.twitter_ads.twitter_ads__account_report 259. model.twitter_ads_source.stg_twitter_ads__account_history->254. model.twitter_ads.twitter_ads__campaign_report 259. model.twitter_ads_source.stg_twitter_ads__account_history->255. model.twitter_ads.twitter_ads__keyword_report 259. model.twitter_ads_source.stg_twitter_ads__account_history->256. model.twitter_ads.twitter_ads__line_item_report 259. model.twitter_ads_source.stg_twitter_ads__account_history->257. model.twitter_ads.twitter_ads__promoted_tweet_report 259. model.twitter_ads_source.stg_twitter_ads__account_history->258. model.twitter_ads.twitter_ads__url_report 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp->259. model.twitter_ads_source.stg_twitter_ads__account_history 261. model.twitter_ads_source.stg_twitter_ads__campaign_history 261. model.twitter_ads_source.stg_twitter_ads__campaign_history 261. model.twitter_ads_source.stg_twitter_ads__campaign_history->254. model.twitter_ads.twitter_ads__campaign_report 261. model.twitter_ads_source.stg_twitter_ads__campaign_history->255. model.twitter_ads.twitter_ads__keyword_report 261. model.twitter_ads_source.stg_twitter_ads__campaign_history->256. model.twitter_ads.twitter_ads__line_item_report 261. model.twitter_ads_source.stg_twitter_ads__campaign_history->257. model.twitter_ads.twitter_ads__promoted_tweet_report 261. model.twitter_ads_source.stg_twitter_ads__campaign_history->258. model.twitter_ads.twitter_ads__url_report 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp->261. model.twitter_ads_source.stg_twitter_ads__campaign_history 263. model.twitter_ads_source.stg_twitter_ads__campaign_report 263. model.twitter_ads_source.stg_twitter_ads__campaign_report 263. model.twitter_ads_source.stg_twitter_ads__campaign_report->254. model.twitter_ads.twitter_ads__campaign_report 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp->263. model.twitter_ads_source.stg_twitter_ads__campaign_report 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history->255. model.twitter_ads.twitter_ads__keyword_report 265. model.twitter_ads_source.stg_twitter_ads__line_item_history->256. model.twitter_ads.twitter_ads__line_item_report 265. model.twitter_ads_source.stg_twitter_ads__line_item_history->257. model.twitter_ads.twitter_ads__promoted_tweet_report 265. model.twitter_ads_source.stg_twitter_ads__line_item_history->258. model.twitter_ads.twitter_ads__url_report 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp->265. model.twitter_ads_source.stg_twitter_ads__line_item_history 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report->255. model.twitter_ads.twitter_ads__keyword_report 268. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report_tmp 268. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report_tmp 268. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report_tmp->267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report 269. model.twitter_ads_source.stg_twitter_ads__line_item_report 269. model.twitter_ads_source.stg_twitter_ads__line_item_report 269. model.twitter_ads_source.stg_twitter_ads__line_item_report->256. model.twitter_ads.twitter_ads__line_item_report 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp->269. model.twitter_ads_source.stg_twitter_ads__line_item_report 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history->257. model.twitter_ads.twitter_ads__promoted_tweet_report 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history->258. model.twitter_ads.twitter_ads__url_report 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp->271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report->253. model.twitter_ads.twitter_ads__account_report 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report->257. model.twitter_ads.twitter_ads__promoted_tweet_report 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report->258. model.twitter_ads.twitter_ads__url_report 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp->273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report 275. model.twitter_ads_source.stg_twitter_ads__tweet 275. model.twitter_ads_source.stg_twitter_ads__tweet 275. model.twitter_ads_source.stg_twitter_ads__tweet->257. model.twitter_ads.twitter_ads__promoted_tweet_report 275. model.twitter_ads_source.stg_twitter_ads__tweet->258. model.twitter_ads.twitter_ads__url_report 276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp 276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp 276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp->275. model.twitter_ads_source.stg_twitter_ads__tweet 277. model.twitter_ads_source.stg_twitter_ads__tweet_url 277. model.twitter_ads_source.stg_twitter_ads__tweet_url 277. model.twitter_ads_source.stg_twitter_ads__tweet_url->258. model.twitter_ads.twitter_ads__url_report 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp->277. model.twitter_ads_source.stg_twitter_ads__tweet_url 279. source.amazon_ads_source.amazon_ads.ad_group_history 279. source.amazon_ads_source.amazon_ads.ad_group_history 279. source.amazon_ads_source.amazon_ads.ad_group_history->25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp 280. source.amazon_ads_source.amazon_ads.ad_group_level_report 280. source.amazon_ads_source.amazon_ads.ad_group_level_report 280. source.amazon_ads_source.amazon_ads.ad_group_level_report->27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp 281. source.amazon_ads_source.amazon_ads.advertised_product_report 281. source.amazon_ads_source.amazon_ads.advertised_product_report 281. source.amazon_ads_source.amazon_ads.advertised_product_report->29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp 282. source.amazon_ads_source.amazon_ads.campaign_history 282. source.amazon_ads_source.amazon_ads.campaign_history 282. source.amazon_ads_source.amazon_ads.campaign_history->31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp 283. source.amazon_ads_source.amazon_ads.campaign_level_report 283. source.amazon_ads_source.amazon_ads.campaign_level_report 283. source.amazon_ads_source.amazon_ads.campaign_level_report->33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp 284. source.amazon_ads_source.amazon_ads.keyword_history 284. source.amazon_ads_source.amazon_ads.keyword_history 284. source.amazon_ads_source.amazon_ads.keyword_history->35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp 285. source.amazon_ads_source.amazon_ads.portfolio_history 285. source.amazon_ads_source.amazon_ads.portfolio_history 285. source.amazon_ads_source.amazon_ads.portfolio_history->37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp 286. source.amazon_ads_source.amazon_ads.product_ad_history 286. source.amazon_ads_source.amazon_ads.product_ad_history 286. source.amazon_ads_source.amazon_ads.product_ad_history->39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp 287. source.amazon_ads_source.amazon_ads.profile 287. source.amazon_ads_source.amazon_ads.profile 287. source.amazon_ads_source.amazon_ads.profile->41. model.amazon_ads_source.stg_amazon_ads__profile_tmp 288. source.amazon_ads_source.amazon_ads.search_term_ad_keyword_report 288. source.amazon_ads_source.amazon_ads.search_term_ad_keyword_report 288. source.amazon_ads_source.amazon_ads.search_term_ad_keyword_report->43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp 289. source.amazon_ads_source.amazon_ads.targeting_keyword_report 289. source.amazon_ads_source.amazon_ads.targeting_keyword_report 289. source.amazon_ads_source.amazon_ads.targeting_keyword_report->45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp 290. source.apple_search_ads_source.apple_search_ads.ad_group_history 290. source.apple_search_ads_source.apple_search_ads.ad_group_history 290. source.apple_search_ads_source.apple_search_ads.ad_group_history->53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp 291. source.apple_search_ads_source.apple_search_ads.ad_group_report 291. source.apple_search_ads_source.apple_search_ads.ad_group_report 291. source.apple_search_ads_source.apple_search_ads.ad_group_report->55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp 292. source.apple_search_ads_source.apple_search_ads.ad_history 292. source.apple_search_ads_source.apple_search_ads.ad_history 292. source.apple_search_ads_source.apple_search_ads.ad_history->57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp 293. source.apple_search_ads_source.apple_search_ads.ad_level_report 293. source.apple_search_ads_source.apple_search_ads.ad_level_report 293. source.apple_search_ads_source.apple_search_ads.ad_level_report->59. model.apple_search_ads_source.stg_apple_search_ads__ad_report_tmp 294. source.apple_search_ads_source.apple_search_ads.campaign_history 294. source.apple_search_ads_source.apple_search_ads.campaign_history 294. source.apple_search_ads_source.apple_search_ads.campaign_history->61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp 295. source.apple_search_ads_source.apple_search_ads.campaign_report 295. source.apple_search_ads_source.apple_search_ads.campaign_report 295. source.apple_search_ads_source.apple_search_ads.campaign_report->63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp 296. source.apple_search_ads_source.apple_search_ads.keyword_history 296. source.apple_search_ads_source.apple_search_ads.keyword_history 296. source.apple_search_ads_source.apple_search_ads.keyword_history->65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp 297. source.apple_search_ads_source.apple_search_ads.keyword_report 297. source.apple_search_ads_source.apple_search_ads.keyword_report 297. source.apple_search_ads_source.apple_search_ads.keyword_report->67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp 298. source.apple_search_ads_source.apple_search_ads.organization 298. source.apple_search_ads_source.apple_search_ads.organization 298. source.apple_search_ads_source.apple_search_ads.organization->69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp 299. source.apple_search_ads_source.apple_search_ads.search_term_report 299. source.apple_search_ads_source.apple_search_ads.search_term_report 299. source.apple_search_ads_source.apple_search_ads.search_term_report->71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp 300. source.facebook_ads_source.facebook_ads.account_history 300. source.facebook_ads_source.facebook_ads.account_history 300. source.facebook_ads_source.facebook_ads.account_history->80. model.facebook_ads_source.stg_facebook_ads__account_history_tmp 301. source.facebook_ads_source.facebook_ads.ad_history 301. source.facebook_ads_source.facebook_ads.ad_history 301. source.facebook_ads_source.facebook_ads.ad_history->82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp 302. source.facebook_ads_source.facebook_ads.ad_set_history 302. source.facebook_ads_source.facebook_ads.ad_set_history 302. source.facebook_ads_source.facebook_ads.ad_set_history->84. model.facebook_ads_source.stg_facebook_ads__ad_set_history_tmp 303. source.facebook_ads_source.facebook_ads.basic_ad 303. source.facebook_ads_source.facebook_ads.basic_ad 303. source.facebook_ads_source.facebook_ads.basic_ad->86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp 304. source.facebook_ads_source.facebook_ads.campaign_history 304. source.facebook_ads_source.facebook_ads.campaign_history 304. source.facebook_ads_source.facebook_ads.campaign_history->88. model.facebook_ads_source.stg_facebook_ads__campaign_history_tmp 305. source.facebook_ads_source.facebook_ads.creative_history 305. source.facebook_ads_source.facebook_ads.creative_history 305. source.facebook_ads_source.facebook_ads.creative_history->90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp 306. source.google_ads_source.google_ads.account_history 306. source.google_ads_source.google_ads.account_history 306. source.google_ads_source.google_ads.account_history->98. model.google_ads_source.stg_google_ads__account_history_tmp 307. source.google_ads_source.google_ads.account_stats 307. source.google_ads_source.google_ads.account_stats 307. source.google_ads_source.google_ads.account_stats->100. model.google_ads_source.stg_google_ads__account_stats_tmp 308. source.google_ads_source.google_ads.ad_group_criterion_history 308. source.google_ads_source.google_ads.ad_group_criterion_history 308. source.google_ads_source.google_ads.ad_group_criterion_history->102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp 309. source.google_ads_source.google_ads.ad_group_history 309. source.google_ads_source.google_ads.ad_group_history 309. source.google_ads_source.google_ads.ad_group_history->104. model.google_ads_source.stg_google_ads__ad_group_history_tmp 310. source.google_ads_source.google_ads.ad_group_stats 310. source.google_ads_source.google_ads.ad_group_stats 310. source.google_ads_source.google_ads.ad_group_stats->106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp 311. source.google_ads_source.google_ads.ad_history 311. source.google_ads_source.google_ads.ad_history 311. source.google_ads_source.google_ads.ad_history->108. model.google_ads_source.stg_google_ads__ad_history_tmp 312. source.google_ads_source.google_ads.ad_stats 312. source.google_ads_source.google_ads.ad_stats 312. source.google_ads_source.google_ads.ad_stats->110. model.google_ads_source.stg_google_ads__ad_stats_tmp 313. source.google_ads_source.google_ads.campaign_history 313. source.google_ads_source.google_ads.campaign_history 313. source.google_ads_source.google_ads.campaign_history->112. model.google_ads_source.stg_google_ads__campaign_history_tmp 314. source.google_ads_source.google_ads.campaign_stats 314. source.google_ads_source.google_ads.campaign_stats 314. source.google_ads_source.google_ads.campaign_stats->114. model.google_ads_source.stg_google_ads__campaign_stats_tmp 315. source.google_ads_source.google_ads.keyword_stats 315. source.google_ads_source.google_ads.keyword_stats 315. source.google_ads_source.google_ads.keyword_stats->116. model.google_ads_source.stg_google_ads__keyword_stats_tmp 316. source.linkedin_source.linkedin_ads.account_history 316. source.linkedin_source.linkedin_ads.account_history 316. source.linkedin_source.linkedin_ads.account_history->123. model.linkedin_source.stg_linkedin_ads__account_history_tmp 317. source.linkedin_source.linkedin_ads.ad_analytics_by_campaign 317. source.linkedin_source.linkedin_ads.ad_analytics_by_campaign 317. source.linkedin_source.linkedin_ads.ad_analytics_by_campaign->125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp 318. source.linkedin_source.linkedin_ads.ad_analytics_by_creative 318. source.linkedin_source.linkedin_ads.ad_analytics_by_creative 318. source.linkedin_source.linkedin_ads.ad_analytics_by_creative->127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp 319. source.linkedin_source.linkedin_ads.campaign_group_history 319. source.linkedin_source.linkedin_ads.campaign_group_history 319. source.linkedin_source.linkedin_ads.campaign_group_history->129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp 320. source.linkedin_source.linkedin_ads.campaign_history 320. source.linkedin_source.linkedin_ads.campaign_history 320. source.linkedin_source.linkedin_ads.campaign_history->131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp 321. source.linkedin_source.linkedin_ads.creative_history 321. source.linkedin_source.linkedin_ads.creative_history 321. source.linkedin_source.linkedin_ads.creative_history->133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp 322. source.microsoft_ads_source.microsoft_ads.account_history 322. source.microsoft_ads_source.microsoft_ads.account_history 322. source.microsoft_ads_source.microsoft_ads.account_history->144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp 323. source.microsoft_ads_source.microsoft_ads.account_performance_daily_report 323. source.microsoft_ads_source.microsoft_ads.account_performance_daily_report 323. source.microsoft_ads_source.microsoft_ads.account_performance_daily_report->142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp 324. source.microsoft_ads_source.microsoft_ads.ad_group_history 324. source.microsoft_ads_source.microsoft_ads.ad_group_history 324. source.microsoft_ads_source.microsoft_ads.ad_group_history->150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp 325. source.microsoft_ads_source.microsoft_ads.ad_group_performance_daily_report 325. source.microsoft_ads_source.microsoft_ads.ad_group_performance_daily_report 325. source.microsoft_ads_source.microsoft_ads.ad_group_performance_daily_report->148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp 326. source.microsoft_ads_source.microsoft_ads.ad_history 326. source.microsoft_ads_source.microsoft_ads.ad_history 326. source.microsoft_ads_source.microsoft_ads.ad_history->152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp 327. source.microsoft_ads_source.microsoft_ads.ad_performance_daily_report 327. source.microsoft_ads_source.microsoft_ads.ad_performance_daily_report 327. source.microsoft_ads_source.microsoft_ads.ad_performance_daily_report->146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp 328. source.microsoft_ads_source.microsoft_ads.campaign_history 328. source.microsoft_ads_source.microsoft_ads.campaign_history 328. source.microsoft_ads_source.microsoft_ads.campaign_history->156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp 329. source.microsoft_ads_source.microsoft_ads.campaign_performance_daily_report 329. source.microsoft_ads_source.microsoft_ads.campaign_performance_daily_report 329. source.microsoft_ads_source.microsoft_ads.campaign_performance_daily_report->154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp 330. source.microsoft_ads_source.microsoft_ads.keyword_history 330. source.microsoft_ads_source.microsoft_ads.keyword_history 330. source.microsoft_ads_source.microsoft_ads.keyword_history->160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp 331. source.microsoft_ads_source.microsoft_ads.keyword_performance_daily_report 331. source.microsoft_ads_source.microsoft_ads.keyword_performance_daily_report 331. source.microsoft_ads_source.microsoft_ads.keyword_performance_daily_report->158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp 332. source.microsoft_ads_source.microsoft_ads.search_query_performance_daily_report 332. source.microsoft_ads_source.microsoft_ads.search_query_performance_daily_report 332. source.microsoft_ads_source.microsoft_ads.search_query_performance_daily_report->162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp 333. source.pinterest_source.pinterest_ads.ad_group_history 333. source.pinterest_source.pinterest_ads.ad_group_history 333. source.pinterest_source.pinterest_ads.ad_group_history->170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp 334. source.pinterest_source.pinterest_ads.ad_group_report 334. source.pinterest_source.pinterest_ads.ad_group_report 334. source.pinterest_source.pinterest_ads.ad_group_report->172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp 335. source.pinterest_source.pinterest_ads.advertiser_history 335. source.pinterest_source.pinterest_ads.advertiser_history 335. source.pinterest_source.pinterest_ads.advertiser_history->174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp 336. source.pinterest_source.pinterest_ads.advertiser_report 336. source.pinterest_source.pinterest_ads.advertiser_report 336. source.pinterest_source.pinterest_ads.advertiser_report->176. model.pinterest_source.stg_pinterest_ads__advertiser_report_tmp 337. source.pinterest_source.pinterest_ads.campaign_history 337. source.pinterest_source.pinterest_ads.campaign_history 337. source.pinterest_source.pinterest_ads.campaign_history->178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp 338. source.pinterest_source.pinterest_ads.campaign_report 338. source.pinterest_source.pinterest_ads.campaign_report 338. source.pinterest_source.pinterest_ads.campaign_report->180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp 339. source.pinterest_source.pinterest_ads.keyword_history 339. source.pinterest_source.pinterest_ads.keyword_history 339. source.pinterest_source.pinterest_ads.keyword_history->182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp 340. source.pinterest_source.pinterest_ads.keyword_report 340. source.pinterest_source.pinterest_ads.keyword_report 340. source.pinterest_source.pinterest_ads.keyword_report->184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp 341. source.pinterest_source.pinterest_ads.pin_promotion_history 341. source.pinterest_source.pinterest_ads.pin_promotion_history 341. source.pinterest_source.pinterest_ads.pin_promotion_history->186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp 342. source.pinterest_source.pinterest_ads.pin_promotion_report 342. source.pinterest_source.pinterest_ads.pin_promotion_report 342. source.pinterest_source.pinterest_ads.pin_promotion_report->188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp 343. source.reddit_ads_source.reddit_ads.account 343. source.reddit_ads_source.reddit_ads.account 343. source.reddit_ads_source.reddit_ads.account->197. model.reddit_ads_source.stg_reddit_ads__account_tmp 344. source.reddit_ads_source.reddit_ads.account_report 344. source.reddit_ads_source.reddit_ads.account_report 344. source.reddit_ads_source.reddit_ads.account_report->196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp 345. source.reddit_ads_source.reddit_ads.ad 345. source.reddit_ads_source.reddit_ads.ad 345. source.reddit_ads_source.reddit_ads.ad->205. model.reddit_ads_source.stg_reddit_ads__ad_tmp 346. source.reddit_ads_source.reddit_ads.ad_group 346. source.reddit_ads_source.reddit_ads.ad_group 346. source.reddit_ads_source.reddit_ads.ad_group->202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp 347. source.reddit_ads_source.reddit_ads.ad_group_report 347. source.reddit_ads_source.reddit_ads.ad_group_report 347. source.reddit_ads_source.reddit_ads.ad_group_report->201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp 348. source.reddit_ads_source.reddit_ads.ad_report 348. source.reddit_ads_source.reddit_ads.ad_report 348. source.reddit_ads_source.reddit_ads.ad_report->204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp 349. source.reddit_ads_source.reddit_ads.campaign 349. source.reddit_ads_source.reddit_ads.campaign 349. source.reddit_ads_source.reddit_ads.campaign->209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp 350. source.reddit_ads_source.reddit_ads.campaign_report 350. source.reddit_ads_source.reddit_ads.campaign_report 350. source.reddit_ads_source.reddit_ads.campaign_report->208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp 351. source.snapchat_ads_source.snapchat_ads.ad_account_history 351. source.snapchat_ads_source.snapchat_ads.ad_account_history 351. source.snapchat_ads_source.snapchat_ads.ad_account_history->217. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history_tmp 352. source.snapchat_ads_source.snapchat_ads.ad_history 352. source.snapchat_ads_source.snapchat_ads.ad_history 352. source.snapchat_ads_source.snapchat_ads.ad_history->219. model.snapchat_ads_source.stg_snapchat_ads__ad_history_tmp 353. source.snapchat_ads_source.snapchat_ads.ad_hourly_report 353. source.snapchat_ads_source.snapchat_ads.ad_hourly_report 353. source.snapchat_ads_source.snapchat_ads.ad_hourly_report->221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp 354. source.snapchat_ads_source.snapchat_ads.ad_squad_history 354. source.snapchat_ads_source.snapchat_ads.ad_squad_history 354. source.snapchat_ads_source.snapchat_ads.ad_squad_history->223. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history_tmp 355. source.snapchat_ads_source.snapchat_ads.ad_squad_hourly_report 355. source.snapchat_ads_source.snapchat_ads.ad_squad_hourly_report 355. source.snapchat_ads_source.snapchat_ads.ad_squad_hourly_report->225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp 356. source.snapchat_ads_source.snapchat_ads.campaign_history 356. source.snapchat_ads_source.snapchat_ads.campaign_history 356. source.snapchat_ads_source.snapchat_ads.campaign_history->227. model.snapchat_ads_source.stg_snapchat_ads__campaign_history_tmp 357. source.snapchat_ads_source.snapchat_ads.campaign_hourly_report 357. source.snapchat_ads_source.snapchat_ads.campaign_hourly_report 357. source.snapchat_ads_source.snapchat_ads.campaign_hourly_report->229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp 358. source.snapchat_ads_source.snapchat_ads.creative_history 358. source.snapchat_ads_source.snapchat_ads.creative_history 358. source.snapchat_ads_source.snapchat_ads.creative_history->231. model.snapchat_ads_source.stg_snapchat_ads__creative_history_tmp 359. source.snapchat_ads_source.snapchat_ads.creative_url_tag_history 359. source.snapchat_ads_source.snapchat_ads.creative_url_tag_history 359. source.snapchat_ads_source.snapchat_ads.creative_url_tag_history->233. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history_tmp 360. source.tiktok_ads_source.tiktok_ads.ad_history 360. source.tiktok_ads_source.tiktok_ads.ad_history 360. source.tiktok_ads_source.tiktok_ads.ad_history->244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp 361. source.tiktok_ads_source.tiktok_ads.ad_report_hourly 361. source.tiktok_ads_source.tiktok_ads.ad_report_hourly 361. source.tiktok_ads_source.tiktok_ads.ad_report_hourly->246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 362. source.tiktok_ads_source.tiktok_ads.adgroup_history 362. source.tiktok_ads_source.tiktok_ads.adgroup_history 362. source.tiktok_ads_source.tiktok_ads.adgroup_history->240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp 363. source.tiktok_ads_source.tiktok_ads.adgroup_report_hourly 363. source.tiktok_ads_source.tiktok_ads.adgroup_report_hourly 363. source.tiktok_ads_source.tiktok_ads.adgroup_report_hourly->242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp 364. source.tiktok_ads_source.tiktok_ads.advertiser 364. source.tiktok_ads_source.tiktok_ads.advertiser 364. source.tiktok_ads_source.tiktok_ads.advertiser->248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp 365. source.tiktok_ads_source.tiktok_ads.campaign_history 365. source.tiktok_ads_source.tiktok_ads.campaign_history 365. source.tiktok_ads_source.tiktok_ads.campaign_history->250. model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp 366. source.tiktok_ads_source.tiktok_ads.campaign_report_hourly 366. source.tiktok_ads_source.tiktok_ads.campaign_report_hourly 366. source.tiktok_ads_source.tiktok_ads.campaign_report_hourly->252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp 367. source.twitter_ads_source.twitter_ads.account_history 367. source.twitter_ads_source.twitter_ads.account_history 367. source.twitter_ads_source.twitter_ads.account_history->260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp 368. source.twitter_ads_source.twitter_ads.campaign_history 368. source.twitter_ads_source.twitter_ads.campaign_history 368. source.twitter_ads_source.twitter_ads.campaign_history->262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp 369. source.twitter_ads_source.twitter_ads.campaign_report 369. source.twitter_ads_source.twitter_ads.campaign_report 369. source.twitter_ads_source.twitter_ads.campaign_report->264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp 370. source.twitter_ads_source.twitter_ads.line_item_history 370. source.twitter_ads_source.twitter_ads.line_item_history 370. source.twitter_ads_source.twitter_ads.line_item_history->266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 371. source.twitter_ads_source.twitter_ads.line_item_keywords_report 371. source.twitter_ads_source.twitter_ads.line_item_keywords_report 371. source.twitter_ads_source.twitter_ads.line_item_keywords_report->268. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report_tmp 372. source.twitter_ads_source.twitter_ads.line_item_report 372. source.twitter_ads_source.twitter_ads.line_item_report 372. source.twitter_ads_source.twitter_ads.line_item_report->270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp 373. source.twitter_ads_source.twitter_ads.promoted_tweet_history 373. source.twitter_ads_source.twitter_ads.promoted_tweet_history 373. source.twitter_ads_source.twitter_ads.promoted_tweet_history->272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp 374. source.twitter_ads_source.twitter_ads.promoted_tweet_report 374. source.twitter_ads_source.twitter_ads.promoted_tweet_report 374. source.twitter_ads_source.twitter_ads.promoted_tweet_report->274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp 375. source.twitter_ads_source.twitter_ads.tweet 375. source.twitter_ads_source.twitter_ads.tweet 375. source.twitter_ads_source.twitter_ads.tweet->276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp 376. source.twitter_ads_source.twitter_ads.tweet_url 376. source.twitter_ads_source.twitter_ads.tweet_url 376. source.twitter_ads_source.twitter_ads.tweet_url->278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp
1. model.ad_reporting.ad_reporting__account_report

This SQL query integrates advertising data from multiple platforms (e.g., Twitter, Facebook, Google, Microsoft, Apple, LinkedIn, Pinterest, Snapchat, TikTok, Amazon, and Reddit) into a single unified report. It standardizes the data structure across platforms, casting data types and renaming columns for consistency. The query then aggregates the data by source, date, platform, account ID, and account name, summing up clicks, impressions, and spend.

IntegrationCleaningAggregation
SQL Query
WITH __dbt__cte__int_ad_reporting__account_report AS (
  WITH twitter_ads AS (
    SELECT
      source_relation,
      TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
      CAST('twitter_ads' AS TEXT) AS platform,
      CAST(account_id AS TEXT) AS account_id,
      CAST(account_name AS TEXT) AS account_name,
      CAST(clicks AS INT) AS clicks,
      CAST(impressions AS INT) AS impressions,
      CAST(spend AS FLOAT) AS spend
    FROM TEST.PUBLIC_twitter_ads.twitter_ads__account_report
  ), facebook_ads AS (
    SELECT
      source_relation,
      TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
      CAST('facebook_ads' AS TEXT) AS platform,
      CAST(account_id AS TEXT) AS account_id,
      CAST(account_name AS TEXT) AS account_name,
      CAST(clicks AS INT) AS clicks,
      CAST(impressions AS INT) AS impressions,
      CAST(spend AS FLOAT) AS spend
    FROM TEST.PUBLIC_facebook_ads.facebook_ads__account_report
  ), google_ads AS (
    SELECT
      source_relation,
      TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
      CAST('google_ads' AS TEXT) AS platform,
      CAST(account_id AS TEXT) AS account_id,
      CAST(account_name AS TEXT) AS account_name,
      CAST(clicks AS INT) AS clicks,
      CAST(impressions AS INT) AS impressions,
      CAST(spend AS FLOAT) AS spend
    FROM TEST.PUBLIC_google_ads.google_ads__account_report
  ), microsoft_ads AS (
    SELECT
      source_relation,
      TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
      CAST('microsoft_ads' AS TEXT) AS platform,
      CAST(account_id AS TEXT) AS account_id,
      CAST(account_name AS TEXT) AS account_name,
      CAST(clicks AS INT) AS clicks,
      CAST(impressions AS INT) AS impressions,
      CAST(spend AS FLOAT) AS spend
    FROM TEST.PUBLIC_microsoft_ads.microsoft_ads__account_report
  ), apple_search_ads AS (
    SELECT
      source_relation,
      TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
      CAST('apple_search_ads' AS TEXT) AS platform,
      CAST(organization_id AS TEXT) AS account_id,
      CAST(organization_name AS TEXT) AS account_name,
      CAST(taps AS INT) AS clicks,
      CAST(impressions AS INT) AS impressions,
      CAST(spend AS FLOAT) AS spend
    FROM TEST.PUBLIC_apple_search_ads.apple_search_ads__organization_report
  ), linkedin_ads AS (
    SELECT
      source_relation,
      TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
      CAST('linkedin_ads' AS TEXT) AS platform,
      CAST(account_id AS TEXT) AS account_id,
      CAST(account_name AS TEXT) AS account_name,
      CAST(clicks AS INT) AS clicks,
      CAST(impressions AS INT) AS impressions,
      CAST(cost AS FLOAT) AS spend
    FROM TEST.PUBLIC_linkedin_ads.linkedin_ads__account_report
  ), pinterest_ads AS (
    SELECT
      source_relation,
      TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
      CAST('pinterest_ads' AS TEXT) AS platform,
      CAST(advertiser_id AS TEXT) AS account_id,
      CAST(advertiser_name AS TEXT) AS account_name,
      CAST(clicks AS INT) AS clicks,
      CAST(impressions AS INT) AS impressions,
      CAST(spend AS FLOAT) AS spend
    FROM TEST.PUBLIC_pinterest.pinterest_ads__advertiser_report
  ), snapchat_ads AS (
    SELECT
      source_relation,
      TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
      CAST('snapchat_ads' AS TEXT) AS platform,
      CAST(ad_account_id AS TEXT) AS account_id,
      CAST(ad_account_name AS TEXT) AS account_name,
      CAST(swipes AS INT) AS clicks,
      CAST(impressions AS INT) AS impressions,
      CAST(spend AS FLOAT) AS spend
    FROM TEST.PUBLIC_snapchat_ads.snapchat_ads__account_report
  ), tiktok_ads AS (
    SELECT
      source_relation,
      TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
      CAST('tiktok_ads' AS TEXT) AS platform,
      CAST(advertiser_id AS TEXT) AS account_id,
      CAST(advertiser_name AS TEXT) AS account_name,
      CAST(clicks AS INT) AS clicks,
      CAST(impressions AS INT) AS impressions,
      CAST(spend AS FLOAT) AS spend
    FROM TEST.PUBLIC_tiktok_ads.tiktok_ads__advertiser_report
  ), amazon_ads AS (
    SELECT
      source_relation,
      TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
      CAST('amazon_ads' AS TEXT) AS platform,
      CAST(account_id AS TEXT) AS account_id,
      CAST(account_name AS TEXT) AS account_name,
      CAST(clicks AS INT) AS clicks,
      CAST(impressions AS INT) AS impressions,
      CAST(cost AS FLOAT) AS spend
    FROM TEST.PUBLIC_amazon_ads.amazon_ads__account_report
  ), reddit_ads AS (
    SELECT
      source_relation,
      TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
      CAST('reddit_ads' AS TEXT) AS platform,
      CAST(account_id AS TEXT) AS account_id,
      CAST(NULL AS TEXT) AS account_name,
      CAST(clicks AS INT) AS clicks,
      CAST(impressions AS INT) AS impressions,
      CAST(spend AS FLOAT) AS spend
    FROM TEST.PUBLIC_reddit_ads.reddit_ads__account_report
  ), unioned AS (
    SELECT
      *
    FROM amazon_ads
    UNION ALL
    SELECT
      *
    FROM apple_search_ads
    UNION ALL
    SELECT
      *
    FROM facebook_ads
    UNION ALL
    SELECT
      *
    FROM google_ads
    UNION ALL
    SELECT
      *
    FROM linkedin_ads
    UNION ALL
    SELECT
      *
    FROM microsoft_ads
    UNION ALL
    SELECT
      *
    FROM pinterest_ads
    UNION ALL
    SELECT
      *
    FROM snapchat_ads
    UNION ALL
    SELECT
      *
    FROM tiktok_ads
    UNION ALL
    SELECT
      *
    FROM twitter_ads
    UNION ALL
    SELECT
      *
    FROM reddit_ads
  )
  SELECT
    *
  FROM unioned
), base AS (
  SELECT
    *
  FROM __dbt__cte__int_ad_reporting__account_report
), aggregated AS (
  SELECT
    source_relation,
    date_day,
    platform,
    account_id,
    account_name,
    SUM(clicks) AS clicks,
    SUM(impressions) AS impressions,
    SUM(spend) AS spend
  FROM base
  GROUP BY
    1,
    2,
    3,
    4,
    5
)
SELECT
  *
FROM aggregated
%3 1. model.ad_reporting.ad_reporting__account_report 1. model.ad_reporting.ad_reporting__account_report source_relation date_day platform account_id account_name clicks impressions spend 8. model.ad_reporting.int_ad_reporting__account_report 8. model.ad_reporting.int_ad_reporting__account_report
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
date_day date The date of the report.
platform text The ad platform associated with this record.
account_id text The ID representing the account.
account_name text The name of the account, if present in the source data.
clicks bigint The count of clicks.
impressions bigint The count of impressions.
spend double precision The cost of the ads.
2. model.ad_reporting.ad_reporting__ad_group_report

This SQL query integrates ad performance data from multiple advertising platforms (e.g., Google Ads, Facebook Ads, LinkedIn Ads) into a single unified report. It standardizes data formats across platforms, aligning column names and data types. The query then aggregates the data by date, platform, account, campaign, and ad group, calculating total clicks, impressions, and spend.

IntegrationCleaningAggregation
SQL Query
WITH __dbt__cte__int_ad_reporting__ad_group_report AS (
  WITH google_ads AS (
    SELECT
      source_relation,
      TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
      CAST('google_ads' AS TEXT) AS platform,
      CAST(account_id AS TEXT) AS account_id,
      CAST(account_name AS TEXT) AS account_name,
      CAST(ad_group_id AS TEXT) AS ad_group_id,
      CAST(ad_group_name AS TEXT) AS ad_group_name,
      CAST(campaign_id AS TEXT) AS campaign_id,
      CAST(campaign_name AS TEXT) AS campaign_name,
      CAST(clicks AS INT) AS clicks,
      CAST(impressions AS INT) AS impressions,
      CAST(spend AS FLOAT) AS spend
    FROM TEST.PUBLIC_google_ads.google_ads__ad_group_report
  ), microsoft_ads AS (
    SELECT
      source_relation,
      TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
      CAST('microsoft_ads' AS TEXT) AS platform,
      CAST(account_id AS TEXT) AS account_id,
      CAST(account_name AS TEXT) AS account_name,
      CAST(ad_group_id AS TEXT) AS ad_group_id,
      CAST(ad_group_name AS TEXT) AS ad_group_name,
      CAST(campaign_id AS TEXT) AS campaign_id,
      CAST(campaign_name AS TEXT) AS campaign_name,
      CAST(clicks AS INT) AS clicks,
      CAST(impressions AS INT) AS impressions,
      CAST(spend AS FLOAT) AS spend
    FROM TEST.PUBLIC_microsoft_ads.microsoft_ads__ad_group_report
  ), apple_search_ads AS (
    SELECT
      source_relation,
      TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
      CAST('apple_search_ads' AS TEXT) AS platform,
      CAST(organization_id AS TEXT) AS account_id,
      CAST(organization_name AS TEXT) AS account_name,
      CAST(ad_group_id AS TEXT) AS ad_group_id,
      CAST(ad_group_name AS TEXT) AS ad_group_name,
      CAST(campaign_id AS TEXT) AS campaign_id,
      CAST(campaign_name AS TEXT) AS campaign_name,
      CAST(taps AS INT) AS clicks,
      CAST(impressions AS INT) AS impressions,
      CAST(spend AS FLOAT) AS spend
    FROM TEST.PUBLIC_apple_search_ads.apple_search_ads__ad_group_report
  ), linkedin_ads AS (
    SELECT
      source_relation,
      TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
      CAST('linkedin_ads' AS TEXT) AS platform,
      CAST(account_id AS TEXT) AS account_id,
      CAST(account_name AS TEXT) AS account_name,
      CAST(campaign_id AS TEXT) AS ad_group_id,
      CAST(campaign_name AS TEXT) AS ad_group_name,
      CAST(campaign_group_id AS TEXT) AS campaign_id,
      CAST(campaign_group_name AS TEXT) AS campaign_name,
      CAST(clicks AS INT) AS clicks,
      CAST(impressions AS INT) AS impressions,
      CAST(cost AS FLOAT) AS spend
    FROM TEST.PUBLIC_linkedin_ads.linkedin_ads__campaign_report
  ), facebook_ads AS (
    SELECT
      source_relation,
      TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
      CAST('facebook_ads' AS TEXT) AS platform,
      CAST(account_id AS TEXT) AS account_id,
      CAST(account_name AS TEXT) AS account_name,
      CAST(ad_set_id AS TEXT) AS ad_group_id,
      CAST(ad_set_name AS TEXT) AS ad_group_name,
      CAST(campaign_id AS TEXT) AS campaign_id,
      CAST(campaign_name AS TEXT) AS campaign_name,
      CAST(clicks AS INT) AS clicks,
      CAST(impressions AS INT) AS impressions,
      CAST(spend AS FLOAT) AS spend
    FROM TEST.PUBLIC_facebook_ads.facebook_ads__ad_set_report
  ), pinterest_ads AS (
    SELECT
      source_relation,
      TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
      CAST('pinterest_ads' AS TEXT) AS platform,
      CAST(advertiser_id AS TEXT) AS account_id,
      CAST(advertiser_name AS TEXT) AS account_name,
      CAST(ad_group_id AS TEXT) AS ad_group_id,
      CAST(ad_group_name AS TEXT) AS ad_group_name,
      CAST(campaign_id AS TEXT) AS campaign_id,
      CAST(campaign_name AS TEXT) AS campaign_name,
      CAST(clicks AS INT) AS clicks,
      CAST(impressions AS INT) AS impressions,
      CAST(spend AS FLOAT) AS spend
    FROM TEST.PUBLIC_pinterest.pinterest_ads__ad_group_report
  ), snapchat_ads AS (
    SELECT
      source_relation,
      TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
      CAST('snapchat_ads' AS TEXT) AS platform,
      CAST(ad_account_id AS TEXT) AS account_id,
      CAST(ad_account_name AS TEXT) AS account_name,
      CAST(ad_squad_id AS TEXT) AS ad_group_id,
      CAST(ad_squad_name AS TEXT) AS ad_group_name,
      CAST(campaign_id AS TEXT) AS campaign_id,
      CAST(campaign_name AS TEXT) AS campaign_name,
      CAST(swipes AS INT) AS clicks,
      CAST(impressions AS INT) AS impressions,
      CAST(spend AS FLOAT) AS spend
    FROM TEST.PUBLIC_snapchat_ads.snapchat_ads__ad_squad_report
  ), tiktok_ads AS (
    SELECT
      source_relation,
      TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
      CAST('tiktok_ads' AS TEXT) AS platform,
      CAST(advertiser_id AS TEXT) AS account_id,
      CAST(advertiser_name AS TEXT) AS account_name,
      CAST(ad_group_id AS TEXT) AS ad_group_id,
      CAST(ad_group_name AS TEXT) AS ad_group_name,
      CAST(campaign_id AS TEXT) AS campaign_id,
      CAST(campaign_name AS TEXT) AS campaign_name,
      CAST(clicks AS INT) AS clicks,
      CAST(impressions AS INT) AS impressions,
      CAST(spend AS FLOAT) AS spend
    FROM TEST.PUBLIC_tiktok_ads.tiktok_ads__ad_group_report
  ), twitter_ads AS (
    SELECT
      source_relation,
      TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
      CAST('twitter_ads' AS TEXT) AS platform,
      CAST(account_id AS TEXT) AS account_id,
      CAST(account_name AS TEXT) AS account_name,
      CAST(line_item_id AS TEXT) AS ad_group_id,
      CAST(line_item_name AS TEXT) AS ad_group_name,
      CAST(campaign_id AS TEXT) AS campaign_id,
      CAST(campaign_name AS TEXT) AS campaign_name,
      CAST(clicks AS INT) AS clicks,
      CAST(impressions AS INT) AS impressions,
      CAST(spend AS FLOAT) AS spend
    FROM TEST.PUBLIC_twitter_ads.twitter_ads__line_item_report
  ), amazon_ads AS (
    SELECT
      source_relation,
      TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
      CAST('amazon_ads' AS TEXT) AS platform,
      CAST(account_id AS TEXT) AS account_id,
      CAST(account_name AS TEXT) AS account_name,
      CAST(ad_group_id AS TEXT) AS ad_group_id,
      CAST(ad_group_name AS TEXT) AS ad_group_name,
      CAST(campaign_id AS TEXT) AS campaign_id,
      CAST(campaign_name AS TEXT) AS campaign_name,
      CAST(clicks AS INT) AS clicks,
      CAST(impressions AS INT) AS impressions,
      CAST(cost AS FLOAT) AS spend
    FROM TEST.PUBLIC_amazon_ads.amazon_ads__ad_group_report
  ), reddit_ads AS (
    SELECT
      source_relation,
      TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
      CAST('reddit_ads' AS TEXT) AS platform,
      CAST(account_id AS TEXT) AS account_id,
      CAST(NULL AS TEXT) AS account_name,
      CAST(ad_group_id AS TEXT) AS ad_group_id,
      CAST(ad_group_name AS TEXT) AS ad_group_name,
      CAST(campaign_id AS TEXT) AS campaign_id,
      CAST(campaign_name AS TEXT) AS campaign_name,
      CAST(clicks AS INT) AS clicks,
      CAST(impressions AS INT) AS impressions,
      CAST(spend AS FLOAT) AS spend
    FROM TEST.PUBLIC_reddit_ads.reddit_ads__ad_group_report
  ), unioned AS (
    SELECT
      *
    FROM amazon_ads
    UNION ALL
    SELECT
      *
    FROM apple_search_ads
    UNION ALL
    SELECT
      *
    FROM facebook_ads
    UNION ALL
    SELECT
      *
    FROM google_ads
    UNION ALL
    SELECT
      *
    FROM linkedin_ads
    UNION ALL
    SELECT
      *
    FROM microsoft_ads
    UNION ALL
    SELECT
      *
    FROM pinterest_ads
    UNION ALL
    SELECT
      *
    FROM snapchat_ads
    UNION ALL
    SELECT
      *
    FROM tiktok_ads
    UNION ALL
    SELECT
      *
    FROM twitter_ads
    UNION ALL
    SELECT
      *
    FROM reddit_ads
  )
  SELECT
    *
  FROM unioned
), base AS (
  SELECT
    *
  FROM __dbt__cte__int_ad_reporting__ad_group_report
), aggregated AS (
  SELECT
    source_relation,
    date_day,
    platform,
    account_id,
    account_name,
    campaign_id,
    campaign_name,
    ad_group_id,
    ad_group_name,
    SUM(clicks) AS clicks,
    SUM(impressions) AS impressions,
    SUM(spend) AS spend
  FROM base
  GROUP BY
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9
)
SELECT
  *
FROM aggregated
%3 2. model.ad_reporting.ad_reporting__ad_group_report 2. model.ad_reporting.ad_reporting__ad_group_report source_relation date_day platform account_id account_name campaign_id campaign_name ad_group_id ad_group_name clicks impressions spend 9. model.ad_reporting.int_ad_reporting__ad_group_report 9. model.ad_reporting.int_ad_reporting__ad_group_report
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
date_day date The date of the report.
platform text The ad platform associated with this record.
account_id text The ID representing the account.
account_name text The name of the account, if present in the source data.
campaign_id text The ID representing the campaign, if present in the source data.
campaign_name text The name of the campaign, if present in the source data.
ad_group_id text The ID representing the ad group, if present in the source data.
ad_group_name text The name of the ad group, if present in the source data.
clicks bigint The count of clicks.
impressions bigint The count of impressions.
spend double precision The cost of the ads.
3. model.ad_reporting.ad_reporting__ad_report

This SQL query integrates ad reporting data from multiple advertising platforms (such as Google Ads, Microsoft Ads, Apple Search Ads, Facebook Ads, etc.) into a single unified view. It standardizes the column names and data types across all platforms, performs type casting for consistency, and then aggregates the data by summing clicks, impressions, and spend for each unique combination of date, platform, account, campaign, ad group, and ad.

IntegrationCleaningAggregation
SQL Query
WITH __dbt__cte__int_ad_reporting__ad_report AS (
  WITH google_ads AS (
    SELECT
      source_relation,
      TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
      CAST('google_ads' AS TEXT) AS platform,
      CAST(account_id AS TEXT) AS account_id,
      CAST(account_name AS TEXT) AS account_name,
      CAST(ad_group_id AS TEXT) AS ad_group_id,
      CAST(ad_group_name AS TEXT) AS ad_group_name,
      CAST(ad_id AS TEXT) AS ad_id,
      CAST(ad_name AS TEXT) AS ad_name,
      CAST(campaign_id AS TEXT) AS campaign_id,
      CAST(campaign_name AS TEXT) AS campaign_name,
      CAST(clicks AS INT) AS clicks,
      CAST(impressions AS INT) AS impressions,
      CAST(spend AS FLOAT) AS spend
    FROM TEST.PUBLIC_google_ads.google_ads__ad_report
  ), microsoft_ads AS (
    SELECT
      source_relation,
      TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
      CAST('microsoft_ads' AS TEXT) AS platform,
      CAST(account_id AS TEXT) AS account_id,
      CAST(account_name AS TEXT) AS account_name,
      CAST(ad_group_id AS TEXT) AS ad_group_id,
      CAST(ad_group_name AS TEXT) AS ad_group_name,
      CAST(ad_id AS TEXT) AS ad_id,
      CAST(ad_name AS TEXT) AS ad_name,
      CAST(campaign_id AS TEXT) AS campaign_id,
      CAST(campaign_name AS TEXT) AS campaign_name,
      CAST(clicks AS INT) AS clicks,
      CAST(impressions AS INT) AS impressions,
      CAST(spend AS FLOAT) AS spend
    FROM TEST.PUBLIC_microsoft_ads.microsoft_ads__ad_report
  ), apple_search_ads AS (
    SELECT
      source_relation,
      TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
      CAST('apple_search_ads' AS TEXT) AS platform,
      CAST(organization_id AS TEXT) AS account_id,
      CAST(organization_name AS TEXT) AS account_name,
      CAST(ad_group_id AS TEXT) AS ad_group_id,
      CAST(ad_group_name AS TEXT) AS ad_group_name,
      CAST(ad_id AS TEXT) AS ad_id,
      CAST(ad_name AS TEXT) AS ad_name,
      CAST(campaign_id AS TEXT) AS campaign_id,
      CAST(campaign_name AS TEXT) AS campaign_name,
      CAST(taps AS INT) AS clicks,
      CAST(impressions AS INT) AS impressions,
      CAST(spend AS FLOAT) AS spend
    FROM TEST.PUBLIC_apple_search_ads.apple_search_ads__ad_report
  ), facebook_ads AS (
    SELECT
      source_relation,
      TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
      CAST('facebook_ads' AS TEXT) AS platform,
      CAST(account_id AS TEXT) AS account_id,
      CAST(account_name AS TEXT) AS account_name,
      CAST(ad_set_id AS TEXT) AS ad_group_id,
      CAST(ad_set_name AS TEXT) AS ad_group_name,
      CAST(ad_id AS TEXT) AS ad_id,
      CAST(ad_name AS TEXT) AS ad_name,
      CAST(campaign_id AS TEXT) AS campaign_id,
      CAST(campaign_name AS TEXT) AS campaign_name,
      CAST(clicks AS INT) AS clicks,
      CAST(impressions AS INT) AS impressions,
      CAST(spend AS FLOAT) AS spend
    FROM TEST.PUBLIC_facebook_ads.facebook_ads__ad_report
  ), linkedin_ads AS (
    SELECT
      source_relation,
      TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
      CAST('linkedin_ads' AS TEXT) AS platform,
      CAST(account_id AS TEXT) AS account_id,
      CAST(account_name AS TEXT) AS account_name,
      CAST(campaign_id AS TEXT) AS ad_group_id,
      CAST(campaign_name AS TEXT) AS ad_group_name,
      CAST(creative_id AS TEXT) AS ad_id,
      CAST(NULL AS TEXT) AS ad_name,
      CAST(campaign_group_id AS TEXT) AS campaign_id,
      CAST(campaign_group_name AS TEXT) AS campaign_name,
      CAST(clicks AS INT) AS clicks,
      CAST(impressions AS INT) AS impressions,
      CAST(cost AS FLOAT) AS spend
    FROM TEST.PUBLIC_linkedin_ads.linkedin_ads__creative_report
  ), pinterest_ads AS (
    SELECT
      source_relation,
      TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
      CAST('pinterest_ads' AS TEXT) AS platform,
      CAST(advertiser_id AS TEXT) AS account_id,
      CAST(advertiser_name AS TEXT) AS account_name,
      CAST(ad_group_id AS TEXT) AS ad_group_id,
      CAST(ad_group_name AS TEXT) AS ad_group_name,
      CAST(pin_promotion_id AS TEXT) AS ad_id,
      CAST(pin_name AS TEXT) AS ad_name,
      CAST(campaign_id AS TEXT) AS campaign_id,
      CAST(campaign_name AS TEXT) AS campaign_name,
      CAST(clicks AS INT) AS clicks,
      CAST(impressions AS INT) AS impressions,
      CAST(spend AS FLOAT) AS spend
    FROM TEST.PUBLIC_pinterest.pinterest_ads__pin_promotion_report
  ), snapchat_ads AS (
    SELECT
      source_relation,
      TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
      CAST('snapchat_ads' AS TEXT) AS platform,
      CAST(ad_account_id AS TEXT) AS account_id,
      CAST(ad_account_name AS TEXT) AS account_name,
      CAST(NULL AS TEXT) AS ad_group_id,
      CAST(NULL AS TEXT) AS ad_group_name,
      CAST(ad_id AS TEXT) AS ad_id,
      CAST(ad_name AS TEXT) AS ad_name,
      CAST(NULL AS TEXT) AS campaign_id,
      CAST(NULL AS TEXT) AS campaign_name,
      CAST(swipes AS INT) AS clicks,
      CAST(impressions AS INT) AS impressions,
      CAST(spend AS FLOAT) AS spend
    FROM TEST.PUBLIC_snapchat_ads.snapchat_ads__ad_report
  ), tiktok_ads AS (
    SELECT
      source_relation,
      TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
      CAST('tiktok_ads' AS TEXT) AS platform,
      CAST(advertiser_id AS TEXT) AS account_id,
      CAST(advertiser_name AS TEXT) AS account_name,
      CAST(ad_group_id AS TEXT) AS ad_group_id,
      CAST(ad_group_name AS TEXT) AS ad_group_name,
      CAST(ad_id AS TEXT) AS ad_id,
      CAST(ad_name AS TEXT) AS ad_name,
      CAST(campaign_id AS TEXT) AS campaign_id,
      CAST(campaign_name AS TEXT) AS campaign_name,
      CAST(clicks AS INT) AS clicks,
      CAST(impressions AS INT) AS impressions,
      CAST(spend AS FLOAT) AS spend
    FROM TEST.PUBLIC_tiktok_ads.tiktok_ads__ad_report
  ), twitter_ads AS (
    SELECT
      source_relation,
      TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
      CAST('twitter_ads' AS TEXT) AS platform,
      CAST(account_id AS TEXT) AS account_id,
      CAST(account_name AS TEXT) AS account_name,
      CAST(line_item_id AS TEXT) AS ad_group_id,
      CAST(line_item_name AS TEXT) AS ad_group_name,
      CAST(promoted_tweet_id AS TEXT) AS ad_id,
      CAST(tweet_name AS TEXT) AS ad_name,
      CAST(campaign_id AS TEXT) AS campaign_id,
      CAST(campaign_name AS TEXT) AS campaign_name,
      CAST(clicks AS INT) AS clicks,
      CAST(impressions AS INT) AS impressions,
      CAST(spend AS FLOAT) AS spend
    FROM TEST.PUBLIC_twitter_ads.twitter_ads__promoted_tweet_report
  ), amazon_ads AS (
    SELECT
      source_relation,
      TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
      CAST('amazon_ads' AS TEXT) AS platform,
      CAST(account_id AS TEXT) AS account_id,
      CAST(account_name AS TEXT) AS account_name,
      CAST(ad_group_id AS TEXT) AS ad_group_id,
      CAST(ad_group_name AS TEXT) AS ad_group_name,
      CAST(ad_id AS TEXT) AS ad_id,
      CAST(advertised_asin AS TEXT) AS ad_name,
      CAST(campaign_id AS TEXT) AS campaign_id,
      CAST(campaign_name AS TEXT) AS campaign_name,
      CAST(clicks AS INT) AS clicks,
      CAST(impressions AS INT) AS impressions,
      CAST(cost AS FLOAT) AS spend
    FROM TEST.PUBLIC_amazon_ads.amazon_ads__ad_report
  ), reddit_ads AS (
    SELECT
      source_relation,
      TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
      CAST('reddit_ads' AS TEXT) AS platform,
      CAST(account_id AS TEXT) AS account_id,
      CAST(NULL AS TEXT) AS account_name,
      CAST(ad_group_id AS TEXT) AS ad_group_id,
      CAST(ad_group_name AS TEXT) AS ad_group_name,
      CAST(ad_id AS TEXT) AS ad_id,
      CAST(ad_name AS TEXT) AS ad_name,
      CAST(campaign_id AS TEXT) AS campaign_id,
      CAST(campaign_name AS TEXT) AS campaign_name,
      CAST(clicks AS INT) AS clicks,
      CAST(impressions AS INT) AS impressions,
      CAST(spend AS FLOAT) AS spend
    FROM TEST.PUBLIC_reddit_ads.reddit_ads__ad_report
  ), unioned AS (
    SELECT
      *
    FROM amazon_ads
    UNION ALL
    SELECT
      *
    FROM apple_search_ads
    UNION ALL
    SELECT
      *
    FROM facebook_ads
    UNION ALL
    SELECT
      *
    FROM google_ads
    UNION ALL
    SELECT
      *
    FROM linkedin_ads
    UNION ALL
    SELECT
      *
    FROM microsoft_ads
    UNION ALL
    SELECT
      *
    FROM pinterest_ads
    UNION ALL
    SELECT
      *
    FROM snapchat_ads
    UNION ALL
    SELECT
      *
    FROM tiktok_ads
    UNION ALL
    SELECT
      *
    FROM twitter_ads
    UNION ALL
    SELECT
      *
    FROM reddit_ads
  )
  SELECT
    *
  FROM unioned
), base AS (
  SELECT
    *
  FROM __dbt__cte__int_ad_reporting__ad_report
), aggregated AS (
  SELECT
    source_relation,
    date_day,
    platform,
    account_id,
    account_name,
    campaign_id,
    campaign_name,
    ad_group_id,
    ad_group_name,
    ad_id,
    ad_name,
    SUM(clicks) AS clicks,
    SUM(impressions) AS impressions,
    SUM(spend) AS spend
  FROM base
  GROUP BY
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10,
    11
)
SELECT
  *
FROM aggregated
%3 3. model.ad_reporting.ad_reporting__ad_report 3. model.ad_reporting.ad_reporting__ad_report source_relation date_day platform account_id account_name campaign_id campaign_name ad_group_id ad_group_name ad_id ad_name clicks impressions spend 10. model.ad_reporting.int_ad_reporting__ad_report 10. model.ad_reporting.int_ad_reporting__ad_report
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
date_day date The date of the report.
platform text The ad platform associated with this record.
account_id text The ID representing the account.
account_name text The name of the account, if present in the source data.
campaign_id text The ID representing the campaign, if present in the source data.
campaign_name text The name of the campaign, if present in the source data.
ad_group_id text The ID representing the ad group, if present in the source data.
ad_group_name text The name of the ad group, if present in the source data.
ad_id text The ID representing the ad, if present in the source data.
ad_name text The name of the ad, if present in the source data.
clicks bigint The count of clicks.
impressions bigint The count of impressions.
spend double precision The cost of the ads.
4. model.ad_reporting.ad_reporting__campaign_report

This SQL query integrates campaign report data from multiple advertising platforms (such as Twitter, Facebook, Google, Microsoft, Apple, LinkedIn, Pinterest, Snapchat, TikTok, Amazon, and Reddit) into a single unified dataset. It standardizes the column names and data types across all platforms, performs type casting for consistency, and then aggregates the data by source, date, platform, account, and campaign, summing up clicks, impressions, and spend.

IntegrationCleaningAggregation
SQL Query
WITH __dbt__cte__int_ad_reporting__campaign_report AS (
  WITH twitter_ads AS (
    SELECT
      source_relation,
      TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
      CAST('twitter_ads' AS TEXT) AS platform,
      CAST(account_id AS TEXT) AS account_id,
      CAST(account_name AS TEXT) AS account_name,
      CAST(campaign_id AS TEXT) AS campaign_id,
      CAST(campaign_name AS TEXT) AS campaign_name,
      CAST(clicks AS INT) AS clicks,
      CAST(impressions AS INT) AS impressions,
      CAST(spend AS FLOAT) AS spend
    FROM TEST.PUBLIC_twitter_ads.twitter_ads__campaign_report
  ), facebook_ads AS (
    SELECT
      source_relation,
      TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
      CAST('facebook_ads' AS TEXT) AS platform,
      CAST(account_id AS TEXT) AS account_id,
      CAST(account_name AS TEXT) AS account_name,
      CAST(campaign_id AS TEXT) AS campaign_id,
      CAST(campaign_name AS TEXT) AS campaign_name,
      CAST(clicks AS INT) AS clicks,
      CAST(impressions AS INT) AS impressions,
      CAST(spend AS FLOAT) AS spend
    FROM TEST.PUBLIC_facebook_ads.facebook_ads__campaign_report
  ), google_ads AS (
    SELECT
      source_relation,
      TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
      CAST('google_ads' AS TEXT) AS platform,
      CAST(account_id AS TEXT) AS account_id,
      CAST(account_name AS TEXT) AS account_name,
      CAST(campaign_id AS TEXT) AS campaign_id,
      CAST(campaign_name AS TEXT) AS campaign_name,
      CAST(clicks AS INT) AS clicks,
      CAST(impressions AS INT) AS impressions,
      CAST(spend AS FLOAT) AS spend
    FROM TEST.PUBLIC_google_ads.google_ads__campaign_report
  ), microsoft_ads AS (
    SELECT
      source_relation,
      TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
      CAST('microsoft_ads' AS TEXT) AS platform,
      CAST(account_id AS TEXT) AS account_id,
      CAST(account_name AS TEXT) AS account_name,
      CAST(campaign_id AS TEXT) AS campaign_id,
      CAST(campaign_name AS TEXT) AS campaign_name,
      CAST(clicks AS INT) AS clicks,
      CAST(impressions AS INT) AS impressions,
      CAST(spend AS FLOAT) AS spend
    FROM TEST.PUBLIC_microsoft_ads.microsoft_ads__campaign_report
  ), apple_search_ads AS (
    SELECT
      source_relation,
      TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
      CAST('apple_search_ads' AS TEXT) AS platform,
      CAST(organization_id AS TEXT) AS account_id,
      CAST(organization_name AS TEXT) AS account_name,
      CAST(campaign_id AS TEXT) AS campaign_id,
      CAST(campaign_name AS TEXT) AS campaign_name,
      CAST(taps AS INT) AS clicks,
      CAST(impressions AS INT) AS impressions,
      CAST(spend AS FLOAT) AS spend
    FROM TEST.PUBLIC_apple_search_ads.apple_search_ads__campaign_report
  ), linkedin_ads AS (
    SELECT
      source_relation,
      TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
      CAST('linkedin_ads' AS TEXT) AS platform,
      CAST(account_id AS TEXT) AS account_id,
      CAST(account_name AS TEXT) AS account_name,
      CAST(campaign_group_id AS TEXT) AS campaign_id,
      CAST(campaign_group_name AS TEXT) AS campaign_name,
      CAST(clicks AS INT) AS clicks,
      CAST(impressions AS INT) AS impressions,
      CAST(cost AS FLOAT) AS spend
    FROM TEST.PUBLIC_linkedin_ads.linkedin_ads__campaign_group_report
  ), pinterest_ads AS (
    SELECT
      source_relation,
      TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
      CAST('pinterest_ads' AS TEXT) AS platform,
      CAST(advertiser_id AS TEXT) AS account_id,
      CAST(advertiser_name AS TEXT) AS account_name,
      CAST(campaign_id AS TEXT) AS campaign_id,
      CAST(campaign_name AS TEXT) AS campaign_name,
      CAST(clicks AS INT) AS clicks,
      CAST(impressions AS INT) AS impressions,
      CAST(spend AS FLOAT) AS spend
    FROM TEST.PUBLIC_pinterest.pinterest_ads__campaign_report
  ), snapchat_ads AS (
    SELECT
      source_relation,
      TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
      CAST('snapchat_ads' AS TEXT) AS platform,
      CAST(ad_account_id AS TEXT) AS account_id,
      CAST(ad_account_name AS TEXT) AS account_name,
      CAST(campaign_id AS TEXT) AS campaign_id,
      CAST(campaign_name AS TEXT) AS campaign_name,
      CAST(swipes AS INT) AS clicks,
      CAST(impressions AS INT) AS impressions,
      CAST(spend AS FLOAT) AS spend
    FROM TEST.PUBLIC_snapchat_ads.snapchat_ads__campaign_report
  ), tiktok_ads AS (
    SELECT
      source_relation,
      TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
      CAST('tiktok_ads' AS TEXT) AS platform,
      CAST(advertiser_id AS TEXT) AS account_id,
      CAST(advertiser_name AS TEXT) AS account_name,
      CAST(campaign_id AS TEXT) AS campaign_id,
      CAST(campaign_name AS TEXT) AS campaign_name,
      CAST(clicks AS INT) AS clicks,
      CAST(impressions AS INT) AS impressions,
      CAST(spend AS FLOAT) AS spend
    FROM TEST.PUBLIC_tiktok_ads.tiktok_ads__campaign_report
  ), amazon_ads AS (
    SELECT
      source_relation,
      TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
      CAST('amazon_ads' AS TEXT) AS platform,
      CAST(account_id AS TEXT) AS account_id,
      CAST(account_name AS TEXT) AS account_name,
      CAST(campaign_id AS TEXT) AS campaign_id,
      CAST(campaign_name AS TEXT) AS campaign_name,
      CAST(clicks AS INT) AS clicks,
      CAST(impressions AS INT) AS impressions,
      CAST(cost AS FLOAT) AS spend
    FROM TEST.PUBLIC_amazon_ads.amazon_ads__campaign_report
  ), reddit_ads AS (
    SELECT
      source_relation,
      TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
      CAST('reddit_ads' AS TEXT) AS platform,
      CAST(account_id AS TEXT) AS account_id,
      CAST(NULL AS TEXT) AS account_name,
      CAST(campaign_id AS TEXT) AS campaign_id,
      CAST(campaign_name AS TEXT) AS campaign_name,
      CAST(clicks AS INT) AS clicks,
      CAST(impressions AS INT) AS impressions,
      CAST(spend AS FLOAT) AS spend
    FROM TEST.PUBLIC_reddit_ads.reddit_ads__campaign_report
  ), unioned AS (
    SELECT
      *
    FROM amazon_ads
    UNION ALL
    SELECT
      *
    FROM apple_search_ads
    UNION ALL
    SELECT
      *
    FROM facebook_ads
    UNION ALL
    SELECT
      *
    FROM google_ads
    UNION ALL
    SELECT
      *
    FROM linkedin_ads
    UNION ALL
    SELECT
      *
    FROM microsoft_ads
    UNION ALL
    SELECT
      *
    FROM pinterest_ads
    UNION ALL
    SELECT
      *
    FROM snapchat_ads
    UNION ALL
    SELECT
      *
    FROM tiktok_ads
    UNION ALL
    SELECT
      *
    FROM twitter_ads
    UNION ALL
    SELECT
      *
    FROM reddit_ads
  )
  SELECT
    *
  FROM unioned
), base AS (
  SELECT
    *
  FROM __dbt__cte__int_ad_reporting__campaign_report
), aggregated AS (
  SELECT
    source_relation,
    date_day,
    platform,
    account_id,
    account_name,
    campaign_id,
    campaign_name,
    SUM(clicks) AS clicks,
    SUM(impressions) AS impressions,
    SUM(spend) AS spend
  FROM base
  GROUP BY
    1,
    2,
    3,
    4,
    5,
    6,
    7
)
SELECT
  *
FROM aggregated
%3 4. model.ad_reporting.ad_reporting__campaign_report 4. model.ad_reporting.ad_reporting__campaign_report source_relation date_day platform account_id account_name campaign_id campaign_name clicks impressions spend 11. model.ad_reporting.int_ad_reporting__campaign_report 11. model.ad_reporting.int_ad_reporting__campaign_report
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
date_day date The date of the report.
platform text The ad platform associated with this record.
account_id text The ID representing the account.
account_name text The name of the account, if present in the source data.
campaign_id text The ID representing the campaign, if present in the source data.
campaign_name text The name of the campaign, if present in the source data.
clicks bigint The count of clicks.
impressions bigint The count of impressions.
spend double precision The cost of the ads.
5. model.ad_reporting.ad_reporting__keyword_report

This SQL query integrates keyword report data from multiple advertising platforms (Amazon Ads, Apple Search Ads, Google Ads, Microsoft Ads, Pinterest Ads, and Twitter Ads) into a single unified table. It standardizes column names and data types across platforms, performs type casting for consistency, and then aggregates the data by various dimensions such as date, platform, account, campaign, ad group, and keyword information. The query calculates total clicks, impressions, and spend for each unique combination of these dimensions.

IntegrationCleaningAggregation
SQL Query
WITH __dbt__cte__int_ad_reporting__keyword_report AS (
  WITH apple_search_ads AS (
    SELECT
      source_relation,
      TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
      CAST('apple_search_ads' AS TEXT) AS platform,
      CAST(organization_id AS TEXT) AS account_id,
      CAST(organization_name AS TEXT) AS account_name,
      CAST(ad_group_id AS TEXT) AS ad_group_id,
      CAST(ad_group_name AS TEXT) AS ad_group_name,
      CAST(campaign_id AS TEXT) AS campaign_id,
      CAST(campaign_name AS TEXT) AS campaign_name,
      CAST(taps AS INT) AS clicks,
      CAST(impressions AS INT) AS impressions,
      CAST(keyword_id AS TEXT) AS keyword_id,
      CAST(match_type AS TEXT) AS keyword_match_type,
      CAST(keyword_text AS TEXT) AS keyword_text,
      CAST(spend AS FLOAT) AS spend
    FROM TEST.PUBLIC_apple_search_ads.apple_search_ads__keyword_report
  ), google_ads AS (
    SELECT
      source_relation,
      TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
      CAST('google_ads' AS TEXT) AS platform,
      CAST(account_id AS TEXT) AS account_id,
      CAST(account_name AS TEXT) AS account_name,
      CAST(ad_group_id AS TEXT) AS ad_group_id,
      CAST(ad_group_name AS TEXT) AS ad_group_name,
      CAST(campaign_id AS TEXT) AS campaign_id,
      CAST(campaign_name AS TEXT) AS campaign_name,
      CAST(clicks AS INT) AS clicks,
      CAST(impressions AS INT) AS impressions,
      CAST(criterion_id AS TEXT) AS keyword_id,
      CAST(keyword_match_type AS TEXT) AS keyword_match_type,
      CAST(keyword_text AS TEXT) AS keyword_text,
      CAST(spend AS FLOAT) AS spend
    FROM TEST.PUBLIC_google_ads.google_ads__keyword_report
  ), microsoft_ads AS (
    SELECT
      source_relation,
      TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
      CAST('microsoft_ads' AS TEXT) AS platform,
      CAST(account_id AS TEXT) AS account_id,
      CAST(account_name AS TEXT) AS account_name,
      CAST(ad_group_id AS TEXT) AS ad_group_id,
      CAST(ad_group_name AS TEXT) AS ad_group_name,
      CAST(campaign_id AS TEXT) AS campaign_id,
      CAST(campaign_name AS TEXT) AS campaign_name,
      CAST(clicks AS INT) AS clicks,
      CAST(impressions AS INT) AS impressions,
      CAST(keyword_id AS TEXT) AS keyword_id,
      CAST(match_type AS TEXT) AS keyword_match_type,
      CAST(keyword_name AS TEXT) AS keyword_text,
      CAST(spend AS FLOAT) AS spend
    FROM TEST.PUBLIC_microsoft_ads.microsoft_ads__keyword_report
  ), pinterest_ads AS (
    SELECT
      source_relation,
      TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
      CAST('pinterest_ads' AS TEXT) AS platform,
      CAST(advertiser_id AS TEXT) AS account_id,
      CAST(advertiser_name AS TEXT) AS account_name,
      CAST(ad_group_id AS TEXT) AS ad_group_id,
      CAST(ad_group_name AS TEXT) AS ad_group_name,
      CAST(campaign_id AS TEXT) AS campaign_id,
      CAST(campaign_name AS TEXT) AS campaign_name,
      CAST(clicks AS INT) AS clicks,
      CAST(impressions AS INT) AS impressions,
      CAST(keyword_id AS TEXT) AS keyword_id,
      CAST(match_type AS TEXT) AS keyword_match_type,
      CAST(keyword_value AS TEXT) AS keyword_text,
      CAST(spend AS FLOAT) AS spend
    FROM TEST.PUBLIC_pinterest.pinterest_ads__keyword_report
  ), twitter_ads AS (
    SELECT
      source_relation,
      TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
      CAST('twitter_ads' AS TEXT) AS platform,
      CAST(account_id AS TEXT) AS account_id,
      CAST(account_name AS TEXT) AS account_name,
      CAST(line_item_id AS TEXT) AS ad_group_id,
      CAST(line_item_name AS TEXT) AS ad_group_name,
      CAST(campaign_id AS TEXT) AS campaign_id,
      CAST(campaign_name AS TEXT) AS campaign_name,
      CAST(clicks AS INT) AS clicks,
      CAST(impressions AS INT) AS impressions,
      CAST(keyword_id AS TEXT) AS keyword_id,
      CAST(NULL AS TEXT) AS keyword_match_type,
      CAST(keyword AS TEXT) AS keyword_text,
      CAST(spend AS FLOAT) AS spend
    FROM TEST.PUBLIC_twitter_ads.twitter_ads__keyword_report
  ), amazon_ads AS (
    SELECT
      source_relation,
      TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
      CAST('amazon_ads' AS TEXT) AS platform,
      CAST(account_id AS TEXT) AS account_id,
      CAST(account_name AS TEXT) AS account_name,
      CAST(ad_group_id AS TEXT) AS ad_group_id,
      CAST(ad_group_name AS TEXT) AS ad_group_name,
      CAST(campaign_id AS TEXT) AS campaign_id,
      CAST(campaign_name AS TEXT) AS campaign_name,
      CAST(clicks AS INT) AS clicks,
      CAST(impressions AS INT) AS impressions,
      CAST(keyword_id AS TEXT) AS keyword_id,
      CAST(match_type AS TEXT) AS keyword_match_type,
      CAST(keyword_text AS TEXT) AS keyword_text,
      CAST(cost AS FLOAT) AS spend
    FROM TEST.PUBLIC_amazon_ads.amazon_ads__keyword_report
  ), unioned AS (
    SELECT
      *
    FROM amazon_ads
    UNION ALL
    SELECT
      *
    FROM apple_search_ads
    UNION ALL
    SELECT
      *
    FROM google_ads
    UNION ALL
    SELECT
      *
    FROM microsoft_ads
    UNION ALL
    SELECT
      *
    FROM pinterest_ads
    UNION ALL
    SELECT
      *
    FROM twitter_ads
  )
  SELECT
    *
  FROM unioned
), base AS (
  SELECT
    *
  FROM __dbt__cte__int_ad_reporting__keyword_report
), aggregated AS (
  SELECT
    source_relation,
    date_day,
    platform,
    account_id,
    account_name,
    campaign_id,
    campaign_name,
    ad_group_id,
    ad_group_name,
    keyword_id,
    keyword_text,
    keyword_match_type,
    SUM(clicks) AS clicks,
    SUM(impressions) AS impressions,
    SUM(spend) AS spend
  FROM base
  GROUP BY
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10,
    11,
    12
)
SELECT
  *
FROM aggregated
%3 5. model.ad_reporting.ad_reporting__keyword_report 5. model.ad_reporting.ad_reporting__keyword_report source_relation date_day platform account_id account_name campaign_id campaign_name ad_group_id ad_group_name keyword_id keyword_text keyword_match_type clicks impressions spend 12. model.ad_reporting.int_ad_reporting__keyword_report 12. model.ad_reporting.int_ad_reporting__keyword_report
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
date_day date The date of the report.
platform text The ad platform associated with this record.
account_id text The ID representing the account.
account_name text The name of the account, if present in the source data.
campaign_id text The ID representing the campaign, if present in the source data.
campaign_name text The name of the campaign, if present in the source data.
ad_group_id text The ID representing the ad group, if present in the source data.
ad_group_name text The name of the ad group, if present in the source data.
keyword_id text The ID representing the keyword, if present in the source data.
keyword_text text The keyword text.
keyword_match_type text The keyword match type associated with this record.
clicks bigint The count of clicks.
impressions bigint The count of impressions.
spend double precision The cost of the ads.
6. model.ad_reporting.ad_reporting__search_report

This SQL query integrates search report data from three different advertising platforms (Microsoft Ads, Apple Search Ads, and Amazon Ads) into a unified format. It standardizes column names and data types across the platforms, combines the data using UNION ALL, and then aggregates the results by various dimensions such as date, platform, account, campaign, ad group, keyword, and search query. The final output includes summed metrics for clicks, impressions, and spend.

IntegrationCleaningAggregation
SQL Query
WITH __dbt__cte__int_ad_reporting__search_report AS (
  WITH microsoft_ads AS (
    SELECT
      source_relation,
      TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
      CAST('microsoft_ads' AS TEXT) AS platform,
      CAST(account_id AS TEXT) AS account_id,
      CAST(account_name AS TEXT) AS account_name,
      CAST(ad_group_id AS TEXT) AS ad_group_id,
      CAST(ad_group_name AS TEXT) AS ad_group_name,
      CAST(campaign_id AS TEXT) AS campaign_id,
      CAST(campaign_name AS TEXT) AS campaign_name,
      CAST(clicks AS INT) AS clicks,
      CAST(impressions AS INT) AS impressions,
      CAST(keyword_id AS TEXT) AS keyword_id,
      CAST(keyword_name AS TEXT) AS keyword_text,
      CAST(match_type AS TEXT) AS search_match_type,
      CAST(search_query AS TEXT) AS search_query,
      CAST(spend AS FLOAT) AS spend
    FROM TEST.PUBLIC_microsoft_ads.microsoft_ads__search_report
  ), apple_search_ads AS (
    SELECT
      source_relation,
      TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
      CAST('apple_search_ads' AS TEXT) AS platform,
      CAST(organization_id AS TEXT) AS account_id,
      CAST(organization_name AS TEXT) AS account_name,
      CAST(ad_group_id AS TEXT) AS ad_group_id,
      CAST(ad_group_name AS TEXT) AS ad_group_name,
      CAST(campaign_id AS TEXT) AS campaign_id,
      CAST(campaign_name AS TEXT) AS campaign_name,
      CAST(taps AS INT) AS clicks,
      CAST(impressions AS INT) AS impressions,
      CAST(keyword_id AS TEXT) AS keyword_id,
      CAST(keyword_text AS TEXT) AS keyword_text,
      CAST(match_type AS TEXT) AS search_match_type,
      CAST(search_term_text AS TEXT) AS search_query,
      CAST(spend AS FLOAT) AS spend
    FROM TEST.PUBLIC_apple_search_ads.apple_search_ads__search_term_report
  ), amazon_ads AS (
    SELECT
      source_relation,
      TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
      CAST('amazon_ads' AS TEXT) AS platform,
      CAST(account_id AS TEXT) AS account_id,
      CAST(account_name AS TEXT) AS account_name,
      CAST(ad_group_id AS TEXT) AS ad_group_id,
      CAST(ad_group_name AS TEXT) AS ad_group_name,
      CAST(campaign_id AS TEXT) AS campaign_id,
      CAST(campaign_name AS TEXT) AS campaign_name,
      CAST(clicks AS INT) AS clicks,
      CAST(impressions AS INT) AS impressions,
      CAST(keyword_id AS TEXT) AS keyword_id,
      CAST(keyword_text AS TEXT) AS keyword_text,
      CAST(match_type AS TEXT) AS search_match_type,
      CAST(search_term AS TEXT) AS search_query,
      CAST(cost AS FLOAT) AS spend
    FROM TEST.PUBLIC_amazon_ads.amazon_ads__search_report
  ), unioned AS (
    SELECT
      *
    FROM amazon_ads
    UNION ALL
    SELECT
      *
    FROM apple_search_ads
    UNION ALL
    SELECT
      *
    FROM microsoft_ads
  )
  SELECT
    *
  FROM unioned
), base AS (
  SELECT
    *
  FROM __dbt__cte__int_ad_reporting__search_report
), aggregated AS (
  SELECT
    source_relation,
    date_day,
    platform,
    account_id,
    account_name,
    campaign_id,
    campaign_name,
    ad_group_id,
    ad_group_name,
    keyword_id,
    keyword_text,
    search_query,
    search_match_type,
    SUM(clicks) AS clicks,
    SUM(impressions) AS impressions,
    SUM(spend) AS spend
  FROM base
  GROUP BY
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10,
    11,
    12,
    13
)
SELECT
  *
FROM aggregated
%3 6. model.ad_reporting.ad_reporting__search_report 6. model.ad_reporting.ad_reporting__search_report source_relation date_day platform account_id account_name campaign_id campaign_name ad_group_id ad_group_name keyword_id keyword_text search_query search_match_type clicks impressions spend 13. model.ad_reporting.int_ad_reporting__search_report 13. model.ad_reporting.int_ad_reporting__search_report
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
date_day date The date of the report.
platform text The ad platform associated with this record.
account_id text The ID representing the account.
account_name text The name of the account, if present in the source data.
campaign_id text The ID representing the campaign, if present in the source data.
campaign_name text The name of the campaign, if present in the source data.
ad_group_id text The ID representing the ad group, if present in the source data.
ad_group_name text The name of the ad group, if present in the source data.
keyword_id text The ID representing the keyword, if present in the source data.
keyword_text text The keyword text.
search_query text The search query text.
search_match_type text The search match type associated with this record.
clicks bigint The count of clicks.
impressions bigint The count of impressions.
spend double precision The cost of the ads.
7. model.ad_reporting.ad_reporting__url_report

This SQL query integrates ad reporting data from multiple advertising platforms (Facebook, Google, LinkedIn, Microsoft, Pinterest, Snapchat, TikTok, Twitter, and Reddit) into a single unified report. It standardizes the column names and data types across all platforms, combines the data using UNION ALL, and then aggregates the metrics (clicks, impressions, and spend) by various dimensions such as date, platform, account, campaign, ad group, and URL components.

IntegrationCleaningAggregation
SQL Query
WITH __dbt__cte__int_ad_reporting__url_report AS (
  WITH google_ads AS (
    SELECT
      source_relation,
      TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
      CAST('google_ads' AS TEXT) AS platform,
      CAST(account_id AS TEXT) AS account_id,
      CAST(account_name AS TEXT) AS account_name,
      CAST(ad_group_id AS TEXT) AS ad_group_id,
      CAST(ad_group_name AS TEXT) AS ad_group_name,
      CAST(base_url AS TEXT) AS base_url,
      CAST(campaign_id AS TEXT) AS campaign_id,
      CAST(campaign_name AS TEXT) AS campaign_name,
      CAST(clicks AS INT) AS clicks,
      CAST(impressions AS INT) AS impressions,
      CAST(spend AS FLOAT) AS spend,
      CAST(url_host AS TEXT) AS url_host,
      CAST(url_path AS TEXT) AS url_path,
      CAST(utm_campaign AS TEXT) AS utm_campaign,
      CAST(utm_content AS TEXT) AS utm_content,
      CAST(utm_medium AS TEXT) AS utm_medium,
      CAST(utm_source AS TEXT) AS utm_source,
      CAST(utm_term AS TEXT) AS utm_term
    FROM TEST.PUBLIC_google_ads.google_ads__url_report
  ), microsoft_ads AS (
    SELECT
      source_relation,
      TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
      CAST('microsoft_ads' AS TEXT) AS platform,
      CAST(account_id AS TEXT) AS account_id,
      CAST(account_name AS TEXT) AS account_name,
      CAST(ad_group_id AS TEXT) AS ad_group_id,
      CAST(ad_group_name AS TEXT) AS ad_group_name,
      CAST(base_url AS TEXT) AS base_url,
      CAST(campaign_id AS TEXT) AS campaign_id,
      CAST(campaign_name AS TEXT) AS campaign_name,
      CAST(clicks AS INT) AS clicks,
      CAST(impressions AS INT) AS impressions,
      CAST(spend AS FLOAT) AS spend,
      CAST(url_host AS TEXT) AS url_host,
      CAST(url_path AS TEXT) AS url_path,
      CAST(utm_campaign AS TEXT) AS utm_campaign,
      CAST(utm_content AS TEXT) AS utm_content,
      CAST(utm_medium AS TEXT) AS utm_medium,
      CAST(utm_source AS TEXT) AS utm_source,
      CAST(utm_term AS TEXT) AS utm_term
    FROM TEST.PUBLIC_microsoft_ads.microsoft_ads__url_report
  ), facebook_ads AS (
    SELECT
      source_relation,
      TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
      CAST('facebook_ads' AS TEXT) AS platform,
      CAST(account_id AS TEXT) AS account_id,
      CAST(account_name AS TEXT) AS account_name,
      CAST(ad_set_id AS TEXT) AS ad_group_id,
      CAST(ad_set_name AS TEXT) AS ad_group_name,
      CAST(base_url AS TEXT) AS base_url,
      CAST(campaign_id AS TEXT) AS campaign_id,
      CAST(campaign_name AS TEXT) AS campaign_name,
      CAST(clicks AS INT) AS clicks,
      CAST(impressions AS INT) AS impressions,
      CAST(spend AS FLOAT) AS spend,
      CAST(url_host AS TEXT) AS url_host,
      CAST(url_path AS TEXT) AS url_path,
      CAST(utm_campaign AS TEXT) AS utm_campaign,
      CAST(utm_content AS TEXT) AS utm_content,
      CAST(utm_medium AS TEXT) AS utm_medium,
      CAST(utm_source AS TEXT) AS utm_source,
      CAST(utm_term AS TEXT) AS utm_term
    FROM TEST.PUBLIC_facebook_ads.facebook_ads__url_report
  ), linkedin_ads AS (
    SELECT
      source_relation,
      TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
      CAST('linkedin_ads' AS TEXT) AS platform,
      CAST(account_id AS TEXT) AS account_id,
      CAST(account_name AS TEXT) AS account_name,
      CAST(campaign_id AS TEXT) AS ad_group_id,
      CAST(campaign_name AS TEXT) AS ad_group_name,
      CAST(base_url AS TEXT) AS base_url,
      CAST(campaign_group_id AS TEXT) AS campaign_id,
      CAST(campaign_group_name AS TEXT) AS campaign_name,
      CAST(clicks AS INT) AS clicks,
      CAST(impressions AS INT) AS impressions,
      CAST(cost AS FLOAT) AS spend,
      CAST(url_host AS TEXT) AS url_host,
      CAST(url_path AS TEXT) AS url_path,
      CAST(utm_campaign AS TEXT) AS utm_campaign,
      CAST(utm_content AS TEXT) AS utm_content,
      CAST(utm_medium AS TEXT) AS utm_medium,
      CAST(utm_source AS TEXT) AS utm_source,
      CAST(utm_term AS TEXT) AS utm_term
    FROM TEST.PUBLIC_linkedin_ads.linkedin_ads__url_report
  ), pinterest_ads AS (
    SELECT
      source_relation,
      TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
      CAST('pinterest_ads' AS TEXT) AS platform,
      CAST(advertiser_id AS TEXT) AS account_id,
      CAST(advertiser_name AS TEXT) AS account_name,
      CAST(ad_group_id AS TEXT) AS ad_group_id,
      CAST(ad_group_name AS TEXT) AS ad_group_name,
      CAST(base_url AS TEXT) AS base_url,
      CAST(campaign_id AS TEXT) AS campaign_id,
      CAST(campaign_name AS TEXT) AS campaign_name,
      CAST(clicks AS INT) AS clicks,
      CAST(impressions AS INT) AS impressions,
      CAST(spend AS FLOAT) AS spend,
      CAST(url_host AS TEXT) AS url_host,
      CAST(url_path AS TEXT) AS url_path,
      CAST(utm_campaign AS TEXT) AS utm_campaign,
      CAST(utm_content AS TEXT) AS utm_content,
      CAST(utm_medium AS TEXT) AS utm_medium,
      CAST(utm_source AS TEXT) AS utm_source,
      CAST(utm_term AS TEXT) AS utm_term
    FROM TEST.PUBLIC_pinterest.pinterest_ads__url_report
  ), snapchat_ads AS (
    SELECT
      source_relation,
      TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
      CAST('snapchat_ads' AS TEXT) AS platform,
      CAST(ad_account_id AS TEXT) AS account_id,
      CAST(ad_account_name AS TEXT) AS account_name,
      CAST(ad_squad_id AS TEXT) AS ad_group_id,
      CAST(ad_squad_name AS TEXT) AS ad_group_name,
      CAST(base_url AS TEXT) AS base_url,
      CAST(campaign_id AS TEXT) AS campaign_id,
      CAST(campaign_name AS TEXT) AS campaign_name,
      CAST(swipes AS INT) AS clicks,
      CAST(impressions AS INT) AS impressions,
      CAST(spend AS FLOAT) AS spend,
      CAST(url_host AS TEXT) AS url_host,
      CAST(url_path AS TEXT) AS url_path,
      CAST(utm_campaign AS TEXT) AS utm_campaign,
      CAST(utm_content AS TEXT) AS utm_content,
      CAST(utm_medium AS TEXT) AS utm_medium,
      CAST(utm_source AS TEXT) AS utm_source,
      CAST(utm_term AS TEXT) AS utm_term
    FROM TEST.PUBLIC_snapchat_ads.snapchat_ads__url_report
  ), tiktok_ads AS (
    SELECT
      source_relation,
      TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
      CAST('tiktok_ads' AS TEXT) AS platform,
      CAST(advertiser_id AS TEXT) AS account_id,
      CAST(advertiser_name AS TEXT) AS account_name,
      CAST(ad_group_id AS TEXT) AS ad_group_id,
      CAST(ad_group_name AS TEXT) AS ad_group_name,
      CAST(base_url AS TEXT) AS base_url,
      CAST(campaign_id AS TEXT) AS campaign_id,
      CAST(campaign_name AS TEXT) AS campaign_name,
      CAST(clicks AS INT) AS clicks,
      CAST(impressions AS INT) AS impressions,
      CAST(spend AS FLOAT) AS spend,
      CAST(url_host AS TEXT) AS url_host,
      CAST(url_path AS TEXT) AS url_path,
      CAST(utm_campaign AS TEXT) AS utm_campaign,
      CAST(utm_content AS TEXT) AS utm_content,
      CAST(utm_medium AS TEXT) AS utm_medium,
      CAST(utm_source AS TEXT) AS utm_source,
      CAST(utm_term AS TEXT) AS utm_term
    FROM TEST.PUBLIC_tiktok_ads.tiktok_ads__url_report
  ), twitter_ads AS (
    SELECT
      source_relation,
      TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
      CAST('twitter_ads' AS TEXT) AS platform,
      CAST(account_id AS TEXT) AS account_id,
      CAST(account_name AS TEXT) AS account_name,
      CAST(line_item_id AS TEXT) AS ad_group_id,
      CAST(line_item_name AS TEXT) AS ad_group_name,
      CAST(base_url AS TEXT) AS base_url,
      CAST(campaign_id AS TEXT) AS campaign_id,
      CAST(campaign_name AS TEXT) AS campaign_name,
      CAST(clicks AS INT) AS clicks,
      CAST(impressions AS INT) AS impressions,
      CAST(spend AS FLOAT) AS spend,
      CAST(url_host AS TEXT) AS url_host,
      CAST(url_path AS TEXT) AS url_path,
      CAST(utm_campaign AS TEXT) AS utm_campaign,
      CAST(utm_content AS TEXT) AS utm_content,
      CAST(utm_medium AS TEXT) AS utm_medium,
      CAST(utm_source AS TEXT) AS utm_source,
      CAST(utm_term AS TEXT) AS utm_term
    FROM TEST.PUBLIC_twitter_ads.twitter_ads__url_report
  ), reddit_ads AS (
    SELECT
      source_relation,
      TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
      CAST('reddit_ads' AS TEXT) AS platform,
      CAST(account_id AS TEXT) AS account_id,
      CAST(NULL AS TEXT) AS account_name,
      CAST(ad_group_id AS TEXT) AS ad_group_id,
      CAST(ad_group_name AS TEXT) AS ad_group_name,
      CAST(base_url AS TEXT) AS base_url,
      CAST(campaign_id AS TEXT) AS campaign_id,
      CAST(campaign_name AS TEXT) AS campaign_name,
      CAST(clicks AS INT) AS clicks,
      CAST(impressions AS INT) AS impressions,
      CAST(spend AS FLOAT) AS spend,
      CAST(url_host AS TEXT) AS url_host,
      CAST(url_path AS TEXT) AS url_path,
      CAST(utm_campaign AS TEXT) AS utm_campaign,
      CAST(utm_content AS TEXT) AS utm_content,
      CAST(utm_medium AS TEXT) AS utm_medium,
      CAST(utm_source AS TEXT) AS utm_source,
      CAST(utm_term AS TEXT) AS utm_term
    FROM TEST.PUBLIC_reddit_ads.reddit_ads__url_report
  ), unioned AS (
    SELECT
      *
    FROM facebook_ads
    UNION ALL
    SELECT
      *
    FROM google_ads
    UNION ALL
    SELECT
      *
    FROM linkedin_ads
    UNION ALL
    SELECT
      *
    FROM microsoft_ads
    UNION ALL
    SELECT
      *
    FROM pinterest_ads
    UNION ALL
    SELECT
      *
    FROM snapchat_ads
    UNION ALL
    SELECT
      *
    FROM tiktok_ads
    UNION ALL
    SELECT
      *
    FROM twitter_ads
    UNION ALL
    SELECT
      *
    FROM reddit_ads
  )
  SELECT
    *
  FROM unioned
), base AS (
  SELECT
    *
  FROM __dbt__cte__int_ad_reporting__url_report
), aggregated AS (
  SELECT
    source_relation,
    date_day,
    platform,
    account_id,
    account_name,
    campaign_id,
    campaign_name,
    ad_group_id,
    ad_group_name,
    base_url,
    url_host,
    url_path,
    utm_source,
    utm_medium,
    utm_campaign,
    utm_content,
    utm_term,
    SUM(clicks) AS clicks,
    SUM(impressions) AS impressions,
    SUM(spend) AS spend
  FROM base
  GROUP BY
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10,
    11,
    12,
    13,
    14,
    15,
    16,
    17
)
SELECT
  *
FROM aggregated
%3 7. model.ad_reporting.ad_reporting__url_report 7. model.ad_reporting.ad_reporting__url_report source_relation date_day platform account_id account_name campaign_id campaign_name ad_group_id ad_group_name base_url url_host url_path utm_source utm_medium utm_campaign utm_content utm_term clicks impressions spend 14. model.ad_reporting.int_ad_reporting__url_report 14. model.ad_reporting.int_ad_reporting__url_report
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
date_day date The date of the report.
platform text The ad platform associated with this record.
account_id text The ID representing the account.
account_name text The name of the account, if present in the source data.
campaign_id text The ID representing the campaign, if present in the source data.
campaign_name text The name of the campaign, if present in the source data.
ad_group_id text The ID representing the ad group, if present in the source data.
ad_group_name text The name of the ad group, if present in the source data.
base_url text The base url of the ad.
url_host text The URL host of the ad.
url_path text The URL path of the ad.
utm_source text The utm_source parameter of the ad.
utm_medium text The utm_medium parameter of the ad.
utm_campaign text The utm_campaign parameter of the ad.
utm_content text The utm_content parameter of the ad.
utm_term text The utm_term parameter of the ad.
clicks bigint The count of clicks.
impressions bigint The count of impressions.
spend double precision The cost of the ads.
8. model.ad_reporting.int_ad_reporting__account_report

This SQL query integrates advertising data from multiple platforms (such as Twitter, Facebook, Google, Microsoft, Apple, LinkedIn, Pinterest, Snapchat, TikTok, Amazon, and Reddit) into a single unified table. It standardizes the data structure across all platforms by selecting common fields, casting them to consistent data types, and renaming some platform-specific fields to match a common schema. The query uses Common Table Expressions (CTEs) for each platform and then unions all the data together.

IntegrationCleaning
SQL Query
WITH twitter_ads AS (
  SELECT
    source_relation,
    TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
    CAST('twitter_ads' AS TEXT) AS platform,
    CAST(account_id AS TEXT) AS account_id,
    CAST(account_name AS TEXT) AS account_name,
    CAST(clicks AS INT) AS clicks,
    CAST(impressions AS INT) AS impressions,
    CAST(spend AS FLOAT) AS spend
  FROM TEST.PUBLIC_twitter_ads.twitter_ads__account_report
), facebook_ads AS (
  SELECT
    source_relation,
    TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
    CAST('facebook_ads' AS TEXT) AS platform,
    CAST(account_id AS TEXT) AS account_id,
    CAST(account_name AS TEXT) AS account_name,
    CAST(clicks AS INT) AS clicks,
    CAST(impressions AS INT) AS impressions,
    CAST(spend AS FLOAT) AS spend
  FROM TEST.PUBLIC_facebook_ads.facebook_ads__account_report
), google_ads AS (
  SELECT
    source_relation,
    TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
    CAST('google_ads' AS TEXT) AS platform,
    CAST(account_id AS TEXT) AS account_id,
    CAST(account_name AS TEXT) AS account_name,
    CAST(clicks AS INT) AS clicks,
    CAST(impressions AS INT) AS impressions,
    CAST(spend AS FLOAT) AS spend
  FROM TEST.PUBLIC_google_ads.google_ads__account_report
), microsoft_ads AS (
  SELECT
    source_relation,
    TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
    CAST('microsoft_ads' AS TEXT) AS platform,
    CAST(account_id AS TEXT) AS account_id,
    CAST(account_name AS TEXT) AS account_name,
    CAST(clicks AS INT) AS clicks,
    CAST(impressions AS INT) AS impressions,
    CAST(spend AS FLOAT) AS spend
  FROM TEST.PUBLIC_microsoft_ads.microsoft_ads__account_report
), apple_search_ads AS (
  SELECT
    source_relation,
    TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
    CAST('apple_search_ads' AS TEXT) AS platform,
    CAST(organization_id AS TEXT) AS account_id,
    CAST(organization_name AS TEXT) AS account_name,
    CAST(taps AS INT) AS clicks,
    CAST(impressions AS INT) AS impressions,
    CAST(spend AS FLOAT) AS spend
  FROM TEST.PUBLIC_apple_search_ads.apple_search_ads__organization_report
), linkedin_ads AS (
  SELECT
    source_relation,
    TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
    CAST('linkedin_ads' AS TEXT) AS platform,
    CAST(account_id AS TEXT) AS account_id,
    CAST(account_name AS TEXT) AS account_name,
    CAST(clicks AS INT) AS clicks,
    CAST(impressions AS INT) AS impressions,
    CAST(cost AS FLOAT) AS spend
  FROM TEST.PUBLIC_linkedin_ads.linkedin_ads__account_report
), pinterest_ads AS (
  SELECT
    source_relation,
    TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
    CAST('pinterest_ads' AS TEXT) AS platform,
    CAST(advertiser_id AS TEXT) AS account_id,
    CAST(advertiser_name AS TEXT) AS account_name,
    CAST(clicks AS INT) AS clicks,
    CAST(impressions AS INT) AS impressions,
    CAST(spend AS FLOAT) AS spend
  FROM TEST.PUBLIC_pinterest.pinterest_ads__advertiser_report
), snapchat_ads AS (
  SELECT
    source_relation,
    TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
    CAST('snapchat_ads' AS TEXT) AS platform,
    CAST(ad_account_id AS TEXT) AS account_id,
    CAST(ad_account_name AS TEXT) AS account_name,
    CAST(swipes AS INT) AS clicks,
    CAST(impressions AS INT) AS impressions,
    CAST(spend AS FLOAT) AS spend
  FROM TEST.PUBLIC_snapchat_ads.snapchat_ads__account_report
), tiktok_ads AS (
  SELECT
    source_relation,
    TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
    CAST('tiktok_ads' AS TEXT) AS platform,
    CAST(advertiser_id AS TEXT) AS account_id,
    CAST(advertiser_name AS TEXT) AS account_name,
    CAST(clicks AS INT) AS clicks,
    CAST(impressions AS INT) AS impressions,
    CAST(spend AS FLOAT) AS spend
  FROM TEST.PUBLIC_tiktok_ads.tiktok_ads__advertiser_report
), amazon_ads AS (
  SELECT
    source_relation,
    TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
    CAST('amazon_ads' AS TEXT) AS platform,
    CAST(account_id AS TEXT) AS account_id,
    CAST(account_name AS TEXT) AS account_name,
    CAST(clicks AS INT) AS clicks,
    CAST(impressions AS INT) AS impressions,
    CAST(cost AS FLOAT) AS spend
  FROM TEST.PUBLIC_amazon_ads.amazon_ads__account_report
), reddit_ads AS (
  SELECT
    source_relation,
    TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
    CAST('reddit_ads' AS TEXT) AS platform,
    CAST(account_id AS TEXT) AS account_id,
    CAST(NULL AS TEXT) AS account_name,
    CAST(clicks AS INT) AS clicks,
    CAST(impressions AS INT) AS impressions,
    CAST(spend AS FLOAT) AS spend
  FROM TEST.PUBLIC_reddit_ads.reddit_ads__account_report
), unioned AS (
  SELECT
    *
  FROM amazon_ads
  UNION ALL
  SELECT
    *
  FROM apple_search_ads
  UNION ALL
  SELECT
    *
  FROM facebook_ads
  UNION ALL
  SELECT
    *
  FROM google_ads
  UNION ALL
  SELECT
    *
  FROM linkedin_ads
  UNION ALL
  SELECT
    *
  FROM microsoft_ads
  UNION ALL
  SELECT
    *
  FROM pinterest_ads
  UNION ALL
  SELECT
    *
  FROM snapchat_ads
  UNION ALL
  SELECT
    *
  FROM tiktok_ads
  UNION ALL
  SELECT
    *
  FROM twitter_ads
  UNION ALL
  SELECT
    *
  FROM reddit_ads
)
SELECT
  *
FROM unioned
%3 8. model.ad_reporting.int_ad_reporting__account_report 8. model.ad_reporting.int_ad_reporting__account_report 16. model.amazon_ads.amazon_ads__account_report 16. model.amazon_ads.amazon_ads__account_report 50. model.apple_search_ads.apple_search_ads__organization_report 50. model.apple_search_ads.apple_search_ads__organization_report 72. model.facebook_ads.facebook_ads__account_report 72. model.facebook_ads.facebook_ads__account_report 91. model.google_ads.google_ads__account_report 91. model.google_ads.google_ads__account_report 117. model.linkedin.linkedin_ads__account_report 117. model.linkedin.linkedin_ads__account_report 134. model.microsoft_ads.microsoft_ads__account_report 134. model.microsoft_ads.microsoft_ads__account_report 164. model.pinterest.pinterest_ads__advertiser_report 164. model.pinterest.pinterest_ads__advertiser_report 189. model.reddit_ads.reddit_ads__account_report 189. model.reddit_ads.reddit_ads__account_report 210. model.snapchat_ads.snapchat_ads__account_report 210. model.snapchat_ads.snapchat_ads__account_report 236. model.tiktok_ads.tiktok_ads__advertiser_report 236. model.tiktok_ads.tiktok_ads__advertiser_report 253. model.twitter_ads.twitter_ads__account_report 253. model.twitter_ads.twitter_ads__account_report
Name Type Comment
9. model.ad_reporting.int_ad_reporting__ad_group_report

This SQL query combines ad reporting data from multiple advertising platforms (including Amazon, Apple Search, Facebook, Google, LinkedIn, Microsoft, Pinterest, Snapchat, TikTok, Twitter, and Reddit) into a unified format. It standardizes column names, data types, and structures across these diverse sources, creating a consolidated view of ad performance metrics such as clicks, impressions, and spend across different platforms, accounts, campaigns, and ad groups.

CleaningIntegration
SQL Query
WITH google_ads AS (
  SELECT
    source_relation,
    TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
    CAST('google_ads' AS TEXT) AS platform,
    CAST(account_id AS TEXT) AS account_id,
    CAST(account_name AS TEXT) AS account_name,
    CAST(ad_group_id AS TEXT) AS ad_group_id,
    CAST(ad_group_name AS TEXT) AS ad_group_name,
    CAST(campaign_id AS TEXT) AS campaign_id,
    CAST(campaign_name AS TEXT) AS campaign_name,
    CAST(clicks AS INT) AS clicks,
    CAST(impressions AS INT) AS impressions,
    CAST(spend AS FLOAT) AS spend
  FROM TEST.PUBLIC_google_ads.google_ads__ad_group_report
), microsoft_ads AS (
  SELECT
    source_relation,
    TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
    CAST('microsoft_ads' AS TEXT) AS platform,
    CAST(account_id AS TEXT) AS account_id,
    CAST(account_name AS TEXT) AS account_name,
    CAST(ad_group_id AS TEXT) AS ad_group_id,
    CAST(ad_group_name AS TEXT) AS ad_group_name,
    CAST(campaign_id AS TEXT) AS campaign_id,
    CAST(campaign_name AS TEXT) AS campaign_name,
    CAST(clicks AS INT) AS clicks,
    CAST(impressions AS INT) AS impressions,
    CAST(spend AS FLOAT) AS spend
  FROM TEST.PUBLIC_microsoft_ads.microsoft_ads__ad_group_report
), apple_search_ads AS (
  SELECT
    source_relation,
    TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
    CAST('apple_search_ads' AS TEXT) AS platform,
    CAST(organization_id AS TEXT) AS account_id,
    CAST(organization_name AS TEXT) AS account_name,
    CAST(ad_group_id AS TEXT) AS ad_group_id,
    CAST(ad_group_name AS TEXT) AS ad_group_name,
    CAST(campaign_id AS TEXT) AS campaign_id,
    CAST(campaign_name AS TEXT) AS campaign_name,
    CAST(taps AS INT) AS clicks,
    CAST(impressions AS INT) AS impressions,
    CAST(spend AS FLOAT) AS spend
  FROM TEST.PUBLIC_apple_search_ads.apple_search_ads__ad_group_report
), linkedin_ads AS (
  SELECT
    source_relation,
    TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
    CAST('linkedin_ads' AS TEXT) AS platform,
    CAST(account_id AS TEXT) AS account_id,
    CAST(account_name AS TEXT) AS account_name,
    CAST(campaign_id AS TEXT) AS ad_group_id,
    CAST(campaign_name AS TEXT) AS ad_group_name,
    CAST(campaign_group_id AS TEXT) AS campaign_id,
    CAST(campaign_group_name AS TEXT) AS campaign_name,
    CAST(clicks AS INT) AS clicks,
    CAST(impressions AS INT) AS impressions,
    CAST(cost AS FLOAT) AS spend
  FROM TEST.PUBLIC_linkedin_ads.linkedin_ads__campaign_report
), facebook_ads AS (
  SELECT
    source_relation,
    TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
    CAST('facebook_ads' AS TEXT) AS platform,
    CAST(account_id AS TEXT) AS account_id,
    CAST(account_name AS TEXT) AS account_name,
    CAST(ad_set_id AS TEXT) AS ad_group_id,
    CAST(ad_set_name AS TEXT) AS ad_group_name,
    CAST(campaign_id AS TEXT) AS campaign_id,
    CAST(campaign_name AS TEXT) AS campaign_name,
    CAST(clicks AS INT) AS clicks,
    CAST(impressions AS INT) AS impressions,
    CAST(spend AS FLOAT) AS spend
  FROM TEST.PUBLIC_facebook_ads.facebook_ads__ad_set_report
), pinterest_ads AS (
  SELECT
    source_relation,
    TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
    CAST('pinterest_ads' AS TEXT) AS platform,
    CAST(advertiser_id AS TEXT) AS account_id,
    CAST(advertiser_name AS TEXT) AS account_name,
    CAST(ad_group_id AS TEXT) AS ad_group_id,
    CAST(ad_group_name AS TEXT) AS ad_group_name,
    CAST(campaign_id AS TEXT) AS campaign_id,
    CAST(campaign_name AS TEXT) AS campaign_name,
    CAST(clicks AS INT) AS clicks,
    CAST(impressions AS INT) AS impressions,
    CAST(spend AS FLOAT) AS spend
  FROM TEST.PUBLIC_pinterest.pinterest_ads__ad_group_report
), snapchat_ads AS (
  SELECT
    source_relation,
    TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
    CAST('snapchat_ads' AS TEXT) AS platform,
    CAST(ad_account_id AS TEXT) AS account_id,
    CAST(ad_account_name AS TEXT) AS account_name,
    CAST(ad_squad_id AS TEXT) AS ad_group_id,
    CAST(ad_squad_name AS TEXT) AS ad_group_name,
    CAST(campaign_id AS TEXT) AS campaign_id,
    CAST(campaign_name AS TEXT) AS campaign_name,
    CAST(swipes AS INT) AS clicks,
    CAST(impressions AS INT) AS impressions,
    CAST(spend AS FLOAT) AS spend
  FROM TEST.PUBLIC_snapchat_ads.snapchat_ads__ad_squad_report
), tiktok_ads AS (
  SELECT
    source_relation,
    TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
    CAST('tiktok_ads' AS TEXT) AS platform,
    CAST(advertiser_id AS TEXT) AS account_id,
    CAST(advertiser_name AS TEXT) AS account_name,
    CAST(ad_group_id AS TEXT) AS ad_group_id,
    CAST(ad_group_name AS TEXT) AS ad_group_name,
    CAST(campaign_id AS TEXT) AS campaign_id,
    CAST(campaign_name AS TEXT) AS campaign_name,
    CAST(clicks AS INT) AS clicks,
    CAST(impressions AS INT) AS impressions,
    CAST(spend AS FLOAT) AS spend
  FROM TEST.PUBLIC_tiktok_ads.tiktok_ads__ad_group_report
), twitter_ads AS (
  SELECT
    source_relation,
    TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
    CAST('twitter_ads' AS TEXT) AS platform,
    CAST(account_id AS TEXT) AS account_id,
    CAST(account_name AS TEXT) AS account_name,
    CAST(line_item_id AS TEXT) AS ad_group_id,
    CAST(line_item_name AS TEXT) AS ad_group_name,
    CAST(campaign_id AS TEXT) AS campaign_id,
    CAST(campaign_name AS TEXT) AS campaign_name,
    CAST(clicks AS INT) AS clicks,
    CAST(impressions AS INT) AS impressions,
    CAST(spend AS FLOAT) AS spend
  FROM TEST.PUBLIC_twitter_ads.twitter_ads__line_item_report
), amazon_ads AS (
  SELECT
    source_relation,
    TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
    CAST('amazon_ads' AS TEXT) AS platform,
    CAST(account_id AS TEXT) AS account_id,
    CAST(account_name AS TEXT) AS account_name,
    CAST(ad_group_id AS TEXT) AS ad_group_id,
    CAST(ad_group_name AS TEXT) AS ad_group_name,
    CAST(campaign_id AS TEXT) AS campaign_id,
    CAST(campaign_name AS TEXT) AS campaign_name,
    CAST(clicks AS INT) AS clicks,
    CAST(impressions AS INT) AS impressions,
    CAST(cost AS FLOAT) AS spend
  FROM TEST.PUBLIC_amazon_ads.amazon_ads__ad_group_report
), reddit_ads AS (
  SELECT
    source_relation,
    TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
    CAST('reddit_ads' AS TEXT) AS platform,
    CAST(account_id AS TEXT) AS account_id,
    CAST(NULL AS TEXT) AS account_name,
    CAST(ad_group_id AS TEXT) AS ad_group_id,
    CAST(ad_group_name AS TEXT) AS ad_group_name,
    CAST(campaign_id AS TEXT) AS campaign_id,
    CAST(campaign_name AS TEXT) AS campaign_name,
    CAST(clicks AS INT) AS clicks,
    CAST(impressions AS INT) AS impressions,
    CAST(spend AS FLOAT) AS spend
  FROM TEST.PUBLIC_reddit_ads.reddit_ads__ad_group_report
), unioned AS (
  SELECT
    *
  FROM amazon_ads
  UNION ALL
  SELECT
    *
  FROM apple_search_ads
  UNION ALL
  SELECT
    *
  FROM facebook_ads
  UNION ALL
  SELECT
    *
  FROM google_ads
  UNION ALL
  SELECT
    *
  FROM linkedin_ads
  UNION ALL
  SELECT
    *
  FROM microsoft_ads
  UNION ALL
  SELECT
    *
  FROM pinterest_ads
  UNION ALL
  SELECT
    *
  FROM snapchat_ads
  UNION ALL
  SELECT
    *
  FROM tiktok_ads
  UNION ALL
  SELECT
    *
  FROM twitter_ads
  UNION ALL
  SELECT
    *
  FROM reddit_ads
)
SELECT
  *
FROM unioned
%3 9. model.ad_reporting.int_ad_reporting__ad_group_report 9. model.ad_reporting.int_ad_reporting__ad_group_report 17. model.amazon_ads.amazon_ads__ad_group_report 17. model.amazon_ads.amazon_ads__ad_group_report 46. model.apple_search_ads.apple_search_ads__ad_group_report 46. model.apple_search_ads.apple_search_ads__ad_group_report 74. model.facebook_ads.facebook_ads__ad_set_report 74. model.facebook_ads.facebook_ads__ad_set_report 92. model.google_ads.google_ads__ad_group_report 92. model.google_ads.google_ads__ad_group_report 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report 135. model.microsoft_ads.microsoft_ads__ad_group_report 135. model.microsoft_ads.microsoft_ads__ad_group_report 163. model.pinterest.pinterest_ads__ad_group_report 163. model.pinterest.pinterest_ads__ad_group_report 190. model.reddit_ads.reddit_ads__ad_group_report 190. model.reddit_ads.reddit_ads__ad_group_report 212. model.snapchat_ads.snapchat_ads__ad_squad_report 212. model.snapchat_ads.snapchat_ads__ad_squad_report 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report
Name Type Comment
10. model.ad_reporting.int_ad_reporting__ad_report

This SQL query integrates ad reporting data from multiple advertising platforms (such as Google Ads, Microsoft Ads, Apple Search Ads, Facebook Ads, LinkedIn Ads, Pinterest Ads, Snapchat Ads, TikTok Ads, Twitter Ads, Amazon Ads, and Reddit Ads) into a unified format. It standardizes column names and data types across all platforms, ensuring consistency in the final output. The query uses CTEs to transform data from each platform separately before combining them all using UNION ALL operations.

IntegrationCleaning
SQL Query
WITH google_ads AS (
  SELECT
    source_relation,
    TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
    CAST('google_ads' AS TEXT) AS platform,
    CAST(account_id AS TEXT) AS account_id,
    CAST(account_name AS TEXT) AS account_name,
    CAST(ad_group_id AS TEXT) AS ad_group_id,
    CAST(ad_group_name AS TEXT) AS ad_group_name,
    CAST(ad_id AS TEXT) AS ad_id,
    CAST(ad_name AS TEXT) AS ad_name,
    CAST(campaign_id AS TEXT) AS campaign_id,
    CAST(campaign_name AS TEXT) AS campaign_name,
    CAST(clicks AS INT) AS clicks,
    CAST(impressions AS INT) AS impressions,
    CAST(spend AS FLOAT) AS spend
  FROM TEST.PUBLIC_google_ads.google_ads__ad_report
), microsoft_ads AS (
  SELECT
    source_relation,
    TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
    CAST('microsoft_ads' AS TEXT) AS platform,
    CAST(account_id AS TEXT) AS account_id,
    CAST(account_name AS TEXT) AS account_name,
    CAST(ad_group_id AS TEXT) AS ad_group_id,
    CAST(ad_group_name AS TEXT) AS ad_group_name,
    CAST(ad_id AS TEXT) AS ad_id,
    CAST(ad_name AS TEXT) AS ad_name,
    CAST(campaign_id AS TEXT) AS campaign_id,
    CAST(campaign_name AS TEXT) AS campaign_name,
    CAST(clicks AS INT) AS clicks,
    CAST(impressions AS INT) AS impressions,
    CAST(spend AS FLOAT) AS spend
  FROM TEST.PUBLIC_microsoft_ads.microsoft_ads__ad_report
), apple_search_ads AS (
  SELECT
    source_relation,
    TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
    CAST('apple_search_ads' AS TEXT) AS platform,
    CAST(organization_id AS TEXT) AS account_id,
    CAST(organization_name AS TEXT) AS account_name,
    CAST(ad_group_id AS TEXT) AS ad_group_id,
    CAST(ad_group_name AS TEXT) AS ad_group_name,
    CAST(ad_id AS TEXT) AS ad_id,
    CAST(ad_name AS TEXT) AS ad_name,
    CAST(campaign_id AS TEXT) AS campaign_id,
    CAST(campaign_name AS TEXT) AS campaign_name,
    CAST(taps AS INT) AS clicks,
    CAST(impressions AS INT) AS impressions,
    CAST(spend AS FLOAT) AS spend
  FROM TEST.PUBLIC_apple_search_ads.apple_search_ads__ad_report
), facebook_ads AS (
  SELECT
    source_relation,
    TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
    CAST('facebook_ads' AS TEXT) AS platform,
    CAST(account_id AS TEXT) AS account_id,
    CAST(account_name AS TEXT) AS account_name,
    CAST(ad_set_id AS TEXT) AS ad_group_id,
    CAST(ad_set_name AS TEXT) AS ad_group_name,
    CAST(ad_id AS TEXT) AS ad_id,
    CAST(ad_name AS TEXT) AS ad_name,
    CAST(campaign_id AS TEXT) AS campaign_id,
    CAST(campaign_name AS TEXT) AS campaign_name,
    CAST(clicks AS INT) AS clicks,
    CAST(impressions AS INT) AS impressions,
    CAST(spend AS FLOAT) AS spend
  FROM TEST.PUBLIC_facebook_ads.facebook_ads__ad_report
), linkedin_ads AS (
  SELECT
    source_relation,
    TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
    CAST('linkedin_ads' AS TEXT) AS platform,
    CAST(account_id AS TEXT) AS account_id,
    CAST(account_name AS TEXT) AS account_name,
    CAST(campaign_id AS TEXT) AS ad_group_id,
    CAST(campaign_name AS TEXT) AS ad_group_name,
    CAST(creative_id AS TEXT) AS ad_id,
    CAST(NULL AS TEXT) AS ad_name,
    CAST(campaign_group_id AS TEXT) AS campaign_id,
    CAST(campaign_group_name AS TEXT) AS campaign_name,
    CAST(clicks AS INT) AS clicks,
    CAST(impressions AS INT) AS impressions,
    CAST(cost AS FLOAT) AS spend
  FROM TEST.PUBLIC_linkedin_ads.linkedin_ads__creative_report
), pinterest_ads AS (
  SELECT
    source_relation,
    TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
    CAST('pinterest_ads' AS TEXT) AS platform,
    CAST(advertiser_id AS TEXT) AS account_id,
    CAST(advertiser_name AS TEXT) AS account_name,
    CAST(ad_group_id AS TEXT) AS ad_group_id,
    CAST(ad_group_name AS TEXT) AS ad_group_name,
    CAST(pin_promotion_id AS TEXT) AS ad_id,
    CAST(pin_name AS TEXT) AS ad_name,
    CAST(campaign_id AS TEXT) AS campaign_id,
    CAST(campaign_name AS TEXT) AS campaign_name,
    CAST(clicks AS INT) AS clicks,
    CAST(impressions AS INT) AS impressions,
    CAST(spend AS FLOAT) AS spend
  FROM TEST.PUBLIC_pinterest.pinterest_ads__pin_promotion_report
), snapchat_ads AS (
  SELECT
    source_relation,
    TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
    CAST('snapchat_ads' AS TEXT) AS platform,
    CAST(ad_account_id AS TEXT) AS account_id,
    CAST(ad_account_name AS TEXT) AS account_name,
    CAST(NULL AS TEXT) AS ad_group_id,
    CAST(NULL AS TEXT) AS ad_group_name,
    CAST(ad_id AS TEXT) AS ad_id,
    CAST(ad_name AS TEXT) AS ad_name,
    CAST(NULL AS TEXT) AS campaign_id,
    CAST(NULL AS TEXT) AS campaign_name,
    CAST(swipes AS INT) AS clicks,
    CAST(impressions AS INT) AS impressions,
    CAST(spend AS FLOAT) AS spend
  FROM TEST.PUBLIC_snapchat_ads.snapchat_ads__ad_report
), tiktok_ads AS (
  SELECT
    source_relation,
    TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
    CAST('tiktok_ads' AS TEXT) AS platform,
    CAST(advertiser_id AS TEXT) AS account_id,
    CAST(advertiser_name AS TEXT) AS account_name,
    CAST(ad_group_id AS TEXT) AS ad_group_id,
    CAST(ad_group_name AS TEXT) AS ad_group_name,
    CAST(ad_id AS TEXT) AS ad_id,
    CAST(ad_name AS TEXT) AS ad_name,
    CAST(campaign_id AS TEXT) AS campaign_id,
    CAST(campaign_name AS TEXT) AS campaign_name,
    CAST(clicks AS INT) AS clicks,
    CAST(impressions AS INT) AS impressions,
    CAST(spend AS FLOAT) AS spend
  FROM TEST.PUBLIC_tiktok_ads.tiktok_ads__ad_report
), twitter_ads AS (
  SELECT
    source_relation,
    TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
    CAST('twitter_ads' AS TEXT) AS platform,
    CAST(account_id AS TEXT) AS account_id,
    CAST(account_name AS TEXT) AS account_name,
    CAST(line_item_id AS TEXT) AS ad_group_id,
    CAST(line_item_name AS TEXT) AS ad_group_name,
    CAST(promoted_tweet_id AS TEXT) AS ad_id,
    CAST(tweet_name AS TEXT) AS ad_name,
    CAST(campaign_id AS TEXT) AS campaign_id,
    CAST(campaign_name AS TEXT) AS campaign_name,
    CAST(clicks AS INT) AS clicks,
    CAST(impressions AS INT) AS impressions,
    CAST(spend AS FLOAT) AS spend
  FROM TEST.PUBLIC_twitter_ads.twitter_ads__promoted_tweet_report
), amazon_ads AS (
  SELECT
    source_relation,
    TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
    CAST('amazon_ads' AS TEXT) AS platform,
    CAST(account_id AS TEXT) AS account_id,
    CAST(account_name AS TEXT) AS account_name,
    CAST(ad_group_id AS TEXT) AS ad_group_id,
    CAST(ad_group_name AS TEXT) AS ad_group_name,
    CAST(ad_id AS TEXT) AS ad_id,
    CAST(advertised_asin AS TEXT) AS ad_name,
    CAST(campaign_id AS TEXT) AS campaign_id,
    CAST(campaign_name AS TEXT) AS campaign_name,
    CAST(clicks AS INT) AS clicks,
    CAST(impressions AS INT) AS impressions,
    CAST(cost AS FLOAT) AS spend
  FROM TEST.PUBLIC_amazon_ads.amazon_ads__ad_report
), reddit_ads AS (
  SELECT
    source_relation,
    TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
    CAST('reddit_ads' AS TEXT) AS platform,
    CAST(account_id AS TEXT) AS account_id,
    CAST(NULL AS TEXT) AS account_name,
    CAST(ad_group_id AS TEXT) AS ad_group_id,
    CAST(ad_group_name AS TEXT) AS ad_group_name,
    CAST(ad_id AS TEXT) AS ad_id,
    CAST(ad_name AS TEXT) AS ad_name,
    CAST(campaign_id AS TEXT) AS campaign_id,
    CAST(campaign_name AS TEXT) AS campaign_name,
    CAST(clicks AS INT) AS clicks,
    CAST(impressions AS INT) AS impressions,
    CAST(spend AS FLOAT) AS spend
  FROM TEST.PUBLIC_reddit_ads.reddit_ads__ad_report
), unioned AS (
  SELECT
    *
  FROM amazon_ads
  UNION ALL
  SELECT
    *
  FROM apple_search_ads
  UNION ALL
  SELECT
    *
  FROM facebook_ads
  UNION ALL
  SELECT
    *
  FROM google_ads
  UNION ALL
  SELECT
    *
  FROM linkedin_ads
  UNION ALL
  SELECT
    *
  FROM microsoft_ads
  UNION ALL
  SELECT
    *
  FROM pinterest_ads
  UNION ALL
  SELECT
    *
  FROM snapchat_ads
  UNION ALL
  SELECT
    *
  FROM tiktok_ads
  UNION ALL
  SELECT
    *
  FROM twitter_ads
  UNION ALL
  SELECT
    *
  FROM reddit_ads
)
SELECT
  *
FROM unioned
%3 10. model.ad_reporting.int_ad_reporting__ad_report 10. model.ad_reporting.int_ad_reporting__ad_report 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report 47. model.apple_search_ads.apple_search_ads__ad_report 47. model.apple_search_ads.apple_search_ads__ad_report 73. model.facebook_ads.facebook_ads__ad_report 73. model.facebook_ads.facebook_ads__ad_report 93. model.google_ads.google_ads__ad_report 93. model.google_ads.google_ads__ad_report 120. model.linkedin.linkedin_ads__creative_report 120. model.linkedin.linkedin_ads__creative_report 136. model.microsoft_ads.microsoft_ads__ad_report 136. model.microsoft_ads.microsoft_ads__ad_report 167. model.pinterest.pinterest_ads__pin_promotion_report 167. model.pinterest.pinterest_ads__pin_promotion_report 191. model.reddit_ads.reddit_ads__ad_report 191. model.reddit_ads.reddit_ads__ad_report 211. model.snapchat_ads.snapchat_ads__ad_report 211. model.snapchat_ads.snapchat_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report
Name Type Comment
11. model.ad_reporting.int_ad_reporting__campaign_report

This SQL query integrates campaign report data from multiple advertising platforms (e.g., Twitter, Facebook, Google, Microsoft, Apple Search, LinkedIn, Pinterest, Snapchat, TikTok, Amazon, and Reddit) into a unified dataset. It standardizes the column names and data types across all platforms, ensuring consistency in the final output. The query uses CTEs to transform and union data from each platform, creating a comprehensive view of advertising campaign performance across various channels.

IntegrationCleaning
SQL Query
WITH twitter_ads AS (
  SELECT
    source_relation,
    TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
    CAST('twitter_ads' AS TEXT) AS platform,
    CAST(account_id AS TEXT) AS account_id,
    CAST(account_name AS TEXT) AS account_name,
    CAST(campaign_id AS TEXT) AS campaign_id,
    CAST(campaign_name AS TEXT) AS campaign_name,
    CAST(clicks AS INT) AS clicks,
    CAST(impressions AS INT) AS impressions,
    CAST(spend AS FLOAT) AS spend
  FROM TEST.PUBLIC_twitter_ads.twitter_ads__campaign_report
), facebook_ads AS (
  SELECT
    source_relation,
    TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
    CAST('facebook_ads' AS TEXT) AS platform,
    CAST(account_id AS TEXT) AS account_id,
    CAST(account_name AS TEXT) AS account_name,
    CAST(campaign_id AS TEXT) AS campaign_id,
    CAST(campaign_name AS TEXT) AS campaign_name,
    CAST(clicks AS INT) AS clicks,
    CAST(impressions AS INT) AS impressions,
    CAST(spend AS FLOAT) AS spend
  FROM TEST.PUBLIC_facebook_ads.facebook_ads__campaign_report
), google_ads AS (
  SELECT
    source_relation,
    TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
    CAST('google_ads' AS TEXT) AS platform,
    CAST(account_id AS TEXT) AS account_id,
    CAST(account_name AS TEXT) AS account_name,
    CAST(campaign_id AS TEXT) AS campaign_id,
    CAST(campaign_name AS TEXT) AS campaign_name,
    CAST(clicks AS INT) AS clicks,
    CAST(impressions AS INT) AS impressions,
    CAST(spend AS FLOAT) AS spend
  FROM TEST.PUBLIC_google_ads.google_ads__campaign_report
), microsoft_ads AS (
  SELECT
    source_relation,
    TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
    CAST('microsoft_ads' AS TEXT) AS platform,
    CAST(account_id AS TEXT) AS account_id,
    CAST(account_name AS TEXT) AS account_name,
    CAST(campaign_id AS TEXT) AS campaign_id,
    CAST(campaign_name AS TEXT) AS campaign_name,
    CAST(clicks AS INT) AS clicks,
    CAST(impressions AS INT) AS impressions,
    CAST(spend AS FLOAT) AS spend
  FROM TEST.PUBLIC_microsoft_ads.microsoft_ads__campaign_report
), apple_search_ads AS (
  SELECT
    source_relation,
    TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
    CAST('apple_search_ads' AS TEXT) AS platform,
    CAST(organization_id AS TEXT) AS account_id,
    CAST(organization_name AS TEXT) AS account_name,
    CAST(campaign_id AS TEXT) AS campaign_id,
    CAST(campaign_name AS TEXT) AS campaign_name,
    CAST(taps AS INT) AS clicks,
    CAST(impressions AS INT) AS impressions,
    CAST(spend AS FLOAT) AS spend
  FROM TEST.PUBLIC_apple_search_ads.apple_search_ads__campaign_report
), linkedin_ads AS (
  SELECT
    source_relation,
    TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
    CAST('linkedin_ads' AS TEXT) AS platform,
    CAST(account_id AS TEXT) AS account_id,
    CAST(account_name AS TEXT) AS account_name,
    CAST(campaign_group_id AS TEXT) AS campaign_id,
    CAST(campaign_group_name AS TEXT) AS campaign_name,
    CAST(clicks AS INT) AS clicks,
    CAST(impressions AS INT) AS impressions,
    CAST(cost AS FLOAT) AS spend
  FROM TEST.PUBLIC_linkedin_ads.linkedin_ads__campaign_group_report
), pinterest_ads AS (
  SELECT
    source_relation,
    TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
    CAST('pinterest_ads' AS TEXT) AS platform,
    CAST(advertiser_id AS TEXT) AS account_id,
    CAST(advertiser_name AS TEXT) AS account_name,
    CAST(campaign_id AS TEXT) AS campaign_id,
    CAST(campaign_name AS TEXT) AS campaign_name,
    CAST(clicks AS INT) AS clicks,
    CAST(impressions AS INT) AS impressions,
    CAST(spend AS FLOAT) AS spend
  FROM TEST.PUBLIC_pinterest.pinterest_ads__campaign_report
), snapchat_ads AS (
  SELECT
    source_relation,
    TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
    CAST('snapchat_ads' AS TEXT) AS platform,
    CAST(ad_account_id AS TEXT) AS account_id,
    CAST(ad_account_name AS TEXT) AS account_name,
    CAST(campaign_id AS TEXT) AS campaign_id,
    CAST(campaign_name AS TEXT) AS campaign_name,
    CAST(swipes AS INT) AS clicks,
    CAST(impressions AS INT) AS impressions,
    CAST(spend AS FLOAT) AS spend
  FROM TEST.PUBLIC_snapchat_ads.snapchat_ads__campaign_report
), tiktok_ads AS (
  SELECT
    source_relation,
    TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
    CAST('tiktok_ads' AS TEXT) AS platform,
    CAST(advertiser_id AS TEXT) AS account_id,
    CAST(advertiser_name AS TEXT) AS account_name,
    CAST(campaign_id AS TEXT) AS campaign_id,
    CAST(campaign_name AS TEXT) AS campaign_name,
    CAST(clicks AS INT) AS clicks,
    CAST(impressions AS INT) AS impressions,
    CAST(spend AS FLOAT) AS spend
  FROM TEST.PUBLIC_tiktok_ads.tiktok_ads__campaign_report
), amazon_ads AS (
  SELECT
    source_relation,
    TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
    CAST('amazon_ads' AS TEXT) AS platform,
    CAST(account_id AS TEXT) AS account_id,
    CAST(account_name AS TEXT) AS account_name,
    CAST(campaign_id AS TEXT) AS campaign_id,
    CAST(campaign_name AS TEXT) AS campaign_name,
    CAST(clicks AS INT) AS clicks,
    CAST(impressions AS INT) AS impressions,
    CAST(cost AS FLOAT) AS spend
  FROM TEST.PUBLIC_amazon_ads.amazon_ads__campaign_report
), reddit_ads AS (
  SELECT
    source_relation,
    TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
    CAST('reddit_ads' AS TEXT) AS platform,
    CAST(account_id AS TEXT) AS account_id,
    CAST(NULL AS TEXT) AS account_name,
    CAST(campaign_id AS TEXT) AS campaign_id,
    CAST(campaign_name AS TEXT) AS campaign_name,
    CAST(clicks AS INT) AS clicks,
    CAST(impressions AS INT) AS impressions,
    CAST(spend AS FLOAT) AS spend
  FROM TEST.PUBLIC_reddit_ads.reddit_ads__campaign_report
), unioned AS (
  SELECT
    *
  FROM amazon_ads
  UNION ALL
  SELECT
    *
  FROM apple_search_ads
  UNION ALL
  SELECT
    *
  FROM facebook_ads
  UNION ALL
  SELECT
    *
  FROM google_ads
  UNION ALL
  SELECT
    *
  FROM linkedin_ads
  UNION ALL
  SELECT
    *
  FROM microsoft_ads
  UNION ALL
  SELECT
    *
  FROM pinterest_ads
  UNION ALL
  SELECT
    *
  FROM snapchat_ads
  UNION ALL
  SELECT
    *
  FROM tiktok_ads
  UNION ALL
  SELECT
    *
  FROM twitter_ads
  UNION ALL
  SELECT
    *
  FROM reddit_ads
)
SELECT
  *
FROM unioned
%3 11. model.ad_reporting.int_ad_reporting__campaign_report 11. model.ad_reporting.int_ad_reporting__campaign_report 19. model.amazon_ads.amazon_ads__campaign_report 19. model.amazon_ads.amazon_ads__campaign_report 48. model.apple_search_ads.apple_search_ads__campaign_report 48. model.apple_search_ads.apple_search_ads__campaign_report 75. model.facebook_ads.facebook_ads__campaign_report 75. model.facebook_ads.facebook_ads__campaign_report 94. model.google_ads.google_ads__campaign_report 94. model.google_ads.google_ads__campaign_report 118. model.linkedin.linkedin_ads__campaign_group_report 118. model.linkedin.linkedin_ads__campaign_group_report 137. model.microsoft_ads.microsoft_ads__campaign_report 137. model.microsoft_ads.microsoft_ads__campaign_report 165. model.pinterest.pinterest_ads__campaign_report 165. model.pinterest.pinterest_ads__campaign_report 192. model.reddit_ads.reddit_ads__campaign_report 192. model.reddit_ads.reddit_ads__campaign_report 213. model.snapchat_ads.snapchat_ads__campaign_report 213. model.snapchat_ads.snapchat_ads__campaign_report 237. model.tiktok_ads.tiktok_ads__campaign_report 237. model.tiktok_ads.tiktok_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report
Name Type Comment
12. model.ad_reporting.int_ad_reporting__keyword_report

This SQL query integrates keyword report data from multiple advertising platforms (Amazon Ads, Apple Search Ads, Google Ads, Microsoft Ads, Pinterest Ads, and Twitter Ads) into a single unified table. It standardizes column names and data types across all platforms, ensuring consistency in the final output. The query uses Common Table Expressions (CTEs) to select and transform data from each platform separately before combining them using UNION ALL.

IntegrationCleaning
SQL Query
WITH apple_search_ads AS (
  SELECT
    source_relation,
    TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
    CAST('apple_search_ads' AS TEXT) AS platform,
    CAST(organization_id AS TEXT) AS account_id,
    CAST(organization_name AS TEXT) AS account_name,
    CAST(ad_group_id AS TEXT) AS ad_group_id,
    CAST(ad_group_name AS TEXT) AS ad_group_name,
    CAST(campaign_id AS TEXT) AS campaign_id,
    CAST(campaign_name AS TEXT) AS campaign_name,
    CAST(taps AS INT) AS clicks,
    CAST(impressions AS INT) AS impressions,
    CAST(keyword_id AS TEXT) AS keyword_id,
    CAST(match_type AS TEXT) AS keyword_match_type,
    CAST(keyword_text AS TEXT) AS keyword_text,
    CAST(spend AS FLOAT) AS spend
  FROM TEST.PUBLIC_apple_search_ads.apple_search_ads__keyword_report
), google_ads AS (
  SELECT
    source_relation,
    TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
    CAST('google_ads' AS TEXT) AS platform,
    CAST(account_id AS TEXT) AS account_id,
    CAST(account_name AS TEXT) AS account_name,
    CAST(ad_group_id AS TEXT) AS ad_group_id,
    CAST(ad_group_name AS TEXT) AS ad_group_name,
    CAST(campaign_id AS TEXT) AS campaign_id,
    CAST(campaign_name AS TEXT) AS campaign_name,
    CAST(clicks AS INT) AS clicks,
    CAST(impressions AS INT) AS impressions,
    CAST(criterion_id AS TEXT) AS keyword_id,
    CAST(keyword_match_type AS TEXT) AS keyword_match_type,
    CAST(keyword_text AS TEXT) AS keyword_text,
    CAST(spend AS FLOAT) AS spend
  FROM TEST.PUBLIC_google_ads.google_ads__keyword_report
), microsoft_ads AS (
  SELECT
    source_relation,
    TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
    CAST('microsoft_ads' AS TEXT) AS platform,
    CAST(account_id AS TEXT) AS account_id,
    CAST(account_name AS TEXT) AS account_name,
    CAST(ad_group_id AS TEXT) AS ad_group_id,
    CAST(ad_group_name AS TEXT) AS ad_group_name,
    CAST(campaign_id AS TEXT) AS campaign_id,
    CAST(campaign_name AS TEXT) AS campaign_name,
    CAST(clicks AS INT) AS clicks,
    CAST(impressions AS INT) AS impressions,
    CAST(keyword_id AS TEXT) AS keyword_id,
    CAST(match_type AS TEXT) AS keyword_match_type,
    CAST(keyword_name AS TEXT) AS keyword_text,
    CAST(spend AS FLOAT) AS spend
  FROM TEST.PUBLIC_microsoft_ads.microsoft_ads__keyword_report
), pinterest_ads AS (
  SELECT
    source_relation,
    TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
    CAST('pinterest_ads' AS TEXT) AS platform,
    CAST(advertiser_id AS TEXT) AS account_id,
    CAST(advertiser_name AS TEXT) AS account_name,
    CAST(ad_group_id AS TEXT) AS ad_group_id,
    CAST(ad_group_name AS TEXT) AS ad_group_name,
    CAST(campaign_id AS TEXT) AS campaign_id,
    CAST(campaign_name AS TEXT) AS campaign_name,
    CAST(clicks AS INT) AS clicks,
    CAST(impressions AS INT) AS impressions,
    CAST(keyword_id AS TEXT) AS keyword_id,
    CAST(match_type AS TEXT) AS keyword_match_type,
    CAST(keyword_value AS TEXT) AS keyword_text,
    CAST(spend AS FLOAT) AS spend
  FROM TEST.PUBLIC_pinterest.pinterest_ads__keyword_report
), twitter_ads AS (
  SELECT
    source_relation,
    TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
    CAST('twitter_ads' AS TEXT) AS platform,
    CAST(account_id AS TEXT) AS account_id,
    CAST(account_name AS TEXT) AS account_name,
    CAST(line_item_id AS TEXT) AS ad_group_id,
    CAST(line_item_name AS TEXT) AS ad_group_name,
    CAST(campaign_id AS TEXT) AS campaign_id,
    CAST(campaign_name AS TEXT) AS campaign_name,
    CAST(clicks AS INT) AS clicks,
    CAST(impressions AS INT) AS impressions,
    CAST(keyword_id AS TEXT) AS keyword_id,
    CAST(NULL AS TEXT) AS keyword_match_type,
    CAST(keyword AS TEXT) AS keyword_text,
    CAST(spend AS FLOAT) AS spend
  FROM TEST.PUBLIC_twitter_ads.twitter_ads__keyword_report
), amazon_ads AS (
  SELECT
    source_relation,
    TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
    CAST('amazon_ads' AS TEXT) AS platform,
    CAST(account_id AS TEXT) AS account_id,
    CAST(account_name AS TEXT) AS account_name,
    CAST(ad_group_id AS TEXT) AS ad_group_id,
    CAST(ad_group_name AS TEXT) AS ad_group_name,
    CAST(campaign_id AS TEXT) AS campaign_id,
    CAST(campaign_name AS TEXT) AS campaign_name,
    CAST(clicks AS INT) AS clicks,
    CAST(impressions AS INT) AS impressions,
    CAST(keyword_id AS TEXT) AS keyword_id,
    CAST(match_type AS TEXT) AS keyword_match_type,
    CAST(keyword_text AS TEXT) AS keyword_text,
    CAST(cost AS FLOAT) AS spend
  FROM TEST.PUBLIC_amazon_ads.amazon_ads__keyword_report
), unioned AS (
  SELECT
    *
  FROM amazon_ads
  UNION ALL
  SELECT
    *
  FROM apple_search_ads
  UNION ALL
  SELECT
    *
  FROM google_ads
  UNION ALL
  SELECT
    *
  FROM microsoft_ads
  UNION ALL
  SELECT
    *
  FROM pinterest_ads
  UNION ALL
  SELECT
    *
  FROM twitter_ads
)
SELECT
  *
FROM unioned
%3 12. model.ad_reporting.int_ad_reporting__keyword_report 12. model.ad_reporting.int_ad_reporting__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report 49. model.apple_search_ads.apple_search_ads__keyword_report 49. model.apple_search_ads.apple_search_ads__keyword_report 95. model.google_ads.google_ads__keyword_report 95. model.google_ads.google_ads__keyword_report 138. model.microsoft_ads.microsoft_ads__keyword_report 138. model.microsoft_ads.microsoft_ads__keyword_report 166. model.pinterest.pinterest_ads__keyword_report 166. model.pinterest.pinterest_ads__keyword_report 255. model.twitter_ads.twitter_ads__keyword_report 255. model.twitter_ads.twitter_ads__keyword_report
Name Type Comment
13. model.ad_reporting.int_ad_reporting__search_report

This SQL query combines search report data from three different advertising platforms (Microsoft Ads, Apple Search Ads, and Amazon Ads) into a unified format. It standardizes column names and data types across the platforms, ensuring consistency in the final output. The query uses CTEs to transform each platform's data separately before combining them using UNION ALL.

IntegrationCleaning
SQL Query
WITH microsoft_ads AS (
  SELECT
    source_relation,
    TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
    CAST('microsoft_ads' AS TEXT) AS platform,
    CAST(account_id AS TEXT) AS account_id,
    CAST(account_name AS TEXT) AS account_name,
    CAST(ad_group_id AS TEXT) AS ad_group_id,
    CAST(ad_group_name AS TEXT) AS ad_group_name,
    CAST(campaign_id AS TEXT) AS campaign_id,
    CAST(campaign_name AS TEXT) AS campaign_name,
    CAST(clicks AS INT) AS clicks,
    CAST(impressions AS INT) AS impressions,
    CAST(keyword_id AS TEXT) AS keyword_id,
    CAST(keyword_name AS TEXT) AS keyword_text,
    CAST(match_type AS TEXT) AS search_match_type,
    CAST(search_query AS TEXT) AS search_query,
    CAST(spend AS FLOAT) AS spend
  FROM TEST.PUBLIC_microsoft_ads.microsoft_ads__search_report
), apple_search_ads AS (
  SELECT
    source_relation,
    TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
    CAST('apple_search_ads' AS TEXT) AS platform,
    CAST(organization_id AS TEXT) AS account_id,
    CAST(organization_name AS TEXT) AS account_name,
    CAST(ad_group_id AS TEXT) AS ad_group_id,
    CAST(ad_group_name AS TEXT) AS ad_group_name,
    CAST(campaign_id AS TEXT) AS campaign_id,
    CAST(campaign_name AS TEXT) AS campaign_name,
    CAST(taps AS INT) AS clicks,
    CAST(impressions AS INT) AS impressions,
    CAST(keyword_id AS TEXT) AS keyword_id,
    CAST(keyword_text AS TEXT) AS keyword_text,
    CAST(match_type AS TEXT) AS search_match_type,
    CAST(search_term_text AS TEXT) AS search_query,
    CAST(spend AS FLOAT) AS spend
  FROM TEST.PUBLIC_apple_search_ads.apple_search_ads__search_term_report
), amazon_ads AS (
  SELECT
    source_relation,
    TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
    CAST('amazon_ads' AS TEXT) AS platform,
    CAST(account_id AS TEXT) AS account_id,
    CAST(account_name AS TEXT) AS account_name,
    CAST(ad_group_id AS TEXT) AS ad_group_id,
    CAST(ad_group_name AS TEXT) AS ad_group_name,
    CAST(campaign_id AS TEXT) AS campaign_id,
    CAST(campaign_name AS TEXT) AS campaign_name,
    CAST(clicks AS INT) AS clicks,
    CAST(impressions AS INT) AS impressions,
    CAST(keyword_id AS TEXT) AS keyword_id,
    CAST(keyword_text AS TEXT) AS keyword_text,
    CAST(match_type AS TEXT) AS search_match_type,
    CAST(search_term AS TEXT) AS search_query,
    CAST(cost AS FLOAT) AS spend
  FROM TEST.PUBLIC_amazon_ads.amazon_ads__search_report
), unioned AS (
  SELECT
    *
  FROM amazon_ads
  UNION ALL
  SELECT
    *
  FROM apple_search_ads
  UNION ALL
  SELECT
    *
  FROM microsoft_ads
)
SELECT
  *
FROM unioned
%3 13. model.ad_reporting.int_ad_reporting__search_report 13. model.ad_reporting.int_ad_reporting__search_report 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report 51. model.apple_search_ads.apple_search_ads__search_term_report 51. model.apple_search_ads.apple_search_ads__search_term_report 139. model.microsoft_ads.microsoft_ads__search_report 139. model.microsoft_ads.microsoft_ads__search_report
Name Type Comment
14. model.ad_reporting.int_ad_reporting__url_report

This SQL query combines ad reporting data from multiple advertising platforms (Facebook, Google, LinkedIn, Microsoft, Pinterest, Snapchat, TikTok, Twitter, and Reddit) into a single unified table. It standardizes the column names and data types across all platforms, ensuring consistency in the output. The query uses Common Table Expressions (CTEs) to select and transform data from each platform's source table, and then unions all these CTEs together to create a comprehensive ad reporting dataset.

IntegrationCleaning
SQL Query
WITH google_ads AS (
  SELECT
    source_relation,
    TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
    CAST('google_ads' AS TEXT) AS platform,
    CAST(account_id AS TEXT) AS account_id,
    CAST(account_name AS TEXT) AS account_name,
    CAST(ad_group_id AS TEXT) AS ad_group_id,
    CAST(ad_group_name AS TEXT) AS ad_group_name,
    CAST(base_url AS TEXT) AS base_url,
    CAST(campaign_id AS TEXT) AS campaign_id,
    CAST(campaign_name AS TEXT) AS campaign_name,
    CAST(clicks AS INT) AS clicks,
    CAST(impressions AS INT) AS impressions,
    CAST(spend AS FLOAT) AS spend,
    CAST(url_host AS TEXT) AS url_host,
    CAST(url_path AS TEXT) AS url_path,
    CAST(utm_campaign AS TEXT) AS utm_campaign,
    CAST(utm_content AS TEXT) AS utm_content,
    CAST(utm_medium AS TEXT) AS utm_medium,
    CAST(utm_source AS TEXT) AS utm_source,
    CAST(utm_term AS TEXT) AS utm_term
  FROM TEST.PUBLIC_google_ads.google_ads__url_report
), microsoft_ads AS (
  SELECT
    source_relation,
    TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
    CAST('microsoft_ads' AS TEXT) AS platform,
    CAST(account_id AS TEXT) AS account_id,
    CAST(account_name AS TEXT) AS account_name,
    CAST(ad_group_id AS TEXT) AS ad_group_id,
    CAST(ad_group_name AS TEXT) AS ad_group_name,
    CAST(base_url AS TEXT) AS base_url,
    CAST(campaign_id AS TEXT) AS campaign_id,
    CAST(campaign_name AS TEXT) AS campaign_name,
    CAST(clicks AS INT) AS clicks,
    CAST(impressions AS INT) AS impressions,
    CAST(spend AS FLOAT) AS spend,
    CAST(url_host AS TEXT) AS url_host,
    CAST(url_path AS TEXT) AS url_path,
    CAST(utm_campaign AS TEXT) AS utm_campaign,
    CAST(utm_content AS TEXT) AS utm_content,
    CAST(utm_medium AS TEXT) AS utm_medium,
    CAST(utm_source AS TEXT) AS utm_source,
    CAST(utm_term AS TEXT) AS utm_term
  FROM TEST.PUBLIC_microsoft_ads.microsoft_ads__url_report
), facebook_ads AS (
  SELECT
    source_relation,
    TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
    CAST('facebook_ads' AS TEXT) AS platform,
    CAST(account_id AS TEXT) AS account_id,
    CAST(account_name AS TEXT) AS account_name,
    CAST(ad_set_id AS TEXT) AS ad_group_id,
    CAST(ad_set_name AS TEXT) AS ad_group_name,
    CAST(base_url AS TEXT) AS base_url,
    CAST(campaign_id AS TEXT) AS campaign_id,
    CAST(campaign_name AS TEXT) AS campaign_name,
    CAST(clicks AS INT) AS clicks,
    CAST(impressions AS INT) AS impressions,
    CAST(spend AS FLOAT) AS spend,
    CAST(url_host AS TEXT) AS url_host,
    CAST(url_path AS TEXT) AS url_path,
    CAST(utm_campaign AS TEXT) AS utm_campaign,
    CAST(utm_content AS TEXT) AS utm_content,
    CAST(utm_medium AS TEXT) AS utm_medium,
    CAST(utm_source AS TEXT) AS utm_source,
    CAST(utm_term AS TEXT) AS utm_term
  FROM TEST.PUBLIC_facebook_ads.facebook_ads__url_report
), linkedin_ads AS (
  SELECT
    source_relation,
    TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
    CAST('linkedin_ads' AS TEXT) AS platform,
    CAST(account_id AS TEXT) AS account_id,
    CAST(account_name AS TEXT) AS account_name,
    CAST(campaign_id AS TEXT) AS ad_group_id,
    CAST(campaign_name AS TEXT) AS ad_group_name,
    CAST(base_url AS TEXT) AS base_url,
    CAST(campaign_group_id AS TEXT) AS campaign_id,
    CAST(campaign_group_name AS TEXT) AS campaign_name,
    CAST(clicks AS INT) AS clicks,
    CAST(impressions AS INT) AS impressions,
    CAST(cost AS FLOAT) AS spend,
    CAST(url_host AS TEXT) AS url_host,
    CAST(url_path AS TEXT) AS url_path,
    CAST(utm_campaign AS TEXT) AS utm_campaign,
    CAST(utm_content AS TEXT) AS utm_content,
    CAST(utm_medium AS TEXT) AS utm_medium,
    CAST(utm_source AS TEXT) AS utm_source,
    CAST(utm_term AS TEXT) AS utm_term
  FROM TEST.PUBLIC_linkedin_ads.linkedin_ads__url_report
), pinterest_ads AS (
  SELECT
    source_relation,
    TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
    CAST('pinterest_ads' AS TEXT) AS platform,
    CAST(advertiser_id AS TEXT) AS account_id,
    CAST(advertiser_name AS TEXT) AS account_name,
    CAST(ad_group_id AS TEXT) AS ad_group_id,
    CAST(ad_group_name AS TEXT) AS ad_group_name,
    CAST(base_url AS TEXT) AS base_url,
    CAST(campaign_id AS TEXT) AS campaign_id,
    CAST(campaign_name AS TEXT) AS campaign_name,
    CAST(clicks AS INT) AS clicks,
    CAST(impressions AS INT) AS impressions,
    CAST(spend AS FLOAT) AS spend,
    CAST(url_host AS TEXT) AS url_host,
    CAST(url_path AS TEXT) AS url_path,
    CAST(utm_campaign AS TEXT) AS utm_campaign,
    CAST(utm_content AS TEXT) AS utm_content,
    CAST(utm_medium AS TEXT) AS utm_medium,
    CAST(utm_source AS TEXT) AS utm_source,
    CAST(utm_term AS TEXT) AS utm_term
  FROM TEST.PUBLIC_pinterest.pinterest_ads__url_report
), snapchat_ads AS (
  SELECT
    source_relation,
    TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
    CAST('snapchat_ads' AS TEXT) AS platform,
    CAST(ad_account_id AS TEXT) AS account_id,
    CAST(ad_account_name AS TEXT) AS account_name,
    CAST(ad_squad_id AS TEXT) AS ad_group_id,
    CAST(ad_squad_name AS TEXT) AS ad_group_name,
    CAST(base_url AS TEXT) AS base_url,
    CAST(campaign_id AS TEXT) AS campaign_id,
    CAST(campaign_name AS TEXT) AS campaign_name,
    CAST(swipes AS INT) AS clicks,
    CAST(impressions AS INT) AS impressions,
    CAST(spend AS FLOAT) AS spend,
    CAST(url_host AS TEXT) AS url_host,
    CAST(url_path AS TEXT) AS url_path,
    CAST(utm_campaign AS TEXT) AS utm_campaign,
    CAST(utm_content AS TEXT) AS utm_content,
    CAST(utm_medium AS TEXT) AS utm_medium,
    CAST(utm_source AS TEXT) AS utm_source,
    CAST(utm_term AS TEXT) AS utm_term
  FROM TEST.PUBLIC_snapchat_ads.snapchat_ads__url_report
), tiktok_ads AS (
  SELECT
    source_relation,
    TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
    CAST('tiktok_ads' AS TEXT) AS platform,
    CAST(advertiser_id AS TEXT) AS account_id,
    CAST(advertiser_name AS TEXT) AS account_name,
    CAST(ad_group_id AS TEXT) AS ad_group_id,
    CAST(ad_group_name AS TEXT) AS ad_group_name,
    CAST(base_url AS TEXT) AS base_url,
    CAST(campaign_id AS TEXT) AS campaign_id,
    CAST(campaign_name AS TEXT) AS campaign_name,
    CAST(clicks AS INT) AS clicks,
    CAST(impressions AS INT) AS impressions,
    CAST(spend AS FLOAT) AS spend,
    CAST(url_host AS TEXT) AS url_host,
    CAST(url_path AS TEXT) AS url_path,
    CAST(utm_campaign AS TEXT) AS utm_campaign,
    CAST(utm_content AS TEXT) AS utm_content,
    CAST(utm_medium AS TEXT) AS utm_medium,
    CAST(utm_source AS TEXT) AS utm_source,
    CAST(utm_term AS TEXT) AS utm_term
  FROM TEST.PUBLIC_tiktok_ads.tiktok_ads__url_report
), twitter_ads AS (
  SELECT
    source_relation,
    TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
    CAST('twitter_ads' AS TEXT) AS platform,
    CAST(account_id AS TEXT) AS account_id,
    CAST(account_name AS TEXT) AS account_name,
    CAST(line_item_id AS TEXT) AS ad_group_id,
    CAST(line_item_name AS TEXT) AS ad_group_name,
    CAST(base_url AS TEXT) AS base_url,
    CAST(campaign_id AS TEXT) AS campaign_id,
    CAST(campaign_name AS TEXT) AS campaign_name,
    CAST(clicks AS INT) AS clicks,
    CAST(impressions AS INT) AS impressions,
    CAST(spend AS FLOAT) AS spend,
    CAST(url_host AS TEXT) AS url_host,
    CAST(url_path AS TEXT) AS url_path,
    CAST(utm_campaign AS TEXT) AS utm_campaign,
    CAST(utm_content AS TEXT) AS utm_content,
    CAST(utm_medium AS TEXT) AS utm_medium,
    CAST(utm_source AS TEXT) AS utm_source,
    CAST(utm_term AS TEXT) AS utm_term
  FROM TEST.PUBLIC_twitter_ads.twitter_ads__url_report
), reddit_ads AS (
  SELECT
    source_relation,
    TO_DATE(TO_TIMESTAMP(date_day)) AS date_day,
    CAST('reddit_ads' AS TEXT) AS platform,
    CAST(account_id AS TEXT) AS account_id,
    CAST(NULL AS TEXT) AS account_name,
    CAST(ad_group_id AS TEXT) AS ad_group_id,
    CAST(ad_group_name AS TEXT) AS ad_group_name,
    CAST(base_url AS TEXT) AS base_url,
    CAST(campaign_id AS TEXT) AS campaign_id,
    CAST(campaign_name AS TEXT) AS campaign_name,
    CAST(clicks AS INT) AS clicks,
    CAST(impressions AS INT) AS impressions,
    CAST(spend AS FLOAT) AS spend,
    CAST(url_host AS TEXT) AS url_host,
    CAST(url_path AS TEXT) AS url_path,
    CAST(utm_campaign AS TEXT) AS utm_campaign,
    CAST(utm_content AS TEXT) AS utm_content,
    CAST(utm_medium AS TEXT) AS utm_medium,
    CAST(utm_source AS TEXT) AS utm_source,
    CAST(utm_term AS TEXT) AS utm_term
  FROM TEST.PUBLIC_reddit_ads.reddit_ads__url_report
), unioned AS (
  SELECT
    *
  FROM facebook_ads
  UNION ALL
  SELECT
    *
  FROM google_ads
  UNION ALL
  SELECT
    *
  FROM linkedin_ads
  UNION ALL
  SELECT
    *
  FROM microsoft_ads
  UNION ALL
  SELECT
    *
  FROM pinterest_ads
  UNION ALL
  SELECT
    *
  FROM snapchat_ads
  UNION ALL
  SELECT
    *
  FROM tiktok_ads
  UNION ALL
  SELECT
    *
  FROM twitter_ads
  UNION ALL
  SELECT
    *
  FROM reddit_ads
)
SELECT
  *
FROM unioned
%3 14. model.ad_reporting.int_ad_reporting__url_report 14. model.ad_reporting.int_ad_reporting__url_report 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report 96. model.google_ads.google_ads__url_report 96. model.google_ads.google_ads__url_report 121. model.linkedin.linkedin_ads__url_report 121. model.linkedin.linkedin_ads__url_report 140. model.microsoft_ads.microsoft_ads__url_report 140. model.microsoft_ads.microsoft_ads__url_report 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report 193. model.reddit_ads.reddit_ads__url_report 193. model.reddit_ads.reddit_ads__url_report 215. model.snapchat_ads.snapchat_ads__url_report 215. model.snapchat_ads.snapchat_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report
Name Type Comment
15. model.ad_reporting.metricflow_time_spine

This SQL query generates a time spine (a series of consecutive dates) starting from 10 years ago up to tomorrow in the America/Los_Angeles timezone. It uses a recursive CTE to generate numbers, converts them to dates, and then filters and formats the results. The final output is a table with a single column of dates.

FeaturizationFilteringCleaning
SQL Query
WITH days AS (
  WITH date_spine AS (
    WITH rawdata AS (
      WITH p AS (
        SELECT
          0 AS generated_number
        UNION ALL
        SELECT
          1
      ), unioned AS (
        SELECT
          p0.generated_number * POWER(2, 0) + p1.generated_number * POWER(2, 1) + p2.generated_number * POWER(2, 2) + p3.generated_number * POWER(2, 3) + p4.generated_number * POWER(2, 4) + p5.generated_number * POWER(2, 5) + p6.generated_number * POWER(2, 6) + p7.generated_number * POWER(2, 7) + p8.generated_number * POWER(2, 8) + p9.generated_number * POWER(2, 9) + p10.generated_number * POWER(2, 10) + p11.generated_number * POWER(2, 11) + 1 AS generated_number
        FROM p AS p0
        CROSS JOIN p AS p1
        CROSS JOIN p AS p2
        CROSS JOIN p AS p3
        CROSS JOIN p AS p4
        CROSS JOIN p AS p5
        CROSS JOIN p AS p6
        CROSS JOIN p AS p7
        CROSS JOIN p AS p8
        CROSS JOIN p AS p9
        CROSS JOIN p AS p10
        CROSS JOIN p AS p11
      )
      SELECT
        *
      FROM unioned
      WHERE
        generated_number <= 3651
      ORDER BY
        generated_number
    ), all_periods AS (
      SELECT
        (
          DATEADD(
            day,
            (
              ROW_NUMBER() OVER (ORDER BY 1) - 1
            ),
            DATEADD(
              day,
              -3650,
              CAST(CONVERT_TIMEZONE(
                'UTC',
                'America/Los_Angeles',
                CAST(CONVERT_TIMEZONE('UTC', CURRENT_TIMESTAMP()) AS TIMESTAMP)
              ) AS DATE)
            )
          )
        ) AS date_day
      FROM rawdata
    ), filtered AS (
      SELECT
        *
      FROM all_periods
      WHERE
        date_day <= CAST(DATEADD(
          day,
          1,
          CAST(CONVERT_TIMEZONE(
            'UTC',
            'America/Los_Angeles',
            CAST(CONVERT_TIMEZONE('UTC', CURRENT_TIMESTAMP()) AS TIMESTAMP)
          ) AS DATE)
        ) AS DATE)
    )
    SELECT
      *
    FROM filtered
  )
  SELECT
    CAST(d.date_day AS TIMESTAMP) AS date_day
  FROM date_spine AS d
), cast_to_date AS (
  SELECT
    CAST(date_day AS DATE) AS date_day
  FROM days
)
SELECT
  *
FROM cast_to_date
%3 15. model.ad_reporting.metricflow_time_spine 15. model.ad_reporting.metricflow_time_spine date_day
Name Type Comment
date_day date None
16. model.amazon_ads.amazon_ads__account_report

This SQL query combines data from campaign-level reports, profile information, and campaign history to create an account-level report for Amazon Ads. It joins these tables, filters for non-deleted and most recent records, and aggregates metrics such as cost, clicks, and impressions by account, date, and other dimensions.

FilteringIntegrationAggregation
SQL Query
WITH report AS (
  SELECT
    *
  /* use campaign report since account report not provided */
  FROM TEST.PUBLIC_amazon_ads_source.stg_amazon_ads__campaign_level_report
), account_info AS (
  SELECT
    *
  FROM TEST.PUBLIC_amazon_ads_source.stg_amazon_ads__profile
  WHERE
    _fivetran_deleted = FALSE
), campaigns AS (
  SELECT
    *
  FROM TEST.PUBLIC_amazon_ads_source.stg_amazon_ads__campaign_history
  WHERE
    is_most_recent_record = TRUE
), fields AS (
  SELECT
    report.source_relation,
    report.date_day,
    account_info.account_name,
    account_info.account_id,
    account_info.country_code,
    account_info.profile_id,
    SUM(report.cost) AS cost,
    SUM(report.clicks) AS clicks,
    SUM(report.impressions) AS impressions
  /* use campaign report since portfolio report not provided */
  FROM report
  LEFT JOIN campaigns
    ON campaigns.campaign_id = report.campaign_id
    AND campaigns.source_relation = report.source_relation
  LEFT JOIN account_info
    ON account_info.profile_id = campaigns.profile_id
    AND account_info.source_relation = campaigns.source_relation
  GROUP BY
    1,
    2,
    3,
    4,
    5,
    6
)
SELECT
  *
FROM fields
%3 16. model.amazon_ads.amazon_ads__account_report 16. model.amazon_ads.amazon_ads__account_report source_relation date_day profile_id account_id account_name country_code clicks impressions cost 30. model.amazon_ads_source.stg_amazon_ads__campaign_history 30. model.amazon_ads_source.stg_amazon_ads__campaign_history source_relation profile_id 30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0->16. model.amazon_ads.amazon_ads__account_report:f0 30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f1->16. model.amazon_ads.amazon_ads__account_report:f2 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report source_relation date_day clicks impressions cost 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0->16. model.amazon_ads.amazon_ads__account_report:f0 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f1->16. model.amazon_ads.amazon_ads__account_report:f1 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f2->16. model.amazon_ads.amazon_ads__account_report:f6 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f3->16. model.amazon_ads.amazon_ads__account_report:f7 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f4->16. model.amazon_ads.amazon_ads__account_report:f8 40. model.amazon_ads_source.stg_amazon_ads__profile 40. model.amazon_ads_source.stg_amazon_ads__profile source_relation profile_id account_id account_name country_code 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->16. model.amazon_ads.amazon_ads__account_report:f0 40. model.amazon_ads_source.stg_amazon_ads__profile:f1->16. model.amazon_ads.amazon_ads__account_report:f2 40. model.amazon_ads_source.stg_amazon_ads__profile:f2->16. model.amazon_ads.amazon_ads__account_report:f3 40. model.amazon_ads_source.stg_amazon_ads__profile:f3->16. model.amazon_ads.amazon_ads__account_report:f4 40. model.amazon_ads_source.stg_amazon_ads__profile:f4->16. model.amazon_ads.amazon_ads__account_report:f5
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
date_day date The date of the report.
profile_id text The profile ID associated with your Amazon Ads account. Advertisers who operate in more than one marketplace (for example, Amazon.com, Amazon.co.uk, Amazon.co.jp) will have one profile associated with each marketplace.
account_id text The ID representing the account.
account_name text The name of the account, if present in the source data.
country_code text The code for a given country.
clicks bigint The count of clicks.
impressions bigint The count of impressions.
cost double precision Total cost of ad clicks.
Column Lineage
%3 30. model.amazon_ads_source.stg_amazon_ads__campaign_history 30. model.amazon_ads_source.stg_amazon_ads__campaign_history source_relation 16. model.amazon_ads.amazon_ads__account_report 16. model.amazon_ads.amazon_ads__account_report source_relation 30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0->16. model.amazon_ads.amazon_ads__account_report:f0 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report source_relation 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0->16. model.amazon_ads.amazon_ads__account_report:f0 40. model.amazon_ads_source.stg_amazon_ads__profile 40. model.amazon_ads_source.stg_amazon_ads__profile source_relation 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->16. model.amazon_ads.amazon_ads__account_report:f0
16. model.amazon_ads.amazon_ads__account_report
  • Input Column: 30. model.amazon_ads_source.stg_amazon_ads__campaign_history[source_relation]
    • Integration used as a key to join with the report table
    • Direct copied to the output without transformation
    • Output Columns:
      • source_relation: directly copied to the output
  • Input Column: 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with other tables
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[source_relation]
    • Integration used as part of the join condition with campaigns table
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
Column Lineage
%3 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report date_day 16. model.amazon_ads.amazon_ads__account_report 16. model.amazon_ads.amazon_ads__account_report date_day 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0->16. model.amazon_ads.amazon_ads__account_report:f0 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp date 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp:f0->32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0
32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report
  • Input Column: 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp[date]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • date_day: Directly mapped and renamed
16. model.amazon_ads.amazon_ads__account_report
  • Input Column: 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 30. model.amazon_ads_source.stg_amazon_ads__campaign_history 30. model.amazon_ads_source.stg_amazon_ads__campaign_history profile_id 16. model.amazon_ads.amazon_ads__account_report 16. model.amazon_ads.amazon_ads__account_report profile_id 30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0->16. model.amazon_ads.amazon_ads__account_report:f0 40. model.amazon_ads_source.stg_amazon_ads__profile 40. model.amazon_ads_source.stg_amazon_ads__profile profile_id 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->16. model.amazon_ads.amazon_ads__account_report:f0 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp profile_id 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp:f0->30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp id 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp:f0->40. model.amazon_ads_source.stg_amazon_ads__profile:f0
30. model.amazon_ads_source.stg_amazon_ads__campaign_history
  • Input Column: 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp[profile_id]
    • Cleaning Cast as TEXT
    • Output Columns:
      • profile_id: Mapped after casting to TEXT
40. model.amazon_ads_source.stg_amazon_ads__profile
  • Input Column: 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp[id]
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • profile_id: It is directly mapped after casting to TEXT
16. model.amazon_ads.amazon_ads__account_report
  • Input Column: 30. model.amazon_ads_source.stg_amazon_ads__campaign_history[profile_id]
    • Integration used as a key to join with the account_info table
    • Output Columns:
      • profile_id: directly copied to the output
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[profile_id]
    • Integration used as part of the join condition with campaigns table
    • Direct directly copied to the output
    • Output Columns:
      • profile_id: directly copied
Column Lineage
%3 40. model.amazon_ads_source.stg_amazon_ads__profile 40. model.amazon_ads_source.stg_amazon_ads__profile account_id 16. model.amazon_ads.amazon_ads__account_report 16. model.amazon_ads.amazon_ads__account_report account_id 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->16. model.amazon_ads.amazon_ads__account_report:f0 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp account_id 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp:f0->40. model.amazon_ads_source.stg_amazon_ads__profile:f0
40. model.amazon_ads_source.stg_amazon_ads__profile
  • Input Column: 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp[account_id]
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • account_id: It is directly mapped after casting to TEXT
16. model.amazon_ads.amazon_ads__account_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[account_id]
    • Direct directly copied to the output
    • Output Columns:
      • account_id: directly copied
Column Lineage
%3 40. model.amazon_ads_source.stg_amazon_ads__profile 40. model.amazon_ads_source.stg_amazon_ads__profile account_name 16. model.amazon_ads.amazon_ads__account_report 16. model.amazon_ads.amazon_ads__account_report account_name 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->16. model.amazon_ads.amazon_ads__account_report:f0 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp account_name 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp:f0->40. model.amazon_ads_source.stg_amazon_ads__profile:f0
40. model.amazon_ads_source.stg_amazon_ads__profile
  • Input Column: 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp[account_name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • account_name: It is directly mapped
16. model.amazon_ads.amazon_ads__account_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[account_name]
    • Direct directly copied to the output
    • Output Columns:
      • account_name: directly copied
Column Lineage
%3 40. model.amazon_ads_source.stg_amazon_ads__profile 40. model.amazon_ads_source.stg_amazon_ads__profile country_code 16. model.amazon_ads.amazon_ads__account_report 16. model.amazon_ads.amazon_ads__account_report country_code 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->16. model.amazon_ads.amazon_ads__account_report:f0 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp country_code 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp:f0->40. model.amazon_ads_source.stg_amazon_ads__profile:f0
40. model.amazon_ads_source.stg_amazon_ads__profile
  • Input Column: 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp[country_code]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • country_code: It is directly mapped
16. model.amazon_ads.amazon_ads__account_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[country_code]
    • Direct directly copied to the output
    • Output Columns:
      • country_code: directly copied
Column Lineage
%3 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report clicks 16. model.amazon_ads.amazon_ads__account_report 16. model.amazon_ads.amazon_ads__account_report clicks 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0->16. model.amazon_ads.amazon_ads__account_report:f0 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp clicks 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp:f0->32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0
32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report
  • Input Column: 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp[clicks]
    • Cleaning The column is cast to INT in the fields CTE
    • Output Columns:
      • clicks: Directly mapped after casting
16. model.amazon_ads.amazon_ads__account_report
  • Input Column: 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report[clicks]
    • Aggregation The column is summed up in the SELECT clause
    • Output Columns:
      • clicks: Aggregated sum of clicks
Column Lineage
%3 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report impressions 16. model.amazon_ads.amazon_ads__account_report 16. model.amazon_ads.amazon_ads__account_report impressions 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0->16. model.amazon_ads.amazon_ads__account_report:f0 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp impressions 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp:f0->32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0
32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report
  • Input Column: 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp[impressions]
    • Cleaning The column is cast to INT data type
    • Direct The column is directly copied to the output after casting
    • Output Columns:
      • impressions: Directly mapped after casting to INT
16. model.amazon_ads.amazon_ads__account_report
  • Input Column: 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report[impressions]
    • Aggregation The column is summed up in the SELECT clause
    • Output Columns:
      • impressions: Aggregated sum of impressions
Column Lineage
%3 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report cost 16. model.amazon_ads.amazon_ads__account_report 16. model.amazon_ads.amazon_ads__account_report cost 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0->16. model.amazon_ads.amazon_ads__account_report:f0 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp cost 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp:f0->32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0
32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report
  • Input Column: 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp[cost]
    • Cleaning The column is cast to FLOAT data type
    • Direct The column is directly copied to the output after casting
    • Output Columns:
      • cost: Directly mapped after casting to FLOAT
16. model.amazon_ads.amazon_ads__account_report
  • Input Column: 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report[cost]
    • Aggregation The column is summed up in the SELECT clause
    • Output Columns:
      • cost: Aggregated sum of cost
17. model.amazon_ads.amazon_ads__ad_group_report

This SQL query integrates data from multiple Amazon Ads-related tables to create a comprehensive ad group report. It joins information from ad group reports, account profiles, portfolios, campaigns, and ad groups. The query filters for the most recent records in some tables, aggregates cost, clicks, and impressions data, and combines various attributes like account details, portfolio information, campaign data, and ad group specifics into a single result set.

FilteringIntegrationAggregation
SQL Query
WITH report AS (
  SELECT
    *
  FROM TEST.PUBLIC_amazon_ads_source.stg_amazon_ads__ad_group_level_report
), account_info AS (
  SELECT
    *
  FROM TEST.PUBLIC_amazon_ads_source.stg_amazon_ads__profile
  WHERE
    _fivetran_deleted = FALSE
), portfolios AS (
  SELECT
    *
  FROM TEST.PUBLIC_amazon_ads.int_amazon_ads__portfolio_history
), campaigns AS (
  SELECT
    *
  FROM TEST.PUBLIC_amazon_ads_source.stg_amazon_ads__campaign_history
  WHERE
    is_most_recent_record = TRUE
), ad_groups AS (
  SELECT
    *
  FROM TEST.PUBLIC_amazon_ads_source.stg_amazon_ads__ad_group_history
  WHERE
    is_most_recent_record = TRUE
), fields AS (
  SELECT
    report.source_relation,
    report.date_day,
    account_info.account_name,
    account_info.account_id,
    account_info.country_code,
    account_info.profile_id,
    portfolios.portfolio_name,
    portfolios.portfolio_id,
    campaigns.campaign_name,
    campaigns.campaign_id,
    ad_groups.ad_group_name,
    report.ad_group_id,
    ad_groups.serving_status,
    ad_groups.state,
    ad_groups.default_bid,
    report.campaign_bidding_strategy,
    SUM(report.cost) AS cost,
    SUM(report.clicks) AS clicks,
    SUM(report.impressions) AS impressions
  FROM report
  LEFT JOIN ad_groups
    ON ad_groups.ad_group_id = report.ad_group_id
    AND ad_groups.source_relation = report.source_relation
  LEFT JOIN campaigns
    ON campaigns.campaign_id = ad_groups.campaign_id
    AND campaigns.source_relation = ad_groups.source_relation
  LEFT JOIN portfolios
    ON portfolios.portfolio_id = campaigns.portfolio_id
    AND portfolios.source_relation = campaigns.source_relation
  LEFT JOIN account_info
    ON account_info.profile_id = campaigns.profile_id
    AND account_info.source_relation = campaigns.source_relation
  GROUP BY
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10,
    11,
    12,
    13,
    14,
    15,
    16
)
SELECT
  *
FROM fields
%3 17. model.amazon_ads.amazon_ads__ad_group_report 17. model.amazon_ads.amazon_ads__ad_group_report source_relation date_day account_id account_name ad_group_id ad_group_name campaign_bidding_strategy campaign_id campaign_name country_code default_bid portfolio_id portfolio_name profile_id serving_status state clicks impressions cost 23. model.amazon_ads.int_amazon_ads__portfolio_history 23. model.amazon_ads.int_amazon_ads__portfolio_history source_relation portfolio_id portfolio_name 23. model.amazon_ads.int_amazon_ads__portfolio_history:f0->17. model.amazon_ads.amazon_ads__ad_group_report:f0 23. model.amazon_ads.int_amazon_ads__portfolio_history:f1->17. model.amazon_ads.amazon_ads__ad_group_report:f11 23. model.amazon_ads.int_amazon_ads__portfolio_history:f2->17. model.amazon_ads.amazon_ads__ad_group_report:f12 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history source_relation ad_group_id ad_group_name default_bid serving_status state 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f0->17. model.amazon_ads.amazon_ads__ad_group_report:f0 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f1->17. model.amazon_ads.amazon_ads__ad_group_report:f4 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f2->17. model.amazon_ads.amazon_ads__ad_group_report:f5 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f3->17. model.amazon_ads.amazon_ads__ad_group_report:f10 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f4->17. model.amazon_ads.amazon_ads__ad_group_report:f14 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f5->17. model.amazon_ads.amazon_ads__ad_group_report:f15 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report source_relation date_day ad_group_id campaign_bidding_strategy clicks impressions cost 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report:f0->17. model.amazon_ads.amazon_ads__ad_group_report:f0 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report:f1->17. model.amazon_ads.amazon_ads__ad_group_report:f1 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report:f2->17. model.amazon_ads.amazon_ads__ad_group_report:f4 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report:f3->17. model.amazon_ads.amazon_ads__ad_group_report:f6 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report:f4->17. model.amazon_ads.amazon_ads__ad_group_report:f16 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report:f5->17. model.amazon_ads.amazon_ads__ad_group_report:f17 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report:f6->17. model.amazon_ads.amazon_ads__ad_group_report:f18 30. model.amazon_ads_source.stg_amazon_ads__campaign_history 30. model.amazon_ads_source.stg_amazon_ads__campaign_history source_relation campaign_id campaign_name 30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0->17. model.amazon_ads.amazon_ads__ad_group_report:f0 30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f1->17. model.amazon_ads.amazon_ads__ad_group_report:f7 30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f2->17. model.amazon_ads.amazon_ads__ad_group_report:f8 40. model.amazon_ads_source.stg_amazon_ads__profile 40. model.amazon_ads_source.stg_amazon_ads__profile source_relation profile_id account_id account_name country_code 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->17. model.amazon_ads.amazon_ads__ad_group_report:f0 40. model.amazon_ads_source.stg_amazon_ads__profile:f1->17. model.amazon_ads.amazon_ads__ad_group_report:f13 40. model.amazon_ads_source.stg_amazon_ads__profile:f2->17. model.amazon_ads.amazon_ads__ad_group_report:f2 40. model.amazon_ads_source.stg_amazon_ads__profile:f3->17. model.amazon_ads.amazon_ads__ad_group_report:f3 40. model.amazon_ads_source.stg_amazon_ads__profile:f4->17. model.amazon_ads.amazon_ads__ad_group_report:f9
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
date_day date The date of the report.
account_id text The ID representing the account.
account_name text The name of the account, if present in the source data.
ad_group_id text The ID representing the campaign, if present in the source data.
ad_group_name text The name of the campaign, if present in the source data.
campaign_bidding_strategy text The bidding strategy associated with a campaign.
campaign_id text The ID representing the campaign, if present in the source data.
campaign_name text The name of the campaign, if present in the source data.
country_code text The code for a given country.
default_bid double precision The date of creation of the record.
portfolio_id text The ID of the Portfolio.
portfolio_name text The name of the Portfolio.
profile_id text The profile ID associated with your Amazon Ads account. Advertisers who operate in more than one marketplace (for example, Amazon.com, Amazon.co.uk, Amazon.co.jp) will have one profile associated with each marketplace.
serving_status text The current serving status of the record.
state text The state of the record (enabled, paused, or archived).
clicks bigint The count of clicks.
impressions bigint The count of impressions.
cost double precision Total cost of ad clicks.
Column Lineage
%3 23. model.amazon_ads.int_amazon_ads__portfolio_history 23. model.amazon_ads.int_amazon_ads__portfolio_history source_relation 17. model.amazon_ads.amazon_ads__ad_group_report 17. model.amazon_ads.amazon_ads__ad_group_report source_relation 23. model.amazon_ads.int_amazon_ads__portfolio_history:f0->17. model.amazon_ads.amazon_ads__ad_group_report:f0 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history source_relation 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f0->17. model.amazon_ads.amazon_ads__ad_group_report:f0 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report source_relation 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report:f0->17. model.amazon_ads.amazon_ads__ad_group_report:f0 30. model.amazon_ads_source.stg_amazon_ads__campaign_history 30. model.amazon_ads_source.stg_amazon_ads__campaign_history source_relation 30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0->17. model.amazon_ads.amazon_ads__ad_group_report:f0 40. model.amazon_ads_source.stg_amazon_ads__profile 40. model.amazon_ads_source.stg_amazon_ads__profile source_relation 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->17. model.amazon_ads.amazon_ads__ad_group_report:f0 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history source_relation 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->23. model.amazon_ads.int_amazon_ads__portfolio_history:f0
23. model.amazon_ads.int_amazon_ads__portfolio_history
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[source_relation]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • source_relation: Directly copied
17. model.amazon_ads.amazon_ads__ad_group_report
  • Input Column: 23. model.amazon_ads.int_amazon_ads__portfolio_history[source_relation]
    • Direct The column is directly copied without transformation
    • Integration Used as part of the join condition with other tables
    • Output Columns:
      • source_relation: Directly copied to the output
  • Input Column: 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history[source_relation]
    • Direct The column is directly copied without transformation
    • Integration Used as part of the join condition with other tables
    • Output Columns:
      • source_relation: Directly copied to the output
  • Input Column: 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as a key to join with other tables
    • Aggregation The column is grouped by in the final SELECT statement
    • Output Columns:
      • source_relation: Directly copied to the output
  • Input Column: 30. model.amazon_ads_source.stg_amazon_ads__campaign_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[source_relation]
    • Integration used to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
Column Lineage
%3 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report date_day 17. model.amazon_ads.amazon_ads__ad_group_report 17. model.amazon_ads.amazon_ads__ad_group_report date_day 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report:f0->17. model.amazon_ads.amazon_ads__ad_group_report:f0 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp date 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp:f0->26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report:f0
26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report
  • Input Column: 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp[date]
    • Cleaning The column is cast to DATE type in the fields CTE
    • Output Columns:
      • date_day: Directly mapped after casting to DATE
17. model.amazon_ads.amazon_ads__ad_group_report
  • Input Column: 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation The column is grouped by in the final SELECT statement
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 40. model.amazon_ads_source.stg_amazon_ads__profile 40. model.amazon_ads_source.stg_amazon_ads__profile account_id 17. model.amazon_ads.amazon_ads__ad_group_report 17. model.amazon_ads.amazon_ads__ad_group_report account_id 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->17. model.amazon_ads.amazon_ads__ad_group_report:f0 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp account_id 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp:f0->40. model.amazon_ads_source.stg_amazon_ads__profile:f0
40. model.amazon_ads_source.stg_amazon_ads__profile
  • Input Column: 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp[account_id]
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • account_id: It is directly mapped after casting to TEXT
17. model.amazon_ads.amazon_ads__ad_group_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[account_id]
    • Direct directly copied to the output
    • Output Columns:
      • account_id: directly copied
Column Lineage
%3 40. model.amazon_ads_source.stg_amazon_ads__profile 40. model.amazon_ads_source.stg_amazon_ads__profile account_name 17. model.amazon_ads.amazon_ads__ad_group_report 17. model.amazon_ads.amazon_ads__ad_group_report account_name 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->17. model.amazon_ads.amazon_ads__ad_group_report:f0 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp account_name 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp:f0->40. model.amazon_ads_source.stg_amazon_ads__profile:f0
40. model.amazon_ads_source.stg_amazon_ads__profile
  • Input Column: 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp[account_name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • account_name: It is directly mapped
17. model.amazon_ads.amazon_ads__ad_group_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[account_name]
    • Direct directly copied to the output
    • Output Columns:
      • account_name: directly copied
Column Lineage
%3 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history ad_group_id 17. model.amazon_ads.amazon_ads__ad_group_report 17. model.amazon_ads.amazon_ads__ad_group_report ad_group_id 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f0->17. model.amazon_ads.amazon_ads__ad_group_report:f0 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report ad_group_id 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report:f0->17. model.amazon_ads.amazon_ads__ad_group_report:f0 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp id 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp:f0->24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f0 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp ad_group_id 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp:f0->26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report:f0
24. model.amazon_ads_source.stg_amazon_ads__ad_group_history
  • Input Column: 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp[id]
    • Cleaning Cast to TEXT type
    • Deduplication Used in ROW_NUMBER() window function for deduplication
    • Output Columns:
      • ad_group_id: Directly mapped after casting to TEXT
26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report
  • Input Column: 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp[ad_group_id]
    • Cleaning The column is cast to TEXT type in the final CTE
    • Output Columns:
      • ad_group_id: Directly mapped after casting to TEXT
17. model.amazon_ads.amazon_ads__ad_group_report
  • Input Column: 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history[ad_group_id]
    • Direct The column is directly copied without transformation
    • Integration Used as part of the join condition with the report table
    • Output Columns:
      • ad_group_id: Directly copied to the output
  • Input Column: 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report[ad_group_id]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as a key to join with the ad_groups table
    • Aggregation The column is grouped by in the final SELECT statement
    • Output Columns:
      • ad_group_id: Directly copied to the output
Column Lineage
%3 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history ad_group_name 17. model.amazon_ads.amazon_ads__ad_group_report 17. model.amazon_ads.amazon_ads__ad_group_report ad_group_name 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f0->17. model.amazon_ads.amazon_ads__ad_group_report:f0 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp name 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp:f0->24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f0
24. model.amazon_ads_source.stg_amazon_ads__ad_group_history
  • Input Column: 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp[name]
    • Cleaning Cast to TEXT type
    • Output Columns:
      • ad_group_name: Directly mapped after casting to TEXT
17. model.amazon_ads.amazon_ads__ad_group_report
  • Input Column: 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history[ad_group_name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • ad_group_name: Directly copied to the output
Column Lineage
%3 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report campaign_bidding_strategy 17. model.amazon_ads.amazon_ads__ad_group_report 17. model.amazon_ads.amazon_ads__ad_group_report campaign_bidding_strategy 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report:f0->17. model.amazon_ads.amazon_ads__ad_group_report:f0 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp campaign_bidding_strategy 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp:f0->26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report:f0
26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report
  • Input Column: 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp[campaign_bidding_strategy]
    • Cleaning The column is cast to TEXT type in the fields CTE
    • Output Columns:
      • campaign_bidding_strategy: Directly mapped after casting to TEXT
17. model.amazon_ads.amazon_ads__ad_group_report
  • Input Column: 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report[campaign_bidding_strategy]
    • Direct The column is directly copied without any transformation
    • Aggregation The column is grouped by in the final SELECT statement
    • Output Columns:
      • campaign_bidding_strategy: Directly copied to the output
Column Lineage
%3 30. model.amazon_ads_source.stg_amazon_ads__campaign_history 30. model.amazon_ads_source.stg_amazon_ads__campaign_history campaign_id 17. model.amazon_ads.amazon_ads__ad_group_report 17. model.amazon_ads.amazon_ads__ad_group_report campaign_id 30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0->17. model.amazon_ads.amazon_ads__ad_group_report:f0 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp id 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp:f0->30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0
30. model.amazon_ads_source.stg_amazon_ads__campaign_history
  • Input Column: 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp[id]
    • Cleaning The column is cast as TEXT
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • campaign_id: Directly mapped after casting to TEXT
17. model.amazon_ads.amazon_ads__ad_group_report
  • Input Column: 30. model.amazon_ads_source.stg_amazon_ads__campaign_history[campaign_id]
    • Integration used as a joining key with other tables
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
Column Lineage
%3 30. model.amazon_ads_source.stg_amazon_ads__campaign_history 30. model.amazon_ads_source.stg_amazon_ads__campaign_history campaign_name 17. model.amazon_ads.amazon_ads__ad_group_report 17. model.amazon_ads.amazon_ads__ad_group_report campaign_name 30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0->17. model.amazon_ads.amazon_ads__ad_group_report:f0 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp name 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp:f0->30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0
30. model.amazon_ads_source.stg_amazon_ads__campaign_history
  • Input Column: 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp[name]
    • Direct Copied without transformation
    • Output Columns:
      • campaign_name: Mapped and renamed
17. model.amazon_ads.amazon_ads__ad_group_report
  • Input Column: 30. model.amazon_ads_source.stg_amazon_ads__campaign_history[campaign_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_name: directly copied
Column Lineage
%3 40. model.amazon_ads_source.stg_amazon_ads__profile 40. model.amazon_ads_source.stg_amazon_ads__profile country_code 17. model.amazon_ads.amazon_ads__ad_group_report 17. model.amazon_ads.amazon_ads__ad_group_report country_code 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->17. model.amazon_ads.amazon_ads__ad_group_report:f0 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp country_code 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp:f0->40. model.amazon_ads_source.stg_amazon_ads__profile:f0
40. model.amazon_ads_source.stg_amazon_ads__profile
  • Input Column: 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp[country_code]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • country_code: It is directly mapped
17. model.amazon_ads.amazon_ads__ad_group_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[country_code]
    • Direct directly copied to the output
    • Output Columns:
      • country_code: directly copied
Column Lineage
%3 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history default_bid 17. model.amazon_ads.amazon_ads__ad_group_report 17. model.amazon_ads.amazon_ads__ad_group_report default_bid 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f0->17. model.amazon_ads.amazon_ads__ad_group_report:f0 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp default_bid 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp:f0->24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f0
24. model.amazon_ads_source.stg_amazon_ads__ad_group_history
  • Input Column: 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp[default_bid]
    • Cleaning Cast to FLOAT type
    • Output Columns:
      • default_bid: Directly mapped after casting to FLOAT
17. model.amazon_ads.amazon_ads__ad_group_report
  • Input Column: 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history[default_bid]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • default_bid: Directly copied to the output
Column Lineage
%3 23. model.amazon_ads.int_amazon_ads__portfolio_history 23. model.amazon_ads.int_amazon_ads__portfolio_history portfolio_id 17. model.amazon_ads.amazon_ads__ad_group_report 17. model.amazon_ads.amazon_ads__ad_group_report portfolio_id 23. model.amazon_ads.int_amazon_ads__portfolio_history:f0->17. model.amazon_ads.amazon_ads__ad_group_report:f0 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history portfolio_id 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->23. model.amazon_ads.int_amazon_ads__portfolio_history:f0 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp id 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp:f0->36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0
36. model.amazon_ads_source.stg_amazon_ads__portfolio_history
  • Input Column: 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp[id]
    • Cleaning Cast to TEXT data type
    • Deduplication Used in ROW_NUMBER() window function for identifying the most recent record
    • Output Columns:
      • portfolio_id: Directly mapped after casting to TEXT
23. model.amazon_ads.int_amazon_ads__portfolio_history
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[portfolio_id]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • portfolio_id: Directly copied
17. model.amazon_ads.amazon_ads__ad_group_report
  • Input Column: 23. model.amazon_ads.int_amazon_ads__portfolio_history[portfolio_id]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with other tables
    • Output Columns:
      • portfolio_id: Directly copied to the output
Column Lineage
%3 23. model.amazon_ads.int_amazon_ads__portfolio_history 23. model.amazon_ads.int_amazon_ads__portfolio_history portfolio_name 17. model.amazon_ads.amazon_ads__ad_group_report 17. model.amazon_ads.amazon_ads__ad_group_report portfolio_name 23. model.amazon_ads.int_amazon_ads__portfolio_history:f0->17. model.amazon_ads.amazon_ads__ad_group_report:f0 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history portfolio_name 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->23. model.amazon_ads.int_amazon_ads__portfolio_history:f0 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp name 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp:f0->36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0
36. model.amazon_ads_source.stg_amazon_ads__portfolio_history
  • Input Column: 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • portfolio_name: Directly mapped and renamed
23. model.amazon_ads.int_amazon_ads__portfolio_history
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[portfolio_name]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • portfolio_name: Directly copied
17. model.amazon_ads.amazon_ads__ad_group_report
  • Input Column: 23. model.amazon_ads.int_amazon_ads__portfolio_history[portfolio_name]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with other tables
    • Output Columns:
      • portfolio_name: Directly copied to the output
Column Lineage
%3 40. model.amazon_ads_source.stg_amazon_ads__profile 40. model.amazon_ads_source.stg_amazon_ads__profile profile_id 17. model.amazon_ads.amazon_ads__ad_group_report 17. model.amazon_ads.amazon_ads__ad_group_report profile_id 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->17. model.amazon_ads.amazon_ads__ad_group_report:f0 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp id 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp:f0->40. model.amazon_ads_source.stg_amazon_ads__profile:f0
40. model.amazon_ads_source.stg_amazon_ads__profile
  • Input Column: 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp[id]
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • profile_id: It is directly mapped after casting to TEXT
17. model.amazon_ads.amazon_ads__ad_group_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[profile_id]
    • Integration used to join with campaigns table
    • Direct directly copied to the output
    • Output Columns:
      • profile_id: directly copied
Column Lineage
%3 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history serving_status 17. model.amazon_ads.amazon_ads__ad_group_report 17. model.amazon_ads.amazon_ads__ad_group_report serving_status 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f0->17. model.amazon_ads.amazon_ads__ad_group_report:f0 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp serving_status 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp:f0->24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f0
24. model.amazon_ads_source.stg_amazon_ads__ad_group_history
  • Input Column: 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp[serving_status]
    • Cleaning Cast to TEXT type
    • Output Columns:
      • serving_status: Directly mapped after casting to TEXT
17. model.amazon_ads.amazon_ads__ad_group_report
  • Input Column: 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history[serving_status]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • serving_status: Directly copied to the output
Column Lineage
%3 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history state 17. model.amazon_ads.amazon_ads__ad_group_report 17. model.amazon_ads.amazon_ads__ad_group_report state 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f0->17. model.amazon_ads.amazon_ads__ad_group_report:f0 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp state 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp:f0->24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f0
24. model.amazon_ads_source.stg_amazon_ads__ad_group_history
  • Input Column: 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp[state]
    • Cleaning Cast to TEXT type
    • Output Columns:
      • state: Directly mapped after casting to TEXT
17. model.amazon_ads.amazon_ads__ad_group_report
  • Input Column: 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history[state]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • state: Directly copied to the output
Column Lineage
%3 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report clicks 17. model.amazon_ads.amazon_ads__ad_group_report 17. model.amazon_ads.amazon_ads__ad_group_report clicks 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report:f0->17. model.amazon_ads.amazon_ads__ad_group_report:f0 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp clicks 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp:f0->26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report:f0
26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report
  • Input Column: 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp[clicks]
    • Cleaning The column is cast to INT type in the fields CTE
    • Output Columns:
      • clicks: Directly mapped after casting to INT
17. model.amazon_ads.amazon_ads__ad_group_report
  • Input Column: 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report[clicks]
    • Aggregation The column is summed up in the SELECT statement
    • Output Columns:
      • clicks: Aggregated into the sum of clicks
Column Lineage
%3 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report impressions 17. model.amazon_ads.amazon_ads__ad_group_report 17. model.amazon_ads.amazon_ads__ad_group_report impressions 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report:f0->17. model.amazon_ads.amazon_ads__ad_group_report:f0 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp impressions 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp:f0->26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report:f0
26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report
  • Input Column: 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp[impressions]
    • Cleaning The column is cast to INT type in the fields CTE
    • Output Columns:
      • impressions: Directly mapped after casting to INT
17. model.amazon_ads.amazon_ads__ad_group_report
  • Input Column: 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report[impressions]
    • Aggregation The column is summed up in the SELECT statement
    • Output Columns:
      • impressions: Aggregated into the sum of impressions
Column Lineage
%3 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report cost 17. model.amazon_ads.amazon_ads__ad_group_report 17. model.amazon_ads.amazon_ads__ad_group_report cost 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report:f0->17. model.amazon_ads.amazon_ads__ad_group_report:f0 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp cost 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp:f0->26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report:f0
26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report
  • Input Column: 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp[cost]
    • Cleaning The column is cast to FLOAT type in the fields CTE
    • Output Columns:
      • cost: Directly mapped after casting to FLOAT
17. model.amazon_ads.amazon_ads__ad_group_report
  • Input Column: 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report[cost]
    • Aggregation The column is summed up in the SELECT statement
    • Output Columns:
      • cost: Aggregated into the sum of cost
18. model.amazon_ads.amazon_ads__ad_report

This SQL query combines data from multiple Amazon Ads-related tables to create a comprehensive ad performance report. It joins information from advertised product reports, account profiles, portfolios, campaigns, ad groups, and product ads. The query filters for the most recent records in some tables, aggregates metrics like cost, clicks, and impressions, and includes various identifiers and attributes related to the ads and their hierarchical structure.

FilteringIntegrationAggregation
SQL Query
WITH report AS (
  SELECT
    *
  FROM TEST.PUBLIC_amazon_ads_source.stg_amazon_ads__advertised_product_report
), account_info AS (
  SELECT
    *
  FROM TEST.PUBLIC_amazon_ads_source.stg_amazon_ads__profile
  WHERE
    _fivetran_deleted = FALSE
), portfolios AS (
  SELECT
    *
  FROM TEST.PUBLIC_amazon_ads.int_amazon_ads__portfolio_history
), campaigns AS (
  SELECT
    *
  FROM TEST.PUBLIC_amazon_ads_source.stg_amazon_ads__campaign_history
  WHERE
    is_most_recent_record = TRUE
), ad_groups AS (
  SELECT
    *
  FROM TEST.PUBLIC_amazon_ads_source.stg_amazon_ads__ad_group_history
  WHERE
    is_most_recent_record = TRUE
), ads AS (
  SELECT
    *
  FROM TEST.PUBLIC_amazon_ads_source.stg_amazon_ads__product_ad_history
  WHERE
    is_most_recent_record = TRUE
), fields AS (
  SELECT
    report.source_relation,
    report.date_day,
    account_info.account_name,
    account_info.account_id,
    account_info.country_code,
    account_info.profile_id,
    portfolios.portfolio_name,
    portfolios.portfolio_id,
    campaigns.campaign_name,
    report.campaign_id,
    ad_groups.ad_group_name,
    report.ad_group_id,
    report.ad_id,
    ads.serving_status,
    ads.state,
    report.advertised_asin,
    report.advertised_sku,
    report.campaign_budget_amount,
    report.campaign_budget_currency_code,
    report.campaign_budget_type,
    SUM(report.cost) AS cost,
    SUM(report.clicks) AS clicks,
    SUM(report.impressions) AS impressions
  FROM report
  LEFT JOIN ads
    ON ads.ad_id = report.ad_id AND ads.source_relation = report.source_relation
  LEFT JOIN ad_groups
    ON ad_groups.ad_group_id = report.ad_group_id
    AND ad_groups.source_relation = report.source_relation
  LEFT JOIN campaigns
    ON campaigns.campaign_id = report.campaign_id
    AND campaigns.source_relation = report.source_relation
  LEFT JOIN portfolios
    ON portfolios.portfolio_id = campaigns.portfolio_id
    AND portfolios.source_relation = campaigns.source_relation
  LEFT JOIN account_info
    ON account_info.profile_id = campaigns.profile_id
    AND account_info.source_relation = campaigns.source_relation
  GROUP BY
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10,
    11,
    12,
    13,
    14,
    15,
    16,
    17,
    18,
    19,
    20
)
SELECT
  *
FROM fields
%3 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report source_relation date_day account_id account_name ad_id ad_group_id ad_group_name campaign_id campaign_name country_code portfolio_id portfolio_name profile_id serving_status state advertised_asin advertised_sku campaign_budget_amount campaign_budget_currency_code campaign_budget_type clicks impressions cost 23. model.amazon_ads.int_amazon_ads__portfolio_history 23. model.amazon_ads.int_amazon_ads__portfolio_history source_relation portfolio_id portfolio_name 23. model.amazon_ads.int_amazon_ads__portfolio_history:f0->18. model.amazon_ads.amazon_ads__ad_report:f0 23. model.amazon_ads.int_amazon_ads__portfolio_history:f1->18. model.amazon_ads.amazon_ads__ad_report:f10 23. model.amazon_ads.int_amazon_ads__portfolio_history:f2->18. model.amazon_ads.amazon_ads__ad_report:f11 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history ad_group_id ad_group_name 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f0->18. model.amazon_ads.amazon_ads__ad_report:f5 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f1->18. model.amazon_ads.amazon_ads__ad_report:f6 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report source_relation date_day ad_id ad_group_id advertised_asin advertised_sku campaign_budget_amount campaign_budget_currency_code campaign_budget_type campaign_id clicks impressions cost 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f0->18. model.amazon_ads.amazon_ads__ad_report:f0 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f1->18. model.amazon_ads.amazon_ads__ad_report:f1 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f2->18. model.amazon_ads.amazon_ads__ad_report:f4 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f3->18. model.amazon_ads.amazon_ads__ad_report:f5 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f4->18. model.amazon_ads.amazon_ads__ad_report:f15 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f5->18. model.amazon_ads.amazon_ads__ad_report:f16 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f6->18. model.amazon_ads.amazon_ads__ad_report:f17 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f7->18. model.amazon_ads.amazon_ads__ad_report:f18 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f8->18. model.amazon_ads.amazon_ads__ad_report:f19 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f9->18. model.amazon_ads.amazon_ads__ad_report:f7 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f10->18. model.amazon_ads.amazon_ads__ad_report:f20 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f11->18. model.amazon_ads.amazon_ads__ad_report:f21 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f12->18. model.amazon_ads.amazon_ads__ad_report:f22 30. model.amazon_ads_source.stg_amazon_ads__campaign_history 30. model.amazon_ads_source.stg_amazon_ads__campaign_history source_relation campaign_id campaign_name 30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0->18. model.amazon_ads.amazon_ads__ad_report:f0 30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f1->18. model.amazon_ads.amazon_ads__ad_report:f7 30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f2->18. model.amazon_ads.amazon_ads__ad_report:f8 38. model.amazon_ads_source.stg_amazon_ads__product_ad_history 38. model.amazon_ads_source.stg_amazon_ads__product_ad_history source_relation ad_id serving_status state 38. model.amazon_ads_source.stg_amazon_ads__product_ad_history:f0->18. model.amazon_ads.amazon_ads__ad_report:f0 38. model.amazon_ads_source.stg_amazon_ads__product_ad_history:f1->18. model.amazon_ads.amazon_ads__ad_report:f4 38. model.amazon_ads_source.stg_amazon_ads__product_ad_history:f2->18. model.amazon_ads.amazon_ads__ad_report:f13 38. model.amazon_ads_source.stg_amazon_ads__product_ad_history:f3->18. model.amazon_ads.amazon_ads__ad_report:f14 40. model.amazon_ads_source.stg_amazon_ads__profile 40. model.amazon_ads_source.stg_amazon_ads__profile source_relation profile_id account_id account_name country_code 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->18. model.amazon_ads.amazon_ads__ad_report:f0 40. model.amazon_ads_source.stg_amazon_ads__profile:f1->18. model.amazon_ads.amazon_ads__ad_report:f12 40. model.amazon_ads_source.stg_amazon_ads__profile:f2->18. model.amazon_ads.amazon_ads__ad_report:f2 40. model.amazon_ads_source.stg_amazon_ads__profile:f3->18. model.amazon_ads.amazon_ads__ad_report:f3 40. model.amazon_ads_source.stg_amazon_ads__profile:f4->18. model.amazon_ads.amazon_ads__ad_report:f9
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
date_day date The date of the report.
account_id text The ID representing the account.
account_name text The name of the account, if present in the source data.
ad_id text The ID representing the ad, if present in the source data.
ad_group_id text The ID representing the ad group, if present in the source data.
ad_group_name text The name of the campaign, if present in the source data.
campaign_id text The ID representing the campaign, if present in the source data.
campaign_name text The name of the campaign, if present in the source data.
country_code text The code for a given country.
portfolio_id text The ID of the Portfolio.
portfolio_name text The name of the Portfolio.
profile_id text The profile ID associated with your Amazon Ads account. Advertisers who operate in more than one marketplace (for example, Amazon.com, Amazon.co.uk, Amazon.co.jp) will have one profile associated with each marketplace.
serving_status text The current serving status of the record.
state text The state of the record (enabled, paused, or archived).
advertised_asin text The ASIN associated to an advertised product.
advertised_sku text The SKU being advertised.
campaign_budget_amount double precision Total budget allocated to the campaign.
campaign_budget_currency_code text The currency code associated with the campaign.
campaign_budget_type text One of: daily or lifetime.
clicks bigint The count of clicks.
impressions bigint The count of impressions.
cost double precision Total cost of ad clicks.
Column Lineage
%3 23. model.amazon_ads.int_amazon_ads__portfolio_history 23. model.amazon_ads.int_amazon_ads__portfolio_history source_relation 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report source_relation 23. model.amazon_ads.int_amazon_ads__portfolio_history:f0->18. model.amazon_ads.amazon_ads__ad_report:f0 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report source_relation 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f0->18. model.amazon_ads.amazon_ads__ad_report:f0 30. model.amazon_ads_source.stg_amazon_ads__campaign_history 30. model.amazon_ads_source.stg_amazon_ads__campaign_history source_relation 30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0->18. model.amazon_ads.amazon_ads__ad_report:f0 38. model.amazon_ads_source.stg_amazon_ads__product_ad_history 38. model.amazon_ads_source.stg_amazon_ads__product_ad_history source_relation 38. model.amazon_ads_source.stg_amazon_ads__product_ad_history:f0->18. model.amazon_ads.amazon_ads__ad_report:f0 40. model.amazon_ads_source.stg_amazon_ads__profile 40. model.amazon_ads_source.stg_amazon_ads__profile source_relation 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->18. model.amazon_ads.amazon_ads__ad_report:f0 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history source_relation 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->23. model.amazon_ads.int_amazon_ads__portfolio_history:f0
23. model.amazon_ads.int_amazon_ads__portfolio_history
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[source_relation]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • source_relation: Directly copied
18. model.amazon_ads.amazon_ads__ad_report
  • Input Column: 23. model.amazon_ads.int_amazon_ads__portfolio_history[source_relation]
    • Direct The column is directly used in the SELECT statement
    • Integration Used to join with other tables
    • Output Columns:
      • source_relation: Directly copied to the output
  • Input Column: 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join conditions with other tables
    • Output Columns:
      • source_relation: Directly copied to the output
  • Input Column: 30. model.amazon_ads_source.stg_amazon_ads__campaign_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 38. model.amazon_ads_source.stg_amazon_ads__product_ad_history[source_relation]
    • Integration used to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[source_relation]
    • Integration Used to join with other tables
    • Output Columns:
      • source_relation: Directly copied
Column Lineage
%3 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report date_day 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report date_day 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f0->18. model.amazon_ads.amazon_ads__ad_report:f0 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp date 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp:f0->28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f0
28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report
  • Input Column: 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp[date]
    • Cleaning The column is renamed to 'date_day'
    • Output Columns:
      • date_day: Directly mapped and renamed
18. model.amazon_ads.amazon_ads__ad_report
  • Input Column: 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 40. model.amazon_ads_source.stg_amazon_ads__profile 40. model.amazon_ads_source.stg_amazon_ads__profile account_id 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report account_id 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->18. model.amazon_ads.amazon_ads__ad_report:f0 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp account_id 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp:f0->40. model.amazon_ads_source.stg_amazon_ads__profile:f0
40. model.amazon_ads_source.stg_amazon_ads__profile
  • Input Column: 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp[account_id]
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • account_id: It is directly mapped after casting to TEXT
18. model.amazon_ads.amazon_ads__ad_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[account_id]
    • Direct Copied to output
    • Output Columns:
      • account_id: Directly copied
Column Lineage
%3 40. model.amazon_ads_source.stg_amazon_ads__profile 40. model.amazon_ads_source.stg_amazon_ads__profile account_name 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report account_name 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->18. model.amazon_ads.amazon_ads__ad_report:f0 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp account_name 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp:f0->40. model.amazon_ads_source.stg_amazon_ads__profile:f0
40. model.amazon_ads_source.stg_amazon_ads__profile
  • Input Column: 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp[account_name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • account_name: It is directly mapped
18. model.amazon_ads.amazon_ads__ad_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[account_name]
    • Direct Copied to output
    • Output Columns:
      • account_name: Directly copied
Column Lineage
%3 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report ad_id 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report ad_id 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f0->18. model.amazon_ads.amazon_ads__ad_report:f0 38. model.amazon_ads_source.stg_amazon_ads__product_ad_history 38. model.amazon_ads_source.stg_amazon_ads__product_ad_history ad_id 38. model.amazon_ads_source.stg_amazon_ads__product_ad_history:f0->18. model.amazon_ads.amazon_ads__ad_report:f0 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp ad_id 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp:f0->28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f0 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp id 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp:f0->38. model.amazon_ads_source.stg_amazon_ads__product_ad_history:f0
28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report
  • Input Column: 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp[ad_id]
    • Cleaning The column is cast to TEXT in the final CTE
    • Output Columns:
      • ad_id: Directly mapped after casting to TEXT
38. model.amazon_ads_source.stg_amazon_ads__product_ad_history
  • Input Column: 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp[id]
    • Cleaning Cast to TEXT datatype
    • Deduplication Used in ROW_NUMBER() function for identifying most recent record
    • Output Columns:
      • ad_id: Directly mapped after casting
18. model.amazon_ads.amazon_ads__ad_report
  • Input Column: 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report[ad_id]
    • Direct The column is directly copied without any transformation
    • Integration Used to join with the ads table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • ad_id: Directly copied to the output
  • Input Column: 38. model.amazon_ads_source.stg_amazon_ads__product_ad_history[ad_id]
    • Integration used to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • ad_id: directly copied
Column Lineage
%3 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history ad_group_id 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report ad_group_id 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f0->18. model.amazon_ads.amazon_ads__ad_report:f0 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report ad_group_id 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f0->18. model.amazon_ads.amazon_ads__ad_report:f0 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp id 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp:f0->24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f0 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp ad_group_id 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp:f0->28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f0
24. model.amazon_ads_source.stg_amazon_ads__ad_group_history
  • Input Column: 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp[id]
    • Cleaning Cast to TEXT type
    • Deduplication Used in ROW_NUMBER() window function for deduplication
    • Output Columns:
      • ad_group_id: Directly mapped after casting to TEXT
28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report
  • Input Column: 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp[ad_group_id]
    • Cleaning The column is cast to TEXT in the final CTE
    • Output Columns:
      • ad_group_id: Directly mapped after casting to TEXT
18. model.amazon_ads.amazon_ads__ad_report
  • Input Column: 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history[ad_group_id]
    • Integration used as the key to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_id: directly copied
  • Input Column: 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report[ad_group_id]
    • Direct The column is directly copied without any transformation
    • Integration Used to join with the ad_groups table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • ad_group_id: Directly copied to the output
Column Lineage
%3 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history ad_group_name 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report ad_group_name 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f0->18. model.amazon_ads.amazon_ads__ad_report:f0 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp name 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp:f0->24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f0
24. model.amazon_ads_source.stg_amazon_ads__ad_group_history
  • Input Column: 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp[name]
    • Cleaning Cast to TEXT type
    • Output Columns:
      • ad_group_name: Directly mapped after casting to TEXT
18. model.amazon_ads.amazon_ads__ad_report
  • Input Column: 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history[ad_group_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_name: directly copied
Column Lineage
%3 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report campaign_id 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report campaign_id 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f0->18. model.amazon_ads.amazon_ads__ad_report:f0 30. model.amazon_ads_source.stg_amazon_ads__campaign_history 30. model.amazon_ads_source.stg_amazon_ads__campaign_history campaign_id 30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0->18. model.amazon_ads.amazon_ads__ad_report:f0 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp campaign_id 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp:f0->28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f0 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp id 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp:f0->30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0
28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report
  • Input Column: 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp[campaign_id]
    • Cleaning The column is cast to TEXT in the final CTE
    • Output Columns:
      • campaign_id: Directly mapped after casting to TEXT
30. model.amazon_ads_source.stg_amazon_ads__campaign_history
  • Input Column: 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp[id]
    • Cleaning The column is cast as TEXT
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • campaign_id: Directly mapped after casting to TEXT
18. model.amazon_ads.amazon_ads__ad_report
  • Input Column: 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report[campaign_id]
    • Direct The column is directly copied without any transformation
    • Integration Used to join with the campaigns table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • campaign_id: Directly copied to the output
  • Input Column: 30. model.amazon_ads_source.stg_amazon_ads__campaign_history[campaign_id]
    • Integration used as join key with the report table
    • Direct directly copied to output
    • Output Columns:
      • campaign_id: directly copied
Column Lineage
%3 30. model.amazon_ads_source.stg_amazon_ads__campaign_history 30. model.amazon_ads_source.stg_amazon_ads__campaign_history campaign_name 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report campaign_name 30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0->18. model.amazon_ads.amazon_ads__ad_report:f0 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp name 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp:f0->30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0
30. model.amazon_ads_source.stg_amazon_ads__campaign_history
  • Input Column: 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp[name]
    • Direct Copied without transformation
    • Output Columns:
      • campaign_name: Mapped and renamed
18. model.amazon_ads.amazon_ads__ad_report
  • Input Column: 30. model.amazon_ads_source.stg_amazon_ads__campaign_history[campaign_name]
    • Direct directly copied to output
    • Output Columns:
      • campaign_name: directly copied
Column Lineage
%3 40. model.amazon_ads_source.stg_amazon_ads__profile 40. model.amazon_ads_source.stg_amazon_ads__profile country_code 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report country_code 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->18. model.amazon_ads.amazon_ads__ad_report:f0 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp country_code 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp:f0->40. model.amazon_ads_source.stg_amazon_ads__profile:f0
40. model.amazon_ads_source.stg_amazon_ads__profile
  • Input Column: 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp[country_code]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • country_code: It is directly mapped
18. model.amazon_ads.amazon_ads__ad_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[country_code]
    • Direct Copied to output
    • Output Columns:
      • country_code: Directly copied
Column Lineage
%3 23. model.amazon_ads.int_amazon_ads__portfolio_history 23. model.amazon_ads.int_amazon_ads__portfolio_history portfolio_id 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report portfolio_id 23. model.amazon_ads.int_amazon_ads__portfolio_history:f0->18. model.amazon_ads.amazon_ads__ad_report:f0 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history portfolio_id 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->23. model.amazon_ads.int_amazon_ads__portfolio_history:f0 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp id 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp:f0->36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0
36. model.amazon_ads_source.stg_amazon_ads__portfolio_history
  • Input Column: 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp[id]
    • Cleaning Cast to TEXT data type
    • Deduplication Used in ROW_NUMBER() window function for identifying the most recent record
    • Output Columns:
      • portfolio_id: Directly mapped after casting to TEXT
23. model.amazon_ads.int_amazon_ads__portfolio_history
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[portfolio_id]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • portfolio_id: Directly copied
18. model.amazon_ads.amazon_ads__ad_report
  • Input Column: 23. model.amazon_ads.int_amazon_ads__portfolio_history[portfolio_id]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the campaigns table
    • Output Columns:
      • portfolio_id: Directly copied to the output
Column Lineage
%3 23. model.amazon_ads.int_amazon_ads__portfolio_history 23. model.amazon_ads.int_amazon_ads__portfolio_history portfolio_name 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report portfolio_name 23. model.amazon_ads.int_amazon_ads__portfolio_history:f0->18. model.amazon_ads.amazon_ads__ad_report:f0 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history portfolio_name 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->23. model.amazon_ads.int_amazon_ads__portfolio_history:f0 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp name 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp:f0->36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0
36. model.amazon_ads_source.stg_amazon_ads__portfolio_history
  • Input Column: 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • portfolio_name: Directly mapped and renamed
23. model.amazon_ads.int_amazon_ads__portfolio_history
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[portfolio_name]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • portfolio_name: Directly copied
18. model.amazon_ads.amazon_ads__ad_report
  • Input Column: 23. model.amazon_ads.int_amazon_ads__portfolio_history[portfolio_name]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the campaigns table
    • Output Columns:
      • portfolio_name: Directly copied to the output
Column Lineage
%3 40. model.amazon_ads_source.stg_amazon_ads__profile 40. model.amazon_ads_source.stg_amazon_ads__profile profile_id 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report profile_id 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->18. model.amazon_ads.amazon_ads__ad_report:f0 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp id 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp:f0->40. model.amazon_ads_source.stg_amazon_ads__profile:f0
40. model.amazon_ads_source.stg_amazon_ads__profile
  • Input Column: 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp[id]
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • profile_id: It is directly mapped after casting to TEXT
18. model.amazon_ads.amazon_ads__ad_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[profile_id]
    • Integration Used to join with campaigns table
    • Direct Copied to output
    • Output Columns:
      • profile_id: Directly copied
Column Lineage
%3 38. model.amazon_ads_source.stg_amazon_ads__product_ad_history 38. model.amazon_ads_source.stg_amazon_ads__product_ad_history serving_status 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report serving_status 38. model.amazon_ads_source.stg_amazon_ads__product_ad_history:f0->18. model.amazon_ads.amazon_ads__ad_report:f0 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp serving_status 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp:f0->38. model.amazon_ads_source.stg_amazon_ads__product_ad_history:f0
38. model.amazon_ads_source.stg_amazon_ads__product_ad_history
  • Input Column: 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp[serving_status]
    • Direct Copied without transformation
    • Output Columns:
      • serving_status: Directly mapped
18. model.amazon_ads.amazon_ads__ad_report
  • Input Column: 38. model.amazon_ads_source.stg_amazon_ads__product_ad_history[serving_status]
    • Direct directly copied to the output
    • Output Columns:
      • serving_status: directly copied
Column Lineage
%3 38. model.amazon_ads_source.stg_amazon_ads__product_ad_history 38. model.amazon_ads_source.stg_amazon_ads__product_ad_history state 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report state 38. model.amazon_ads_source.stg_amazon_ads__product_ad_history:f0->18. model.amazon_ads.amazon_ads__ad_report:f0 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp state 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp:f0->38. model.amazon_ads_source.stg_amazon_ads__product_ad_history:f0
38. model.amazon_ads_source.stg_amazon_ads__product_ad_history
  • Input Column: 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp[state]
    • Direct Copied without transformation
    • Output Columns:
      • state: Directly mapped
18. model.amazon_ads.amazon_ads__ad_report
  • Input Column: 38. model.amazon_ads_source.stg_amazon_ads__product_ad_history[state]
    • Direct directly copied to the output
    • Output Columns:
      • state: directly copied
Column Lineage
%3 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report advertised_asin 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report advertised_asin 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f0->18. model.amazon_ads.amazon_ads__ad_report:f0 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp advertised_asin 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp:f0->28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f0
28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report
  • Input Column: 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp[advertised_asin]
    • Direct The column is directly copied to the output without transformation
    • Output Columns:
      • advertised_asin: Directly mapped without any transformation
18. model.amazon_ads.amazon_ads__ad_report
  • Input Column: 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report[advertised_asin]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • advertised_asin: Directly copied to the output
Column Lineage
%3 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report advertised_sku 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report advertised_sku 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f0->18. model.amazon_ads.amazon_ads__ad_report:f0 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp advertised_sku 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp:f0->28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f0
28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report
  • Input Column: 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp[advertised_sku]
    • Direct The column is directly copied to the output without transformation
    • Output Columns:
      • advertised_sku: Directly mapped without any transformation
18. model.amazon_ads.amazon_ads__ad_report
  • Input Column: 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report[advertised_sku]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • advertised_sku: Directly copied to the output
Column Lineage
%3 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report campaign_budget_amount 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report campaign_budget_amount 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f0->18. model.amazon_ads.amazon_ads__ad_report:f0 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp campaign_budget_amount 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp:f0->28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f0
28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report
  • Input Column: 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp[campaign_budget_amount]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • campaign_budget_amount: Directly mapped
18. model.amazon_ads.amazon_ads__ad_report
  • Input Column: 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report[campaign_budget_amount]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • campaign_budget_amount: Directly copied to the output
Column Lineage
%3 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report campaign_budget_currency_code 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report campaign_budget_currency_code 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f0->18. model.amazon_ads.amazon_ads__ad_report:f0 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp campaign_budget_currency_code 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp:f0->28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f0
28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report
  • Input Column: 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp[campaign_budget_currency_code]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • campaign_budget_currency_code: Directly mapped
18. model.amazon_ads.amazon_ads__ad_report
  • Input Column: 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report[campaign_budget_currency_code]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • campaign_budget_currency_code: Directly copied to the output
Column Lineage
%3 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report campaign_budget_type 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report campaign_budget_type 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f0->18. model.amazon_ads.amazon_ads__ad_report:f0 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp campaign_budget_type 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp:f0->28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f0
28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report
  • Input Column: 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp[campaign_budget_type]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • campaign_budget_type: Directly mapped
18. model.amazon_ads.amazon_ads__ad_report
  • Input Column: 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report[campaign_budget_type]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • campaign_budget_type: Directly copied to the output
Column Lineage
%3 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report clicks 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report clicks 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f0->18. model.amazon_ads.amazon_ads__ad_report:f0 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp clicks 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp:f0->28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f0
28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report
  • Input Column: 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp[clicks]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • clicks: Directly mapped
18. model.amazon_ads.amazon_ads__ad_report
  • Input Column: 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report[clicks]
    • Aggregation The clicks are summed up in the GROUP BY clause
    • Output Columns:
      • clicks: The sum of clicks is directly mapped to the output 'clicks' column
Column Lineage
%3 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report impressions 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report impressions 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f0->18. model.amazon_ads.amazon_ads__ad_report:f0 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp impressions 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp:f0->28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f0
28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report
  • Input Column: 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp[impressions]
    • Cleaning The column is cast to INT data type
    • Direct The column is directly copied to the output after casting
    • Output Columns:
      • impressions: Directly mapped after casting to INT
18. model.amazon_ads.amazon_ads__ad_report
  • Input Column: 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report[impressions]
    • Aggregation The impressions are summed up in the GROUP BY clause
    • Output Columns:
      • impressions: The sum of impressions is directly mapped to the output 'impressions' column
Column Lineage
%3 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report cost 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report cost 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f0->18. model.amazon_ads.amazon_ads__ad_report:f0 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp cost 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp:f0->28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f0
28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report
  • Input Column: 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp[cost]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • cost: Directly mapped
18. model.amazon_ads.amazon_ads__ad_report
  • Input Column: 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report[cost]
    • Aggregation The cost is summed up in the GROUP BY clause
    • Output Columns:
      • cost: The sum of cost is directly mapped to the output 'cost' column
19. model.amazon_ads.amazon_ads__campaign_report

This SQL query integrates data from multiple Amazon Ads-related tables to create a comprehensive campaign report. It joins campaign-level report data with account information, portfolio details, and campaign history. The query then aggregates metrics such as cost, clicks, and impressions at the campaign level, while including various attributes like account name, portfolio name, and campaign details.

IntegrationAggregationFiltering
SQL Query
WITH report AS (
  SELECT
    *
  FROM TEST.PUBLIC_amazon_ads_source.stg_amazon_ads__campaign_level_report
), account_info AS (
  SELECT
    *
  FROM TEST.PUBLIC_amazon_ads_source.stg_amazon_ads__profile
  WHERE
    _fivetran_deleted = FALSE
), portfolios AS (
  SELECT
    *
  FROM TEST.PUBLIC_amazon_ads.int_amazon_ads__portfolio_history
), campaigns AS (
  SELECT
    *
  FROM TEST.PUBLIC_amazon_ads_source.stg_amazon_ads__campaign_history
  WHERE
    is_most_recent_record = TRUE
), fields AS (
  SELECT
    report.source_relation,
    report.date_day,
    account_info.account_name,
    account_info.account_id,
    account_info.country_code,
    account_info.profile_id,
    portfolios.portfolio_name,
    portfolios.portfolio_id,
    campaigns.campaign_name,
    report.campaign_id,
    report.campaign_bidding_strategy,
    report.campaign_budget_amount,
    report.campaign_budget_currency_code,
    report.campaign_budget_type,
    SUM(report.cost) AS cost,
    SUM(report.clicks) AS clicks,
    SUM(report.impressions) AS impressions
  FROM report
  LEFT JOIN campaigns
    ON campaigns.campaign_id = report.campaign_id
    AND campaigns.source_relation = report.source_relation
  LEFT JOIN portfolios
    ON portfolios.portfolio_id = campaigns.portfolio_id
    AND portfolios.source_relation = campaigns.source_relation
  LEFT JOIN account_info
    ON account_info.profile_id = campaigns.profile_id
    AND account_info.source_relation = campaigns.source_relation
  GROUP BY
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10,
    11,
    12,
    13,
    14
)
SELECT
  *
FROM fields
%3 19. model.amazon_ads.amazon_ads__campaign_report 19. model.amazon_ads.amazon_ads__campaign_report source_relation date_day account_id account_name campaign_bidding_strategy campaign_budget_amount campaign_budget_currency_code campaign_budget_type campaign_id campaign_name country_code portfolio_id portfolio_name profile_id clicks impressions cost 23. model.amazon_ads.int_amazon_ads__portfolio_history 23. model.amazon_ads.int_amazon_ads__portfolio_history source_relation portfolio_id portfolio_name 23. model.amazon_ads.int_amazon_ads__portfolio_history:f0->19. model.amazon_ads.amazon_ads__campaign_report:f0 23. model.amazon_ads.int_amazon_ads__portfolio_history:f1->19. model.amazon_ads.amazon_ads__campaign_report:f11 23. model.amazon_ads.int_amazon_ads__portfolio_history:f2->19. model.amazon_ads.amazon_ads__campaign_report:f12 30. model.amazon_ads_source.stg_amazon_ads__campaign_history 30. model.amazon_ads_source.stg_amazon_ads__campaign_history source_relation campaign_id campaign_name 30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0->19. model.amazon_ads.amazon_ads__campaign_report:f0 30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f1->19. model.amazon_ads.amazon_ads__campaign_report:f8 30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f2->19. model.amazon_ads.amazon_ads__campaign_report:f9 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report source_relation date_day campaign_id clicks impressions cost campaign_bidding_strategy campaign_budget_amount campaign_budget_currency_code campaign_budget_type 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0->19. model.amazon_ads.amazon_ads__campaign_report:f0 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f1->19. model.amazon_ads.amazon_ads__campaign_report:f1 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f2->19. model.amazon_ads.amazon_ads__campaign_report:f8 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f3->19. model.amazon_ads.amazon_ads__campaign_report:f14 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f4->19. model.amazon_ads.amazon_ads__campaign_report:f15 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f5->19. model.amazon_ads.amazon_ads__campaign_report:f16 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f6->19. model.amazon_ads.amazon_ads__campaign_report:f4 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f7->19. model.amazon_ads.amazon_ads__campaign_report:f5 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f8->19. model.amazon_ads.amazon_ads__campaign_report:f6 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f9->19. model.amazon_ads.amazon_ads__campaign_report:f7 40. model.amazon_ads_source.stg_amazon_ads__profile 40. model.amazon_ads_source.stg_amazon_ads__profile source_relation profile_id account_id account_name country_code 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->19. model.amazon_ads.amazon_ads__campaign_report:f0 40. model.amazon_ads_source.stg_amazon_ads__profile:f1->19. model.amazon_ads.amazon_ads__campaign_report:f13 40. model.amazon_ads_source.stg_amazon_ads__profile:f2->19. model.amazon_ads.amazon_ads__campaign_report:f2 40. model.amazon_ads_source.stg_amazon_ads__profile:f3->19. model.amazon_ads.amazon_ads__campaign_report:f3 40. model.amazon_ads_source.stg_amazon_ads__profile:f4->19. model.amazon_ads.amazon_ads__campaign_report:f10
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
date_day date The date of the report.
account_id text The ID representing the account.
account_name text The name of the account, if present in the source data.
campaign_bidding_strategy text The bidding strategy associated with a campaign.
campaign_budget_amount double precision Total budget allocated to the campaign.
campaign_budget_currency_code text The currency code associated with the campaign.
campaign_budget_type text One of: daily or lifetime.
campaign_id text The ID representing the campaign, if present in the source data.
campaign_name text The name of the campaign, if present in the source data.
country_code text The code for a given country.
portfolio_id text The ID of the Portfolio.
portfolio_name text The name of the Portfolio.
profile_id text The profile ID associated with your Amazon Ads account. Advertisers who operate in more than one marketplace (for example, Amazon.com, Amazon.co.uk, Amazon.co.jp) will have one profile associated with each marketplace.
clicks bigint The count of clicks.
impressions bigint The count of impressions.
cost double precision Total cost of ad clicks.
Column Lineage
%3 23. model.amazon_ads.int_amazon_ads__portfolio_history 23. model.amazon_ads.int_amazon_ads__portfolio_history source_relation 19. model.amazon_ads.amazon_ads__campaign_report 19. model.amazon_ads.amazon_ads__campaign_report source_relation 23. model.amazon_ads.int_amazon_ads__portfolio_history:f0->19. model.amazon_ads.amazon_ads__campaign_report:f0 30. model.amazon_ads_source.stg_amazon_ads__campaign_history 30. model.amazon_ads_source.stg_amazon_ads__campaign_history source_relation 30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0->19. model.amazon_ads.amazon_ads__campaign_report:f0 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report source_relation 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0->19. model.amazon_ads.amazon_ads__campaign_report:f0 40. model.amazon_ads_source.stg_amazon_ads__profile 40. model.amazon_ads_source.stg_amazon_ads__profile source_relation 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->19. model.amazon_ads.amazon_ads__campaign_report:f0 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history source_relation 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->23. model.amazon_ads.int_amazon_ads__portfolio_history:f0
23. model.amazon_ads.int_amazon_ads__portfolio_history
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[source_relation]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • source_relation: Directly copied
19. model.amazon_ads.amazon_ads__campaign_report
  • Input Column: 23. model.amazon_ads.int_amazon_ads__portfolio_history[source_relation]
    • Integration The column is used as part of the join condition with the campaigns table
    • Output Columns:
      • source_relation: Contributes to the output source_relation column
  • Input Column: 30. model.amazon_ads_source.stg_amazon_ads__campaign_history[source_relation]
    • Integration Used as a key to join with other tables
    • Direct Directly copied to the output
    • Output Columns:
      • source_relation: Directly copied
  • Input Column: 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with other tables
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[source_relation]
    • Integration used as part of the join condition with other tables
    • Output Columns:
      • source_relation: directly copied
Column Lineage
%3 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report date_day 19. model.amazon_ads.amazon_ads__campaign_report 19. model.amazon_ads.amazon_ads__campaign_report date_day 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0->19. model.amazon_ads.amazon_ads__campaign_report:f0 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp date 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp:f0->32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0
32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report
  • Input Column: 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp[date]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • date_day: Directly mapped and renamed
19. model.amazon_ads.amazon_ads__campaign_report
  • Input Column: 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 40. model.amazon_ads_source.stg_amazon_ads__profile 40. model.amazon_ads_source.stg_amazon_ads__profile account_id 19. model.amazon_ads.amazon_ads__campaign_report 19. model.amazon_ads.amazon_ads__campaign_report account_id 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->19. model.amazon_ads.amazon_ads__campaign_report:f0 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp account_id 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp:f0->40. model.amazon_ads_source.stg_amazon_ads__profile:f0
40. model.amazon_ads_source.stg_amazon_ads__profile
  • Input Column: 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp[account_id]
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • account_id: It is directly mapped after casting to TEXT
19. model.amazon_ads.amazon_ads__campaign_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[account_id]
    • Direct directly included in the output
    • Output Columns:
      • account_id: directly copied
Column Lineage
%3 40. model.amazon_ads_source.stg_amazon_ads__profile 40. model.amazon_ads_source.stg_amazon_ads__profile account_name 19. model.amazon_ads.amazon_ads__campaign_report 19. model.amazon_ads.amazon_ads__campaign_report account_name 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->19. model.amazon_ads.amazon_ads__campaign_report:f0 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp account_name 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp:f0->40. model.amazon_ads_source.stg_amazon_ads__profile:f0
40. model.amazon_ads_source.stg_amazon_ads__profile
  • Input Column: 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp[account_name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • account_name: It is directly mapped
19. model.amazon_ads.amazon_ads__campaign_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[account_name]
    • Direct directly included in the output
    • Output Columns:
      • account_name: directly copied
Column Lineage
%3 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report campaign_bidding_strategy 19. model.amazon_ads.amazon_ads__campaign_report 19. model.amazon_ads.amazon_ads__campaign_report campaign_bidding_strategy 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0->19. model.amazon_ads.amazon_ads__campaign_report:f0 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp campaign_bidding_strategy 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp:f0->32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0
32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report
  • Input Column: 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp[campaign_bidding_strategy]
    • Cleaning The column is cast to TEXT in the fields CTE
    • Output Columns:
      • campaign_bidding_strategy: Directly mapped after casting
19. model.amazon_ads.amazon_ads__campaign_report
  • Input Column: 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report[campaign_bidding_strategy]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • campaign_bidding_strategy: Directly copied to the output
Column Lineage
%3 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report campaign_budget_amount 19. model.amazon_ads.amazon_ads__campaign_report 19. model.amazon_ads.amazon_ads__campaign_report campaign_budget_amount 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0->19. model.amazon_ads.amazon_ads__campaign_report:f0 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp campaign_budget_amount 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp:f0->32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0
32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report
  • Input Column: 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp[campaign_budget_amount]
    • Cleaning The column is cast to FLOAT in the fields CTE
    • Output Columns:
      • campaign_budget_amount: Directly mapped after casting
19. model.amazon_ads.amazon_ads__campaign_report
  • Input Column: 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report[campaign_budget_amount]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • campaign_budget_amount: Directly copied to the output
Column Lineage
%3 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report campaign_budget_currency_code 19. model.amazon_ads.amazon_ads__campaign_report 19. model.amazon_ads.amazon_ads__campaign_report campaign_budget_currency_code 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0->19. model.amazon_ads.amazon_ads__campaign_report:f0 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp campaign_budget_currency_code 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp:f0->32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0
32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report
  • Input Column: 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp[campaign_budget_currency_code]
    • Cleaning The column is cast to TEXT in the fields CTE
    • Output Columns:
      • campaign_budget_currency_code: Directly mapped after casting
19. model.amazon_ads.amazon_ads__campaign_report
  • Input Column: 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report[campaign_budget_currency_code]
    • Direct This column is directly copied without any transformation
    • Output Columns:
      • campaign_budget_currency_code: Directly copied to the output
Column Lineage
%3 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report campaign_budget_type 19. model.amazon_ads.amazon_ads__campaign_report 19. model.amazon_ads.amazon_ads__campaign_report campaign_budget_type 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0->19. model.amazon_ads.amazon_ads__campaign_report:f0 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp campaign_budget_type 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp:f0->32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0
32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report
  • Input Column: 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp[campaign_budget_type]
    • Cleaning The column is cast to TEXT in the fields CTE
    • Output Columns:
      • campaign_budget_type: Directly mapped after casting
19. model.amazon_ads.amazon_ads__campaign_report
  • Input Column: 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report[campaign_budget_type]
    • Direct This column is directly copied without any transformation
    • Output Columns:
      • campaign_budget_type: Directly copied to the output
Column Lineage
%3 30. model.amazon_ads_source.stg_amazon_ads__campaign_history 30. model.amazon_ads_source.stg_amazon_ads__campaign_history campaign_id 19. model.amazon_ads.amazon_ads__campaign_report 19. model.amazon_ads.amazon_ads__campaign_report campaign_id 30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0->19. model.amazon_ads.amazon_ads__campaign_report:f0 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report campaign_id 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0->19. model.amazon_ads.amazon_ads__campaign_report:f0 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp id 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp:f0->30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp campaign_id 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp:f0->32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0
30. model.amazon_ads_source.stg_amazon_ads__campaign_history
  • Input Column: 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp[id]
    • Cleaning The column is cast as TEXT
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • campaign_id: Directly mapped after casting to TEXT
32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report
  • Input Column: 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp[campaign_id]
    • Cleaning The column is cast to TEXT in the final CTE
    • Output Columns:
      • campaign_id: Directly mapped after casting to TEXT
19. model.amazon_ads.amazon_ads__campaign_report
  • Input Column: 30. model.amazon_ads_source.stg_amazon_ads__campaign_history[campaign_id]
    • Integration Used as a key to join with the report table
    • Direct Directly copied to the output
    • Output Columns:
      • campaign_id: Directly copied
  • Input Column: 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report[campaign_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as the key to join with the campaigns table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • campaign_id: Directly copied to the output
Column Lineage
%3 30. model.amazon_ads_source.stg_amazon_ads__campaign_history 30. model.amazon_ads_source.stg_amazon_ads__campaign_history campaign_name 19. model.amazon_ads.amazon_ads__campaign_report 19. model.amazon_ads.amazon_ads__campaign_report campaign_name 30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0->19. model.amazon_ads.amazon_ads__campaign_report:f0 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp name 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp:f0->30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0
30. model.amazon_ads_source.stg_amazon_ads__campaign_history
  • Input Column: 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp[name]
    • Direct Copied without transformation
    • Output Columns:
      • campaign_name: Mapped and renamed
19. model.amazon_ads.amazon_ads__campaign_report
  • Input Column: 30. model.amazon_ads_source.stg_amazon_ads__campaign_history[campaign_name]
    • Direct Directly copied to the output
    • Output Columns:
      • campaign_name: Directly copied
Column Lineage
%3 40. model.amazon_ads_source.stg_amazon_ads__profile 40. model.amazon_ads_source.stg_amazon_ads__profile country_code 19. model.amazon_ads.amazon_ads__campaign_report 19. model.amazon_ads.amazon_ads__campaign_report country_code 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->19. model.amazon_ads.amazon_ads__campaign_report:f0 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp country_code 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp:f0->40. model.amazon_ads_source.stg_amazon_ads__profile:f0
40. model.amazon_ads_source.stg_amazon_ads__profile
  • Input Column: 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp[country_code]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • country_code: It is directly mapped
19. model.amazon_ads.amazon_ads__campaign_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[country_code]
    • Direct directly included in the output
    • Output Columns:
      • country_code: directly copied
Column Lineage
%3 23. model.amazon_ads.int_amazon_ads__portfolio_history 23. model.amazon_ads.int_amazon_ads__portfolio_history portfolio_id 19. model.amazon_ads.amazon_ads__campaign_report 19. model.amazon_ads.amazon_ads__campaign_report portfolio_id 23. model.amazon_ads.int_amazon_ads__portfolio_history:f0->19. model.amazon_ads.amazon_ads__campaign_report:f0 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history portfolio_id 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->23. model.amazon_ads.int_amazon_ads__portfolio_history:f0 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp id 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp:f0->36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0
36. model.amazon_ads_source.stg_amazon_ads__portfolio_history
  • Input Column: 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp[id]
    • Cleaning Cast to TEXT data type
    • Deduplication Used in ROW_NUMBER() window function for identifying the most recent record
    • Output Columns:
      • portfolio_id: Directly mapped after casting to TEXT
23. model.amazon_ads.int_amazon_ads__portfolio_history
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[portfolio_id]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • portfolio_id: Directly copied
19. model.amazon_ads.amazon_ads__campaign_report
  • Input Column: 23. model.amazon_ads.int_amazon_ads__portfolio_history[portfolio_id]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the campaigns table
    • Output Columns:
      • portfolio_id: Directly copied to the output
Column Lineage
%3 23. model.amazon_ads.int_amazon_ads__portfolio_history 23. model.amazon_ads.int_amazon_ads__portfolio_history portfolio_name 19. model.amazon_ads.amazon_ads__campaign_report 19. model.amazon_ads.amazon_ads__campaign_report portfolio_name 23. model.amazon_ads.int_amazon_ads__portfolio_history:f0->19. model.amazon_ads.amazon_ads__campaign_report:f0 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history portfolio_name 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->23. model.amazon_ads.int_amazon_ads__portfolio_history:f0 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp name 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp:f0->36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0
36. model.amazon_ads_source.stg_amazon_ads__portfolio_history
  • Input Column: 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • portfolio_name: Directly mapped and renamed
23. model.amazon_ads.int_amazon_ads__portfolio_history
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[portfolio_name]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • portfolio_name: Directly copied
19. model.amazon_ads.amazon_ads__campaign_report
  • Input Column: 23. model.amazon_ads.int_amazon_ads__portfolio_history[portfolio_name]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the campaigns table
    • Output Columns:
      • portfolio_name: Directly copied to the output
Column Lineage
%3 40. model.amazon_ads_source.stg_amazon_ads__profile 40. model.amazon_ads_source.stg_amazon_ads__profile profile_id 19. model.amazon_ads.amazon_ads__campaign_report 19. model.amazon_ads.amazon_ads__campaign_report profile_id 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->19. model.amazon_ads.amazon_ads__campaign_report:f0 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp id 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp:f0->40. model.amazon_ads_source.stg_amazon_ads__profile:f0
40. model.amazon_ads_source.stg_amazon_ads__profile
  • Input Column: 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp[id]
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • profile_id: It is directly mapped after casting to TEXT
19. model.amazon_ads.amazon_ads__campaign_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[profile_id]
    • Integration used as the key to join with other tables
    • Direct directly included in the output
    • Output Columns:
      • profile_id: directly copied
Column Lineage
%3 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report clicks 19. model.amazon_ads.amazon_ads__campaign_report 19. model.amazon_ads.amazon_ads__campaign_report clicks 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0->19. model.amazon_ads.amazon_ads__campaign_report:f0 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp clicks 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp:f0->32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0
32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report
  • Input Column: 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp[clicks]
    • Cleaning The column is cast to INT in the fields CTE
    • Output Columns:
      • clicks: Directly mapped after casting
19. model.amazon_ads.amazon_ads__campaign_report
  • Input Column: 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report[clicks]
    • Aggregation The column is summed up in the SELECT clause
    • Output Columns:
      • clicks: Aggregated sum in the output
Column Lineage
%3 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report impressions 19. model.amazon_ads.amazon_ads__campaign_report 19. model.amazon_ads.amazon_ads__campaign_report impressions 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0->19. model.amazon_ads.amazon_ads__campaign_report:f0 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp impressions 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp:f0->32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0
32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report
  • Input Column: 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp[impressions]
    • Cleaning The column is cast to INT data type
    • Direct The column is directly copied to the output after casting
    • Output Columns:
      • impressions: Directly mapped after casting to INT
19. model.amazon_ads.amazon_ads__campaign_report
  • Input Column: 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report[impressions]
    • Aggregation The column is summed up in the SELECT clause
    • Output Columns:
      • impressions: Aggregated sum in the output
Column Lineage
%3 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report cost 19. model.amazon_ads.amazon_ads__campaign_report 19. model.amazon_ads.amazon_ads__campaign_report cost 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0->19. model.amazon_ads.amazon_ads__campaign_report:f0 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp cost 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp:f0->32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0
32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report
  • Input Column: 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp[cost]
    • Cleaning The column is cast to FLOAT data type
    • Direct The column is directly copied to the output after casting
    • Output Columns:
      • cost: Directly mapped after casting to FLOAT
19. model.amazon_ads.amazon_ads__campaign_report
  • Input Column: 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report[cost]
    • Aggregation The column is summed up in the SELECT clause
    • Output Columns:
      • cost: Aggregated sum in the output
20. model.amazon_ads.amazon_ads__keyword_report

This SQL query integrates data from multiple Amazon Ads-related tables to create a comprehensive keyword report. It joins information from targeting keyword reports, account profiles, portfolios, campaigns, ad groups, and keyword history. The query filters for the most recent records in some tables, combines relevant fields from all sources, and aggregates cost, clicks, and impressions data. The result is a detailed view of keyword performance across various organizational levels (account, portfolio, campaign, ad group) with associated metadata.

FilteringIntegrationAggregation
SQL Query
WITH report AS (
  SELECT
    *
  FROM TEST.PUBLIC_amazon_ads_source.stg_amazon_ads__targeting_keyword_report
), account_info AS (
  SELECT
    *
  FROM TEST.PUBLIC_amazon_ads_source.stg_amazon_ads__profile
  WHERE
    _fivetran_deleted = FALSE
), portfolios AS (
  SELECT
    *
  FROM TEST.PUBLIC_amazon_ads.int_amazon_ads__portfolio_history
), campaigns AS (
  SELECT
    *
  FROM TEST.PUBLIC_amazon_ads_source.stg_amazon_ads__campaign_history
  WHERE
    is_most_recent_record = TRUE
), ad_groups AS (
  SELECT
    *
  FROM TEST.PUBLIC_amazon_ads_source.stg_amazon_ads__ad_group_history
  WHERE
    is_most_recent_record = TRUE
), keywords AS (
  SELECT
    *
  FROM TEST.PUBLIC_amazon_ads_source.stg_amazon_ads__keyword_history
  WHERE
    is_most_recent_record = TRUE
), fields AS (
  SELECT
    report.source_relation,
    report.date_day,
    account_info.account_name,
    account_info.account_id,
    account_info.country_code,
    account_info.profile_id,
    portfolios.portfolio_name,
    portfolios.portfolio_id,
    campaigns.campaign_name,
    report.campaign_id,
    ad_groups.ad_group_name,
    report.ad_group_id,
    report.keyword_id,
    keywords.keyword_text,
    keywords.serving_status,
    keywords.state,
    report.keyword_bid,
    report.keyword_type,
    report.match_type,
    SUM(report.cost) AS cost,
    SUM(report.clicks) AS clicks,
    SUM(report.impressions) AS impressions
  FROM report
  LEFT JOIN keywords
    ON keywords.keyword_id = report.keyword_id
    AND keywords.source_relation = report.source_relation
  LEFT JOIN ad_groups
    ON ad_groups.ad_group_id = report.ad_group_id
    AND ad_groups.source_relation = report.source_relation
  LEFT JOIN campaigns
    ON campaigns.campaign_id = report.campaign_id
    AND campaigns.source_relation = report.source_relation
  LEFT JOIN portfolios
    ON portfolios.portfolio_id = campaigns.portfolio_id
    AND portfolios.source_relation = campaigns.source_relation
  LEFT JOIN account_info
    ON account_info.profile_id = campaigns.profile_id
    AND account_info.source_relation = campaigns.source_relation
  GROUP BY
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10,
    11,
    12,
    13,
    14,
    15,
    16,
    17,
    18,
    19
)
SELECT
  *
FROM fields
%3 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report source_relation date_day account_id account_name ad_group_id ad_group_name campaign_id campaign_name country_code keyword_bid keyword_id keyword_text keyword_type match_type portfolio_id portfolio_name profile_id serving_status state clicks impressions cost 23. model.amazon_ads.int_amazon_ads__portfolio_history 23. model.amazon_ads.int_amazon_ads__portfolio_history source_relation portfolio_id portfolio_name 23. model.amazon_ads.int_amazon_ads__portfolio_history:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0 23. model.amazon_ads.int_amazon_ads__portfolio_history:f1->20. model.amazon_ads.amazon_ads__keyword_report:f14 23. model.amazon_ads.int_amazon_ads__portfolio_history:f2->20. model.amazon_ads.amazon_ads__keyword_report:f15 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history ad_group_id ad_group_name 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f0->20. model.amazon_ads.amazon_ads__keyword_report:f4 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f1->20. model.amazon_ads.amazon_ads__keyword_report:f5 30. model.amazon_ads_source.stg_amazon_ads__campaign_history 30. model.amazon_ads_source.stg_amazon_ads__campaign_history source_relation campaign_id campaign_name profile_id 30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0 30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f1->20. model.amazon_ads.amazon_ads__keyword_report:f6 30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f2->20. model.amazon_ads.amazon_ads__keyword_report:f7 30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f3->20. model.amazon_ads.amazon_ads__keyword_report:f16 34. model.amazon_ads_source.stg_amazon_ads__keyword_history 34. model.amazon_ads_source.stg_amazon_ads__keyword_history source_relation keyword_id keyword_text serving_status state 34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0 34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f1->20. model.amazon_ads.amazon_ads__keyword_report:f10 34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f2->20. model.amazon_ads.amazon_ads__keyword_report:f11 34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f3->20. model.amazon_ads.amazon_ads__keyword_report:f17 34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f4->20. model.amazon_ads.amazon_ads__keyword_report:f18 40. model.amazon_ads_source.stg_amazon_ads__profile 40. model.amazon_ads_source.stg_amazon_ads__profile source_relation profile_id account_id account_name country_code 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0 40. model.amazon_ads_source.stg_amazon_ads__profile:f1->20. model.amazon_ads.amazon_ads__keyword_report:f16 40. model.amazon_ads_source.stg_amazon_ads__profile:f2->20. model.amazon_ads.amazon_ads__keyword_report:f2 40. model.amazon_ads_source.stg_amazon_ads__profile:f3->20. model.amazon_ads.amazon_ads__keyword_report:f3 40. model.amazon_ads_source.stg_amazon_ads__profile:f4->20. model.amazon_ads.amazon_ads__keyword_report:f8 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report source_relation date_day ad_group_id campaign_id keyword_bid keyword_id clicks impressions cost keyword_type match_type 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f1->20. model.amazon_ads.amazon_ads__keyword_report:f1 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f2->20. model.amazon_ads.amazon_ads__keyword_report:f4 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f3->20. model.amazon_ads.amazon_ads__keyword_report:f6 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f4->20. model.amazon_ads.amazon_ads__keyword_report:f9 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f5->20. model.amazon_ads.amazon_ads__keyword_report:f10 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f6->20. model.amazon_ads.amazon_ads__keyword_report:f19 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f7->20. model.amazon_ads.amazon_ads__keyword_report:f20 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f8->20. model.amazon_ads.amazon_ads__keyword_report:f21 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f9->20. model.amazon_ads.amazon_ads__keyword_report:f12 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f10->20. model.amazon_ads.amazon_ads__keyword_report:f13
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
date_day date The date of the report.
account_id text The ID representing the account.
account_name text The name of the account, if present in the source data.
ad_group_id text The ID representing the ad group, if present in the source data.
ad_group_name text The name of the ad group, if present in the source data.
campaign_id text The ID representing the campaign, if present in the source data.
campaign_name text The name of the campaign, if present in the source data.
country_code text The code for a given country.
keyword_bid double precision Bid associated with a keyword or targeting expression.
keyword_id text The ID representing the keyword, if present in the source data.
keyword_text text The keyword text.
keyword_type text Type of matching for the keyword used in bid. One of: BROAD, PHRASE, or EXACT.
match_type text Type of matching for the keyword used in bid. One of: BROAD, PHRASE, or EXACT.
portfolio_id text The ID of the Portfolio.
portfolio_name text The name of the Portfolio.
profile_id text The profile ID associated with your Amazon Ads account. Advertisers who operate in more than one marketplace (for example, Amazon.com, Amazon.co.uk, Amazon.co.jp) will have one profile associated with each marketplace.
serving_status text The current serving status of the record.
state text The state of the record (enabled, paused, or archived).
clicks bigint The count of clicks.
impressions bigint The count of impressions.
cost double precision Total cost of ad clicks.
Column Lineage
%3 23. model.amazon_ads.int_amazon_ads__portfolio_history 23. model.amazon_ads.int_amazon_ads__portfolio_history source_relation 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report source_relation 23. model.amazon_ads.int_amazon_ads__portfolio_history:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0 30. model.amazon_ads_source.stg_amazon_ads__campaign_history 30. model.amazon_ads_source.stg_amazon_ads__campaign_history source_relation 30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0 34. model.amazon_ads_source.stg_amazon_ads__keyword_history 34. model.amazon_ads_source.stg_amazon_ads__keyword_history source_relation 34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0 40. model.amazon_ads_source.stg_amazon_ads__profile 40. model.amazon_ads_source.stg_amazon_ads__profile source_relation 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report source_relation 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history source_relation 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->23. model.amazon_ads.int_amazon_ads__portfolio_history:f0
23. model.amazon_ads.int_amazon_ads__portfolio_history
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[source_relation]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • source_relation: Directly copied
20. model.amazon_ads.amazon_ads__keyword_report
  • Input Column: 23. model.amazon_ads.int_amazon_ads__portfolio_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 30. model.amazon_ads_source.stg_amazon_ads__campaign_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 34. model.amazon_ads_source.stg_amazon_ads__keyword_history[source_relation]
    • Integration used as a key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[source_relation]
    • Integration used as part of the join condition with other tables
    • Output Columns:
      • source_relation: directly copied to output
  • Input Column: 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with other tables
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
Column Lineage
%3 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report date_day 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report date_day 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp date 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp:f0->44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f0
44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report
  • Input Column: 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp[date]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • date_day: Renamed from 'date' to 'date_day'
20. model.amazon_ads.amazon_ads__keyword_report
  • Input Column: 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 40. model.amazon_ads_source.stg_amazon_ads__profile 40. model.amazon_ads_source.stg_amazon_ads__profile account_id 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report account_id 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp account_id 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp:f0->40. model.amazon_ads_source.stg_amazon_ads__profile:f0
40. model.amazon_ads_source.stg_amazon_ads__profile
  • Input Column: 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp[account_id]
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • account_id: It is directly mapped after casting to TEXT
20. model.amazon_ads.amazon_ads__keyword_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[account_id]
    • Direct copied to output
    • Output Columns:
      • account_id: directly copied to output
Column Lineage
%3 40. model.amazon_ads_source.stg_amazon_ads__profile 40. model.amazon_ads_source.stg_amazon_ads__profile account_name 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report account_name 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp account_name 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp:f0->40. model.amazon_ads_source.stg_amazon_ads__profile:f0
40. model.amazon_ads_source.stg_amazon_ads__profile
  • Input Column: 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp[account_name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • account_name: It is directly mapped
20. model.amazon_ads.amazon_ads__keyword_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[account_name]
    • Direct copied to output
    • Output Columns:
      • account_name: directly copied to output
Column Lineage
%3 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history ad_group_id 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report ad_group_id 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report ad_group_id 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp id 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp:f0->24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f0 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp ad_group_id 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp:f0->44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f0
24. model.amazon_ads_source.stg_amazon_ads__ad_group_history
  • Input Column: 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp[id]
    • Cleaning Cast to TEXT type
    • Deduplication Used in ROW_NUMBER() window function for deduplication
    • Output Columns:
      • ad_group_id: Directly mapped after casting to TEXT
44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report
  • Input Column: 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp[ad_group_id]
    • Cleaning The column is cast to TEXT data type
    • Output Columns:
      • ad_group_id: Directly mapped after casting to TEXT
20. model.amazon_ads.amazon_ads__keyword_report
  • Input Column: 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history[ad_group_id]
    • Integration used as the key to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_id: directly copied
  • Input Column: 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report[ad_group_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with the ad_groups table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • ad_group_id: Directly copied to the output
Column Lineage
%3 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history ad_group_name 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report ad_group_name 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp name 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp:f0->24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f0
24. model.amazon_ads_source.stg_amazon_ads__ad_group_history
  • Input Column: 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp[name]
    • Cleaning Cast to TEXT type
    • Output Columns:
      • ad_group_name: Directly mapped after casting to TEXT
20. model.amazon_ads.amazon_ads__keyword_report
  • Input Column: 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history[ad_group_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_name: directly copied
Column Lineage
%3 30. model.amazon_ads_source.stg_amazon_ads__campaign_history 30. model.amazon_ads_source.stg_amazon_ads__campaign_history campaign_id 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report campaign_id 30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report campaign_id 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp id 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp:f0->30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp campaign_id 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp:f0->44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f0
30. model.amazon_ads_source.stg_amazon_ads__campaign_history
  • Input Column: 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp[id]
    • Cleaning The column is cast as TEXT
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • campaign_id: Directly mapped after casting to TEXT
44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report
  • Input Column: 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp[campaign_id]
    • Cleaning The column is cast to TEXT data type
    • Output Columns:
      • campaign_id: Directly mapped after casting to TEXT
20. model.amazon_ads.amazon_ads__keyword_report
  • Input Column: 30. model.amazon_ads_source.stg_amazon_ads__campaign_history[campaign_id]
    • Integration used as the key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
  • Input Column: 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report[campaign_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with the campaigns table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • campaign_id: Directly copied to the output
Column Lineage
%3 30. model.amazon_ads_source.stg_amazon_ads__campaign_history 30. model.amazon_ads_source.stg_amazon_ads__campaign_history campaign_name 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report campaign_name 30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp name 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp:f0->30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0
30. model.amazon_ads_source.stg_amazon_ads__campaign_history
  • Input Column: 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp[name]
    • Direct Copied without transformation
    • Output Columns:
      • campaign_name: Mapped and renamed
20. model.amazon_ads.amazon_ads__keyword_report
  • Input Column: 30. model.amazon_ads_source.stg_amazon_ads__campaign_history[campaign_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_name: directly copied
Column Lineage
%3 40. model.amazon_ads_source.stg_amazon_ads__profile 40. model.amazon_ads_source.stg_amazon_ads__profile country_code 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report country_code 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp country_code 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp:f0->40. model.amazon_ads_source.stg_amazon_ads__profile:f0
40. model.amazon_ads_source.stg_amazon_ads__profile
  • Input Column: 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp[country_code]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • country_code: It is directly mapped
20. model.amazon_ads.amazon_ads__keyword_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[country_code]
    • Direct copied to output
    • Output Columns:
      • country_code: directly copied to output
Column Lineage
%3 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report keyword_bid 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report keyword_bid 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp keyword_bid 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp:f0->44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f0
44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report
  • Input Column: 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp[keyword_bid]
    • Direct The keyword_bid column is directly copied without any transformation
    • Cleaning The column is cast as FLOAT in the fields CTE
    • Output Columns:
      • keyword_bid: Directly mapped to the output 'keyword_bid' column
20. model.amazon_ads.amazon_ads__keyword_report
  • Input Column: 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report[keyword_bid]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • keyword_bid: Directly copied to the output
Column Lineage
%3 34. model.amazon_ads_source.stg_amazon_ads__keyword_history 34. model.amazon_ads_source.stg_amazon_ads__keyword_history keyword_id 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report keyword_id 34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report keyword_id 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp id 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp:f0->34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f0 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp keyword_id 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp:f0->44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f0
34. model.amazon_ads_source.stg_amazon_ads__keyword_history
  • Input Column: 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp[id]
    • Cleaning The column is cast as TEXT
    • Deduplication Used in the ROW_NUMBER() window function to identify the most recent record
    • Output Columns:
      • keyword_id: Directly mapped after casting to TEXT
44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report
  • Input Column: 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp[keyword_id]
    • Cleaning The column is cast to TEXT data type
    • Output Columns:
      • keyword_id: Directly mapped after casting to TEXT
20. model.amazon_ads.amazon_ads__keyword_report
  • Input Column: 34. model.amazon_ads_source.stg_amazon_ads__keyword_history[keyword_id]
    • Integration used as a key to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • keyword_id: directly copied
  • Input Column: 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report[keyword_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with the keywords table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • keyword_id: Directly copied to the output
Column Lineage
%3 34. model.amazon_ads_source.stg_amazon_ads__keyword_history 34. model.amazon_ads_source.stg_amazon_ads__keyword_history keyword_text 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report keyword_text 34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp keyword_text 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp:f0->34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f0
34. model.amazon_ads_source.stg_amazon_ads__keyword_history
  • Input Column: 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp[keyword_text]
    • Cleaning Cast as TEXT
    • Output Columns:
      • keyword_text: Directly mapped after casting
20. model.amazon_ads.amazon_ads__keyword_report
  • Input Column: 34. model.amazon_ads_source.stg_amazon_ads__keyword_history[keyword_text]
    • Direct directly copied to the output
    • Output Columns:
      • keyword_text: directly copied
Column Lineage
%3 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report keyword_type 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report keyword_type 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp keyword_type 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp:f0->44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f0
44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report
  • Input Column: 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp[keyword_type]
    • Direct The keyword_type column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • keyword_type: Directly mapped to the output 'keyword_type' column
20. model.amazon_ads.amazon_ads__keyword_report
  • Input Column: 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report[keyword_type]
    • Direct The keyword_type is directly selected without transformation
    • Output Columns:
      • keyword_type: Directly copied
Column Lineage
%3 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report match_type 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report match_type 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp match_type 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp:f0->44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f0
44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report
  • Input Column: 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp[match_type]
    • Direct The match_type column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • match_type: Directly mapped to the output 'match_type' column
20. model.amazon_ads.amazon_ads__keyword_report
  • Input Column: 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report[match_type]
    • Direct The match_type is directly selected without transformation
    • Output Columns:
      • match_type: Directly copied
Column Lineage
%3 23. model.amazon_ads.int_amazon_ads__portfolio_history 23. model.amazon_ads.int_amazon_ads__portfolio_history portfolio_id 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report portfolio_id 23. model.amazon_ads.int_amazon_ads__portfolio_history:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history portfolio_id 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->23. model.amazon_ads.int_amazon_ads__portfolio_history:f0 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp id 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp:f0->36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0
36. model.amazon_ads_source.stg_amazon_ads__portfolio_history
  • Input Column: 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp[id]
    • Cleaning Cast to TEXT data type
    • Deduplication Used in ROW_NUMBER() window function for identifying the most recent record
    • Output Columns:
      • portfolio_id: Directly mapped after casting to TEXT
23. model.amazon_ads.int_amazon_ads__portfolio_history
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[portfolio_id]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • portfolio_id: Directly copied
20. model.amazon_ads.amazon_ads__keyword_report
  • Input Column: 23. model.amazon_ads.int_amazon_ads__portfolio_history[portfolio_id]
    • Integration used as part of the join condition with the campaigns table
    • Direct directly copied to the output
    • Output Columns:
      • portfolio_id: directly copied
Column Lineage
%3 23. model.amazon_ads.int_amazon_ads__portfolio_history 23. model.amazon_ads.int_amazon_ads__portfolio_history portfolio_name 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report portfolio_name 23. model.amazon_ads.int_amazon_ads__portfolio_history:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history portfolio_name 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->23. model.amazon_ads.int_amazon_ads__portfolio_history:f0 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp name 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp:f0->36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0
36. model.amazon_ads_source.stg_amazon_ads__portfolio_history
  • Input Column: 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • portfolio_name: Directly mapped and renamed
23. model.amazon_ads.int_amazon_ads__portfolio_history
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[portfolio_name]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • portfolio_name: Directly copied
20. model.amazon_ads.amazon_ads__keyword_report
  • Input Column: 23. model.amazon_ads.int_amazon_ads__portfolio_history[portfolio_name]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the campaigns table
    • Output Columns:
      • portfolio_name: Directly copied to the output
Column Lineage
%3 30. model.amazon_ads_source.stg_amazon_ads__campaign_history 30. model.amazon_ads_source.stg_amazon_ads__campaign_history profile_id 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report profile_id 30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0 40. model.amazon_ads_source.stg_amazon_ads__profile 40. model.amazon_ads_source.stg_amazon_ads__profile profile_id 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp profile_id 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp:f0->30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp id 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp:f0->40. model.amazon_ads_source.stg_amazon_ads__profile:f0
30. model.amazon_ads_source.stg_amazon_ads__campaign_history
  • Input Column: 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp[profile_id]
    • Cleaning Cast as TEXT
    • Output Columns:
      • profile_id: Mapped after casting to TEXT
40. model.amazon_ads_source.stg_amazon_ads__profile
  • Input Column: 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp[id]
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • profile_id: It is directly mapped after casting to TEXT
20. model.amazon_ads.amazon_ads__keyword_report
  • Input Column: 30. model.amazon_ads_source.stg_amazon_ads__campaign_history[profile_id]
    • Integration Used as a key to join with the account_info table
    • Output Columns:
      • profile_id: Directly copied to the output
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[profile_id]
    • Integration used as part of the join condition with campaigns table
    • Direct copied to output
    • Output Columns:
      • profile_id: directly copied to output
Column Lineage
%3 34. model.amazon_ads_source.stg_amazon_ads__keyword_history 34. model.amazon_ads_source.stg_amazon_ads__keyword_history serving_status 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report serving_status 34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp serving_status 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp:f0->34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f0
34. model.amazon_ads_source.stg_amazon_ads__keyword_history
  • Input Column: 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp[serving_status]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • serving_status: Directly copied after casting to TEXT
20. model.amazon_ads.amazon_ads__keyword_report
  • Input Column: 34. model.amazon_ads_source.stg_amazon_ads__keyword_history[serving_status]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • serving_status: Directly copied to the output
Column Lineage
%3 34. model.amazon_ads_source.stg_amazon_ads__keyword_history 34. model.amazon_ads_source.stg_amazon_ads__keyword_history state 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report state 34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp state 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp:f0->34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f0
34. model.amazon_ads_source.stg_amazon_ads__keyword_history
  • Input Column: 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp[state]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • state: Directly copied after casting to TEXT
20. model.amazon_ads.amazon_ads__keyword_report
  • Input Column: 34. model.amazon_ads_source.stg_amazon_ads__keyword_history[state]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • state: Directly copied to the output
Column Lineage
%3 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report clicks 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report clicks 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp clicks 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp:f0->44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f0
44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report
  • Input Column: 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp[clicks]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • clicks: Directly mapped without changes
20. model.amazon_ads.amazon_ads__keyword_report
  • Input Column: 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report[clicks]
    • Aggregation The clicks are summed up in the GROUP BY clause
    • Output Columns:
      • clicks: Directly mapped after aggregation
Column Lineage
%3 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report impressions 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report impressions 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp impressions 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp:f0->44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f0
44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report
  • Input Column: 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp[impressions]
    • Direct The impressions column is directly copied without any transformation
    • Cleaning The column is cast as INT in the fields CTE
    • Output Columns:
      • impressions: Directly mapped to the output 'impressions' column
20. model.amazon_ads.amazon_ads__keyword_report
  • Input Column: 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report[impressions]
    • Aggregation The impressions are summed up in the GROUP BY clause
    • Output Columns:
      • impressions: Directly mapped after aggregation
Column Lineage
%3 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report cost 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report cost 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp cost 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp:f0->44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f0
44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report
  • Input Column: 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp[cost]
    • Direct The cost column is directly copied without any transformation
    • Cleaning The column is cast as FLOAT in the fields CTE
    • Output Columns:
      • cost: Directly mapped to the output 'cost' column
20. model.amazon_ads.amazon_ads__keyword_report
  • Input Column: 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report[cost]
    • Aggregation The cost is summed up in the GROUP BY clause
    • Output Columns:
      • cost: Directly mapped after aggregation
21. model.amazon_ads.amazon_ads__portfolio_report

This SQL query combines data from multiple Amazon Ads-related tables to create a comprehensive portfolio report. It joins information from campaign reports, account profiles, portfolio history, and campaign history. The query filters for the most recent records in portfolio and campaign history, and aggregates cost, clicks, and impressions data at the portfolio level. The result provides a detailed view of portfolio performance including budget information, serving status, and associated account details.

FilteringIntegrationAggregation
SQL Query
WITH report AS (
  SELECT
    *
  /* use campaign report since portfolio report not provided */
  FROM TEST.PUBLIC_amazon_ads_source.stg_amazon_ads__campaign_level_report
), account_info AS (
  SELECT
    *
  FROM TEST.PUBLIC_amazon_ads_source.stg_amazon_ads__profile
  WHERE
    _fivetran_deleted = FALSE
), portfolios AS (
  SELECT
    *
  FROM TEST.PUBLIC_amazon_ads_source.stg_amazon_ads__portfolio_history
  WHERE
    is_most_recent_record = TRUE
), campaigns AS (
  SELECT
    *
  FROM TEST.PUBLIC_amazon_ads_source.stg_amazon_ads__campaign_history
  WHERE
    is_most_recent_record = TRUE
), fields AS (
  SELECT
    report.source_relation,
    report.date_day,
    account_info.account_name,
    account_info.account_id,
    account_info.country_code,
    account_info.profile_id,
    portfolios.portfolio_name,
    portfolios.portfolio_id,
    portfolios.budget_amount,
    portfolios.budget_currency_code,
    portfolios.budget_start_date,
    portfolios.budget_end_date,
    portfolios.budget_policy,
    portfolios.in_budget,
    portfolios.serving_status,
    portfolios.state,
    SUM(report.cost) AS cost,
    SUM(report.clicks) AS clicks,
    SUM(report.impressions) AS impressions
  /* use campaign report since portfolio report not provided */
  FROM portfolios
  LEFT JOIN campaigns
    ON campaigns.portfolio_id = portfolios.portfolio_id
    AND campaigns.source_relation = portfolios.source_relation
  LEFT JOIN account_info
    ON account_info.profile_id = campaigns.profile_id
    AND account_info.source_relation = campaigns.source_relation
  LEFT JOIN report
    ON report.campaign_id = campaigns.campaign_id
    AND report.source_relation = campaigns.source_relation
  GROUP BY
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10,
    11,
    12,
    13,
    14,
    15,
    16
)
SELECT
  *
FROM fields
%3 21. model.amazon_ads.amazon_ads__portfolio_report 21. model.amazon_ads.amazon_ads__portfolio_report source_relation date_day account_id account_name budget_amount budget_currency_code budget_end_date budget_start_date budget_policy country_code in_budget portfolio_id portfolio_name profile_id serving_status state clicks impressions cost 30. model.amazon_ads_source.stg_amazon_ads__campaign_history 30. model.amazon_ads_source.stg_amazon_ads__campaign_history source_relation portfolio_id 30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0->21. model.amazon_ads.amazon_ads__portfolio_report:f0 30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f1->21. model.amazon_ads.amazon_ads__portfolio_report:f11 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report source_relation date_day clicks impressions cost 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0->21. model.amazon_ads.amazon_ads__portfolio_report:f0 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f1->21. model.amazon_ads.amazon_ads__portfolio_report:f1 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f2->21. model.amazon_ads.amazon_ads__portfolio_report:f16 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f3->21. model.amazon_ads.amazon_ads__portfolio_report:f17 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f4->21. model.amazon_ads.amazon_ads__portfolio_report:f18 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history source_relation portfolio_id portfolio_name budget_amount budget_currency_code budget_end_date budget_start_date budget_policy in_budget serving_status state 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->21. model.amazon_ads.amazon_ads__portfolio_report:f0 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f1->21. model.amazon_ads.amazon_ads__portfolio_report:f11 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f2->21. model.amazon_ads.amazon_ads__portfolio_report:f12 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f3->21. model.amazon_ads.amazon_ads__portfolio_report:f4 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f4->21. model.amazon_ads.amazon_ads__portfolio_report:f5 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f5->21. model.amazon_ads.amazon_ads__portfolio_report:f6 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f6->21. model.amazon_ads.amazon_ads__portfolio_report:f7 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f7->21. model.amazon_ads.amazon_ads__portfolio_report:f8 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f8->21. model.amazon_ads.amazon_ads__portfolio_report:f10 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f9->21. model.amazon_ads.amazon_ads__portfolio_report:f14 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f10->21. model.amazon_ads.amazon_ads__portfolio_report:f15 40. model.amazon_ads_source.stg_amazon_ads__profile 40. model.amazon_ads_source.stg_amazon_ads__profile source_relation profile_id account_id account_name country_code currency_code 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->21. model.amazon_ads.amazon_ads__portfolio_report:f0 40. model.amazon_ads_source.stg_amazon_ads__profile:f1->21. model.amazon_ads.amazon_ads__portfolio_report:f13 40. model.amazon_ads_source.stg_amazon_ads__profile:f2->21. model.amazon_ads.amazon_ads__portfolio_report:f2 40. model.amazon_ads_source.stg_amazon_ads__profile:f3->21. model.amazon_ads.amazon_ads__portfolio_report:f3 40. model.amazon_ads_source.stg_amazon_ads__profile:f4->21. model.amazon_ads.amazon_ads__portfolio_report:f9 40. model.amazon_ads_source.stg_amazon_ads__profile:f5->21. model.amazon_ads.amazon_ads__portfolio_report:f5
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
date_day date The date of the report.
account_id text The ID representing the account.
account_name text The name of the account, if present in the source data.
budget_amount integer The budget amount associated with the portfolio. Cannot be null.
budget_currency_code integer The currency used for all monetary values for entities under this profile. Cannot be null.
budget_end_date integer The end date after which the budget is no longer applied. Optional if policy is set to dateRange or monthlyRecurring.
budget_start_date integer The starting date in YYYYMMDD format to which the budget is applied. Required if policy is set to dateRange. Not specified if policy is set to monthlyRecurring. Note that the starting date for monthlyRecurring is the date when the policy is set.
budget_policy integer The budget policy. Set to dateRange to specify a budget for a specific period of time. Set to monthlyRecurring to specify a budget that is automatically renewed at the beginning of each month. Cannot be null.
country_code text The code for a given country.
in_budget boolean Indicates the current budget status of the portfolio. Set to true if the portfolio is in budget, set to false if the portfolio is out of budget.
portfolio_id text The ID of the Portfolio.
portfolio_name text The name of the Portfolio.
profile_id text The profile ID associated with your Amazon Ads account. Advertisers who operate in more than one marketplace (for example, Amazon.com, Amazon.co.uk, Amazon.co.jp) will have one profile associated with each marketplace.
serving_status text The current serving status of the record.
state text The state of the record (enabled, paused, or archived).
clicks bigint The count of clicks.
impressions bigint The count of impressions.
cost double precision Total cost of ad clicks.
Column Lineage
%3 30. model.amazon_ads_source.stg_amazon_ads__campaign_history 30. model.amazon_ads_source.stg_amazon_ads__campaign_history source_relation 21. model.amazon_ads.amazon_ads__portfolio_report 21. model.amazon_ads.amazon_ads__portfolio_report source_relation 30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0->21. model.amazon_ads.amazon_ads__portfolio_report:f0 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report source_relation 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0->21. model.amazon_ads.amazon_ads__portfolio_report:f0 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history source_relation 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->21. model.amazon_ads.amazon_ads__portfolio_report:f0 40. model.amazon_ads_source.stg_amazon_ads__profile 40. model.amazon_ads_source.stg_amazon_ads__profile source_relation 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->21. model.amazon_ads.amazon_ads__portfolio_report:f0
21. model.amazon_ads.amazon_ads__portfolio_report
  • Input Column: 30. model.amazon_ads_source.stg_amazon_ads__campaign_history[source_relation]
    • Integration Used as a key to join with other tables and ensure data from the same source is combined
    • Direct Copied directly to the output
    • Output Columns:
      • source_relation: Directly copied
  • Input Column: 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the joining condition with other tables
    • Output Columns:
      • source_relation: Directly copied to the output
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with other tables
    • Output Columns:
      • source_relation: Directly copied to the output
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[source_relation]
    • Integration Used as part of the join condition with other tables
    • Direct Directly copied to the output
    • Output Columns:
      • source_relation: Directly copied
Column Lineage
%3 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report date_day 21. model.amazon_ads.amazon_ads__portfolio_report 21. model.amazon_ads.amazon_ads__portfolio_report date_day 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0->21. model.amazon_ads.amazon_ads__portfolio_report:f0 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp date 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp:f0->32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0
32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report
  • Input Column: 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp[date]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • date_day: Directly mapped and renamed
21. model.amazon_ads.amazon_ads__portfolio_report
  • Input Column: 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 40. model.amazon_ads_source.stg_amazon_ads__profile 40. model.amazon_ads_source.stg_amazon_ads__profile account_id 21. model.amazon_ads.amazon_ads__portfolio_report 21. model.amazon_ads.amazon_ads__portfolio_report account_id 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->21. model.amazon_ads.amazon_ads__portfolio_report:f0 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp account_id 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp:f0->40. model.amazon_ads_source.stg_amazon_ads__profile:f0
40. model.amazon_ads_source.stg_amazon_ads__profile
  • Input Column: 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp[account_id]
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • account_id: It is directly mapped after casting to TEXT
21. model.amazon_ads.amazon_ads__portfolio_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[account_id]
    • Direct Directly copied to the output
    • Output Columns:
      • account_id: Directly copied
Column Lineage
%3 40. model.amazon_ads_source.stg_amazon_ads__profile 40. model.amazon_ads_source.stg_amazon_ads__profile account_name 21. model.amazon_ads.amazon_ads__portfolio_report 21. model.amazon_ads.amazon_ads__portfolio_report account_name 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->21. model.amazon_ads.amazon_ads__portfolio_report:f0 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp account_name 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp:f0->40. model.amazon_ads_source.stg_amazon_ads__profile:f0
40. model.amazon_ads_source.stg_amazon_ads__profile
  • Input Column: 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp[account_name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • account_name: It is directly mapped
21. model.amazon_ads.amazon_ads__portfolio_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[account_name]
    • Direct Directly copied to the output
    • Output Columns:
      • account_name: Directly copied
Column Lineage
%3 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history budget_amount 21. model.amazon_ads.amazon_ads__portfolio_report 21. model.amazon_ads.amazon_ads__portfolio_report budget_amount 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->21. model.amazon_ads.amazon_ads__portfolio_report:f0 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp budget_amount 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp:f0->36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0
36. model.amazon_ads_source.stg_amazon_ads__portfolio_history
  • Input Column: 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp[budget_amount]
    • Cleaning Cast to FLOAT data type
    • Output Columns:
      • budget_amount: Directly mapped after casting to FLOAT
21. model.amazon_ads.amazon_ads__portfolio_report
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[budget_amount]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • budget_amount: Directly copied to the output
Column Lineage
%3 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history budget_currency_code 21. model.amazon_ads.amazon_ads__portfolio_report 21. model.amazon_ads.amazon_ads__portfolio_report budget_currency_code 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->21. model.amazon_ads.amazon_ads__portfolio_report:f0 40. model.amazon_ads_source.stg_amazon_ads__profile 40. model.amazon_ads_source.stg_amazon_ads__profile currency_code 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->21. model.amazon_ads.amazon_ads__portfolio_report:f0 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp budget_currency_code 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp:f0->36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp currency_code 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp:f0->40. model.amazon_ads_source.stg_amazon_ads__profile:f0
36. model.amazon_ads_source.stg_amazon_ads__portfolio_history
  • Input Column: 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp[budget_currency_code]
    • Cleaning Cast to TEXT data type
    • Output Columns:
      • budget_currency_code: Directly mapped after casting to TEXT
40. model.amazon_ads_source.stg_amazon_ads__profile
  • Input Column: 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp[currency_code]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • currency_code: Directly mapped after casting to TEXT
21. model.amazon_ads.amazon_ads__portfolio_report
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[budget_currency_code]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • budget_currency_code: Directly copied to the output
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[currency_code]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the profile information when joining with other tables
    • Output Columns:
      • budget_currency_code: It is directly copied to this output column
Column Lineage
%3 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history budget_end_date 21. model.amazon_ads.amazon_ads__portfolio_report 21. model.amazon_ads.amazon_ads__portfolio_report budget_end_date 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->21. model.amazon_ads.amazon_ads__portfolio_report:f0 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp budget_end_date 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp:f0->36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0
36. model.amazon_ads_source.stg_amazon_ads__portfolio_history
  • Input Column: 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp[budget_end_date]
    • Cleaning Cast to DATE data type
    • Output Columns:
      • budget_end_date: Directly mapped after casting to DATE
21. model.amazon_ads.amazon_ads__portfolio_report
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[budget_end_date]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • budget_end_date: Directly copied to the output
Column Lineage
%3 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history budget_start_date 21. model.amazon_ads.amazon_ads__portfolio_report 21. model.amazon_ads.amazon_ads__portfolio_report budget_start_date 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->21. model.amazon_ads.amazon_ads__portfolio_report:f0 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp budget_start_date 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp:f0->36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0
36. model.amazon_ads_source.stg_amazon_ads__portfolio_history
  • Input Column: 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp[budget_start_date]
    • Cleaning Cast to DATE data type
    • Output Columns:
      • budget_start_date: Directly mapped after casting to DATE
21. model.amazon_ads.amazon_ads__portfolio_report
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[budget_start_date]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • budget_start_date: Directly copied to the output
Column Lineage
%3 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history budget_policy 21. model.amazon_ads.amazon_ads__portfolio_report 21. model.amazon_ads.amazon_ads__portfolio_report budget_policy 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->21. model.amazon_ads.amazon_ads__portfolio_report:f0 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp budget_policy 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp:f0->36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0
36. model.amazon_ads_source.stg_amazon_ads__portfolio_history
  • Input Column: 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp[budget_policy]
    • Cleaning Cast to TEXT data type
    • Output Columns:
      • budget_policy: Directly mapped after casting to TEXT
21. model.amazon_ads.amazon_ads__portfolio_report
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[budget_policy]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • budget_policy: Directly copied to the output
Column Lineage
%3 40. model.amazon_ads_source.stg_amazon_ads__profile 40. model.amazon_ads_source.stg_amazon_ads__profile country_code 21. model.amazon_ads.amazon_ads__portfolio_report 21. model.amazon_ads.amazon_ads__portfolio_report country_code 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->21. model.amazon_ads.amazon_ads__portfolio_report:f0 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp country_code 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp:f0->40. model.amazon_ads_source.stg_amazon_ads__profile:f0
40. model.amazon_ads_source.stg_amazon_ads__profile
  • Input Column: 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp[country_code]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • country_code: It is directly mapped
21. model.amazon_ads.amazon_ads__portfolio_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[country_code]
    • Direct Directly copied to the output
    • Output Columns:
      • country_code: Directly copied
Column Lineage
%3 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history in_budget 21. model.amazon_ads.amazon_ads__portfolio_report 21. model.amazon_ads.amazon_ads__portfolio_report in_budget 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->21. model.amazon_ads.amazon_ads__portfolio_report:f0 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp in_budget 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp:f0->36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0
36. model.amazon_ads_source.stg_amazon_ads__portfolio_history
  • Input Column: 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp[in_budget]
    • Cleaning Cast to BOOLEAN data type
    • Output Columns:
      • in_budget: Directly mapped after casting to BOOLEAN
21. model.amazon_ads.amazon_ads__portfolio_report
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[in_budget]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • in_budget: Directly copied to the output
Column Lineage
%3 30. model.amazon_ads_source.stg_amazon_ads__campaign_history 30. model.amazon_ads_source.stg_amazon_ads__campaign_history portfolio_id 21. model.amazon_ads.amazon_ads__portfolio_report 21. model.amazon_ads.amazon_ads__portfolio_report portfolio_id 30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0->21. model.amazon_ads.amazon_ads__portfolio_report:f0 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history portfolio_id 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->21. model.amazon_ads.amazon_ads__portfolio_report:f0 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp portfolio_id 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp:f0->30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp id 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp:f0->36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0
30. model.amazon_ads_source.stg_amazon_ads__campaign_history
  • Input Column: 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp[portfolio_id]
    • Cleaning Cast as TEXT
    • Output Columns:
      • portfolio_id: Mapped after casting to TEXT
36. model.amazon_ads_source.stg_amazon_ads__portfolio_history
  • Input Column: 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp[id]
    • Cleaning Cast to TEXT data type
    • Deduplication Used in ROW_NUMBER() window function for identifying the most recent record
    • Output Columns:
      • portfolio_id: Directly mapped after casting to TEXT
21. model.amazon_ads.amazon_ads__portfolio_report
  • Input Column: 30. model.amazon_ads_source.stg_amazon_ads__campaign_history[portfolio_id]
    • Integration Used as a join key to connect with the portfolios table
    • Output Columns:
      • portfolio_id: Indirectly mapped through the join with portfolios table
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[portfolio_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with the campaigns table
    • Output Columns:
      • portfolio_id: Directly copied to the output
Column Lineage
%3 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history portfolio_name 21. model.amazon_ads.amazon_ads__portfolio_report 21. model.amazon_ads.amazon_ads__portfolio_report portfolio_name 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->21. model.amazon_ads.amazon_ads__portfolio_report:f0 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp name 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp:f0->36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0
36. model.amazon_ads_source.stg_amazon_ads__portfolio_history
  • Input Column: 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • portfolio_name: Directly mapped and renamed
21. model.amazon_ads.amazon_ads__portfolio_report
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[portfolio_name]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • portfolio_name: Directly copied to the output
Column Lineage
%3 40. model.amazon_ads_source.stg_amazon_ads__profile 40. model.amazon_ads_source.stg_amazon_ads__profile profile_id 21. model.amazon_ads.amazon_ads__portfolio_report 21. model.amazon_ads.amazon_ads__portfolio_report profile_id 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->21. model.amazon_ads.amazon_ads__portfolio_report:f0 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp id 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp:f0->40. model.amazon_ads_source.stg_amazon_ads__profile:f0
40. model.amazon_ads_source.stg_amazon_ads__profile
  • Input Column: 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp[id]
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • profile_id: It is directly mapped after casting to TEXT
21. model.amazon_ads.amazon_ads__portfolio_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[profile_id]
    • Integration Used as join key with other tables
    • Direct Directly copied to the output
    • Output Columns:
      • profile_id: Directly copied
Column Lineage
%3 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history serving_status 21. model.amazon_ads.amazon_ads__portfolio_report 21. model.amazon_ads.amazon_ads__portfolio_report serving_status 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->21. model.amazon_ads.amazon_ads__portfolio_report:f0 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp serving_status 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp:f0->36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0
36. model.amazon_ads_source.stg_amazon_ads__portfolio_history
  • Input Column: 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp[serving_status]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • serving_status: Directly mapped
21. model.amazon_ads.amazon_ads__portfolio_report
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[serving_status]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • serving_status: Directly copied to the output
Column Lineage
%3 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history state 21. model.amazon_ads.amazon_ads__portfolio_report 21. model.amazon_ads.amazon_ads__portfolio_report state 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->21. model.amazon_ads.amazon_ads__portfolio_report:f0 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp state 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp:f0->36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0
36. model.amazon_ads_source.stg_amazon_ads__portfolio_history
  • Input Column: 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp[state]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • state: Directly mapped
21. model.amazon_ads.amazon_ads__portfolio_report
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[state]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • state: Directly copied to the output
Column Lineage
%3 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report clicks 21. model.amazon_ads.amazon_ads__portfolio_report 21. model.amazon_ads.amazon_ads__portfolio_report clicks 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0->21. model.amazon_ads.amazon_ads__portfolio_report:f0 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp clicks 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp:f0->32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0
32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report
  • Input Column: 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp[clicks]
    • Cleaning The column is cast to INT in the fields CTE
    • Output Columns:
      • clicks: Directly mapped after casting
21. model.amazon_ads.amazon_ads__portfolio_report
  • Input Column: 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report[clicks]
    • Aggregation The column is summed up in the SELECT statement
    • Output Columns:
      • clicks: Aggregated sum of clicks
Column Lineage
%3 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report impressions 21. model.amazon_ads.amazon_ads__portfolio_report 21. model.amazon_ads.amazon_ads__portfolio_report impressions 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0->21. model.amazon_ads.amazon_ads__portfolio_report:f0 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp impressions 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp:f0->32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0
32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report
  • Input Column: 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp[impressions]
    • Cleaning The column is cast to INT data type
    • Direct The column is directly copied to the output after casting
    • Output Columns:
      • impressions: Directly mapped after casting to INT
21. model.amazon_ads.amazon_ads__portfolio_report
  • Input Column: 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report[impressions]
    • Aggregation The column is summed up in the SELECT statement
    • Output Columns:
      • impressions: Aggregated sum of impressions
Column Lineage
%3 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report cost 21. model.amazon_ads.amazon_ads__portfolio_report 21. model.amazon_ads.amazon_ads__portfolio_report cost 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0->21. model.amazon_ads.amazon_ads__portfolio_report:f0 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp cost 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp:f0->32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0
32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report
  • Input Column: 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp[cost]
    • Cleaning The column is cast to FLOAT data type
    • Direct The column is directly copied to the output after casting
    • Output Columns:
      • cost: Directly mapped after casting to FLOAT
21. model.amazon_ads.amazon_ads__portfolio_report
  • Input Column: 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report[cost]
    • Aggregation The column is summed up in the SELECT statement
    • Output Columns:
      • cost: Aggregated sum of cost
22. model.amazon_ads.amazon_ads__search_report

This SQL query integrates data from multiple Amazon Ads-related tables to create a comprehensive search term report. It joins information from search term reports, account profiles, portfolios, campaigns, ad groups, and keywords. The query filters for the most recent records in some tables, aggregates cost, clicks, and impressions data, and provides a detailed view of search term performance across various levels of the account structure.

FilteringIntegrationAggregation
SQL Query
WITH report AS (
  SELECT
    *
  FROM TEST.PUBLIC_amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report
), account_info AS (
  SELECT
    *
  FROM TEST.PUBLIC_amazon_ads_source.stg_amazon_ads__profile
  WHERE
    _fivetran_deleted = FALSE
), portfolios AS (
  SELECT
    *
  FROM TEST.PUBLIC_amazon_ads.int_amazon_ads__portfolio_history
), campaigns AS (
  SELECT
    *
  FROM TEST.PUBLIC_amazon_ads_source.stg_amazon_ads__campaign_history
  WHERE
    is_most_recent_record = TRUE
), ad_groups AS (
  SELECT
    *
  FROM TEST.PUBLIC_amazon_ads_source.stg_amazon_ads__ad_group_history
  WHERE
    is_most_recent_record = TRUE
), keywords AS (
  SELECT
    *
  FROM TEST.PUBLIC_amazon_ads_source.stg_amazon_ads__keyword_history
  WHERE
    is_most_recent_record = TRUE
), fields AS (
  SELECT
    report.source_relation,
    report.date_day,
    account_info.account_name,
    account_info.account_id,
    account_info.country_code,
    account_info.profile_id,
    portfolios.portfolio_name,
    portfolios.portfolio_id,
    campaigns.campaign_name,
    report.campaign_id,
    ad_groups.ad_group_name,
    report.ad_group_id,
    report.keyword_id,
    keywords.keyword_text,
    keywords.match_type,
    keywords.serving_status,
    keywords.state,
    report.search_term,
    report.targeting,
    SUM(report.cost) AS cost,
    SUM(report.clicks) AS clicks,
    SUM(report.impressions) AS impressions
  FROM report
  LEFT JOIN keywords
    ON keywords.keyword_id = report.keyword_id
    AND keywords.source_relation = report.source_relation
  LEFT JOIN ad_groups
    ON ad_groups.ad_group_id = report.ad_group_id
    AND ad_groups.source_relation = report.source_relation
  LEFT JOIN campaigns
    ON campaigns.campaign_id = report.campaign_id
    AND campaigns.source_relation = report.source_relation
  LEFT JOIN portfolios
    ON portfolios.portfolio_id = campaigns.portfolio_id
    AND portfolios.source_relation = campaigns.source_relation
  LEFT JOIN account_info
    ON account_info.profile_id = campaigns.profile_id
    AND account_info.source_relation = campaigns.source_relation
  GROUP BY
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10,
    11,
    12,
    13,
    14,
    15,
    16,
    17,
    18,
    19
)
SELECT
  *
FROM fields
%3 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report source_relation date_day account_id account_name ad_group_id ad_group_name campaign_id campaign_name country_code keyword_id keyword_text match_type portfolio_id portfolio_name profile_id serving_status search_term state targeting clicks impressions cost 23. model.amazon_ads.int_amazon_ads__portfolio_history 23. model.amazon_ads.int_amazon_ads__portfolio_history source_relation portfolio_id portfolio_name 23. model.amazon_ads.int_amazon_ads__portfolio_history:f0->22. model.amazon_ads.amazon_ads__search_report:f0 23. model.amazon_ads.int_amazon_ads__portfolio_history:f1->22. model.amazon_ads.amazon_ads__search_report:f12 23. model.amazon_ads.int_amazon_ads__portfolio_history:f2->22. model.amazon_ads.amazon_ads__search_report:f13 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history ad_group_id ad_group_name 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f0->22. model.amazon_ads.amazon_ads__search_report:f4 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f1->22. model.amazon_ads.amazon_ads__search_report:f5 30. model.amazon_ads_source.stg_amazon_ads__campaign_history 30. model.amazon_ads_source.stg_amazon_ads__campaign_history source_relation campaign_id campaign_name 30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0->22. model.amazon_ads.amazon_ads__search_report:f0 30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f1->22. model.amazon_ads.amazon_ads__search_report:f6 30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f2->22. model.amazon_ads.amazon_ads__search_report:f7 34. model.amazon_ads_source.stg_amazon_ads__keyword_history 34. model.amazon_ads_source.stg_amazon_ads__keyword_history source_relation keyword_id keyword_text match_type serving_status state 34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f0->22. model.amazon_ads.amazon_ads__search_report:f0 34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f1->22. model.amazon_ads.amazon_ads__search_report:f9 34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f2->22. model.amazon_ads.amazon_ads__search_report:f10 34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f3->22. model.amazon_ads.amazon_ads__search_report:f11 34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f4->22. model.amazon_ads.amazon_ads__search_report:f15 34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f5->22. model.amazon_ads.amazon_ads__search_report:f17 40. model.amazon_ads_source.stg_amazon_ads__profile 40. model.amazon_ads_source.stg_amazon_ads__profile source_relation profile_id account_id account_name country_code 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->22. model.amazon_ads.amazon_ads__search_report:f0 40. model.amazon_ads_source.stg_amazon_ads__profile:f1->22. model.amazon_ads.amazon_ads__search_report:f14 40. model.amazon_ads_source.stg_amazon_ads__profile:f2->22. model.amazon_ads.amazon_ads__search_report:f2 40. model.amazon_ads_source.stg_amazon_ads__profile:f3->22. model.amazon_ads.amazon_ads__search_report:f3 40. model.amazon_ads_source.stg_amazon_ads__profile:f4->22. model.amazon_ads.amazon_ads__search_report:f8 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report source_relation date_day ad_group_id campaign_id keyword_id clicks impressions cost search_term targeting 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f0->22. model.amazon_ads.amazon_ads__search_report:f0 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f1->22. model.amazon_ads.amazon_ads__search_report:f1 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f2->22. model.amazon_ads.amazon_ads__search_report:f4 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f3->22. model.amazon_ads.amazon_ads__search_report:f6 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f4->22. model.amazon_ads.amazon_ads__search_report:f9 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f5->22. model.amazon_ads.amazon_ads__search_report:f19 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f6->22. model.amazon_ads.amazon_ads__search_report:f20 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f7->22. model.amazon_ads.amazon_ads__search_report:f21 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f8->22. model.amazon_ads.amazon_ads__search_report:f16 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f9->22. model.amazon_ads.amazon_ads__search_report:f18
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
date_day date The date of the report.
account_id text The ID representing the account.
account_name text The name of the account, if present in the source data.
ad_group_id text The ID representing the ad group, if present in the source data.
ad_group_name text The name of the ad group, if present in the source data.
campaign_id text The ID representing the campaign, if present in the source data.
campaign_name text The name of the campaign, if present in the source data.
country_code text The code for a given country.
keyword_id text The ID representing the keyword, if present in the source data.
keyword_text text The keyword text.
match_type text Type of matching for the keyword used in bid. One of: BROAD, PHRASE, or EXACT.
portfolio_id text The ID of the Portfolio.
portfolio_name text The name of the Portfolio.
profile_id text The profile ID associated with your Amazon Ads account. Advertisers who operate in more than one marketplace (for example, Amazon.com, Amazon.co.uk, Amazon.co.jp) will have one profile associated with each marketplace.
serving_status text The current serving status of the record.
search_term text The search term used by the customer.
state text The state of the record (enabled, paused, or archived).
targeting text A string representation of the expression object used in the targeting clause.
clicks bigint The count of clicks.
impressions bigint The count of impressions.
cost double precision Total cost of ad clicks.
Column Lineage
%3 23. model.amazon_ads.int_amazon_ads__portfolio_history 23. model.amazon_ads.int_amazon_ads__portfolio_history source_relation 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report source_relation 23. model.amazon_ads.int_amazon_ads__portfolio_history:f0->22. model.amazon_ads.amazon_ads__search_report:f0 30. model.amazon_ads_source.stg_amazon_ads__campaign_history 30. model.amazon_ads_source.stg_amazon_ads__campaign_history source_relation 30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0->22. model.amazon_ads.amazon_ads__search_report:f0 34. model.amazon_ads_source.stg_amazon_ads__keyword_history 34. model.amazon_ads_source.stg_amazon_ads__keyword_history source_relation 34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f0->22. model.amazon_ads.amazon_ads__search_report:f0 40. model.amazon_ads_source.stg_amazon_ads__profile 40. model.amazon_ads_source.stg_amazon_ads__profile source_relation 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->22. model.amazon_ads.amazon_ads__search_report:f0 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report source_relation 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f0->22. model.amazon_ads.amazon_ads__search_report:f0 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history source_relation 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->23. model.amazon_ads.int_amazon_ads__portfolio_history:f0
23. model.amazon_ads.int_amazon_ads__portfolio_history
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[source_relation]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • source_relation: Directly copied
22. model.amazon_ads.amazon_ads__search_report
  • Input Column: 23. model.amazon_ads.int_amazon_ads__portfolio_history[source_relation]
    • Integration used to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 30. model.amazon_ads_source.stg_amazon_ads__campaign_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 34. model.amazon_ads_source.stg_amazon_ads__keyword_history[source_relation]
    • Direct The column is directly copied without transformation
    • Integration Used as a key to join with other tables
    • Output Columns:
      • source_relation: Directly copied to the output
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[source_relation]
    • Integration used to join with other tables
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join conditions with other tables
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
Column Lineage
%3 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report date_day 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report date_day 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f0->22. model.amazon_ads.amazon_ads__search_report:f0 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp date 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp:f0->42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f0
42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report
  • Input Column: 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp[date]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • date_day: It is directly mapped and renamed
22. model.amazon_ads.amazon_ads__search_report
  • Input Column: 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 40. model.amazon_ads_source.stg_amazon_ads__profile 40. model.amazon_ads_source.stg_amazon_ads__profile account_id 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report account_id 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->22. model.amazon_ads.amazon_ads__search_report:f0 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp account_id 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp:f0->40. model.amazon_ads_source.stg_amazon_ads__profile:f0
40. model.amazon_ads_source.stg_amazon_ads__profile
  • Input Column: 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp[account_id]
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • account_id: It is directly mapped after casting to TEXT
22. model.amazon_ads.amazon_ads__search_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[account_id]
    • Direct directly selected in the output
    • Output Columns:
      • account_id: directly copied
Column Lineage
%3 40. model.amazon_ads_source.stg_amazon_ads__profile 40. model.amazon_ads_source.stg_amazon_ads__profile account_name 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report account_name 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->22. model.amazon_ads.amazon_ads__search_report:f0 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp account_name 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp:f0->40. model.amazon_ads_source.stg_amazon_ads__profile:f0
40. model.amazon_ads_source.stg_amazon_ads__profile
  • Input Column: 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp[account_name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • account_name: It is directly mapped
22. model.amazon_ads.amazon_ads__search_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[account_name]
    • Direct directly selected in the output
    • Output Columns:
      • account_name: directly copied
Column Lineage
%3 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history ad_group_id 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report ad_group_id 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f0->22. model.amazon_ads.amazon_ads__search_report:f0 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report ad_group_id 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f0->22. model.amazon_ads.amazon_ads__search_report:f0 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp id 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp:f0->24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f0 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp ad_group_id 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp:f0->42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f0
24. model.amazon_ads_source.stg_amazon_ads__ad_group_history
  • Input Column: 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp[id]
    • Cleaning Cast to TEXT type
    • Deduplication Used in ROW_NUMBER() window function for deduplication
    • Output Columns:
      • ad_group_id: Directly mapped after casting to TEXT
42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report
  • Input Column: 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp[ad_group_id]
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • ad_group_id: It is directly mapped after casting
22. model.amazon_ads.amazon_ads__search_report
  • Input Column: 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history[ad_group_id]
    • Integration used as part of the JOIN condition to match with the report table
    • Direct directly selected in the final output
    • Output Columns:
      • ad_group_id: directly copied to the output
  • Input Column: 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report[ad_group_id]
    • Direct The column is directly copied without any transformation
    • Integration Used to join with the ad_groups table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • ad_group_id: Directly copied to the output
Column Lineage
%3 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history ad_group_name 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report ad_group_name 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f0->22. model.amazon_ads.amazon_ads__search_report:f0 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp name 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp:f0->24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f0
24. model.amazon_ads_source.stg_amazon_ads__ad_group_history
  • Input Column: 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp[name]
    • Cleaning Cast to TEXT type
    • Output Columns:
      • ad_group_name: Directly mapped after casting to TEXT
22. model.amazon_ads.amazon_ads__search_report
  • Input Column: 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history[ad_group_name]
    • Direct directly selected in the final output
    • Output Columns:
      • ad_group_name: directly copied to the output
Column Lineage
%3 30. model.amazon_ads_source.stg_amazon_ads__campaign_history 30. model.amazon_ads_source.stg_amazon_ads__campaign_history campaign_id 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report campaign_id 30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0->22. model.amazon_ads.amazon_ads__search_report:f0 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report campaign_id 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f0->22. model.amazon_ads.amazon_ads__search_report:f0 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp id 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp:f0->30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp campaign_id 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp:f0->42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f0
30. model.amazon_ads_source.stg_amazon_ads__campaign_history
  • Input Column: 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp[id]
    • Cleaning The column is cast as TEXT
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • campaign_id: Directly mapped after casting to TEXT
42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report
  • Input Column: 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp[campaign_id]
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • campaign_id: It is directly mapped after casting
22. model.amazon_ads.amazon_ads__search_report
  • Input Column: 30. model.amazon_ads_source.stg_amazon_ads__campaign_history[campaign_id]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
  • Input Column: 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report[campaign_id]
    • Direct The column is directly copied without any transformation
    • Integration Used to join with the campaigns table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • campaign_id: Directly copied to the output
Column Lineage
%3 30. model.amazon_ads_source.stg_amazon_ads__campaign_history 30. model.amazon_ads_source.stg_amazon_ads__campaign_history campaign_name 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report campaign_name 30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0->22. model.amazon_ads.amazon_ads__search_report:f0 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp name 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp:f0->30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0
30. model.amazon_ads_source.stg_amazon_ads__campaign_history
  • Input Column: 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp[name]
    • Direct Copied without transformation
    • Output Columns:
      • campaign_name: Mapped and renamed
22. model.amazon_ads.amazon_ads__search_report
  • Input Column: 30. model.amazon_ads_source.stg_amazon_ads__campaign_history[campaign_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_name: directly copied
Column Lineage
%3 40. model.amazon_ads_source.stg_amazon_ads__profile 40. model.amazon_ads_source.stg_amazon_ads__profile country_code 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report country_code 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->22. model.amazon_ads.amazon_ads__search_report:f0 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp country_code 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp:f0->40. model.amazon_ads_source.stg_amazon_ads__profile:f0
40. model.amazon_ads_source.stg_amazon_ads__profile
  • Input Column: 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp[country_code]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • country_code: It is directly mapped
22. model.amazon_ads.amazon_ads__search_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[country_code]
    • Direct directly selected in the output
    • Output Columns:
      • country_code: directly copied
Column Lineage
%3 34. model.amazon_ads_source.stg_amazon_ads__keyword_history 34. model.amazon_ads_source.stg_amazon_ads__keyword_history keyword_id 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report keyword_id 34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f0->22. model.amazon_ads.amazon_ads__search_report:f0 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report keyword_id 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f0->22. model.amazon_ads.amazon_ads__search_report:f0 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp id 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp:f0->34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f0 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp keyword_id 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp:f0->42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f0
34. model.amazon_ads_source.stg_amazon_ads__keyword_history
  • Input Column: 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp[id]
    • Cleaning The column is cast as TEXT
    • Deduplication Used in the ROW_NUMBER() window function to identify the most recent record
    • Output Columns:
      • keyword_id: Directly mapped after casting to TEXT
42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report
  • Input Column: 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp[keyword_id]
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • keyword_id: It is directly mapped after casting
22. model.amazon_ads.amazon_ads__search_report
  • Input Column: 34. model.amazon_ads_source.stg_amazon_ads__keyword_history[keyword_id]
    • Direct The column is directly copied without transformation
    • Integration Used as a key to join with the report table
    • Output Columns:
      • keyword_id: Directly copied to the output
  • Input Column: 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report[keyword_id]
    • Direct The column is directly copied without any transformation
    • Integration Used to join with the keywords table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • keyword_id: Directly copied to the output
Column Lineage
%3 34. model.amazon_ads_source.stg_amazon_ads__keyword_history 34. model.amazon_ads_source.stg_amazon_ads__keyword_history keyword_text 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report keyword_text 34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f0->22. model.amazon_ads.amazon_ads__search_report:f0 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp keyword_text 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp:f0->34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f0
34. model.amazon_ads_source.stg_amazon_ads__keyword_history
  • Input Column: 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp[keyword_text]
    • Cleaning Cast as TEXT
    • Output Columns:
      • keyword_text: Directly mapped after casting
22. model.amazon_ads.amazon_ads__search_report
  • Input Column: 34. model.amazon_ads_source.stg_amazon_ads__keyword_history[keyword_text]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • keyword_text: Directly copied to the output
Column Lineage
%3 34. model.amazon_ads_source.stg_amazon_ads__keyword_history 34. model.amazon_ads_source.stg_amazon_ads__keyword_history match_type 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report match_type 34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f0->22. model.amazon_ads.amazon_ads__search_report:f0 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp match_type 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp:f0->34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f0
34. model.amazon_ads_source.stg_amazon_ads__keyword_history
  • Input Column: 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp[match_type]
    • Cleaning Cast as TEXT
    • Output Columns:
      • match_type: Directly mapped after casting
22. model.amazon_ads.amazon_ads__search_report
  • Input Column: 34. model.amazon_ads_source.stg_amazon_ads__keyword_history[match_type]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • match_type: Directly copied to the output
Column Lineage
%3 23. model.amazon_ads.int_amazon_ads__portfolio_history 23. model.amazon_ads.int_amazon_ads__portfolio_history portfolio_id 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report portfolio_id 23. model.amazon_ads.int_amazon_ads__portfolio_history:f0->22. model.amazon_ads.amazon_ads__search_report:f0 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history portfolio_id 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->23. model.amazon_ads.int_amazon_ads__portfolio_history:f0 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp id 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp:f0->36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0
36. model.amazon_ads_source.stg_amazon_ads__portfolio_history
  • Input Column: 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp[id]
    • Cleaning Cast to TEXT data type
    • Deduplication Used in ROW_NUMBER() window function for identifying the most recent record
    • Output Columns:
      • portfolio_id: Directly mapped after casting to TEXT
23. model.amazon_ads.int_amazon_ads__portfolio_history
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[portfolio_id]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • portfolio_id: Directly copied
22. model.amazon_ads.amazon_ads__search_report
  • Input Column: 23. model.amazon_ads.int_amazon_ads__portfolio_history[portfolio_id]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the campaigns table
    • Output Columns:
      • portfolio_id: Directly copied to the output
Column Lineage
%3 23. model.amazon_ads.int_amazon_ads__portfolio_history 23. model.amazon_ads.int_amazon_ads__portfolio_history portfolio_name 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report portfolio_name 23. model.amazon_ads.int_amazon_ads__portfolio_history:f0->22. model.amazon_ads.amazon_ads__search_report:f0 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history portfolio_name 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->23. model.amazon_ads.int_amazon_ads__portfolio_history:f0 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp name 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp:f0->36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0
36. model.amazon_ads_source.stg_amazon_ads__portfolio_history
  • Input Column: 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • portfolio_name: Directly mapped and renamed
23. model.amazon_ads.int_amazon_ads__portfolio_history
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[portfolio_name]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • portfolio_name: Directly copied
22. model.amazon_ads.amazon_ads__search_report
  • Input Column: 23. model.amazon_ads.int_amazon_ads__portfolio_history[portfolio_name]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the campaigns table
    • Output Columns:
      • portfolio_name: Directly copied to the output
Column Lineage
%3 40. model.amazon_ads_source.stg_amazon_ads__profile 40. model.amazon_ads_source.stg_amazon_ads__profile profile_id 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report profile_id 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->22. model.amazon_ads.amazon_ads__search_report:f0 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp id 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp:f0->40. model.amazon_ads_source.stg_amazon_ads__profile:f0
40. model.amazon_ads_source.stg_amazon_ads__profile
  • Input Column: 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp[id]
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • profile_id: It is directly mapped after casting to TEXT
22. model.amazon_ads.amazon_ads__search_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[profile_id]
    • Integration used to join with campaigns table
    • Direct directly selected in the output
    • Output Columns:
      • profile_id: directly copied
Column Lineage
%3 34. model.amazon_ads_source.stg_amazon_ads__keyword_history 34. model.amazon_ads_source.stg_amazon_ads__keyword_history serving_status 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report serving_status 34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f0->22. model.amazon_ads.amazon_ads__search_report:f0 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp serving_status 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp:f0->34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f0
34. model.amazon_ads_source.stg_amazon_ads__keyword_history
  • Input Column: 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp[serving_status]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • serving_status: Directly copied after casting to TEXT
22. model.amazon_ads.amazon_ads__search_report
  • Input Column: 34. model.amazon_ads_source.stg_amazon_ads__keyword_history[serving_status]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • serving_status: Directly copied to the output column
Column Lineage
%3 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report search_term 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report search_term 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f0->22. model.amazon_ads.amazon_ads__search_report:f0 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp search_term 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp:f0->42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f0
42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report
  • Input Column: 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp[search_term]
    • Cleaning The column is cast to TEXT data type
    • Output Columns:
      • search_term: It is directly mapped after casting
22. model.amazon_ads.amazon_ads__search_report
  • Input Column: 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report[search_term]
    • Direct The search_term is directly selected without transformation
    • Integration It's part of the GROUP BY clause, implying it's used for joining or integrating data
    • Output Columns:
      • search_term: Directly copied to the output
Column Lineage
%3 34. model.amazon_ads_source.stg_amazon_ads__keyword_history 34. model.amazon_ads_source.stg_amazon_ads__keyword_history state 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report state 34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f0->22. model.amazon_ads.amazon_ads__search_report:f0 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp state 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp:f0->34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f0
34. model.amazon_ads_source.stg_amazon_ads__keyword_history
  • Input Column: 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp[state]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • state: Directly copied after casting to TEXT
22. model.amazon_ads.amazon_ads__search_report
  • Input Column: 34. model.amazon_ads_source.stg_amazon_ads__keyword_history[state]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • state: Directly copied to the output column
Column Lineage
%3 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report targeting 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report targeting 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f0->22. model.amazon_ads.amazon_ads__search_report:f0 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp targeting 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp:f0->42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f0
42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report
  • Input Column: 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp[targeting]
    • Cleaning The column is cast to TEXT data type
    • Output Columns:
      • targeting: It is directly mapped after casting
22. model.amazon_ads.amazon_ads__search_report
  • Input Column: 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report[targeting]
    • Direct The targeting is directly selected without transformation
    • Integration It's part of the GROUP BY clause, implying it's used for joining or integrating data
    • Output Columns:
      • targeting: Directly copied to the output
Column Lineage
%3 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report clicks 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report clicks 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f0->22. model.amazon_ads.amazon_ads__search_report:f0 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp clicks 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp:f0->42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f0
42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report
  • Input Column: 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp[clicks]
    • Cleaning The column is cast to INT type
    • Output Columns:
      • clicks: It is directly mapped after casting
22. model.amazon_ads.amazon_ads__search_report
  • Input Column: 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report[clicks]
    • Aggregation The clicks are summed up in the GROUP BY clause
    • Output Columns:
      • clicks: Directly mapped after aggregation
Column Lineage
%3 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report impressions 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report impressions 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f0->22. model.amazon_ads.amazon_ads__search_report:f0 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp impressions 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp:f0->42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f0
42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report
  • Input Column: 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp[impressions]
    • Cleaning The column is cast to INT data type
    • Output Columns:
      • impressions: It is directly mapped after casting
22. model.amazon_ads.amazon_ads__search_report
  • Input Column: 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report[impressions]
    • Aggregation The impressions are summed up in the GROUP BY clause
    • Output Columns:
      • impressions: Directly mapped after aggregation
Column Lineage
%3 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report cost 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report cost 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f0->22. model.amazon_ads.amazon_ads__search_report:f0 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp cost 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp:f0->42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f0
42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report
  • Input Column: 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp[cost]
    • Cleaning The column is cast to FLOAT type
    • Output Columns:
      • cost: It is directly mapped after casting
22. model.amazon_ads.amazon_ads__search_report
  • Input Column: 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report[cost]
    • Aggregation The cost is summed up in the GROUP BY clause
    • Output Columns:
      • cost: Directly mapped after aggregation
23. model.amazon_ads.int_amazon_ads__portfolio_history

This SQL query selects all columns from the most recent records in the amazon_ads_source.stg_amazon_ads__portfolio_history table. It filters the data to include only the rows where 'is_most_recent_record' is TRUE, effectively retrieving the latest portfolio history information.

Filtering
SQL Query
WITH portfolios AS (
  SELECT
    *
  FROM TEST.PUBLIC_amazon_ads_source.stg_amazon_ads__portfolio_history
  WHERE
    is_most_recent_record = TRUE
)
SELECT
  *
FROM portfolios
%3 23. model.amazon_ads.int_amazon_ads__portfolio_history 23. model.amazon_ads.int_amazon_ads__portfolio_history source_relation portfolio_id budget_amount budget_currency_code budget_end_date budget_policy budget_start_date creation_date in_budget last_updated_date portfolio_name profile_id serving_status state is_most_recent_record 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history source_relation portfolio_id portfolio_name last_updated_date creation_date budget_amount budget_currency_code budget_end_date budget_start_date budget_policy in_budget profile_id serving_status state is_most_recent_record 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->23. model.amazon_ads.int_amazon_ads__portfolio_history:f0 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f1->23. model.amazon_ads.int_amazon_ads__portfolio_history:f1 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f2->23. model.amazon_ads.int_amazon_ads__portfolio_history:f10 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f3->23. model.amazon_ads.int_amazon_ads__portfolio_history:f9 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f4->23. model.amazon_ads.int_amazon_ads__portfolio_history:f7 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f5->23. model.amazon_ads.int_amazon_ads__portfolio_history:f2 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f6->23. model.amazon_ads.int_amazon_ads__portfolio_history:f3 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f7->23. model.amazon_ads.int_amazon_ads__portfolio_history:f4 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f8->23. model.amazon_ads.int_amazon_ads__portfolio_history:f6 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f9->23. model.amazon_ads.int_amazon_ads__portfolio_history:f5 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f10->23. model.amazon_ads.int_amazon_ads__portfolio_history:f8 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f11->23. model.amazon_ads.int_amazon_ads__portfolio_history:f11 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f12->23. model.amazon_ads.int_amazon_ads__portfolio_history:f12 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f13->23. model.amazon_ads.int_amazon_ads__portfolio_history:f13 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f14->23. model.amazon_ads.int_amazon_ads__portfolio_history:f14
Name Type Comment
source_relation text None
portfolio_id text None
budget_amount integer None
budget_currency_code integer None
budget_end_date integer None
budget_policy integer None
budget_start_date integer None
creation_date text None
in_budget boolean None
last_updated_date text None
portfolio_name text None
profile_id text None
serving_status text None
state text None
is_most_recent_record boolean None
Column Lineage
%3 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history source_relation 23. model.amazon_ads.int_amazon_ads__portfolio_history 23. model.amazon_ads.int_amazon_ads__portfolio_history source_relation 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->23. model.amazon_ads.int_amazon_ads__portfolio_history:f0 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report source_relation 23. model.amazon_ads.int_amazon_ads__portfolio_history:f0->22. model.amazon_ads.amazon_ads__search_report:f0 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report source_relation 23. model.amazon_ads.int_amazon_ads__portfolio_history:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0 17. model.amazon_ads.amazon_ads__ad_group_report 17. model.amazon_ads.amazon_ads__ad_group_report source_relation 23. model.amazon_ads.int_amazon_ads__portfolio_history:f0->17. model.amazon_ads.amazon_ads__ad_group_report:f0 19. model.amazon_ads.amazon_ads__campaign_report 19. model.amazon_ads.amazon_ads__campaign_report source_relation 23. model.amazon_ads.int_amazon_ads__portfolio_history:f0->19. model.amazon_ads.amazon_ads__campaign_report:f0 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report source_relation 23. model.amazon_ads.int_amazon_ads__portfolio_history:f0->18. model.amazon_ads.amazon_ads__ad_report:f0
23. model.amazon_ads.int_amazon_ads__portfolio_history
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[source_relation]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • source_relation: Directly copied
17. model.amazon_ads.amazon_ads__ad_group_report
  • Input Column: 23. model.amazon_ads.int_amazon_ads__portfolio_history[source_relation]
    • Direct The column is directly copied without transformation
    • Integration Used as part of the join condition with other tables
    • Output Columns:
      • source_relation: Directly copied to the output
18. model.amazon_ads.amazon_ads__ad_report
  • Input Column: 23. model.amazon_ads.int_amazon_ads__portfolio_history[source_relation]
    • Direct The column is directly used in the SELECT statement
    • Integration Used to join with other tables
    • Output Columns:
      • source_relation: Directly copied to the output
19. model.amazon_ads.amazon_ads__campaign_report
  • Input Column: 23. model.amazon_ads.int_amazon_ads__portfolio_history[source_relation]
    • Integration The column is used as part of the join condition with the campaigns table
    • Output Columns:
      • source_relation: Contributes to the output source_relation column
20. model.amazon_ads.amazon_ads__keyword_report
  • Input Column: 23. model.amazon_ads.int_amazon_ads__portfolio_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
22. model.amazon_ads.amazon_ads__search_report
  • Input Column: 23. model.amazon_ads.int_amazon_ads__portfolio_history[source_relation]
    • Integration used to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
Column Lineage
%3 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history portfolio_id 23. model.amazon_ads.int_amazon_ads__portfolio_history 23. model.amazon_ads.int_amazon_ads__portfolio_history portfolio_id 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->23. model.amazon_ads.int_amazon_ads__portfolio_history:f0 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report portfolio_id 23. model.amazon_ads.int_amazon_ads__portfolio_history:f0->22. model.amazon_ads.amazon_ads__search_report:f0 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report portfolio_id 23. model.amazon_ads.int_amazon_ads__portfolio_history:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0 17. model.amazon_ads.amazon_ads__ad_group_report 17. model.amazon_ads.amazon_ads__ad_group_report portfolio_id 23. model.amazon_ads.int_amazon_ads__portfolio_history:f0->17. model.amazon_ads.amazon_ads__ad_group_report:f0 19. model.amazon_ads.amazon_ads__campaign_report 19. model.amazon_ads.amazon_ads__campaign_report portfolio_id 23. model.amazon_ads.int_amazon_ads__portfolio_history:f0->19. model.amazon_ads.amazon_ads__campaign_report:f0 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report portfolio_id 23. model.amazon_ads.int_amazon_ads__portfolio_history:f0->18. model.amazon_ads.amazon_ads__ad_report:f0 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp id 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp:f0->36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0
36. model.amazon_ads_source.stg_amazon_ads__portfolio_history
  • Input Column: 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp[id]
    • Cleaning Cast to TEXT data type
    • Deduplication Used in ROW_NUMBER() window function for identifying the most recent record
    • Output Columns:
      • portfolio_id: Directly mapped after casting to TEXT
23. model.amazon_ads.int_amazon_ads__portfolio_history
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[portfolio_id]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • portfolio_id: Directly copied
17. model.amazon_ads.amazon_ads__ad_group_report
  • Input Column: 23. model.amazon_ads.int_amazon_ads__portfolio_history[portfolio_id]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with other tables
    • Output Columns:
      • portfolio_id: Directly copied to the output
18. model.amazon_ads.amazon_ads__ad_report
  • Input Column: 23. model.amazon_ads.int_amazon_ads__portfolio_history[portfolio_id]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the campaigns table
    • Output Columns:
      • portfolio_id: Directly copied to the output
19. model.amazon_ads.amazon_ads__campaign_report
  • Input Column: 23. model.amazon_ads.int_amazon_ads__portfolio_history[portfolio_id]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the campaigns table
    • Output Columns:
      • portfolio_id: Directly copied to the output
20. model.amazon_ads.amazon_ads__keyword_report
  • Input Column: 23. model.amazon_ads.int_amazon_ads__portfolio_history[portfolio_id]
    • Integration used as part of the join condition with the campaigns table
    • Direct directly copied to the output
    • Output Columns:
      • portfolio_id: directly copied
22. model.amazon_ads.amazon_ads__search_report
  • Input Column: 23. model.amazon_ads.int_amazon_ads__portfolio_history[portfolio_id]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the campaigns table
    • Output Columns:
      • portfolio_id: Directly copied to the output
Column Lineage
%3 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history budget_amount 23. model.amazon_ads.int_amazon_ads__portfolio_history 23. model.amazon_ads.int_amazon_ads__portfolio_history budget_amount 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->23. model.amazon_ads.int_amazon_ads__portfolio_history:f0 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp budget_amount 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp:f0->36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0
36. model.amazon_ads_source.stg_amazon_ads__portfolio_history
  • Input Column: 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp[budget_amount]
    • Cleaning Cast to FLOAT data type
    • Output Columns:
      • budget_amount: Directly mapped after casting to FLOAT
23. model.amazon_ads.int_amazon_ads__portfolio_history
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[budget_amount]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • budget_amount: Directly copied
Column Lineage
%3 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history budget_currency_code 23. model.amazon_ads.int_amazon_ads__portfolio_history 23. model.amazon_ads.int_amazon_ads__portfolio_history budget_currency_code 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->23. model.amazon_ads.int_amazon_ads__portfolio_history:f0 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp budget_currency_code 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp:f0->36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0
36. model.amazon_ads_source.stg_amazon_ads__portfolio_history
  • Input Column: 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp[budget_currency_code]
    • Cleaning Cast to TEXT data type
    • Output Columns:
      • budget_currency_code: Directly mapped after casting to TEXT
23. model.amazon_ads.int_amazon_ads__portfolio_history
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[budget_currency_code]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • budget_currency_code: Directly copied
Column Lineage
%3 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history budget_end_date 23. model.amazon_ads.int_amazon_ads__portfolio_history 23. model.amazon_ads.int_amazon_ads__portfolio_history budget_end_date 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->23. model.amazon_ads.int_amazon_ads__portfolio_history:f0 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp budget_end_date 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp:f0->36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0
36. model.amazon_ads_source.stg_amazon_ads__portfolio_history
  • Input Column: 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp[budget_end_date]
    • Cleaning Cast to DATE data type
    • Output Columns:
      • budget_end_date: Directly mapped after casting to DATE
23. model.amazon_ads.int_amazon_ads__portfolio_history
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[budget_end_date]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • budget_end_date: Directly copied
Column Lineage
%3 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history budget_policy 23. model.amazon_ads.int_amazon_ads__portfolio_history 23. model.amazon_ads.int_amazon_ads__portfolio_history budget_policy 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->23. model.amazon_ads.int_amazon_ads__portfolio_history:f0 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp budget_policy 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp:f0->36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0
36. model.amazon_ads_source.stg_amazon_ads__portfolio_history
  • Input Column: 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp[budget_policy]
    • Cleaning Cast to TEXT data type
    • Output Columns:
      • budget_policy: Directly mapped after casting to TEXT
23. model.amazon_ads.int_amazon_ads__portfolio_history
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[budget_policy]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • budget_policy: Directly copied
Column Lineage
%3 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history budget_start_date 23. model.amazon_ads.int_amazon_ads__portfolio_history 23. model.amazon_ads.int_amazon_ads__portfolio_history budget_start_date 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->23. model.amazon_ads.int_amazon_ads__portfolio_history:f0 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp budget_start_date 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp:f0->36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0
36. model.amazon_ads_source.stg_amazon_ads__portfolio_history
  • Input Column: 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp[budget_start_date]
    • Cleaning Cast to DATE data type
    • Output Columns:
      • budget_start_date: Directly mapped after casting to DATE
23. model.amazon_ads.int_amazon_ads__portfolio_history
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[budget_start_date]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • budget_start_date: Directly copied
Column Lineage
%3 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history creation_date 23. model.amazon_ads.int_amazon_ads__portfolio_history 23. model.amazon_ads.int_amazon_ads__portfolio_history creation_date 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->23. model.amazon_ads.int_amazon_ads__portfolio_history:f0 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp creation_date 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp:f0->36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0
36. model.amazon_ads_source.stg_amazon_ads__portfolio_history
  • Input Column: 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp[creation_date]
    • Cleaning Cast to TIMESTAMP data type
    • Output Columns:
      • creation_date: Directly mapped after casting to TIMESTAMP
23. model.amazon_ads.int_amazon_ads__portfolio_history
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[creation_date]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • creation_date: Directly copied
Column Lineage
%3 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history in_budget 23. model.amazon_ads.int_amazon_ads__portfolio_history 23. model.amazon_ads.int_amazon_ads__portfolio_history in_budget 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->23. model.amazon_ads.int_amazon_ads__portfolio_history:f0 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp in_budget 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp:f0->36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0
36. model.amazon_ads_source.stg_amazon_ads__portfolio_history
  • Input Column: 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp[in_budget]
    • Cleaning Cast to BOOLEAN data type
    • Output Columns:
      • in_budget: Directly mapped after casting to BOOLEAN
23. model.amazon_ads.int_amazon_ads__portfolio_history
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[in_budget]
    • Direct This column is directly copied without any transformation
    • Output Columns:
      • in_budget: Directly copied to the output
Column Lineage
%3 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history last_updated_date 23. model.amazon_ads.int_amazon_ads__portfolio_history 23. model.amazon_ads.int_amazon_ads__portfolio_history last_updated_date 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->23. model.amazon_ads.int_amazon_ads__portfolio_history:f0 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp last_updated_date 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp:f0->36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0
36. model.amazon_ads_source.stg_amazon_ads__portfolio_history
  • Input Column: 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp[last_updated_date]
    • Cleaning Cast to TIMESTAMP data type
    • Deduplication Used in ROW_NUMBER() window function for ordering and identifying the most recent record
    • Output Columns:
      • last_updated_date: Directly mapped after casting to TIMESTAMP
23. model.amazon_ads.int_amazon_ads__portfolio_history
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[last_updated_date]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • last_updated_date: Directly copied
Column Lineage
%3 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history portfolio_name 23. model.amazon_ads.int_amazon_ads__portfolio_history 23. model.amazon_ads.int_amazon_ads__portfolio_history portfolio_name 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->23. model.amazon_ads.int_amazon_ads__portfolio_history:f0 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report portfolio_name 23. model.amazon_ads.int_amazon_ads__portfolio_history:f0->22. model.amazon_ads.amazon_ads__search_report:f0 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report portfolio_name 23. model.amazon_ads.int_amazon_ads__portfolio_history:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0 17. model.amazon_ads.amazon_ads__ad_group_report 17. model.amazon_ads.amazon_ads__ad_group_report portfolio_name 23. model.amazon_ads.int_amazon_ads__portfolio_history:f0->17. model.amazon_ads.amazon_ads__ad_group_report:f0 19. model.amazon_ads.amazon_ads__campaign_report 19. model.amazon_ads.amazon_ads__campaign_report portfolio_name 23. model.amazon_ads.int_amazon_ads__portfolio_history:f0->19. model.amazon_ads.amazon_ads__campaign_report:f0 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report portfolio_name 23. model.amazon_ads.int_amazon_ads__portfolio_history:f0->18. model.amazon_ads.amazon_ads__ad_report:f0 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp name 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp:f0->36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0
36. model.amazon_ads_source.stg_amazon_ads__portfolio_history
  • Input Column: 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • portfolio_name: Directly mapped and renamed
23. model.amazon_ads.int_amazon_ads__portfolio_history
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[portfolio_name]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • portfolio_name: Directly copied
17. model.amazon_ads.amazon_ads__ad_group_report
  • Input Column: 23. model.amazon_ads.int_amazon_ads__portfolio_history[portfolio_name]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with other tables
    • Output Columns:
      • portfolio_name: Directly copied to the output
18. model.amazon_ads.amazon_ads__ad_report
  • Input Column: 23. model.amazon_ads.int_amazon_ads__portfolio_history[portfolio_name]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the campaigns table
    • Output Columns:
      • portfolio_name: Directly copied to the output
19. model.amazon_ads.amazon_ads__campaign_report
  • Input Column: 23. model.amazon_ads.int_amazon_ads__portfolio_history[portfolio_name]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the campaigns table
    • Output Columns:
      • portfolio_name: Directly copied to the output
20. model.amazon_ads.amazon_ads__keyword_report
  • Input Column: 23. model.amazon_ads.int_amazon_ads__portfolio_history[portfolio_name]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the campaigns table
    • Output Columns:
      • portfolio_name: Directly copied to the output
22. model.amazon_ads.amazon_ads__search_report
  • Input Column: 23. model.amazon_ads.int_amazon_ads__portfolio_history[portfolio_name]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the campaigns table
    • Output Columns:
      • portfolio_name: Directly copied to the output
Column Lineage
%3 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history profile_id 23. model.amazon_ads.int_amazon_ads__portfolio_history 23. model.amazon_ads.int_amazon_ads__portfolio_history profile_id 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->23. model.amazon_ads.int_amazon_ads__portfolio_history:f0 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp profile_id 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp:f0->36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0
36. model.amazon_ads_source.stg_amazon_ads__portfolio_history
  • Input Column: 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp[profile_id]
    • Cleaning The column is cast as INT in the fields CTE and then as TEXT in the final CTE
    • Output Columns:
      • profile_id: Mapped after casting
23. model.amazon_ads.int_amazon_ads__portfolio_history
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[profile_id]
    • Direct This column is directly copied without any transformation
    • Output Columns:
      • profile_id: Directly copied to the output
Column Lineage
%3 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history serving_status 23. model.amazon_ads.int_amazon_ads__portfolio_history 23. model.amazon_ads.int_amazon_ads__portfolio_history serving_status 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->23. model.amazon_ads.int_amazon_ads__portfolio_history:f0 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp serving_status 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp:f0->36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0
36. model.amazon_ads_source.stg_amazon_ads__portfolio_history
  • Input Column: 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp[serving_status]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • serving_status: Directly mapped
23. model.amazon_ads.int_amazon_ads__portfolio_history
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[serving_status]
    • Direct This column is directly copied without any transformation
    • Output Columns:
      • serving_status: Directly copied to the output
Column Lineage
%3 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history state 23. model.amazon_ads.int_amazon_ads__portfolio_history 23. model.amazon_ads.int_amazon_ads__portfolio_history state 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->23. model.amazon_ads.int_amazon_ads__portfolio_history:f0 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp state 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp:f0->36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0
36. model.amazon_ads_source.stg_amazon_ads__portfolio_history
  • Input Column: 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp[state]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • state: Directly mapped
23. model.amazon_ads.int_amazon_ads__portfolio_history
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[state]
    • Direct This column is directly copied without any transformation
    • Output Columns:
      • state: Directly copied to the output
Column Lineage
%3 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history is_most_recent_record 23. model.amazon_ads.int_amazon_ads__portfolio_history 23. model.amazon_ads.int_amazon_ads__portfolio_history is_most_recent_record 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->23. model.amazon_ads.int_amazon_ads__portfolio_history:f0
23. model.amazon_ads.int_amazon_ads__portfolio_history
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[is_most_recent_record]
    • Filtering This column is used to filter the data to include only the most recent records
    • Direct After filtering, this column is directly copied to the output
    • Output Columns:
      • is_most_recent_record: Directly copied to the output after being used for filtering
24. model.amazon_ads_source.stg_amazon_ads__ad_group_history

This SQL query stages data from an Amazon Ads ad group history source table. It casts and renames several columns, adds a source_relation column, and creates an is_most_recent_record flag to identify the most recent record for each ad group. The query also performs type casting to ensure data consistency.

CleaningDeduplicationOther
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_amazon_ads_source.stg_amazon_ads__ad_group_history_tmp
), fields AS (
  SELECT
    CAST(NULL AS INT) AS campaign_id,
    CAST(NULL AS TIMESTAMP) AS creation_date,
    CAST(NULL AS FLOAT) AS default_bid,
    CAST(NULL AS TEXT) AS id,
    CAST(NULL AS TIMESTAMP) AS last_updated_date,
    CAST(NULL AS TEXT) AS name,
    CAST(NULL AS TEXT) AS serving_status,
    CAST(NULL AS TEXT) AS state,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    CAST(id AS TEXT) AS ad_group_id,
    CAST(campaign_id AS TEXT) AS campaign_id,
    creation_date,
    default_bid,
    last_updated_date,
    name AS ad_group_name,
    serving_status,
    state,
    ROW_NUMBER() OVER (PARTITION BY source_relation, id ORDER BY last_updated_date DESC) = 1 AS is_most_recent_record
  FROM fields
)
SELECT
  *
FROM final
%3 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history source_relation ad_group_id ad_group_name campaign_id creation_date default_bid last_updated_date serving_status state is_most_recent_record 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp id last_updated_date campaign_id creation_date default_bid name serving_status state 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp:f0->24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f1 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp:f1->24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f6 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp:f1->24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f9 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp:f2->24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f3 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp:f3->24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f4 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp:f4->24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f5 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp:f5->24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f2 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp:f6->24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f7 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp:f7->24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f8
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
ad_group_id text The ID representing the ad group, if present in the source data.
ad_group_name text The name of the ad group, if present in the source data.
campaign_id text The ID representing the campaign, if present in the source data.
creation_date text The date of creation of the record.
default_bid double precision The date of creation of the record.
last_updated_date text Date of last update to record.
serving_status text The current serving status of the record.
state text The state of the record (enabled, paused, or archived).
is_most_recent_record boolean Boolean indicating whether record was the most recent instance.
Column Lineage
%3 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history source_relation 17. model.amazon_ads.amazon_ads__ad_group_report 17. model.amazon_ads.amazon_ads__ad_group_report source_relation 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f0->17. model.amazon_ads.amazon_ads__ad_group_report:f0
17. model.amazon_ads.amazon_ads__ad_group_report
  • Input Column: 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history[source_relation]
    • Direct The column is directly copied without transformation
    • Integration Used as part of the join condition with other tables
    • Output Columns:
      • source_relation: Directly copied to the output
Column Lineage
%3 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp id 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history ad_group_id 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp:f0->24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f0 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report ad_group_id 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f0->22. model.amazon_ads.amazon_ads__search_report:f0 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report ad_group_id 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0 17. model.amazon_ads.amazon_ads__ad_group_report 17. model.amazon_ads.amazon_ads__ad_group_report ad_group_id 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f0->17. model.amazon_ads.amazon_ads__ad_group_report:f0 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report ad_group_id 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f0->18. model.amazon_ads.amazon_ads__ad_report:f0
24. model.amazon_ads_source.stg_amazon_ads__ad_group_history
  • Input Column: 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp[id]
    • Cleaning Cast to TEXT type
    • Deduplication Used in ROW_NUMBER() window function for deduplication
    • Output Columns:
      • ad_group_id: Directly mapped after casting to TEXT
17. model.amazon_ads.amazon_ads__ad_group_report
  • Input Column: 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history[ad_group_id]
    • Direct The column is directly copied without transformation
    • Integration Used as part of the join condition with the report table
    • Output Columns:
      • ad_group_id: Directly copied to the output
18. model.amazon_ads.amazon_ads__ad_report
  • Input Column: 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history[ad_group_id]
    • Integration used as the key to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_id: directly copied
20. model.amazon_ads.amazon_ads__keyword_report
  • Input Column: 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history[ad_group_id]
    • Integration used as the key to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_id: directly copied
22. model.amazon_ads.amazon_ads__search_report
  • Input Column: 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history[ad_group_id]
    • Integration used as part of the JOIN condition to match with the report table
    • Direct directly selected in the final output
    • Output Columns:
      • ad_group_id: directly copied to the output
Column Lineage
%3 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp name 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history ad_group_name 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp:f0->24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f0 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report ad_group_name 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f0->22. model.amazon_ads.amazon_ads__search_report:f0 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report ad_group_name 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0 17. model.amazon_ads.amazon_ads__ad_group_report 17. model.amazon_ads.amazon_ads__ad_group_report ad_group_name 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f0->17. model.amazon_ads.amazon_ads__ad_group_report:f0 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report ad_group_name 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f0->18. model.amazon_ads.amazon_ads__ad_report:f0
24. model.amazon_ads_source.stg_amazon_ads__ad_group_history
  • Input Column: 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp[name]
    • Cleaning Cast to TEXT type
    • Output Columns:
      • ad_group_name: Directly mapped after casting to TEXT
17. model.amazon_ads.amazon_ads__ad_group_report
  • Input Column: 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history[ad_group_name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • ad_group_name: Directly copied to the output
18. model.amazon_ads.amazon_ads__ad_report
  • Input Column: 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history[ad_group_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_name: directly copied
20. model.amazon_ads.amazon_ads__keyword_report
  • Input Column: 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history[ad_group_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_name: directly copied
22. model.amazon_ads.amazon_ads__search_report
  • Input Column: 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history[ad_group_name]
    • Direct directly selected in the final output
    • Output Columns:
      • ad_group_name: directly copied to the output
Column Lineage
%3 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp campaign_id 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history campaign_id 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp:f0->24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f0
24. model.amazon_ads_source.stg_amazon_ads__ad_group_history
  • Input Column: 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp[campaign_id]
    • Cleaning Cast to TEXT type
    • Output Columns:
      • campaign_id: Directly mapped after casting to TEXT
Column Lineage
%3 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp creation_date 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history creation_date 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp:f0->24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f0
24. model.amazon_ads_source.stg_amazon_ads__ad_group_history
  • Input Column: 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp[creation_date]
    • Cleaning Cast to TIMESTAMP type
    • Output Columns:
      • creation_date: Directly mapped after casting to TIMESTAMP
Column Lineage
%3 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp default_bid 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history default_bid 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp:f0->24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f0 17. model.amazon_ads.amazon_ads__ad_group_report 17. model.amazon_ads.amazon_ads__ad_group_report default_bid 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f0->17. model.amazon_ads.amazon_ads__ad_group_report:f0
24. model.amazon_ads_source.stg_amazon_ads__ad_group_history
  • Input Column: 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp[default_bid]
    • Cleaning Cast to FLOAT type
    • Output Columns:
      • default_bid: Directly mapped after casting to FLOAT
17. model.amazon_ads.amazon_ads__ad_group_report
  • Input Column: 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history[default_bid]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • default_bid: Directly copied to the output
Column Lineage
%3 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp last_updated_date 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history is_most_recent_record last_updated_date 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp:f0->24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f1 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp:f0->24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f0
24. model.amazon_ads_source.stg_amazon_ads__ad_group_history
  • Input Column: 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp[last_updated_date]
    • Cleaning Cast to TIMESTAMP type
    • Deduplication Used in ROW_NUMBER() window function for ordering and deduplication
    • Output Columns:
      • last_updated_date: Directly mapped after casting to TIMESTAMP
      • is_most_recent_record: Used to determine the most recent record
Column Lineage
%3 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp serving_status 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history serving_status 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp:f0->24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f0 17. model.amazon_ads.amazon_ads__ad_group_report 17. model.amazon_ads.amazon_ads__ad_group_report serving_status 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f0->17. model.amazon_ads.amazon_ads__ad_group_report:f0
24. model.amazon_ads_source.stg_amazon_ads__ad_group_history
  • Input Column: 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp[serving_status]
    • Cleaning Cast to TEXT type
    • Output Columns:
      • serving_status: Directly mapped after casting to TEXT
17. model.amazon_ads.amazon_ads__ad_group_report
  • Input Column: 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history[serving_status]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • serving_status: Directly copied to the output
Column Lineage
%3 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp state 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history state 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp:f0->24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f0 17. model.amazon_ads.amazon_ads__ad_group_report 17. model.amazon_ads.amazon_ads__ad_group_report state 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f0->17. model.amazon_ads.amazon_ads__ad_group_report:f0
24. model.amazon_ads_source.stg_amazon_ads__ad_group_history
  • Input Column: 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp[state]
    • Cleaning Cast to TEXT type
    • Output Columns:
      • state: Directly mapped after casting to TEXT
17. model.amazon_ads.amazon_ads__ad_group_report
  • Input Column: 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history[state]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • state: Directly copied to the output
Column Lineage
%3 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp last_updated_date 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history is_most_recent_record last_updated_date 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp:f0->24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f1 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp:f0->24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f0
24. model.amazon_ads_source.stg_amazon_ads__ad_group_history
  • Input Column: 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp[last_updated_date]
    • Cleaning Cast to TIMESTAMP type
    • Deduplication Used in ROW_NUMBER() window function for ordering and deduplication
    • Output Columns:
      • last_updated_date: Directly mapped after casting to TIMESTAMP
      • is_most_recent_record: Used to determine the most recent record
25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of type TEXT. It's likely used as a placeholder or template for further development or testing purposes.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp id last_updated_date _fivetran_synced campaign_id creation_date default_bid name serving_status state 279. source.amazon_ads_source.amazon_ads.ad_group_history 279. source.amazon_ads_source.amazon_ads.ad_group_history
Name Type Comment
id integer None
last_updated_date text None
_fivetran_synced text None
campaign_id integer None
creation_date text None
default_bid double precision None
name text None
serving_status text None
state text None
Column Lineage
%3 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp id 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history ad_group_id 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp:f0->24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f0 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report ad_group_id 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f0->22. model.amazon_ads.amazon_ads__search_report:f0 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report ad_group_id 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0 17. model.amazon_ads.amazon_ads__ad_group_report 17. model.amazon_ads.amazon_ads__ad_group_report ad_group_id 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f0->17. model.amazon_ads.amazon_ads__ad_group_report:f0 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report ad_group_id 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f0->18. model.amazon_ads.amazon_ads__ad_report:f0
24. model.amazon_ads_source.stg_amazon_ads__ad_group_history
  • Input Column: 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp[id]
    • Cleaning Cast to TEXT type
    • Deduplication Used in ROW_NUMBER() window function for deduplication
    • Output Columns:
      • ad_group_id: Directly mapped after casting to TEXT
17. model.amazon_ads.amazon_ads__ad_group_report
  • Input Column: 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history[ad_group_id]
    • Direct The column is directly copied without transformation
    • Integration Used as part of the join condition with the report table
    • Output Columns:
      • ad_group_id: Directly copied to the output
18. model.amazon_ads.amazon_ads__ad_report
  • Input Column: 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history[ad_group_id]
    • Integration used as the key to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_id: directly copied
20. model.amazon_ads.amazon_ads__keyword_report
  • Input Column: 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history[ad_group_id]
    • Integration used as the key to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_id: directly copied
22. model.amazon_ads.amazon_ads__search_report
  • Input Column: 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history[ad_group_id]
    • Integration used as part of the JOIN condition to match with the report table
    • Direct directly selected in the final output
    • Output Columns:
      • ad_group_id: directly copied to the output
Column Lineage
%3 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp last_updated_date 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history is_most_recent_record last_updated_date 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp:f0->24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f1 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp:f0->24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f0
24. model.amazon_ads_source.stg_amazon_ads__ad_group_history
  • Input Column: 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp[last_updated_date]
    • Cleaning Cast to TIMESTAMP type
    • Deduplication Used in ROW_NUMBER() window function for ordering and deduplication
    • Output Columns:
      • last_updated_date: Directly mapped after casting to TIMESTAMP
      • is_most_recent_record: Used to determine the most recent record
Column Lineage
%3 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp campaign_id 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history campaign_id 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp:f0->24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f0
24. model.amazon_ads_source.stg_amazon_ads__ad_group_history
  • Input Column: 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp[campaign_id]
    • Cleaning Cast to TEXT type
    • Output Columns:
      • campaign_id: Directly mapped after casting to TEXT
Column Lineage
%3 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp creation_date 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history creation_date 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp:f0->24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f0
24. model.amazon_ads_source.stg_amazon_ads__ad_group_history
  • Input Column: 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp[creation_date]
    • Cleaning Cast to TIMESTAMP type
    • Output Columns:
      • creation_date: Directly mapped after casting to TIMESTAMP
Column Lineage
%3 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp default_bid 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history default_bid 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp:f0->24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f0 17. model.amazon_ads.amazon_ads__ad_group_report 17. model.amazon_ads.amazon_ads__ad_group_report default_bid 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f0->17. model.amazon_ads.amazon_ads__ad_group_report:f0
24. model.amazon_ads_source.stg_amazon_ads__ad_group_history
  • Input Column: 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp[default_bid]
    • Cleaning Cast to FLOAT type
    • Output Columns:
      • default_bid: Directly mapped after casting to FLOAT
17. model.amazon_ads.amazon_ads__ad_group_report
  • Input Column: 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history[default_bid]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • default_bid: Directly copied to the output
Column Lineage
%3 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp name 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history ad_group_name 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp:f0->24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f0 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report ad_group_name 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f0->22. model.amazon_ads.amazon_ads__search_report:f0 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report ad_group_name 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0 17. model.amazon_ads.amazon_ads__ad_group_report 17. model.amazon_ads.amazon_ads__ad_group_report ad_group_name 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f0->17. model.amazon_ads.amazon_ads__ad_group_report:f0 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report ad_group_name 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f0->18. model.amazon_ads.amazon_ads__ad_report:f0
24. model.amazon_ads_source.stg_amazon_ads__ad_group_history
  • Input Column: 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp[name]
    • Cleaning Cast to TEXT type
    • Output Columns:
      • ad_group_name: Directly mapped after casting to TEXT
17. model.amazon_ads.amazon_ads__ad_group_report
  • Input Column: 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history[ad_group_name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • ad_group_name: Directly copied to the output
18. model.amazon_ads.amazon_ads__ad_report
  • Input Column: 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history[ad_group_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_name: directly copied
20. model.amazon_ads.amazon_ads__keyword_report
  • Input Column: 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history[ad_group_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_name: directly copied
22. model.amazon_ads.amazon_ads__search_report
  • Input Column: 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history[ad_group_name]
    • Direct directly selected in the final output
    • Output Columns:
      • ad_group_name: directly copied to the output
Column Lineage
%3 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp serving_status 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history serving_status 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp:f0->24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f0 17. model.amazon_ads.amazon_ads__ad_group_report 17. model.amazon_ads.amazon_ads__ad_group_report serving_status 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f0->17. model.amazon_ads.amazon_ads__ad_group_report:f0
24. model.amazon_ads_source.stg_amazon_ads__ad_group_history
  • Input Column: 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp[serving_status]
    • Cleaning Cast to TEXT type
    • Output Columns:
      • serving_status: Directly mapped after casting to TEXT
17. model.amazon_ads.amazon_ads__ad_group_report
  • Input Column: 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history[serving_status]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • serving_status: Directly copied to the output
Column Lineage
%3 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp state 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history state 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp:f0->24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f0 17. model.amazon_ads.amazon_ads__ad_group_report 17. model.amazon_ads.amazon_ads__ad_group_report state 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history:f0->17. model.amazon_ads.amazon_ads__ad_group_report:f0
24. model.amazon_ads_source.stg_amazon_ads__ad_group_history
  • Input Column: 25. model.amazon_ads_source.stg_amazon_ads__ad_group_history_tmp[state]
    • Cleaning Cast to TEXT type
    • Output Columns:
      • state: Directly mapped after casting to TEXT
17. model.amazon_ads.amazon_ads__ad_group_report
  • Input Column: 24. model.amazon_ads_source.stg_amazon_ads__ad_group_history[state]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • state: Directly copied to the output
26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report

This SQL query performs data type casting and column renaming on a staging table for Amazon Ads ad group level reports. It creates a base CTE from a temporary table, defines a fields CTE with explicit data types for each column (mostly set to NULL or empty values), and then casts and renames columns in the final CTE. The query doesn't filter, deduplicate, or aggregate data, but focuses on data type standardization and column naming.

Cleaning
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp
), fields AS (
  SELECT
    CAST(NULL AS INT) AS ad_group_id,
    CAST(NULL AS TEXT) AS campaign_bidding_strategy,
    CAST(NULL AS INT) AS clicks,
    CAST(NULL AS FLOAT) AS cost,
    CAST(NULL AS DATE) AS date,
    CAST(NULL AS INT) AS impressions,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    CAST(ad_group_id AS TEXT) AS ad_group_id,
    campaign_bidding_strategy,
    clicks,
    cost,
    date AS date_day,
    impressions
  FROM fields
)
SELECT
  *
FROM final
%3 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report source_relation date_day ad_group_id campaign_bidding_strategy clicks impressions cost 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp ad_group_id date campaign_bidding_strategy clicks cost impressions 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp:f0->26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report:f2 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp:f1->26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report:f1 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp:f2->26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report:f3 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp:f3->26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report:f4 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp:f4->26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report:f6 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp:f5->26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report:f5
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
date_day date The date of the report.
ad_group_id text The ID representing the ad group, if present in the source data.
campaign_bidding_strategy text The bidding strategy associated with a campaign.
clicks integer The count of clicks.
impressions integer The count of impressions.
cost double precision Total cost of ad clicks.
Column Lineage
%3 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report source_relation 17. model.amazon_ads.amazon_ads__ad_group_report 17. model.amazon_ads.amazon_ads__ad_group_report source_relation 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report:f0->17. model.amazon_ads.amazon_ads__ad_group_report:f0
17. model.amazon_ads.amazon_ads__ad_group_report
  • Input Column: 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as a key to join with other tables
    • Aggregation The column is grouped by in the final SELECT statement
    • Output Columns:
      • source_relation: Directly copied to the output
Column Lineage
%3 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp date 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report date_day 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp:f0->26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report:f0 17. model.amazon_ads.amazon_ads__ad_group_report 17. model.amazon_ads.amazon_ads__ad_group_report date_day 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report:f0->17. model.amazon_ads.amazon_ads__ad_group_report:f0
26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report
  • Input Column: 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp[date]
    • Cleaning The column is cast to DATE type in the fields CTE
    • Output Columns:
      • date_day: Directly mapped after casting to DATE
17. model.amazon_ads.amazon_ads__ad_group_report
  • Input Column: 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation The column is grouped by in the final SELECT statement
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp ad_group_id 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report ad_group_id 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp:f0->26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report:f0 17. model.amazon_ads.amazon_ads__ad_group_report 17. model.amazon_ads.amazon_ads__ad_group_report ad_group_id 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report:f0->17. model.amazon_ads.amazon_ads__ad_group_report:f0
26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report
  • Input Column: 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp[ad_group_id]
    • Cleaning The column is cast to TEXT type in the final CTE
    • Output Columns:
      • ad_group_id: Directly mapped after casting to TEXT
17. model.amazon_ads.amazon_ads__ad_group_report
  • Input Column: 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report[ad_group_id]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as a key to join with the ad_groups table
    • Aggregation The column is grouped by in the final SELECT statement
    • Output Columns:
      • ad_group_id: Directly copied to the output
Column Lineage
%3 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp campaign_bidding_strategy 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report campaign_bidding_strategy 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp:f0->26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report:f0 17. model.amazon_ads.amazon_ads__ad_group_report 17. model.amazon_ads.amazon_ads__ad_group_report campaign_bidding_strategy 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report:f0->17. model.amazon_ads.amazon_ads__ad_group_report:f0
26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report
  • Input Column: 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp[campaign_bidding_strategy]
    • Cleaning The column is cast to TEXT type in the fields CTE
    • Output Columns:
      • campaign_bidding_strategy: Directly mapped after casting to TEXT
17. model.amazon_ads.amazon_ads__ad_group_report
  • Input Column: 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report[campaign_bidding_strategy]
    • Direct The column is directly copied without any transformation
    • Aggregation The column is grouped by in the final SELECT statement
    • Output Columns:
      • campaign_bidding_strategy: Directly copied to the output
Column Lineage
%3 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp clicks 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report clicks 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp:f0->26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report:f0 17. model.amazon_ads.amazon_ads__ad_group_report 17. model.amazon_ads.amazon_ads__ad_group_report clicks 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report:f0->17. model.amazon_ads.amazon_ads__ad_group_report:f0
26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report
  • Input Column: 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp[clicks]
    • Cleaning The column is cast to INT type in the fields CTE
    • Output Columns:
      • clicks: Directly mapped after casting to INT
17. model.amazon_ads.amazon_ads__ad_group_report
  • Input Column: 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report[clicks]
    • Aggregation The column is summed up in the SELECT statement
    • Output Columns:
      • clicks: Aggregated into the sum of clicks
Column Lineage
%3 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp impressions 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report impressions 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp:f0->26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report:f0 17. model.amazon_ads.amazon_ads__ad_group_report 17. model.amazon_ads.amazon_ads__ad_group_report impressions 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report:f0->17. model.amazon_ads.amazon_ads__ad_group_report:f0
26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report
  • Input Column: 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp[impressions]
    • Cleaning The column is cast to INT type in the fields CTE
    • Output Columns:
      • impressions: Directly mapped after casting to INT
17. model.amazon_ads.amazon_ads__ad_group_report
  • Input Column: 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report[impressions]
    • Aggregation The column is summed up in the SELECT statement
    • Output Columns:
      • impressions: Aggregated into the sum of impressions
Column Lineage
%3 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp cost 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report cost 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp:f0->26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report:f0 17. model.amazon_ads.amazon_ads__ad_group_report 17. model.amazon_ads.amazon_ads__ad_group_report cost 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report:f0->17. model.amazon_ads.amazon_ads__ad_group_report:f0
26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report
  • Input Column: 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp[cost]
    • Cleaning The column is cast to FLOAT type in the fields CTE
    • Output Columns:
      • cost: Directly mapped after casting to FLOAT
17. model.amazon_ads.amazon_ads__ad_group_report
  • Input Column: 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report[cost]
    • Aggregation The column is summed up in the SELECT statement
    • Output Columns:
      • cost: Aggregated into the sum of cost
27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of TEXT data type. It's likely used as a template or placeholder query, possibly for testing or initializing a structure without actually populating it with data.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp ad_group_id date _fivetran_synced campaign_bidding_strategy clicks cost impressions 280. source.amazon_ads_source.amazon_ads.ad_group_level_report 280. source.amazon_ads_source.amazon_ads.ad_group_level_report
Name Type Comment
ad_group_id integer None
date date None
_fivetran_synced text None
campaign_bidding_strategy text None
clicks integer None
cost double precision None
impressions integer None
Column Lineage
%3 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp ad_group_id 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report ad_group_id 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp:f0->26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report:f0 17. model.amazon_ads.amazon_ads__ad_group_report 17. model.amazon_ads.amazon_ads__ad_group_report ad_group_id 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report:f0->17. model.amazon_ads.amazon_ads__ad_group_report:f0
26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report
  • Input Column: 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp[ad_group_id]
    • Cleaning The column is cast to TEXT type in the final CTE
    • Output Columns:
      • ad_group_id: Directly mapped after casting to TEXT
17. model.amazon_ads.amazon_ads__ad_group_report
  • Input Column: 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report[ad_group_id]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as a key to join with the ad_groups table
    • Aggregation The column is grouped by in the final SELECT statement
    • Output Columns:
      • ad_group_id: Directly copied to the output
Column Lineage
%3 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp date 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report date_day 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp:f0->26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report:f0 17. model.amazon_ads.amazon_ads__ad_group_report 17. model.amazon_ads.amazon_ads__ad_group_report date_day 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report:f0->17. model.amazon_ads.amazon_ads__ad_group_report:f0
26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report
  • Input Column: 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp[date]
    • Cleaning The column is cast to DATE type in the fields CTE
    • Output Columns:
      • date_day: Directly mapped after casting to DATE
17. model.amazon_ads.amazon_ads__ad_group_report
  • Input Column: 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation The column is grouped by in the final SELECT statement
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp campaign_bidding_strategy 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report campaign_bidding_strategy 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp:f0->26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report:f0 17. model.amazon_ads.amazon_ads__ad_group_report 17. model.amazon_ads.amazon_ads__ad_group_report campaign_bidding_strategy 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report:f0->17. model.amazon_ads.amazon_ads__ad_group_report:f0
26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report
  • Input Column: 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp[campaign_bidding_strategy]
    • Cleaning The column is cast to TEXT type in the fields CTE
    • Output Columns:
      • campaign_bidding_strategy: Directly mapped after casting to TEXT
17. model.amazon_ads.amazon_ads__ad_group_report
  • Input Column: 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report[campaign_bidding_strategy]
    • Direct The column is directly copied without any transformation
    • Aggregation The column is grouped by in the final SELECT statement
    • Output Columns:
      • campaign_bidding_strategy: Directly copied to the output
Column Lineage
%3 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp clicks 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report clicks 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp:f0->26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report:f0 17. model.amazon_ads.amazon_ads__ad_group_report 17. model.amazon_ads.amazon_ads__ad_group_report clicks 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report:f0->17. model.amazon_ads.amazon_ads__ad_group_report:f0
26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report
  • Input Column: 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp[clicks]
    • Cleaning The column is cast to INT type in the fields CTE
    • Output Columns:
      • clicks: Directly mapped after casting to INT
17. model.amazon_ads.amazon_ads__ad_group_report
  • Input Column: 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report[clicks]
    • Aggregation The column is summed up in the SELECT statement
    • Output Columns:
      • clicks: Aggregated into the sum of clicks
Column Lineage
%3 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp cost 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report cost 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp:f0->26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report:f0 17. model.amazon_ads.amazon_ads__ad_group_report 17. model.amazon_ads.amazon_ads__ad_group_report cost 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report:f0->17. model.amazon_ads.amazon_ads__ad_group_report:f0
26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report
  • Input Column: 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp[cost]
    • Cleaning The column is cast to FLOAT type in the fields CTE
    • Output Columns:
      • cost: Directly mapped after casting to FLOAT
17. model.amazon_ads.amazon_ads__ad_group_report
  • Input Column: 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report[cost]
    • Aggregation The column is summed up in the SELECT statement
    • Output Columns:
      • cost: Aggregated into the sum of cost
Column Lineage
%3 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp impressions 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report impressions 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp:f0->26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report:f0 17. model.amazon_ads.amazon_ads__ad_group_report 17. model.amazon_ads.amazon_ads__ad_group_report impressions 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report:f0->17. model.amazon_ads.amazon_ads__ad_group_report:f0
26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report
  • Input Column: 27. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report_tmp[impressions]
    • Cleaning The column is cast to INT type in the fields CTE
    • Output Columns:
      • impressions: Directly mapped after casting to INT
17. model.amazon_ads.amazon_ads__ad_group_report
  • Input Column: 26. model.amazon_ads_source.stg_amazon_ads__ad_group_level_report[impressions]
    • Aggregation The column is summed up in the SELECT statement
    • Output Columns:
      • impressions: Aggregated into the sum of impressions
28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report

This SQL query performs a series of data type conversions and column renamings on the 'stg_amazon_ads__advertised_product_report' table. It starts by selecting all columns from a temporary table, then creates a fields CTE with NULL or empty values for all columns. Finally, it casts several columns to different data types, renames the 'date' column to 'date_day', and selects all columns from the final CTE.

Cleaning
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp
), fields AS (
  SELECT
    CAST(NULL AS INT) AS ad_group_id,
    CAST(NULL AS INT) AS ad_id,
    CAST(NULL AS TEXT) AS advertised_asin,
    CAST(NULL AS TEXT) AS advertised_sku,
    CAST(NULL AS FLOAT) AS campaign_budget_amount,
    CAST(NULL AS TEXT) AS campaign_budget_currency_code,
    CAST(NULL AS TEXT) AS campaign_budget_type,
    CAST(NULL AS INT) AS campaign_id,
    CAST(NULL AS INT) AS clicks,
    CAST(NULL AS FLOAT) AS cost,
    CAST(NULL AS DATE) AS date,
    CAST(NULL AS INT) AS impressions,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    CAST(ad_id AS TEXT) AS ad_id,
    CAST(ad_group_id AS TEXT) AS ad_group_id,
    advertised_asin,
    advertised_sku,
    campaign_budget_amount,
    campaign_budget_currency_code,
    campaign_budget_type,
    CAST(campaign_id AS TEXT) AS campaign_id,
    clicks,
    cost,
    date AS date_day,
    impressions
  FROM fields
)
SELECT
  *
FROM final
%3 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report source_relation date_day ad_id ad_group_id advertised_asin advertised_sku campaign_budget_amount campaign_budget_currency_code campaign_budget_type campaign_id clicks impressions cost 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp ad_group_id ad_id campaign_id date campaign_budget_amount campaign_budget_currency_code campaign_budget_type clicks cost impressions advertised_asin advertised_sku 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp:f0->28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f3 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp:f1->28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f2 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp:f2->28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f9 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp:f3->28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f1 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp:f4->28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f6 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp:f5->28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f7 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp:f6->28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f8 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp:f7->28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f10 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp:f8->28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f12 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp:f9->28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f11 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp:f10->28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f4 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp:f11->28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f5
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
date_day date The date of the report.
ad_id text The ID representing the ad group, if present in the source data.
ad_group_id text The ID representing the ad group, if present in the source data.
advertised_asin text The ASIN associated to an advertised product.
advertised_sku text The SKU being advertised.
campaign_budget_amount double precision Total budget allocated to the campaign.
campaign_budget_currency_code text The currency code associated with the campaign.
campaign_budget_type text One of: daily or lifetime.
campaign_id text The ID representing the campaign, if present in the source data.
clicks integer The count of clicks.
impressions integer The count of impressions.
cost double precision Total cost of ad clicks.
Column Lineage
%3 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report source_relation 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report source_relation 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f0->18. model.amazon_ads.amazon_ads__ad_report:f0
18. model.amazon_ads.amazon_ads__ad_report
  • Input Column: 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join conditions with other tables
    • Output Columns:
      • source_relation: Directly copied to the output
Column Lineage
%3 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp date 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report date_day 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp:f0->28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f0 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report date_day 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f0->18. model.amazon_ads.amazon_ads__ad_report:f0
28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report
  • Input Column: 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp[date]
    • Cleaning The column is renamed to 'date_day'
    • Output Columns:
      • date_day: Directly mapped and renamed
18. model.amazon_ads.amazon_ads__ad_report
  • Input Column: 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp ad_id 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report ad_id 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp:f0->28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f0 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report ad_id 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f0->18. model.amazon_ads.amazon_ads__ad_report:f0
28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report
  • Input Column: 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp[ad_id]
    • Cleaning The column is cast to TEXT in the final CTE
    • Output Columns:
      • ad_id: Directly mapped after casting to TEXT
18. model.amazon_ads.amazon_ads__ad_report
  • Input Column: 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report[ad_id]
    • Direct The column is directly copied without any transformation
    • Integration Used to join with the ads table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • ad_id: Directly copied to the output
Column Lineage
%3 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp ad_group_id 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report ad_group_id 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp:f0->28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f0 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report ad_group_id 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f0->18. model.amazon_ads.amazon_ads__ad_report:f0
28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report
  • Input Column: 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp[ad_group_id]
    • Cleaning The column is cast to TEXT in the final CTE
    • Output Columns:
      • ad_group_id: Directly mapped after casting to TEXT
18. model.amazon_ads.amazon_ads__ad_report
  • Input Column: 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report[ad_group_id]
    • Direct The column is directly copied without any transformation
    • Integration Used to join with the ad_groups table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • ad_group_id: Directly copied to the output
Column Lineage
%3 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp advertised_asin 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report advertised_asin 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp:f0->28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f0 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report advertised_asin 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f0->18. model.amazon_ads.amazon_ads__ad_report:f0
28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report
  • Input Column: 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp[advertised_asin]
    • Direct The column is directly copied to the output without transformation
    • Output Columns:
      • advertised_asin: Directly mapped without any transformation
18. model.amazon_ads.amazon_ads__ad_report
  • Input Column: 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report[advertised_asin]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • advertised_asin: Directly copied to the output
Column Lineage
%3 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp advertised_sku 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report advertised_sku 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp:f0->28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f0 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report advertised_sku 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f0->18. model.amazon_ads.amazon_ads__ad_report:f0
28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report
  • Input Column: 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp[advertised_sku]
    • Direct The column is directly copied to the output without transformation
    • Output Columns:
      • advertised_sku: Directly mapped without any transformation
18. model.amazon_ads.amazon_ads__ad_report
  • Input Column: 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report[advertised_sku]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • advertised_sku: Directly copied to the output
Column Lineage
%3 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp campaign_budget_amount 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report campaign_budget_amount 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp:f0->28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f0 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report campaign_budget_amount 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f0->18. model.amazon_ads.amazon_ads__ad_report:f0
28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report
  • Input Column: 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp[campaign_budget_amount]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • campaign_budget_amount: Directly mapped
18. model.amazon_ads.amazon_ads__ad_report
  • Input Column: 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report[campaign_budget_amount]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • campaign_budget_amount: Directly copied to the output
Column Lineage
%3 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp campaign_budget_currency_code 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report campaign_budget_currency_code 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp:f0->28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f0 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report campaign_budget_currency_code 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f0->18. model.amazon_ads.amazon_ads__ad_report:f0
28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report
  • Input Column: 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp[campaign_budget_currency_code]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • campaign_budget_currency_code: Directly mapped
18. model.amazon_ads.amazon_ads__ad_report
  • Input Column: 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report[campaign_budget_currency_code]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • campaign_budget_currency_code: Directly copied to the output
Column Lineage
%3 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp campaign_budget_type 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report campaign_budget_type 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp:f0->28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f0 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report campaign_budget_type 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f0->18. model.amazon_ads.amazon_ads__ad_report:f0
28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report
  • Input Column: 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp[campaign_budget_type]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • campaign_budget_type: Directly mapped
18. model.amazon_ads.amazon_ads__ad_report
  • Input Column: 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report[campaign_budget_type]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • campaign_budget_type: Directly copied to the output
Column Lineage
%3 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp campaign_id 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report campaign_id 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp:f0->28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f0 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report campaign_id 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f0->18. model.amazon_ads.amazon_ads__ad_report:f0
28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report
  • Input Column: 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp[campaign_id]
    • Cleaning The column is cast to TEXT in the final CTE
    • Output Columns:
      • campaign_id: Directly mapped after casting to TEXT
18. model.amazon_ads.amazon_ads__ad_report
  • Input Column: 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report[campaign_id]
    • Direct The column is directly copied without any transformation
    • Integration Used to join with the campaigns table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • campaign_id: Directly copied to the output
Column Lineage
%3 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp clicks 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report clicks 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp:f0->28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f0 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report clicks 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f0->18. model.amazon_ads.amazon_ads__ad_report:f0
28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report
  • Input Column: 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp[clicks]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • clicks: Directly mapped
18. model.amazon_ads.amazon_ads__ad_report
  • Input Column: 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report[clicks]
    • Aggregation The clicks are summed up in the GROUP BY clause
    • Output Columns:
      • clicks: The sum of clicks is directly mapped to the output 'clicks' column
Column Lineage
%3 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp impressions 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report impressions 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp:f0->28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f0 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report impressions 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f0->18. model.amazon_ads.amazon_ads__ad_report:f0
28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report
  • Input Column: 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp[impressions]
    • Cleaning The column is cast to INT data type
    • Direct The column is directly copied to the output after casting
    • Output Columns:
      • impressions: Directly mapped after casting to INT
18. model.amazon_ads.amazon_ads__ad_report
  • Input Column: 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report[impressions]
    • Aggregation The impressions are summed up in the GROUP BY clause
    • Output Columns:
      • impressions: The sum of impressions is directly mapped to the output 'impressions' column
Column Lineage
%3 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp cost 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report cost 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp:f0->28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f0 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report cost 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f0->18. model.amazon_ads.amazon_ads__ad_report:f0
28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report
  • Input Column: 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp[cost]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • cost: Directly mapped
18. model.amazon_ads.amazon_ads__ad_report
  • Input Column: 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report[cost]
    • Aggregation The cost is summed up in the GROUP BY clause
    • Output Columns:
      • cost: The sum of cost is directly mapped to the output 'cost' column
29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of type TEXT. It's likely used as a placeholder or template for a staging table in a dbt (data build tool) project, specifically for Amazon Ads data.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp ad_group_id ad_id campaign_id date _fivetran_synced campaign_budget_amount campaign_budget_currency_code campaign_budget_type clicks cost impressions advertised_asin advertised_sku 281. source.amazon_ads_source.amazon_ads.advertised_product_report 281. source.amazon_ads_source.amazon_ads.advertised_product_report
Name Type Comment
ad_group_id integer None
ad_id integer None
campaign_id integer None
date date None
_fivetran_synced timestamp without time zone None
campaign_budget_amount double precision None
campaign_budget_currency_code text None
campaign_budget_type text None
clicks integer None
cost double precision None
impressions integer None
advertised_asin integer None
advertised_sku integer None
Column Lineage
%3 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp ad_group_id 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report ad_group_id 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp:f0->28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f0 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report ad_group_id 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f0->18. model.amazon_ads.amazon_ads__ad_report:f0
28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report
  • Input Column: 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp[ad_group_id]
    • Cleaning The column is cast to TEXT in the final CTE
    • Output Columns:
      • ad_group_id: Directly mapped after casting to TEXT
18. model.amazon_ads.amazon_ads__ad_report
  • Input Column: 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report[ad_group_id]
    • Direct The column is directly copied without any transformation
    • Integration Used to join with the ad_groups table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • ad_group_id: Directly copied to the output
Column Lineage
%3 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp ad_id 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report ad_id 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp:f0->28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f0 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report ad_id 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f0->18. model.amazon_ads.amazon_ads__ad_report:f0
28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report
  • Input Column: 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp[ad_id]
    • Cleaning The column is cast to TEXT in the final CTE
    • Output Columns:
      • ad_id: Directly mapped after casting to TEXT
18. model.amazon_ads.amazon_ads__ad_report
  • Input Column: 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report[ad_id]
    • Direct The column is directly copied without any transformation
    • Integration Used to join with the ads table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • ad_id: Directly copied to the output
Column Lineage
%3 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp campaign_id 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report campaign_id 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp:f0->28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f0 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report campaign_id 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f0->18. model.amazon_ads.amazon_ads__ad_report:f0
28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report
  • Input Column: 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp[campaign_id]
    • Cleaning The column is cast to TEXT in the final CTE
    • Output Columns:
      • campaign_id: Directly mapped after casting to TEXT
18. model.amazon_ads.amazon_ads__ad_report
  • Input Column: 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report[campaign_id]
    • Direct The column is directly copied without any transformation
    • Integration Used to join with the campaigns table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • campaign_id: Directly copied to the output
Column Lineage
%3 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp date 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report date_day 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp:f0->28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f0 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report date_day 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f0->18. model.amazon_ads.amazon_ads__ad_report:f0
28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report
  • Input Column: 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp[date]
    • Cleaning The column is renamed to 'date_day'
    • Output Columns:
      • date_day: Directly mapped and renamed
18. model.amazon_ads.amazon_ads__ad_report
  • Input Column: 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp campaign_budget_amount 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report campaign_budget_amount 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp:f0->28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f0 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report campaign_budget_amount 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f0->18. model.amazon_ads.amazon_ads__ad_report:f0
28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report
  • Input Column: 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp[campaign_budget_amount]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • campaign_budget_amount: Directly mapped
18. model.amazon_ads.amazon_ads__ad_report
  • Input Column: 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report[campaign_budget_amount]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • campaign_budget_amount: Directly copied to the output
Column Lineage
%3 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp campaign_budget_currency_code 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report campaign_budget_currency_code 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp:f0->28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f0 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report campaign_budget_currency_code 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f0->18. model.amazon_ads.amazon_ads__ad_report:f0
28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report
  • Input Column: 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp[campaign_budget_currency_code]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • campaign_budget_currency_code: Directly mapped
18. model.amazon_ads.amazon_ads__ad_report
  • Input Column: 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report[campaign_budget_currency_code]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • campaign_budget_currency_code: Directly copied to the output
Column Lineage
%3 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp campaign_budget_type 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report campaign_budget_type 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp:f0->28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f0 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report campaign_budget_type 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f0->18. model.amazon_ads.amazon_ads__ad_report:f0
28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report
  • Input Column: 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp[campaign_budget_type]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • campaign_budget_type: Directly mapped
18. model.amazon_ads.amazon_ads__ad_report
  • Input Column: 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report[campaign_budget_type]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • campaign_budget_type: Directly copied to the output
Column Lineage
%3 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp clicks 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report clicks 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp:f0->28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f0 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report clicks 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f0->18. model.amazon_ads.amazon_ads__ad_report:f0
28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report
  • Input Column: 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp[clicks]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • clicks: Directly mapped
18. model.amazon_ads.amazon_ads__ad_report
  • Input Column: 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report[clicks]
    • Aggregation The clicks are summed up in the GROUP BY clause
    • Output Columns:
      • clicks: The sum of clicks is directly mapped to the output 'clicks' column
Column Lineage
%3 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp cost 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report cost 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp:f0->28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f0 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report cost 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f0->18. model.amazon_ads.amazon_ads__ad_report:f0
28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report
  • Input Column: 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp[cost]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • cost: Directly mapped
18. model.amazon_ads.amazon_ads__ad_report
  • Input Column: 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report[cost]
    • Aggregation The cost is summed up in the GROUP BY clause
    • Output Columns:
      • cost: The sum of cost is directly mapped to the output 'cost' column
Column Lineage
%3 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp impressions 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report impressions 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp:f0->28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f0 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report impressions 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report:f0->18. model.amazon_ads.amazon_ads__ad_report:f0
28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report
  • Input Column: 29. model.amazon_ads_source.stg_amazon_ads__advertised_product_report_tmp[impressions]
    • Cleaning The column is cast to INT data type
    • Direct The column is directly copied to the output after casting
    • Output Columns:
      • impressions: Directly mapped after casting to INT
18. model.amazon_ads.amazon_ads__ad_report
  • Input Column: 28. model.amazon_ads_source.stg_amazon_ads__advertised_product_report[impressions]
    • Aggregation The impressions are summed up in the GROUP BY clause
    • Output Columns:
      • impressions: The sum of impressions is directly mapped to the output 'impressions' column
30. model.amazon_ads_source.stg_amazon_ads__campaign_history

This SQL query stages data from an Amazon Ads campaign history source. It first creates a base CTE from a temporary table, then defines a fields CTE with nullable columns of specific data types. The final CTE casts some columns, renames others, and adds a flag for the most recent record per campaign. The query then selects all columns from this final CTE.

CleaningDeduplication
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_amazon_ads_source.stg_amazon_ads__campaign_history_tmp
), fields AS (
  SELECT
    CAST(NULL AS TEXT) AS bidding_strategy,
    CAST(NULL AS TIMESTAMP) AS creation_date,
    CAST(NULL AS DATE) AS end_date,
    CAST(NULL AS TEXT) AS id,
    CAST(NULL AS TIMESTAMP) AS last_updated_date,
    CAST(NULL AS TEXT) AS name,
    CAST(NULL AS INT) AS portfolio_id,
    CAST(NULL AS INT) AS profile_id,
    CAST(NULL AS TEXT) AS serving_status,
    CAST(NULL AS DATE) AS start_date,
    CAST(NULL AS TEXT) AS state,
    CAST(NULL AS TEXT) AS targeting_type,
    CAST(NULL AS FLOAT) AS budget,
    CAST(NULL AS TEXT) AS budget_type,
    CAST(NULL AS FLOAT) AS effective_budget,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    CAST(id AS TEXT) AS campaign_id,
    last_updated_date,
    bidding_strategy,
    creation_date,
    end_date,
    name AS campaign_name,
    CAST(portfolio_id AS TEXT) AS portfolio_id,
    CAST(profile_id AS TEXT) AS profile_id,
    serving_status,
    start_date,
    state,
    targeting_type,
    budget,
    budget_type,
    effective_budget,
    ROW_NUMBER() OVER (PARTITION BY source_relation, id ORDER BY last_updated_date DESC) = 1 AS is_most_recent_record
  FROM fields
)
SELECT
  *
FROM final
%3 30. model.amazon_ads_source.stg_amazon_ads__campaign_history 30. model.amazon_ads_source.stg_amazon_ads__campaign_history source_relation campaign_id campaign_name creation_date last_updated_date portfolio_id bidding_strategy budget budget_type effective_budget end_date profile_id serving_status start_date state targeting_type is_most_recent_record 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp id last_updated_date bidding_strategy creation_date budget end_date name portfolio_id profile_id serving_status start_date state targeting_type budget_type effective_budget 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp:f0->30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f1 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp:f1->30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f4 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp:f2->30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f6 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp:f3->30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f3 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp:f4->30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f7 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp:f5->30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f10 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp:f6->30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f2 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp:f7->30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f5 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp:f8->30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f11 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp:f9->30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f12 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp:f10->30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f13 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp:f11->30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f14 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp:f12->30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f15 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp:f13->30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f8 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp:f14->30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f9
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
campaign_id text The ID representing the campaign, if present in the source data.
campaign_name text The name of the campaign, if present in the source data.
creation_date text The date of creation of the record.
last_updated_date text Date of last update to record.
portfolio_id text The ID of the Portfolio.
bidding_strategy text The bidding strategy associated with a campaign (legacyForSales, autoForSales, or manual.)
budget integer The budget for the campaign.
budget_type text One of: daily or lifetime.
effective_budget integer Adjusted budget for the campaign that has been impacted by a budget rule.
end_date integer The end date of the campaign.
profile_id text The profile ID associated with your Amazon Ads account. Advertisers who operate in more than one marketplace (for example, Amazon.com, Amazon.co.uk, Amazon.co.jp) will have one profile associated with each marketplace.
serving_status text The current serving status of the record.
start_date date The start date of the campaign.
state text The state of the record (enabled, paused, or archived).
targeting_type text The type of targeting used for the campaign, either manual or auto.
is_most_recent_record boolean Boolean indicating whether record was the most recent instance.
Column Lineage
%3 30. model.amazon_ads_source.stg_amazon_ads__campaign_history 30. model.amazon_ads_source.stg_amazon_ads__campaign_history source_relation 21. model.amazon_ads.amazon_ads__portfolio_report 21. model.amazon_ads.amazon_ads__portfolio_report source_relation 30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0->21. model.amazon_ads.amazon_ads__portfolio_report:f0 16. model.amazon_ads.amazon_ads__account_report 16. model.amazon_ads.amazon_ads__account_report source_relation 30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0->16. model.amazon_ads.amazon_ads__account_report:f0 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report source_relation 30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0->22. model.amazon_ads.amazon_ads__search_report:f0 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report source_relation 30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0 17. model.amazon_ads.amazon_ads__ad_group_report 17. model.amazon_ads.amazon_ads__ad_group_report source_relation 30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0->17. model.amazon_ads.amazon_ads__ad_group_report:f0 19. model.amazon_ads.amazon_ads__campaign_report 19. model.amazon_ads.amazon_ads__campaign_report source_relation 30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0->19. model.amazon_ads.amazon_ads__campaign_report:f0 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report source_relation 30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0->18. model.amazon_ads.amazon_ads__ad_report:f0
16. model.amazon_ads.amazon_ads__account_report
  • Input Column: 30. model.amazon_ads_source.stg_amazon_ads__campaign_history[source_relation]
    • Integration used as a key to join with the report table
    • Direct copied to the output without transformation
    • Output Columns:
      • source_relation: directly copied to the output
17. model.amazon_ads.amazon_ads__ad_group_report
  • Input Column: 30. model.amazon_ads_source.stg_amazon_ads__campaign_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
18. model.amazon_ads.amazon_ads__ad_report
  • Input Column: 30. model.amazon_ads_source.stg_amazon_ads__campaign_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Output Columns:
      • source_relation: directly copied
19. model.amazon_ads.amazon_ads__campaign_report
  • Input Column: 30. model.amazon_ads_source.stg_amazon_ads__campaign_history[source_relation]
    • Integration Used as a key to join with other tables
    • Direct Directly copied to the output
    • Output Columns:
      • source_relation: Directly copied
20. model.amazon_ads.amazon_ads__keyword_report
  • Input Column: 30. model.amazon_ads_source.stg_amazon_ads__campaign_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
21. model.amazon_ads.amazon_ads__portfolio_report
  • Input Column: 30. model.amazon_ads_source.stg_amazon_ads__campaign_history[source_relation]
    • Integration Used as a key to join with other tables and ensure data from the same source is combined
    • Direct Copied directly to the output
    • Output Columns:
      • source_relation: Directly copied
22. model.amazon_ads.amazon_ads__search_report
  • Input Column: 30. model.amazon_ads_source.stg_amazon_ads__campaign_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
Column Lineage
%3 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp id 30. model.amazon_ads_source.stg_amazon_ads__campaign_history 30. model.amazon_ads_source.stg_amazon_ads__campaign_history campaign_id 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp:f0->30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report campaign_id 30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0->22. model.amazon_ads.amazon_ads__search_report:f0 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report campaign_id 30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0 17. model.amazon_ads.amazon_ads__ad_group_report 17. model.amazon_ads.amazon_ads__ad_group_report campaign_id 30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0->17. model.amazon_ads.amazon_ads__ad_group_report:f0 19. model.amazon_ads.amazon_ads__campaign_report 19. model.amazon_ads.amazon_ads__campaign_report campaign_id 30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0->19. model.amazon_ads.amazon_ads__campaign_report:f0 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report campaign_id 30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0->18. model.amazon_ads.amazon_ads__ad_report:f0
30. model.amazon_ads_source.stg_amazon_ads__campaign_history
  • Input Column: 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp[id]
    • Cleaning The column is cast as TEXT
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • campaign_id: Directly mapped after casting to TEXT
17. model.amazon_ads.amazon_ads__ad_group_report
  • Input Column: 30. model.amazon_ads_source.stg_amazon_ads__campaign_history[campaign_id]
    • Integration used as a joining key with other tables
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
18. model.amazon_ads.amazon_ads__ad_report
  • Input Column: 30. model.amazon_ads_source.stg_amazon_ads__campaign_history[campaign_id]
    • Integration used as join key with the report table
    • Direct directly copied to output
    • Output Columns:
      • campaign_id: directly copied
19. model.amazon_ads.amazon_ads__campaign_report
  • Input Column: 30. model.amazon_ads_source.stg_amazon_ads__campaign_history[campaign_id]
    • Integration Used as a key to join with the report table
    • Direct Directly copied to the output
    • Output Columns:
      • campaign_id: Directly copied
20. model.amazon_ads.amazon_ads__keyword_report
  • Input Column: 30. model.amazon_ads_source.stg_amazon_ads__campaign_history[campaign_id]
    • Integration used as the key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
22. model.amazon_ads.amazon_ads__search_report
  • Input Column: 30. model.amazon_ads_source.stg_amazon_ads__campaign_history[campaign_id]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
Column Lineage
%3 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp name 30. model.amazon_ads_source.stg_amazon_ads__campaign_history 30. model.amazon_ads_source.stg_amazon_ads__campaign_history campaign_name 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp:f0->30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report campaign_name 30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0->22. model.amazon_ads.amazon_ads__search_report:f0 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report campaign_name 30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0 17. model.amazon_ads.amazon_ads__ad_group_report 17. model.amazon_ads.amazon_ads__ad_group_report campaign_name 30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0->17. model.amazon_ads.amazon_ads__ad_group_report:f0 19. model.amazon_ads.amazon_ads__campaign_report 19. model.amazon_ads.amazon_ads__campaign_report campaign_name 30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0->19. model.amazon_ads.amazon_ads__campaign_report:f0 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report campaign_name 30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0->18. model.amazon_ads.amazon_ads__ad_report:f0
30. model.amazon_ads_source.stg_amazon_ads__campaign_history
  • Input Column: 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp[name]
    • Direct Copied without transformation
    • Output Columns:
      • campaign_name: Mapped and renamed
17. model.amazon_ads.amazon_ads__ad_group_report
  • Input Column: 30. model.amazon_ads_source.stg_amazon_ads__campaign_history[campaign_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_name: directly copied
18. model.amazon_ads.amazon_ads__ad_report
  • Input Column: 30. model.amazon_ads_source.stg_amazon_ads__campaign_history[campaign_name]
    • Direct directly copied to output
    • Output Columns:
      • campaign_name: directly copied
19. model.amazon_ads.amazon_ads__campaign_report
  • Input Column: 30. model.amazon_ads_source.stg_amazon_ads__campaign_history[campaign_name]
    • Direct Directly copied to the output
    • Output Columns:
      • campaign_name: Directly copied
20. model.amazon_ads.amazon_ads__keyword_report
  • Input Column: 30. model.amazon_ads_source.stg_amazon_ads__campaign_history[campaign_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_name: directly copied
22. model.amazon_ads.amazon_ads__search_report
  • Input Column: 30. model.amazon_ads_source.stg_amazon_ads__campaign_history[campaign_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_name: directly copied
Column Lineage
%3 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp creation_date 30. model.amazon_ads_source.stg_amazon_ads__campaign_history 30. model.amazon_ads_source.stg_amazon_ads__campaign_history creation_date 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp:f0->30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0
30. model.amazon_ads_source.stg_amazon_ads__campaign_history
  • Input Column: 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp[creation_date]
    • Direct Copied without transformation
    • Output Columns:
      • creation_date: Directly mapped
Column Lineage
%3 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp last_updated_date 30. model.amazon_ads_source.stg_amazon_ads__campaign_history 30. model.amazon_ads_source.stg_amazon_ads__campaign_history last_updated_date 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp:f0->30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0
30. model.amazon_ads_source.stg_amazon_ads__campaign_history
  • Input Column: 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp[last_updated_date]
    • Direct Copied without transformation
    • Deduplication Used in the ROW_NUMBER() function to order and identify the most recent record
    • Output Columns:
      • last_updated_date: Directly mapped
Column Lineage
%3 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp portfolio_id 30. model.amazon_ads_source.stg_amazon_ads__campaign_history 30. model.amazon_ads_source.stg_amazon_ads__campaign_history portfolio_id 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp:f0->30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0 21. model.amazon_ads.amazon_ads__portfolio_report 21. model.amazon_ads.amazon_ads__portfolio_report portfolio_id 30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0->21. model.amazon_ads.amazon_ads__portfolio_report:f0
30. model.amazon_ads_source.stg_amazon_ads__campaign_history
  • Input Column: 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp[portfolio_id]
    • Cleaning Cast as TEXT
    • Output Columns:
      • portfolio_id: Mapped after casting to TEXT
21. model.amazon_ads.amazon_ads__portfolio_report
  • Input Column: 30. model.amazon_ads_source.stg_amazon_ads__campaign_history[portfolio_id]
    • Integration Used as a join key to connect with the portfolios table
    • Output Columns:
      • portfolio_id: Indirectly mapped through the join with portfolios table
Column Lineage
%3 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp bidding_strategy 30. model.amazon_ads_source.stg_amazon_ads__campaign_history 30. model.amazon_ads_source.stg_amazon_ads__campaign_history bidding_strategy 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp:f0->30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0
30. model.amazon_ads_source.stg_amazon_ads__campaign_history
  • Input Column: 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp[bidding_strategy]
    • Direct Copied without transformation
    • Output Columns:
      • bidding_strategy: Directly mapped
Column Lineage
%3 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp budget 30. model.amazon_ads_source.stg_amazon_ads__campaign_history 30. model.amazon_ads_source.stg_amazon_ads__campaign_history budget 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp:f0->30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0
30. model.amazon_ads_source.stg_amazon_ads__campaign_history
  • Input Column: 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp[budget]
    • Cleaning Cast as FLOAT
    • Output Columns:
      • budget: Directly mapped after casting to FLOAT
Column Lineage
%3 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp budget_type 30. model.amazon_ads_source.stg_amazon_ads__campaign_history 30. model.amazon_ads_source.stg_amazon_ads__campaign_history budget_type 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp:f0->30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0
30. model.amazon_ads_source.stg_amazon_ads__campaign_history
  • Input Column: 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp[budget_type]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • budget_type: Directly mapped to this output column
Column Lineage
%3 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp effective_budget 30. model.amazon_ads_source.stg_amazon_ads__campaign_history 30. model.amazon_ads_source.stg_amazon_ads__campaign_history effective_budget 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp:f0->30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0
30. model.amazon_ads_source.stg_amazon_ads__campaign_history
  • Input Column: 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp[effective_budget]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as FLOAT in the fields CTE
    • Output Columns:
      • effective_budget: Directly mapped to this output column
Column Lineage
%3 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp end_date 30. model.amazon_ads_source.stg_amazon_ads__campaign_history 30. model.amazon_ads_source.stg_amazon_ads__campaign_history end_date 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp:f0->30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0
30. model.amazon_ads_source.stg_amazon_ads__campaign_history
  • Input Column: 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp[end_date]
    • Direct Copied without transformation
    • Output Columns:
      • end_date: Directly mapped
Column Lineage
%3 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp profile_id 30. model.amazon_ads_source.stg_amazon_ads__campaign_history 30. model.amazon_ads_source.stg_amazon_ads__campaign_history profile_id 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp:f0->30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0 16. model.amazon_ads.amazon_ads__account_report 16. model.amazon_ads.amazon_ads__account_report profile_id 30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0->16. model.amazon_ads.amazon_ads__account_report:f0 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report profile_id 30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0
30. model.amazon_ads_source.stg_amazon_ads__campaign_history
  • Input Column: 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp[profile_id]
    • Cleaning Cast as TEXT
    • Output Columns:
      • profile_id: Mapped after casting to TEXT
16. model.amazon_ads.amazon_ads__account_report
  • Input Column: 30. model.amazon_ads_source.stg_amazon_ads__campaign_history[profile_id]
    • Integration used as a key to join with the account_info table
    • Output Columns:
      • profile_id: directly copied to the output
20. model.amazon_ads.amazon_ads__keyword_report
  • Input Column: 30. model.amazon_ads_source.stg_amazon_ads__campaign_history[profile_id]
    • Integration Used as a key to join with the account_info table
    • Output Columns:
      • profile_id: Directly copied to the output
Column Lineage
%3 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp serving_status 30. model.amazon_ads_source.stg_amazon_ads__campaign_history 30. model.amazon_ads_source.stg_amazon_ads__campaign_history serving_status 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp:f0->30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0
30. model.amazon_ads_source.stg_amazon_ads__campaign_history
  • Input Column: 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp[serving_status]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • serving_status: Directly mapped to this output column
Column Lineage
%3 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp start_date 30. model.amazon_ads_source.stg_amazon_ads__campaign_history 30. model.amazon_ads_source.stg_amazon_ads__campaign_history start_date 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp:f0->30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0
30. model.amazon_ads_source.stg_amazon_ads__campaign_history
  • Input Column: 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp[start_date]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as DATE in the fields CTE
    • Output Columns:
      • start_date: Directly mapped to this output column
Column Lineage
%3 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp state 30. model.amazon_ads_source.stg_amazon_ads__campaign_history 30. model.amazon_ads_source.stg_amazon_ads__campaign_history state 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp:f0->30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0
30. model.amazon_ads_source.stg_amazon_ads__campaign_history
  • Input Column: 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp[state]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • state: Directly mapped to this output column
Column Lineage
%3 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp targeting_type 30. model.amazon_ads_source.stg_amazon_ads__campaign_history 30. model.amazon_ads_source.stg_amazon_ads__campaign_history targeting_type 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp:f0->30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0
30. model.amazon_ads_source.stg_amazon_ads__campaign_history
  • Input Column: 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp[targeting_type]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • targeting_type: Directly mapped to this output column
31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of type TEXT. It's likely used as a placeholder or template for further development or testing purposes.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp id last_updated_date _fivetran_synced bidding_strategy creation_date budget end_date name portfolio_id profile_id serving_status start_date state targeting_type budget_type effective_budget 282. source.amazon_ads_source.amazon_ads.campaign_history 282. source.amazon_ads_source.amazon_ads.campaign_history
Name Type Comment
id integer None
last_updated_date text None
_fivetran_synced text None
bidding_strategy text None
creation_date text None
budget integer None
end_date integer None
name text None
portfolio_id integer None
profile_id integer None
serving_status text None
start_date date None
state text None
targeting_type text None
budget_type text None
effective_budget integer None
Column Lineage
%3 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp id 30. model.amazon_ads_source.stg_amazon_ads__campaign_history 30. model.amazon_ads_source.stg_amazon_ads__campaign_history campaign_id 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp:f0->30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report campaign_id 30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0->22. model.amazon_ads.amazon_ads__search_report:f0 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report campaign_id 30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0 17. model.amazon_ads.amazon_ads__ad_group_report 17. model.amazon_ads.amazon_ads__ad_group_report campaign_id 30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0->17. model.amazon_ads.amazon_ads__ad_group_report:f0 19. model.amazon_ads.amazon_ads__campaign_report 19. model.amazon_ads.amazon_ads__campaign_report campaign_id 30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0->19. model.amazon_ads.amazon_ads__campaign_report:f0 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report campaign_id 30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0->18. model.amazon_ads.amazon_ads__ad_report:f0
30. model.amazon_ads_source.stg_amazon_ads__campaign_history
  • Input Column: 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp[id]
    • Cleaning The column is cast as TEXT
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • campaign_id: Directly mapped after casting to TEXT
17. model.amazon_ads.amazon_ads__ad_group_report
  • Input Column: 30. model.amazon_ads_source.stg_amazon_ads__campaign_history[campaign_id]
    • Integration used as a joining key with other tables
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
18. model.amazon_ads.amazon_ads__ad_report
  • Input Column: 30. model.amazon_ads_source.stg_amazon_ads__campaign_history[campaign_id]
    • Integration used as join key with the report table
    • Direct directly copied to output
    • Output Columns:
      • campaign_id: directly copied
19. model.amazon_ads.amazon_ads__campaign_report
  • Input Column: 30. model.amazon_ads_source.stg_amazon_ads__campaign_history[campaign_id]
    • Integration Used as a key to join with the report table
    • Direct Directly copied to the output
    • Output Columns:
      • campaign_id: Directly copied
20. model.amazon_ads.amazon_ads__keyword_report
  • Input Column: 30. model.amazon_ads_source.stg_amazon_ads__campaign_history[campaign_id]
    • Integration used as the key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
22. model.amazon_ads.amazon_ads__search_report
  • Input Column: 30. model.amazon_ads_source.stg_amazon_ads__campaign_history[campaign_id]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
Column Lineage
%3 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp last_updated_date 30. model.amazon_ads_source.stg_amazon_ads__campaign_history 30. model.amazon_ads_source.stg_amazon_ads__campaign_history last_updated_date 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp:f0->30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0
30. model.amazon_ads_source.stg_amazon_ads__campaign_history
  • Input Column: 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp[last_updated_date]
    • Direct Copied without transformation
    • Deduplication Used in the ROW_NUMBER() function to order and identify the most recent record
    • Output Columns:
      • last_updated_date: Directly mapped
Column Lineage
%3 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp bidding_strategy 30. model.amazon_ads_source.stg_amazon_ads__campaign_history 30. model.amazon_ads_source.stg_amazon_ads__campaign_history bidding_strategy 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp:f0->30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0
30. model.amazon_ads_source.stg_amazon_ads__campaign_history
  • Input Column: 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp[bidding_strategy]
    • Direct Copied without transformation
    • Output Columns:
      • bidding_strategy: Directly mapped
Column Lineage
%3 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp creation_date 30. model.amazon_ads_source.stg_amazon_ads__campaign_history 30. model.amazon_ads_source.stg_amazon_ads__campaign_history creation_date 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp:f0->30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0
30. model.amazon_ads_source.stg_amazon_ads__campaign_history
  • Input Column: 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp[creation_date]
    • Direct Copied without transformation
    • Output Columns:
      • creation_date: Directly mapped
Column Lineage
%3 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp budget 30. model.amazon_ads_source.stg_amazon_ads__campaign_history 30. model.amazon_ads_source.stg_amazon_ads__campaign_history budget 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp:f0->30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0
30. model.amazon_ads_source.stg_amazon_ads__campaign_history
  • Input Column: 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp[budget]
    • Cleaning Cast as FLOAT
    • Output Columns:
      • budget: Directly mapped after casting to FLOAT
Column Lineage
%3 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp end_date 30. model.amazon_ads_source.stg_amazon_ads__campaign_history 30. model.amazon_ads_source.stg_amazon_ads__campaign_history end_date 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp:f0->30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0
30. model.amazon_ads_source.stg_amazon_ads__campaign_history
  • Input Column: 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp[end_date]
    • Direct Copied without transformation
    • Output Columns:
      • end_date: Directly mapped
Column Lineage
%3 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp name 30. model.amazon_ads_source.stg_amazon_ads__campaign_history 30. model.amazon_ads_source.stg_amazon_ads__campaign_history campaign_name 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp:f0->30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report campaign_name 30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0->22. model.amazon_ads.amazon_ads__search_report:f0 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report campaign_name 30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0 17. model.amazon_ads.amazon_ads__ad_group_report 17. model.amazon_ads.amazon_ads__ad_group_report campaign_name 30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0->17. model.amazon_ads.amazon_ads__ad_group_report:f0 19. model.amazon_ads.amazon_ads__campaign_report 19. model.amazon_ads.amazon_ads__campaign_report campaign_name 30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0->19. model.amazon_ads.amazon_ads__campaign_report:f0 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report campaign_name 30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0->18. model.amazon_ads.amazon_ads__ad_report:f0
30. model.amazon_ads_source.stg_amazon_ads__campaign_history
  • Input Column: 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp[name]
    • Direct Copied without transformation
    • Output Columns:
      • campaign_name: Mapped and renamed
17. model.amazon_ads.amazon_ads__ad_group_report
  • Input Column: 30. model.amazon_ads_source.stg_amazon_ads__campaign_history[campaign_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_name: directly copied
18. model.amazon_ads.amazon_ads__ad_report
  • Input Column: 30. model.amazon_ads_source.stg_amazon_ads__campaign_history[campaign_name]
    • Direct directly copied to output
    • Output Columns:
      • campaign_name: directly copied
19. model.amazon_ads.amazon_ads__campaign_report
  • Input Column: 30. model.amazon_ads_source.stg_amazon_ads__campaign_history[campaign_name]
    • Direct Directly copied to the output
    • Output Columns:
      • campaign_name: Directly copied
20. model.amazon_ads.amazon_ads__keyword_report
  • Input Column: 30. model.amazon_ads_source.stg_amazon_ads__campaign_history[campaign_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_name: directly copied
22. model.amazon_ads.amazon_ads__search_report
  • Input Column: 30. model.amazon_ads_source.stg_amazon_ads__campaign_history[campaign_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_name: directly copied
Column Lineage
%3 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp portfolio_id 30. model.amazon_ads_source.stg_amazon_ads__campaign_history 30. model.amazon_ads_source.stg_amazon_ads__campaign_history portfolio_id 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp:f0->30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0 21. model.amazon_ads.amazon_ads__portfolio_report 21. model.amazon_ads.amazon_ads__portfolio_report portfolio_id 30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0->21. model.amazon_ads.amazon_ads__portfolio_report:f0
30. model.amazon_ads_source.stg_amazon_ads__campaign_history
  • Input Column: 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp[portfolio_id]
    • Cleaning Cast as TEXT
    • Output Columns:
      • portfolio_id: Mapped after casting to TEXT
21. model.amazon_ads.amazon_ads__portfolio_report
  • Input Column: 30. model.amazon_ads_source.stg_amazon_ads__campaign_history[portfolio_id]
    • Integration Used as a join key to connect with the portfolios table
    • Output Columns:
      • portfolio_id: Indirectly mapped through the join with portfolios table
Column Lineage
%3 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp profile_id 30. model.amazon_ads_source.stg_amazon_ads__campaign_history 30. model.amazon_ads_source.stg_amazon_ads__campaign_history profile_id 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp:f0->30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0 16. model.amazon_ads.amazon_ads__account_report 16. model.amazon_ads.amazon_ads__account_report profile_id 30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0->16. model.amazon_ads.amazon_ads__account_report:f0 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report profile_id 30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0
30. model.amazon_ads_source.stg_amazon_ads__campaign_history
  • Input Column: 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp[profile_id]
    • Cleaning Cast as TEXT
    • Output Columns:
      • profile_id: Mapped after casting to TEXT
16. model.amazon_ads.amazon_ads__account_report
  • Input Column: 30. model.amazon_ads_source.stg_amazon_ads__campaign_history[profile_id]
    • Integration used as a key to join with the account_info table
    • Output Columns:
      • profile_id: directly copied to the output
20. model.amazon_ads.amazon_ads__keyword_report
  • Input Column: 30. model.amazon_ads_source.stg_amazon_ads__campaign_history[profile_id]
    • Integration Used as a key to join with the account_info table
    • Output Columns:
      • profile_id: Directly copied to the output
Column Lineage
%3 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp serving_status 30. model.amazon_ads_source.stg_amazon_ads__campaign_history 30. model.amazon_ads_source.stg_amazon_ads__campaign_history serving_status 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp:f0->30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0
30. model.amazon_ads_source.stg_amazon_ads__campaign_history
  • Input Column: 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp[serving_status]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • serving_status: Directly mapped to this output column
Column Lineage
%3 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp start_date 30. model.amazon_ads_source.stg_amazon_ads__campaign_history 30. model.amazon_ads_source.stg_amazon_ads__campaign_history start_date 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp:f0->30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0
30. model.amazon_ads_source.stg_amazon_ads__campaign_history
  • Input Column: 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp[start_date]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as DATE in the fields CTE
    • Output Columns:
      • start_date: Directly mapped to this output column
Column Lineage
%3 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp state 30. model.amazon_ads_source.stg_amazon_ads__campaign_history 30. model.amazon_ads_source.stg_amazon_ads__campaign_history state 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp:f0->30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0
30. model.amazon_ads_source.stg_amazon_ads__campaign_history
  • Input Column: 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp[state]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • state: Directly mapped to this output column
Column Lineage
%3 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp targeting_type 30. model.amazon_ads_source.stg_amazon_ads__campaign_history 30. model.amazon_ads_source.stg_amazon_ads__campaign_history targeting_type 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp:f0->30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0
30. model.amazon_ads_source.stg_amazon_ads__campaign_history
  • Input Column: 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp[targeting_type]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • targeting_type: Directly mapped to this output column
Column Lineage
%3 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp budget_type 30. model.amazon_ads_source.stg_amazon_ads__campaign_history 30. model.amazon_ads_source.stg_amazon_ads__campaign_history budget_type 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp:f0->30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0
30. model.amazon_ads_source.stg_amazon_ads__campaign_history
  • Input Column: 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp[budget_type]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • budget_type: Directly mapped to this output column
Column Lineage
%3 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp effective_budget 30. model.amazon_ads_source.stg_amazon_ads__campaign_history 30. model.amazon_ads_source.stg_amazon_ads__campaign_history effective_budget 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp:f0->30. model.amazon_ads_source.stg_amazon_ads__campaign_history:f0
30. model.amazon_ads_source.stg_amazon_ads__campaign_history
  • Input Column: 31. model.amazon_ads_source.stg_amazon_ads__campaign_history_tmp[effective_budget]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as FLOAT in the fields CTE
    • Output Columns:
      • effective_budget: Directly mapped to this output column
32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report

This SQL query creates a staging table for Amazon Ads campaign-level reports. It starts with a base table, then defines a fields CTE that casts all columns to specific data types, including several NULL values. The final CTE renames some columns and casts the campaign_id to TEXT. The query primarily focuses on data type standardization and column renaming.

Cleaning
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp
), fields AS (
  SELECT
    CAST(NULL AS TEXT) AS campaign_applicable_budget_rule_id,
    CAST(NULL AS TEXT) AS campaign_applicable_budget_rule_name,
    CAST(NULL AS TEXT) AS campaign_bidding_strategy,
    CAST(NULL AS FLOAT) AS campaign_budget_amount,
    CAST(NULL AS TEXT) AS campaign_budget_currency_code,
    CAST(NULL AS TEXT) AS campaign_budget_type,
    CAST(NULL AS INT) AS campaign_id,
    CAST(NULL AS FLOAT) AS campaign_rule_based_budget_amount,
    CAST(NULL AS INT) AS clicks,
    CAST(NULL AS FLOAT) AS cost,
    CAST(NULL AS DATE) AS date,
    CAST(NULL AS INT) AS impressions,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    campaign_applicable_budget_rule_id,
    campaign_applicable_budget_rule_name,
    campaign_bidding_strategy,
    campaign_budget_amount,
    campaign_budget_currency_code,
    campaign_budget_type,
    CAST(campaign_id AS TEXT) AS campaign_id,
    campaign_rule_based_budget_amount,
    clicks,
    cost,
    date AS date_day,
    impressions
  FROM fields
)
SELECT
  *
FROM final
%3 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report source_relation date_day campaign_id clicks impressions cost campaign_applicable_budget_rule_id campaign_applicable_budget_rule_name campaign_bidding_strategy campaign_budget_amount campaign_budget_currency_code campaign_budget_type campaign_rule_based_budget_amount 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp campaign_id date campaign_applicable_budget_rule_id campaign_applicable_budget_rule_name campaign_bidding_strategy campaign_budget_amount campaign_budget_currency_code campaign_budget_type clicks cost impressions campaign_rule_based_budget_amount 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp:f0->32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f2 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp:f1->32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f1 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp:f2->32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f6 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp:f3->32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f7 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp:f4->32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f8 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp:f5->32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f9 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp:f6->32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f10 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp:f7->32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f11 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp:f8->32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f3 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp:f9->32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f5 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp:f10->32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f4 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp:f11->32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f12
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
date_day date The date of the report.
campaign_id text The ID representing the campaign, if present in the source data.
clicks integer The count of clicks.
impressions integer The count of impressions.
cost double precision Total cost of ad clicks.
campaign_applicable_budget_rule_id integer The ID associated to the active budget rule for a campaign.
campaign_applicable_budget_rule_name integer The name associated to the active budget rule for a campaign.
campaign_bidding_strategy text The bidding strategy associated with a campaign.
campaign_budget_amount double precision Total budget allocated to the campaign.
campaign_budget_currency_code text The currency code associated with the campaign.
campaign_budget_type text One of: daily or lifetime.
campaign_rule_based_budget_amount integer The value of the rule-based budget for a campaign.
Column Lineage
%3 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report source_relation 21. model.amazon_ads.amazon_ads__portfolio_report 21. model.amazon_ads.amazon_ads__portfolio_report source_relation 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0->21. model.amazon_ads.amazon_ads__portfolio_report:f0 16. model.amazon_ads.amazon_ads__account_report 16. model.amazon_ads.amazon_ads__account_report source_relation 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0->16. model.amazon_ads.amazon_ads__account_report:f0 19. model.amazon_ads.amazon_ads__campaign_report 19. model.amazon_ads.amazon_ads__campaign_report source_relation 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0->19. model.amazon_ads.amazon_ads__campaign_report:f0
16. model.amazon_ads.amazon_ads__account_report
  • Input Column: 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with other tables
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
19. model.amazon_ads.amazon_ads__campaign_report
  • Input Column: 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with other tables
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
21. model.amazon_ads.amazon_ads__portfolio_report
  • Input Column: 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the joining condition with other tables
    • Output Columns:
      • source_relation: Directly copied to the output
Column Lineage
%3 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp date 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report date_day 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp:f0->32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0 21. model.amazon_ads.amazon_ads__portfolio_report 21. model.amazon_ads.amazon_ads__portfolio_report date_day 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0->21. model.amazon_ads.amazon_ads__portfolio_report:f0 16. model.amazon_ads.amazon_ads__account_report 16. model.amazon_ads.amazon_ads__account_report date_day 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0->16. model.amazon_ads.amazon_ads__account_report:f0 19. model.amazon_ads.amazon_ads__campaign_report 19. model.amazon_ads.amazon_ads__campaign_report date_day 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0->19. model.amazon_ads.amazon_ads__campaign_report:f0
32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report
  • Input Column: 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp[date]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • date_day: Directly mapped and renamed
16. model.amazon_ads.amazon_ads__account_report
  • Input Column: 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
19. model.amazon_ads.amazon_ads__campaign_report
  • Input Column: 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
21. model.amazon_ads.amazon_ads__portfolio_report
  • Input Column: 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp campaign_id 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report campaign_id 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp:f0->32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0 19. model.amazon_ads.amazon_ads__campaign_report 19. model.amazon_ads.amazon_ads__campaign_report campaign_id 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0->19. model.amazon_ads.amazon_ads__campaign_report:f0
32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report
  • Input Column: 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp[campaign_id]
    • Cleaning The column is cast to TEXT in the final CTE
    • Output Columns:
      • campaign_id: Directly mapped after casting to TEXT
19. model.amazon_ads.amazon_ads__campaign_report
  • Input Column: 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report[campaign_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as the key to join with the campaigns table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • campaign_id: Directly copied to the output
Column Lineage
%3 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp clicks 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report clicks 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp:f0->32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0 21. model.amazon_ads.amazon_ads__portfolio_report 21. model.amazon_ads.amazon_ads__portfolio_report clicks 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0->21. model.amazon_ads.amazon_ads__portfolio_report:f0 16. model.amazon_ads.amazon_ads__account_report 16. model.amazon_ads.amazon_ads__account_report clicks 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0->16. model.amazon_ads.amazon_ads__account_report:f0 19. model.amazon_ads.amazon_ads__campaign_report 19. model.amazon_ads.amazon_ads__campaign_report clicks 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0->19. model.amazon_ads.amazon_ads__campaign_report:f0
32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report
  • Input Column: 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp[clicks]
    • Cleaning The column is cast to INT in the fields CTE
    • Output Columns:
      • clicks: Directly mapped after casting
16. model.amazon_ads.amazon_ads__account_report
  • Input Column: 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report[clicks]
    • Aggregation The column is summed up in the SELECT clause
    • Output Columns:
      • clicks: Aggregated sum of clicks
19. model.amazon_ads.amazon_ads__campaign_report
  • Input Column: 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report[clicks]
    • Aggregation The column is summed up in the SELECT clause
    • Output Columns:
      • clicks: Aggregated sum in the output
21. model.amazon_ads.amazon_ads__portfolio_report
  • Input Column: 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report[clicks]
    • Aggregation The column is summed up in the SELECT statement
    • Output Columns:
      • clicks: Aggregated sum of clicks
Column Lineage
%3 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp impressions 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report impressions 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp:f0->32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0 21. model.amazon_ads.amazon_ads__portfolio_report 21. model.amazon_ads.amazon_ads__portfolio_report impressions 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0->21. model.amazon_ads.amazon_ads__portfolio_report:f0 16. model.amazon_ads.amazon_ads__account_report 16. model.amazon_ads.amazon_ads__account_report impressions 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0->16. model.amazon_ads.amazon_ads__account_report:f0 19. model.amazon_ads.amazon_ads__campaign_report 19. model.amazon_ads.amazon_ads__campaign_report impressions 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0->19. model.amazon_ads.amazon_ads__campaign_report:f0
32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report
  • Input Column: 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp[impressions]
    • Cleaning The column is cast to INT data type
    • Direct The column is directly copied to the output after casting
    • Output Columns:
      • impressions: Directly mapped after casting to INT
16. model.amazon_ads.amazon_ads__account_report
  • Input Column: 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report[impressions]
    • Aggregation The column is summed up in the SELECT clause
    • Output Columns:
      • impressions: Aggregated sum of impressions
19. model.amazon_ads.amazon_ads__campaign_report
  • Input Column: 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report[impressions]
    • Aggregation The column is summed up in the SELECT clause
    • Output Columns:
      • impressions: Aggregated sum in the output
21. model.amazon_ads.amazon_ads__portfolio_report
  • Input Column: 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report[impressions]
    • Aggregation The column is summed up in the SELECT statement
    • Output Columns:
      • impressions: Aggregated sum of impressions
Column Lineage
%3 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp cost 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report cost 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp:f0->32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0 21. model.amazon_ads.amazon_ads__portfolio_report 21. model.amazon_ads.amazon_ads__portfolio_report cost 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0->21. model.amazon_ads.amazon_ads__portfolio_report:f0 16. model.amazon_ads.amazon_ads__account_report 16. model.amazon_ads.amazon_ads__account_report cost 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0->16. model.amazon_ads.amazon_ads__account_report:f0 19. model.amazon_ads.amazon_ads__campaign_report 19. model.amazon_ads.amazon_ads__campaign_report cost 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0->19. model.amazon_ads.amazon_ads__campaign_report:f0
32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report
  • Input Column: 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp[cost]
    • Cleaning The column is cast to FLOAT data type
    • Direct The column is directly copied to the output after casting
    • Output Columns:
      • cost: Directly mapped after casting to FLOAT
16. model.amazon_ads.amazon_ads__account_report
  • Input Column: 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report[cost]
    • Aggregation The column is summed up in the SELECT clause
    • Output Columns:
      • cost: Aggregated sum of cost
19. model.amazon_ads.amazon_ads__campaign_report
  • Input Column: 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report[cost]
    • Aggregation The column is summed up in the SELECT clause
    • Output Columns:
      • cost: Aggregated sum in the output
21. model.amazon_ads.amazon_ads__portfolio_report
  • Input Column: 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report[cost]
    • Aggregation The column is summed up in the SELECT statement
    • Output Columns:
      • cost: Aggregated sum of cost
Column Lineage
%3 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp campaign_applicable_budget_rule_id 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report campaign_applicable_budget_rule_id 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp:f0->32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0
32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report
  • Input Column: 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp[campaign_applicable_budget_rule_id]
    • Cleaning The column is cast to TEXT in the fields CTE
    • Output Columns:
      • campaign_applicable_budget_rule_id: Directly mapped after casting
Column Lineage
%3 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp campaign_applicable_budget_rule_name 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report campaign_applicable_budget_rule_name 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp:f0->32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0
32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report
  • Input Column: 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp[campaign_applicable_budget_rule_name]
    • Cleaning The column is cast to TEXT in the fields CTE
    • Output Columns:
      • campaign_applicable_budget_rule_name: Directly mapped after casting
Column Lineage
%3 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp campaign_bidding_strategy 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report campaign_bidding_strategy 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp:f0->32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0 19. model.amazon_ads.amazon_ads__campaign_report 19. model.amazon_ads.amazon_ads__campaign_report campaign_bidding_strategy 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0->19. model.amazon_ads.amazon_ads__campaign_report:f0
32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report
  • Input Column: 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp[campaign_bidding_strategy]
    • Cleaning The column is cast to TEXT in the fields CTE
    • Output Columns:
      • campaign_bidding_strategy: Directly mapped after casting
19. model.amazon_ads.amazon_ads__campaign_report
  • Input Column: 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report[campaign_bidding_strategy]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • campaign_bidding_strategy: Directly copied to the output
Column Lineage
%3 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp campaign_budget_amount 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report campaign_budget_amount 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp:f0->32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0 19. model.amazon_ads.amazon_ads__campaign_report 19. model.amazon_ads.amazon_ads__campaign_report campaign_budget_amount 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0->19. model.amazon_ads.amazon_ads__campaign_report:f0
32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report
  • Input Column: 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp[campaign_budget_amount]
    • Cleaning The column is cast to FLOAT in the fields CTE
    • Output Columns:
      • campaign_budget_amount: Directly mapped after casting
19. model.amazon_ads.amazon_ads__campaign_report
  • Input Column: 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report[campaign_budget_amount]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • campaign_budget_amount: Directly copied to the output
Column Lineage
%3 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp campaign_budget_currency_code 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report campaign_budget_currency_code 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp:f0->32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0 19. model.amazon_ads.amazon_ads__campaign_report 19. model.amazon_ads.amazon_ads__campaign_report campaign_budget_currency_code 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0->19. model.amazon_ads.amazon_ads__campaign_report:f0
32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report
  • Input Column: 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp[campaign_budget_currency_code]
    • Cleaning The column is cast to TEXT in the fields CTE
    • Output Columns:
      • campaign_budget_currency_code: Directly mapped after casting
19. model.amazon_ads.amazon_ads__campaign_report
  • Input Column: 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report[campaign_budget_currency_code]
    • Direct This column is directly copied without any transformation
    • Output Columns:
      • campaign_budget_currency_code: Directly copied to the output
Column Lineage
%3 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp campaign_budget_type 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report campaign_budget_type 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp:f0->32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0 19. model.amazon_ads.amazon_ads__campaign_report 19. model.amazon_ads.amazon_ads__campaign_report campaign_budget_type 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0->19. model.amazon_ads.amazon_ads__campaign_report:f0
32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report
  • Input Column: 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp[campaign_budget_type]
    • Cleaning The column is cast to TEXT in the fields CTE
    • Output Columns:
      • campaign_budget_type: Directly mapped after casting
19. model.amazon_ads.amazon_ads__campaign_report
  • Input Column: 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report[campaign_budget_type]
    • Direct This column is directly copied without any transformation
    • Output Columns:
      • campaign_budget_type: Directly copied to the output
Column Lineage
%3 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp campaign_rule_based_budget_amount 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report campaign_rule_based_budget_amount 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp:f0->32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0
32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report
  • Input Column: 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp[campaign_rule_based_budget_amount]
    • Cleaning The column is cast to FLOAT data type
    • Direct The column is directly copied to the output after casting
    • Output Columns:
      • campaign_rule_based_budget_amount: Directly mapped after casting to FLOAT
33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of type TEXT, which is set to NULL. The query is limited to 0 rows, effectively creating a schema-only representation of the table without any data.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp campaign_id date _fivetran_synced campaign_applicable_budget_rule_id campaign_applicable_budget_rule_name campaign_bidding_strategy campaign_budget_amount campaign_budget_currency_code campaign_budget_type clicks cost impressions campaign_rule_based_budget_amount 283. source.amazon_ads_source.amazon_ads.campaign_level_report 283. source.amazon_ads_source.amazon_ads.campaign_level_report
Name Type Comment
campaign_id integer None
date date None
_fivetran_synced timestamp without time zone None
campaign_applicable_budget_rule_id integer None
campaign_applicable_budget_rule_name integer None
campaign_bidding_strategy text None
campaign_budget_amount double precision None
campaign_budget_currency_code text None
campaign_budget_type text None
clicks integer None
cost double precision None
impressions integer None
campaign_rule_based_budget_amount integer None
Column Lineage
%3 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp campaign_id 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report campaign_id 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp:f0->32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0 19. model.amazon_ads.amazon_ads__campaign_report 19. model.amazon_ads.amazon_ads__campaign_report campaign_id 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0->19. model.amazon_ads.amazon_ads__campaign_report:f0
32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report
  • Input Column: 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp[campaign_id]
    • Cleaning The column is cast to TEXT in the final CTE
    • Output Columns:
      • campaign_id: Directly mapped after casting to TEXT
19. model.amazon_ads.amazon_ads__campaign_report
  • Input Column: 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report[campaign_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as the key to join with the campaigns table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • campaign_id: Directly copied to the output
Column Lineage
%3 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp date 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report date_day 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp:f0->32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0 21. model.amazon_ads.amazon_ads__portfolio_report 21. model.amazon_ads.amazon_ads__portfolio_report date_day 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0->21. model.amazon_ads.amazon_ads__portfolio_report:f0 16. model.amazon_ads.amazon_ads__account_report 16. model.amazon_ads.amazon_ads__account_report date_day 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0->16. model.amazon_ads.amazon_ads__account_report:f0 19. model.amazon_ads.amazon_ads__campaign_report 19. model.amazon_ads.amazon_ads__campaign_report date_day 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0->19. model.amazon_ads.amazon_ads__campaign_report:f0
32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report
  • Input Column: 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp[date]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • date_day: Directly mapped and renamed
16. model.amazon_ads.amazon_ads__account_report
  • Input Column: 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
19. model.amazon_ads.amazon_ads__campaign_report
  • Input Column: 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
21. model.amazon_ads.amazon_ads__portfolio_report
  • Input Column: 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp campaign_applicable_budget_rule_id 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report campaign_applicable_budget_rule_id 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp:f0->32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0
32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report
  • Input Column: 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp[campaign_applicable_budget_rule_id]
    • Cleaning The column is cast to TEXT in the fields CTE
    • Output Columns:
      • campaign_applicable_budget_rule_id: Directly mapped after casting
Column Lineage
%3 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp campaign_applicable_budget_rule_name 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report campaign_applicable_budget_rule_name 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp:f0->32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0
32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report
  • Input Column: 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp[campaign_applicable_budget_rule_name]
    • Cleaning The column is cast to TEXT in the fields CTE
    • Output Columns:
      • campaign_applicable_budget_rule_name: Directly mapped after casting
Column Lineage
%3 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp campaign_bidding_strategy 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report campaign_bidding_strategy 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp:f0->32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0 19. model.amazon_ads.amazon_ads__campaign_report 19. model.amazon_ads.amazon_ads__campaign_report campaign_bidding_strategy 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0->19. model.amazon_ads.amazon_ads__campaign_report:f0
32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report
  • Input Column: 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp[campaign_bidding_strategy]
    • Cleaning The column is cast to TEXT in the fields CTE
    • Output Columns:
      • campaign_bidding_strategy: Directly mapped after casting
19. model.amazon_ads.amazon_ads__campaign_report
  • Input Column: 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report[campaign_bidding_strategy]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • campaign_bidding_strategy: Directly copied to the output
Column Lineage
%3 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp campaign_budget_amount 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report campaign_budget_amount 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp:f0->32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0 19. model.amazon_ads.amazon_ads__campaign_report 19. model.amazon_ads.amazon_ads__campaign_report campaign_budget_amount 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0->19. model.amazon_ads.amazon_ads__campaign_report:f0
32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report
  • Input Column: 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp[campaign_budget_amount]
    • Cleaning The column is cast to FLOAT in the fields CTE
    • Output Columns:
      • campaign_budget_amount: Directly mapped after casting
19. model.amazon_ads.amazon_ads__campaign_report
  • Input Column: 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report[campaign_budget_amount]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • campaign_budget_amount: Directly copied to the output
Column Lineage
%3 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp campaign_budget_currency_code 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report campaign_budget_currency_code 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp:f0->32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0 19. model.amazon_ads.amazon_ads__campaign_report 19. model.amazon_ads.amazon_ads__campaign_report campaign_budget_currency_code 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0->19. model.amazon_ads.amazon_ads__campaign_report:f0
32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report
  • Input Column: 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp[campaign_budget_currency_code]
    • Cleaning The column is cast to TEXT in the fields CTE
    • Output Columns:
      • campaign_budget_currency_code: Directly mapped after casting
19. model.amazon_ads.amazon_ads__campaign_report
  • Input Column: 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report[campaign_budget_currency_code]
    • Direct This column is directly copied without any transformation
    • Output Columns:
      • campaign_budget_currency_code: Directly copied to the output
Column Lineage
%3 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp campaign_budget_type 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report campaign_budget_type 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp:f0->32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0 19. model.amazon_ads.amazon_ads__campaign_report 19. model.amazon_ads.amazon_ads__campaign_report campaign_budget_type 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0->19. model.amazon_ads.amazon_ads__campaign_report:f0
32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report
  • Input Column: 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp[campaign_budget_type]
    • Cleaning The column is cast to TEXT in the fields CTE
    • Output Columns:
      • campaign_budget_type: Directly mapped after casting
19. model.amazon_ads.amazon_ads__campaign_report
  • Input Column: 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report[campaign_budget_type]
    • Direct This column is directly copied without any transformation
    • Output Columns:
      • campaign_budget_type: Directly copied to the output
Column Lineage
%3 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp clicks 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report clicks 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp:f0->32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0 21. model.amazon_ads.amazon_ads__portfolio_report 21. model.amazon_ads.amazon_ads__portfolio_report clicks 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0->21. model.amazon_ads.amazon_ads__portfolio_report:f0 16. model.amazon_ads.amazon_ads__account_report 16. model.amazon_ads.amazon_ads__account_report clicks 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0->16. model.amazon_ads.amazon_ads__account_report:f0 19. model.amazon_ads.amazon_ads__campaign_report 19. model.amazon_ads.amazon_ads__campaign_report clicks 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0->19. model.amazon_ads.amazon_ads__campaign_report:f0
32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report
  • Input Column: 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp[clicks]
    • Cleaning The column is cast to INT in the fields CTE
    • Output Columns:
      • clicks: Directly mapped after casting
16. model.amazon_ads.amazon_ads__account_report
  • Input Column: 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report[clicks]
    • Aggregation The column is summed up in the SELECT clause
    • Output Columns:
      • clicks: Aggregated sum of clicks
19. model.amazon_ads.amazon_ads__campaign_report
  • Input Column: 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report[clicks]
    • Aggregation The column is summed up in the SELECT clause
    • Output Columns:
      • clicks: Aggregated sum in the output
21. model.amazon_ads.amazon_ads__portfolio_report
  • Input Column: 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report[clicks]
    • Aggregation The column is summed up in the SELECT statement
    • Output Columns:
      • clicks: Aggregated sum of clicks
Column Lineage
%3 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp cost 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report cost 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp:f0->32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0 21. model.amazon_ads.amazon_ads__portfolio_report 21. model.amazon_ads.amazon_ads__portfolio_report cost 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0->21. model.amazon_ads.amazon_ads__portfolio_report:f0 16. model.amazon_ads.amazon_ads__account_report 16. model.amazon_ads.amazon_ads__account_report cost 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0->16. model.amazon_ads.amazon_ads__account_report:f0 19. model.amazon_ads.amazon_ads__campaign_report 19. model.amazon_ads.amazon_ads__campaign_report cost 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0->19. model.amazon_ads.amazon_ads__campaign_report:f0
32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report
  • Input Column: 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp[cost]
    • Cleaning The column is cast to FLOAT data type
    • Direct The column is directly copied to the output after casting
    • Output Columns:
      • cost: Directly mapped after casting to FLOAT
16. model.amazon_ads.amazon_ads__account_report
  • Input Column: 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report[cost]
    • Aggregation The column is summed up in the SELECT clause
    • Output Columns:
      • cost: Aggregated sum of cost
19. model.amazon_ads.amazon_ads__campaign_report
  • Input Column: 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report[cost]
    • Aggregation The column is summed up in the SELECT clause
    • Output Columns:
      • cost: Aggregated sum in the output
21. model.amazon_ads.amazon_ads__portfolio_report
  • Input Column: 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report[cost]
    • Aggregation The column is summed up in the SELECT statement
    • Output Columns:
      • cost: Aggregated sum of cost
Column Lineage
%3 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp impressions 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report impressions 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp:f0->32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0 21. model.amazon_ads.amazon_ads__portfolio_report 21. model.amazon_ads.amazon_ads__portfolio_report impressions 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0->21. model.amazon_ads.amazon_ads__portfolio_report:f0 16. model.amazon_ads.amazon_ads__account_report 16. model.amazon_ads.amazon_ads__account_report impressions 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0->16. model.amazon_ads.amazon_ads__account_report:f0 19. model.amazon_ads.amazon_ads__campaign_report 19. model.amazon_ads.amazon_ads__campaign_report impressions 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0->19. model.amazon_ads.amazon_ads__campaign_report:f0
32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report
  • Input Column: 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp[impressions]
    • Cleaning The column is cast to INT data type
    • Direct The column is directly copied to the output after casting
    • Output Columns:
      • impressions: Directly mapped after casting to INT
16. model.amazon_ads.amazon_ads__account_report
  • Input Column: 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report[impressions]
    • Aggregation The column is summed up in the SELECT clause
    • Output Columns:
      • impressions: Aggregated sum of impressions
19. model.amazon_ads.amazon_ads__campaign_report
  • Input Column: 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report[impressions]
    • Aggregation The column is summed up in the SELECT clause
    • Output Columns:
      • impressions: Aggregated sum in the output
21. model.amazon_ads.amazon_ads__portfolio_report
  • Input Column: 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report[impressions]
    • Aggregation The column is summed up in the SELECT statement
    • Output Columns:
      • impressions: Aggregated sum of impressions
Column Lineage
%3 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp campaign_rule_based_budget_amount 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report 32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report campaign_rule_based_budget_amount 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp:f0->32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report:f0
32. model.amazon_ads_source.stg_amazon_ads__campaign_level_report
  • Input Column: 33. model.amazon_ads_source.stg_amazon_ads__campaign_level_report_tmp[campaign_rule_based_budget_amount]
    • Cleaning The column is cast to FLOAT data type
    • Direct The column is directly copied to the output after casting
    • Output Columns:
      • campaign_rule_based_budget_amount: Directly mapped after casting to FLOAT
34. model.amazon_ads_source.stg_amazon_ads__keyword_history

This SQL query stages data from a temporary table, casts various fields to specific data types, renames some columns, and adds a flag to identify the most recent record for each keyword. It also includes a 'source_relation' field, which appears to be empty in this case.

CleaningDeduplication
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_amazon_ads_source.stg_amazon_ads__keyword_history_tmp
), fields AS (
  SELECT
    CAST(NULL AS INT) AS ad_group_id,
    CAST(NULL AS FLOAT) AS bid,
    CAST(NULL AS INT) AS campaign_id,
    CAST(NULL AS TIMESTAMP) AS creation_date,
    CAST(NULL AS TEXT) AS id,
    CAST(NULL AS TEXT) AS keyword_text,
    CAST(NULL AS TIMESTAMP) AS last_updated_date,
    CAST(NULL AS TEXT) AS match_type,
    CAST(NULL AS TEXT) AS native_language_keyword,
    CAST(NULL AS TEXT) AS serving_status,
    CAST(NULL AS TEXT) AS state,
    CAST(NULL AS TEXT) AS native_language_locale,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    CAST(id AS TEXT) AS keyword_id,
    CAST(ad_group_id AS TEXT) AS ad_group_id,
    bid,
    CAST(campaign_id AS TEXT) AS campaign_id,
    creation_date,
    keyword_text,
    last_updated_date,
    match_type,
    native_language_keyword,
    serving_status,
    state,
    native_language_locale,
    ROW_NUMBER() OVER (PARTITION BY source_relation, id ORDER BY last_updated_date DESC) = 1 AS is_most_recent_record
  FROM fields
)
SELECT
  *
FROM final
%3 34. model.amazon_ads_source.stg_amazon_ads__keyword_history 34. model.amazon_ads_source.stg_amazon_ads__keyword_history source_relation keyword_id last_updated_date ad_group_id bid campaign_id creation_date keyword_text match_type native_language_keyword native_language_locale serving_status state is_most_recent_record 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp id last_updated_date ad_group_id bid campaign_id creation_date keyword_text match_type native_language_keyword serving_status state native_language_locale 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp:f0->34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f1 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp:f1->34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f2 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp:f2->34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f3 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp:f3->34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f4 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp:f4->34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f5 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp:f5->34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f6 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp:f6->34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f7 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp:f7->34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f8 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp:f8->34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f9 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp:f9->34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f11 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp:f10->34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f12 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp:f11->34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f10
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
keyword_id text The ID representing the keyword, if present in the source data.
last_updated_date text Date of last update to record.
ad_group_id text The ID representing the ad group, if present in the source data.
bid double precision Bid associated with this keyword.
campaign_id text The ID representing the campaign, if present in the source data.
creation_date text The date of creation of the record.
keyword_text text The exact text for the keyword.
match_type text The keyword match type associated with this record.
native_language_keyword integer The unlocalized keyword text in the preferred locale of the advertiser.
native_language_locale integer The preferred language locale of the advertiser.
serving_status text The current serving status of the record.
state text The state of the record (enabled, paused, or archived).
is_most_recent_record boolean Boolean indicating whether record was the most recent instance.
Column Lineage
%3 34. model.amazon_ads_source.stg_amazon_ads__keyword_history 34. model.amazon_ads_source.stg_amazon_ads__keyword_history source_relation 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report source_relation 34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f0->22. model.amazon_ads.amazon_ads__search_report:f0 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report source_relation 34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0
20. model.amazon_ads.amazon_ads__keyword_report
  • Input Column: 34. model.amazon_ads_source.stg_amazon_ads__keyword_history[source_relation]
    • Integration used as a key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
22. model.amazon_ads.amazon_ads__search_report
  • Input Column: 34. model.amazon_ads_source.stg_amazon_ads__keyword_history[source_relation]
    • Direct The column is directly copied without transformation
    • Integration Used as a key to join with other tables
    • Output Columns:
      • source_relation: Directly copied to the output
Column Lineage
%3 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp id 34. model.amazon_ads_source.stg_amazon_ads__keyword_history 34. model.amazon_ads_source.stg_amazon_ads__keyword_history keyword_id 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp:f0->34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f0 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report keyword_id 34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f0->22. model.amazon_ads.amazon_ads__search_report:f0 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report keyword_id 34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0
34. model.amazon_ads_source.stg_amazon_ads__keyword_history
  • Input Column: 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp[id]
    • Cleaning The column is cast as TEXT
    • Deduplication Used in the ROW_NUMBER() window function to identify the most recent record
    • Output Columns:
      • keyword_id: Directly mapped after casting to TEXT
20. model.amazon_ads.amazon_ads__keyword_report
  • Input Column: 34. model.amazon_ads_source.stg_amazon_ads__keyword_history[keyword_id]
    • Integration used as a key to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • keyword_id: directly copied
22. model.amazon_ads.amazon_ads__search_report
  • Input Column: 34. model.amazon_ads_source.stg_amazon_ads__keyword_history[keyword_id]
    • Direct The column is directly copied without transformation
    • Integration Used as a key to join with the report table
    • Output Columns:
      • keyword_id: Directly copied to the output
Column Lineage
%3 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp last_updated_date 34. model.amazon_ads_source.stg_amazon_ads__keyword_history 34. model.amazon_ads_source.stg_amazon_ads__keyword_history last_updated_date 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp:f0->34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f0
34. model.amazon_ads_source.stg_amazon_ads__keyword_history
  • Input Column: 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp[last_updated_date]
    • Cleaning Cast as TIMESTAMP
    • Deduplication Used in the ORDER BY clause of the ROW_NUMBER() window function
    • Output Columns:
      • last_updated_date: Directly mapped after casting
Column Lineage
%3 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp ad_group_id 34. model.amazon_ads_source.stg_amazon_ads__keyword_history 34. model.amazon_ads_source.stg_amazon_ads__keyword_history ad_group_id 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp:f0->34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f0
34. model.amazon_ads_source.stg_amazon_ads__keyword_history
  • Input Column: 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp[ad_group_id]
    • Cleaning Cast as TEXT
    • Output Columns:
      • ad_group_id: Directly mapped after casting to TEXT
Column Lineage
%3 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp bid 34. model.amazon_ads_source.stg_amazon_ads__keyword_history 34. model.amazon_ads_source.stg_amazon_ads__keyword_history bid 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp:f0->34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f0
34. model.amazon_ads_source.stg_amazon_ads__keyword_history
  • Input Column: 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp[bid]
    • Cleaning Cast as FLOAT
    • Output Columns:
      • bid: Directly mapped after casting
Column Lineage
%3 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp campaign_id 34. model.amazon_ads_source.stg_amazon_ads__keyword_history 34. model.amazon_ads_source.stg_amazon_ads__keyword_history campaign_id 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp:f0->34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f0
34. model.amazon_ads_source.stg_amazon_ads__keyword_history
  • Input Column: 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp[campaign_id]
    • Cleaning Cast as TEXT
    • Output Columns:
      • campaign_id: Directly mapped after casting to TEXT
Column Lineage
%3 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp creation_date 34. model.amazon_ads_source.stg_amazon_ads__keyword_history 34. model.amazon_ads_source.stg_amazon_ads__keyword_history creation_date 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp:f0->34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f0
34. model.amazon_ads_source.stg_amazon_ads__keyword_history
  • Input Column: 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp[creation_date]
    • Cleaning Cast as TIMESTAMP
    • Output Columns:
      • creation_date: Directly mapped after casting
Column Lineage
%3 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp keyword_text 34. model.amazon_ads_source.stg_amazon_ads__keyword_history 34. model.amazon_ads_source.stg_amazon_ads__keyword_history keyword_text 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp:f0->34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f0 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report keyword_text 34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f0->22. model.amazon_ads.amazon_ads__search_report:f0 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report keyword_text 34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0
34. model.amazon_ads_source.stg_amazon_ads__keyword_history
  • Input Column: 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp[keyword_text]
    • Cleaning Cast as TEXT
    • Output Columns:
      • keyword_text: Directly mapped after casting
20. model.amazon_ads.amazon_ads__keyword_report
  • Input Column: 34. model.amazon_ads_source.stg_amazon_ads__keyword_history[keyword_text]
    • Direct directly copied to the output
    • Output Columns:
      • keyword_text: directly copied
22. model.amazon_ads.amazon_ads__search_report
  • Input Column: 34. model.amazon_ads_source.stg_amazon_ads__keyword_history[keyword_text]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • keyword_text: Directly copied to the output
Column Lineage
%3 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp match_type 34. model.amazon_ads_source.stg_amazon_ads__keyword_history 34. model.amazon_ads_source.stg_amazon_ads__keyword_history match_type 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp:f0->34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f0 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report match_type 34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f0->22. model.amazon_ads.amazon_ads__search_report:f0
34. model.amazon_ads_source.stg_amazon_ads__keyword_history
  • Input Column: 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp[match_type]
    • Cleaning Cast as TEXT
    • Output Columns:
      • match_type: Directly mapped after casting
22. model.amazon_ads.amazon_ads__search_report
  • Input Column: 34. model.amazon_ads_source.stg_amazon_ads__keyword_history[match_type]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • match_type: Directly copied to the output
Column Lineage
%3 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp native_language_keyword 34. model.amazon_ads_source.stg_amazon_ads__keyword_history 34. model.amazon_ads_source.stg_amazon_ads__keyword_history native_language_keyword 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp:f0->34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f0
34. model.amazon_ads_source.stg_amazon_ads__keyword_history
  • Input Column: 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp[native_language_keyword]
    • Cleaning Cast as TEXT
    • Output Columns:
      • native_language_keyword: Directly mapped after casting
Column Lineage
%3 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp native_language_locale 34. model.amazon_ads_source.stg_amazon_ads__keyword_history 34. model.amazon_ads_source.stg_amazon_ads__keyword_history native_language_locale 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp:f0->34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f0
34. model.amazon_ads_source.stg_amazon_ads__keyword_history
  • Input Column: 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp[native_language_locale]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • native_language_locale: Directly copied after casting to TEXT
Column Lineage
%3 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp serving_status 34. model.amazon_ads_source.stg_amazon_ads__keyword_history 34. model.amazon_ads_source.stg_amazon_ads__keyword_history serving_status 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp:f0->34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f0 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report serving_status 34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f0->22. model.amazon_ads.amazon_ads__search_report:f0 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report serving_status 34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0
34. model.amazon_ads_source.stg_amazon_ads__keyword_history
  • Input Column: 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp[serving_status]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • serving_status: Directly copied after casting to TEXT
20. model.amazon_ads.amazon_ads__keyword_report
  • Input Column: 34. model.amazon_ads_source.stg_amazon_ads__keyword_history[serving_status]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • serving_status: Directly copied to the output
22. model.amazon_ads.amazon_ads__search_report
  • Input Column: 34. model.amazon_ads_source.stg_amazon_ads__keyword_history[serving_status]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • serving_status: Directly copied to the output column
Column Lineage
%3 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp state 34. model.amazon_ads_source.stg_amazon_ads__keyword_history 34. model.amazon_ads_source.stg_amazon_ads__keyword_history state 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp:f0->34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f0 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report state 34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f0->22. model.amazon_ads.amazon_ads__search_report:f0 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report state 34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0
34. model.amazon_ads_source.stg_amazon_ads__keyword_history
  • Input Column: 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp[state]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • state: Directly copied after casting to TEXT
20. model.amazon_ads.amazon_ads__keyword_report
  • Input Column: 34. model.amazon_ads_source.stg_amazon_ads__keyword_history[state]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • state: Directly copied to the output
22. model.amazon_ads.amazon_ads__search_report
  • Input Column: 34. model.amazon_ads_source.stg_amazon_ads__keyword_history[state]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • state: Directly copied to the output column
35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of type TEXT, which is set to NULL. The LIMIT 0 clause ensures no rows are returned. This query appears to be a placeholder or template for defining the structure of a staging table in a dbt (data build tool) project.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp id last_updated_date _fivetran_synced ad_group_id bid campaign_id creation_date keyword_text match_type native_language_keyword serving_status state native_language_locale 284. source.amazon_ads_source.amazon_ads.keyword_history 284. source.amazon_ads_source.amazon_ads.keyword_history
Name Type Comment
id integer None
last_updated_date text None
_fivetran_synced text None
ad_group_id integer None
bid double precision None
campaign_id integer None
creation_date text None
keyword_text text None
match_type text None
native_language_keyword integer None
serving_status text None
state text None
native_language_locale integer None
Column Lineage
%3 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp id 34. model.amazon_ads_source.stg_amazon_ads__keyword_history 34. model.amazon_ads_source.stg_amazon_ads__keyword_history keyword_id 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp:f0->34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f0 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report keyword_id 34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f0->22. model.amazon_ads.amazon_ads__search_report:f0 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report keyword_id 34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0
34. model.amazon_ads_source.stg_amazon_ads__keyword_history
  • Input Column: 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp[id]
    • Cleaning The column is cast as TEXT
    • Deduplication Used in the ROW_NUMBER() window function to identify the most recent record
    • Output Columns:
      • keyword_id: Directly mapped after casting to TEXT
20. model.amazon_ads.amazon_ads__keyword_report
  • Input Column: 34. model.amazon_ads_source.stg_amazon_ads__keyword_history[keyword_id]
    • Integration used as a key to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • keyword_id: directly copied
22. model.amazon_ads.amazon_ads__search_report
  • Input Column: 34. model.amazon_ads_source.stg_amazon_ads__keyword_history[keyword_id]
    • Direct The column is directly copied without transformation
    • Integration Used as a key to join with the report table
    • Output Columns:
      • keyword_id: Directly copied to the output
Column Lineage
%3 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp last_updated_date 34. model.amazon_ads_source.stg_amazon_ads__keyword_history 34. model.amazon_ads_source.stg_amazon_ads__keyword_history last_updated_date 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp:f0->34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f0
34. model.amazon_ads_source.stg_amazon_ads__keyword_history
  • Input Column: 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp[last_updated_date]
    • Cleaning Cast as TIMESTAMP
    • Deduplication Used in the ORDER BY clause of the ROW_NUMBER() window function
    • Output Columns:
      • last_updated_date: Directly mapped after casting
Column Lineage
%3 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp ad_group_id 34. model.amazon_ads_source.stg_amazon_ads__keyword_history 34. model.amazon_ads_source.stg_amazon_ads__keyword_history ad_group_id 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp:f0->34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f0
34. model.amazon_ads_source.stg_amazon_ads__keyword_history
  • Input Column: 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp[ad_group_id]
    • Cleaning Cast as TEXT
    • Output Columns:
      • ad_group_id: Directly mapped after casting to TEXT
Column Lineage
%3 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp bid 34. model.amazon_ads_source.stg_amazon_ads__keyword_history 34. model.amazon_ads_source.stg_amazon_ads__keyword_history bid 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp:f0->34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f0
34. model.amazon_ads_source.stg_amazon_ads__keyword_history
  • Input Column: 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp[bid]
    • Cleaning Cast as FLOAT
    • Output Columns:
      • bid: Directly mapped after casting
Column Lineage
%3 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp campaign_id 34. model.amazon_ads_source.stg_amazon_ads__keyword_history 34. model.amazon_ads_source.stg_amazon_ads__keyword_history campaign_id 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp:f0->34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f0
34. model.amazon_ads_source.stg_amazon_ads__keyword_history
  • Input Column: 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp[campaign_id]
    • Cleaning Cast as TEXT
    • Output Columns:
      • campaign_id: Directly mapped after casting to TEXT
Column Lineage
%3 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp creation_date 34. model.amazon_ads_source.stg_amazon_ads__keyword_history 34. model.amazon_ads_source.stg_amazon_ads__keyword_history creation_date 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp:f0->34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f0
34. model.amazon_ads_source.stg_amazon_ads__keyword_history
  • Input Column: 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp[creation_date]
    • Cleaning Cast as TIMESTAMP
    • Output Columns:
      • creation_date: Directly mapped after casting
Column Lineage
%3 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp keyword_text 34. model.amazon_ads_source.stg_amazon_ads__keyword_history 34. model.amazon_ads_source.stg_amazon_ads__keyword_history keyword_text 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp:f0->34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f0 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report keyword_text 34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f0->22. model.amazon_ads.amazon_ads__search_report:f0 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report keyword_text 34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0
34. model.amazon_ads_source.stg_amazon_ads__keyword_history
  • Input Column: 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp[keyword_text]
    • Cleaning Cast as TEXT
    • Output Columns:
      • keyword_text: Directly mapped after casting
20. model.amazon_ads.amazon_ads__keyword_report
  • Input Column: 34. model.amazon_ads_source.stg_amazon_ads__keyword_history[keyword_text]
    • Direct directly copied to the output
    • Output Columns:
      • keyword_text: directly copied
22. model.amazon_ads.amazon_ads__search_report
  • Input Column: 34. model.amazon_ads_source.stg_amazon_ads__keyword_history[keyword_text]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • keyword_text: Directly copied to the output
Column Lineage
%3 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp match_type 34. model.amazon_ads_source.stg_amazon_ads__keyword_history 34. model.amazon_ads_source.stg_amazon_ads__keyword_history match_type 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp:f0->34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f0 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report match_type 34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f0->22. model.amazon_ads.amazon_ads__search_report:f0
34. model.amazon_ads_source.stg_amazon_ads__keyword_history
  • Input Column: 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp[match_type]
    • Cleaning Cast as TEXT
    • Output Columns:
      • match_type: Directly mapped after casting
22. model.amazon_ads.amazon_ads__search_report
  • Input Column: 34. model.amazon_ads_source.stg_amazon_ads__keyword_history[match_type]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • match_type: Directly copied to the output
Column Lineage
%3 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp native_language_keyword 34. model.amazon_ads_source.stg_amazon_ads__keyword_history 34. model.amazon_ads_source.stg_amazon_ads__keyword_history native_language_keyword 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp:f0->34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f0
34. model.amazon_ads_source.stg_amazon_ads__keyword_history
  • Input Column: 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp[native_language_keyword]
    • Cleaning Cast as TEXT
    • Output Columns:
      • native_language_keyword: Directly mapped after casting
Column Lineage
%3 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp serving_status 34. model.amazon_ads_source.stg_amazon_ads__keyword_history 34. model.amazon_ads_source.stg_amazon_ads__keyword_history serving_status 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp:f0->34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f0 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report serving_status 34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f0->22. model.amazon_ads.amazon_ads__search_report:f0 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report serving_status 34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0
34. model.amazon_ads_source.stg_amazon_ads__keyword_history
  • Input Column: 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp[serving_status]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • serving_status: Directly copied after casting to TEXT
20. model.amazon_ads.amazon_ads__keyword_report
  • Input Column: 34. model.amazon_ads_source.stg_amazon_ads__keyword_history[serving_status]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • serving_status: Directly copied to the output
22. model.amazon_ads.amazon_ads__search_report
  • Input Column: 34. model.amazon_ads_source.stg_amazon_ads__keyword_history[serving_status]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • serving_status: Directly copied to the output column
Column Lineage
%3 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp state 34. model.amazon_ads_source.stg_amazon_ads__keyword_history 34. model.amazon_ads_source.stg_amazon_ads__keyword_history state 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp:f0->34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f0 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report state 34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f0->22. model.amazon_ads.amazon_ads__search_report:f0 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report state 34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0
34. model.amazon_ads_source.stg_amazon_ads__keyword_history
  • Input Column: 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp[state]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • state: Directly copied after casting to TEXT
20. model.amazon_ads.amazon_ads__keyword_report
  • Input Column: 34. model.amazon_ads_source.stg_amazon_ads__keyword_history[state]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • state: Directly copied to the output
22. model.amazon_ads.amazon_ads__search_report
  • Input Column: 34. model.amazon_ads_source.stg_amazon_ads__keyword_history[state]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • state: Directly copied to the output column
Column Lineage
%3 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp native_language_locale 34. model.amazon_ads_source.stg_amazon_ads__keyword_history 34. model.amazon_ads_source.stg_amazon_ads__keyword_history native_language_locale 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp:f0->34. model.amazon_ads_source.stg_amazon_ads__keyword_history:f0
34. model.amazon_ads_source.stg_amazon_ads__keyword_history
  • Input Column: 35. model.amazon_ads_source.stg_amazon_ads__keyword_history_tmp[native_language_locale]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • native_language_locale: Directly copied after casting to TEXT
36. model.amazon_ads_source.stg_amazon_ads__portfolio_history

This SQL query stages data from a temporary table, casts various fields to specific data types, renames some columns, and adds a flag to identify the most recent record for each portfolio. It also includes data type conversions for certain fields.

CleaningDeduplicationOther
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_amazon_ads_source.stg_amazon_ads__portfolio_history_tmp
), fields AS (
  SELECT
    CAST(NULL AS FLOAT) AS budget_amount,
    CAST(NULL AS TEXT) AS budget_currency_code,
    CAST(NULL AS DATE) AS budget_end_date,
    CAST(NULL AS TEXT) AS budget_policy,
    CAST(NULL AS DATE) AS budget_start_date,
    CAST(NULL AS TIMESTAMP) AS creation_date,
    CAST(NULL AS INT) AS id,
    CAST(NULL AS BOOLEAN) AS in_budget,
    CAST(NULL AS TIMESTAMP) AS last_updated_date,
    CAST(NULL AS TEXT) AS name,
    CAST(NULL AS INT) AS profile_id,
    CAST(NULL AS TEXT) AS serving_status,
    CAST(NULL AS TEXT) AS state,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    CAST(id AS TEXT) AS portfolio_id,
    budget_amount,
    budget_currency_code,
    budget_end_date,
    budget_policy,
    budget_start_date,
    creation_date,
    in_budget,
    last_updated_date,
    name AS portfolio_name,
    CAST(profile_id AS TEXT) AS profile_id,
    serving_status,
    state,
    ROW_NUMBER() OVER (PARTITION BY source_relation, id ORDER BY last_updated_date DESC) = 1 AS is_most_recent_record
  FROM fields
)
SELECT
  *
FROM final
%3 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history source_relation portfolio_id portfolio_name last_updated_date creation_date budget_amount budget_currency_code budget_end_date budget_start_date budget_policy in_budget profile_id serving_status state is_most_recent_record 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp id last_updated_date budget_amount budget_currency_code budget_end_date budget_policy budget_start_date creation_date in_budget name profile_id serving_status state 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp:f0->36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f1 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp:f1->36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f3 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp:f2->36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f5 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp:f3->36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f6 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp:f4->36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f7 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp:f5->36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f9 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp:f6->36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f8 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp:f7->36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f4 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp:f8->36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f10 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp:f9->36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f2 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp:f10->36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f11 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp:f11->36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f12 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp:f12->36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f13
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
portfolio_id text The ID of the Portfolio.
portfolio_name text The name of the Portfolio.
last_updated_date text Date of last update to record.
creation_date text The date of creation of the record.
budget_amount integer The budget amount associated with the portfolio. Cannot be null.
budget_currency_code integer The currency used for all monetary values for entities under this profile. Cannot be null.
budget_end_date integer The end date after which the budget is no longer applied. Optional if policy is set to dateRange or monthlyRecurring.
budget_start_date integer The starting date in YYYYMMDD format to which the budget is applied. Required if policy is set to dateRange. Not specified if policy is set to monthlyRecurring. Note that the starting date for monthlyRecurring is the date when the policy is set.
budget_policy integer The budget policy. Set to dateRange to specify a budget for a specific period of time. Set to monthlyRecurring to specify a budget that is automatically renewed at the beginning of each month. Cannot be null.
in_budget boolean Indicates the current budget status of the portfolio. Set to true if the portfolio is in budget, set to false if the portfolio is out of budget.
profile_id text The profile ID associated with your Amazon Ads account. Advertisers who operate in more than one marketplace (for example, Amazon.com, Amazon.co.uk, Amazon.co.jp) will have one profile associated with each marketplace.
serving_status text The current serving status of the record.
state text The state of the record (enabled, paused, or archived).
is_most_recent_record boolean Boolean indicating whether record was the most recent instance.
Column Lineage
%3 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history source_relation 21. model.amazon_ads.amazon_ads__portfolio_report 21. model.amazon_ads.amazon_ads__portfolio_report source_relation 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->21. model.amazon_ads.amazon_ads__portfolio_report:f0 23. model.amazon_ads.int_amazon_ads__portfolio_history 23. model.amazon_ads.int_amazon_ads__portfolio_history source_relation 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->23. model.amazon_ads.int_amazon_ads__portfolio_history:f0 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report source_relation 23. model.amazon_ads.int_amazon_ads__portfolio_history:f0->22. model.amazon_ads.amazon_ads__search_report:f0 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report source_relation 23. model.amazon_ads.int_amazon_ads__portfolio_history:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0 17. model.amazon_ads.amazon_ads__ad_group_report 17. model.amazon_ads.amazon_ads__ad_group_report source_relation 23. model.amazon_ads.int_amazon_ads__portfolio_history:f0->17. model.amazon_ads.amazon_ads__ad_group_report:f0 19. model.amazon_ads.amazon_ads__campaign_report 19. model.amazon_ads.amazon_ads__campaign_report source_relation 23. model.amazon_ads.int_amazon_ads__portfolio_history:f0->19. model.amazon_ads.amazon_ads__campaign_report:f0 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report source_relation 23. model.amazon_ads.int_amazon_ads__portfolio_history:f0->18. model.amazon_ads.amazon_ads__ad_report:f0
21. model.amazon_ads.amazon_ads__portfolio_report
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with other tables
    • Output Columns:
      • source_relation: Directly copied to the output
23. model.amazon_ads.int_amazon_ads__portfolio_history
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[source_relation]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • source_relation: Directly copied
17. model.amazon_ads.amazon_ads__ad_group_report
  • Input Column: 23. model.amazon_ads.int_amazon_ads__portfolio_history[source_relation]
    • Direct The column is directly copied without transformation
    • Integration Used as part of the join condition with other tables
    • Output Columns:
      • source_relation: Directly copied to the output
18. model.amazon_ads.amazon_ads__ad_report
  • Input Column: 23. model.amazon_ads.int_amazon_ads__portfolio_history[source_relation]
    • Direct The column is directly used in the SELECT statement
    • Integration Used to join with other tables
    • Output Columns:
      • source_relation: Directly copied to the output
19. model.amazon_ads.amazon_ads__campaign_report
  • Input Column: 23. model.amazon_ads.int_amazon_ads__portfolio_history[source_relation]
    • Integration The column is used as part of the join condition with the campaigns table
    • Output Columns:
      • source_relation: Contributes to the output source_relation column
20. model.amazon_ads.amazon_ads__keyword_report
  • Input Column: 23. model.amazon_ads.int_amazon_ads__portfolio_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
22. model.amazon_ads.amazon_ads__search_report
  • Input Column: 23. model.amazon_ads.int_amazon_ads__portfolio_history[source_relation]
    • Integration used to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
Column Lineage
%3 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp id 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history portfolio_id 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp:f0->36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0 21. model.amazon_ads.amazon_ads__portfolio_report 21. model.amazon_ads.amazon_ads__portfolio_report portfolio_id 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->21. model.amazon_ads.amazon_ads__portfolio_report:f0 23. model.amazon_ads.int_amazon_ads__portfolio_history 23. model.amazon_ads.int_amazon_ads__portfolio_history portfolio_id 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->23. model.amazon_ads.int_amazon_ads__portfolio_history:f0 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report portfolio_id 23. model.amazon_ads.int_amazon_ads__portfolio_history:f0->22. model.amazon_ads.amazon_ads__search_report:f0 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report portfolio_id 23. model.amazon_ads.int_amazon_ads__portfolio_history:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0 17. model.amazon_ads.amazon_ads__ad_group_report 17. model.amazon_ads.amazon_ads__ad_group_report portfolio_id 23. model.amazon_ads.int_amazon_ads__portfolio_history:f0->17. model.amazon_ads.amazon_ads__ad_group_report:f0 19. model.amazon_ads.amazon_ads__campaign_report 19. model.amazon_ads.amazon_ads__campaign_report portfolio_id 23. model.amazon_ads.int_amazon_ads__portfolio_history:f0->19. model.amazon_ads.amazon_ads__campaign_report:f0 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report portfolio_id 23. model.amazon_ads.int_amazon_ads__portfolio_history:f0->18. model.amazon_ads.amazon_ads__ad_report:f0
36. model.amazon_ads_source.stg_amazon_ads__portfolio_history
  • Input Column: 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp[id]
    • Cleaning Cast to TEXT data type
    • Deduplication Used in ROW_NUMBER() window function for identifying the most recent record
    • Output Columns:
      • portfolio_id: Directly mapped after casting to TEXT
21. model.amazon_ads.amazon_ads__portfolio_report
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[portfolio_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with the campaigns table
    • Output Columns:
      • portfolio_id: Directly copied to the output
23. model.amazon_ads.int_amazon_ads__portfolio_history
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[portfolio_id]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • portfolio_id: Directly copied
17. model.amazon_ads.amazon_ads__ad_group_report
  • Input Column: 23. model.amazon_ads.int_amazon_ads__portfolio_history[portfolio_id]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with other tables
    • Output Columns:
      • portfolio_id: Directly copied to the output
18. model.amazon_ads.amazon_ads__ad_report
  • Input Column: 23. model.amazon_ads.int_amazon_ads__portfolio_history[portfolio_id]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the campaigns table
    • Output Columns:
      • portfolio_id: Directly copied to the output
19. model.amazon_ads.amazon_ads__campaign_report
  • Input Column: 23. model.amazon_ads.int_amazon_ads__portfolio_history[portfolio_id]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the campaigns table
    • Output Columns:
      • portfolio_id: Directly copied to the output
20. model.amazon_ads.amazon_ads__keyword_report
  • Input Column: 23. model.amazon_ads.int_amazon_ads__portfolio_history[portfolio_id]
    • Integration used as part of the join condition with the campaigns table
    • Direct directly copied to the output
    • Output Columns:
      • portfolio_id: directly copied
22. model.amazon_ads.amazon_ads__search_report
  • Input Column: 23. model.amazon_ads.int_amazon_ads__portfolio_history[portfolio_id]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the campaigns table
    • Output Columns:
      • portfolio_id: Directly copied to the output
Column Lineage
%3 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp name 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history portfolio_name 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp:f0->36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0 21. model.amazon_ads.amazon_ads__portfolio_report 21. model.amazon_ads.amazon_ads__portfolio_report portfolio_name 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->21. model.amazon_ads.amazon_ads__portfolio_report:f0 23. model.amazon_ads.int_amazon_ads__portfolio_history 23. model.amazon_ads.int_amazon_ads__portfolio_history portfolio_name 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->23. model.amazon_ads.int_amazon_ads__portfolio_history:f0 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report portfolio_name 23. model.amazon_ads.int_amazon_ads__portfolio_history:f0->22. model.amazon_ads.amazon_ads__search_report:f0 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report portfolio_name 23. model.amazon_ads.int_amazon_ads__portfolio_history:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0 17. model.amazon_ads.amazon_ads__ad_group_report 17. model.amazon_ads.amazon_ads__ad_group_report portfolio_name 23. model.amazon_ads.int_amazon_ads__portfolio_history:f0->17. model.amazon_ads.amazon_ads__ad_group_report:f0 19. model.amazon_ads.amazon_ads__campaign_report 19. model.amazon_ads.amazon_ads__campaign_report portfolio_name 23. model.amazon_ads.int_amazon_ads__portfolio_history:f0->19. model.amazon_ads.amazon_ads__campaign_report:f0 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report portfolio_name 23. model.amazon_ads.int_amazon_ads__portfolio_history:f0->18. model.amazon_ads.amazon_ads__ad_report:f0
36. model.amazon_ads_source.stg_amazon_ads__portfolio_history
  • Input Column: 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • portfolio_name: Directly mapped and renamed
21. model.amazon_ads.amazon_ads__portfolio_report
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[portfolio_name]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • portfolio_name: Directly copied to the output
23. model.amazon_ads.int_amazon_ads__portfolio_history
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[portfolio_name]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • portfolio_name: Directly copied
17. model.amazon_ads.amazon_ads__ad_group_report
  • Input Column: 23. model.amazon_ads.int_amazon_ads__portfolio_history[portfolio_name]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with other tables
    • Output Columns:
      • portfolio_name: Directly copied to the output
18. model.amazon_ads.amazon_ads__ad_report
  • Input Column: 23. model.amazon_ads.int_amazon_ads__portfolio_history[portfolio_name]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the campaigns table
    • Output Columns:
      • portfolio_name: Directly copied to the output
19. model.amazon_ads.amazon_ads__campaign_report
  • Input Column: 23. model.amazon_ads.int_amazon_ads__portfolio_history[portfolio_name]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the campaigns table
    • Output Columns:
      • portfolio_name: Directly copied to the output
20. model.amazon_ads.amazon_ads__keyword_report
  • Input Column: 23. model.amazon_ads.int_amazon_ads__portfolio_history[portfolio_name]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the campaigns table
    • Output Columns:
      • portfolio_name: Directly copied to the output
22. model.amazon_ads.amazon_ads__search_report
  • Input Column: 23. model.amazon_ads.int_amazon_ads__portfolio_history[portfolio_name]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the campaigns table
    • Output Columns:
      • portfolio_name: Directly copied to the output
Column Lineage
%3 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp last_updated_date 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history last_updated_date 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp:f0->36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0 23. model.amazon_ads.int_amazon_ads__portfolio_history 23. model.amazon_ads.int_amazon_ads__portfolio_history last_updated_date 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->23. model.amazon_ads.int_amazon_ads__portfolio_history:f0
36. model.amazon_ads_source.stg_amazon_ads__portfolio_history
  • Input Column: 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp[last_updated_date]
    • Cleaning Cast to TIMESTAMP data type
    • Deduplication Used in ROW_NUMBER() window function for ordering and identifying the most recent record
    • Output Columns:
      • last_updated_date: Directly mapped after casting to TIMESTAMP
23. model.amazon_ads.int_amazon_ads__portfolio_history
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[last_updated_date]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • last_updated_date: Directly copied
Column Lineage
%3 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp creation_date 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history creation_date 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp:f0->36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0 23. model.amazon_ads.int_amazon_ads__portfolio_history 23. model.amazon_ads.int_amazon_ads__portfolio_history creation_date 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->23. model.amazon_ads.int_amazon_ads__portfolio_history:f0
36. model.amazon_ads_source.stg_amazon_ads__portfolio_history
  • Input Column: 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp[creation_date]
    • Cleaning Cast to TIMESTAMP data type
    • Output Columns:
      • creation_date: Directly mapped after casting to TIMESTAMP
23. model.amazon_ads.int_amazon_ads__portfolio_history
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[creation_date]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • creation_date: Directly copied
Column Lineage
%3 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp budget_amount 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history budget_amount 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp:f0->36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0 21. model.amazon_ads.amazon_ads__portfolio_report 21. model.amazon_ads.amazon_ads__portfolio_report budget_amount 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->21. model.amazon_ads.amazon_ads__portfolio_report:f0 23. model.amazon_ads.int_amazon_ads__portfolio_history 23. model.amazon_ads.int_amazon_ads__portfolio_history budget_amount 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->23. model.amazon_ads.int_amazon_ads__portfolio_history:f0
36. model.amazon_ads_source.stg_amazon_ads__portfolio_history
  • Input Column: 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp[budget_amount]
    • Cleaning Cast to FLOAT data type
    • Output Columns:
      • budget_amount: Directly mapped after casting to FLOAT
21. model.amazon_ads.amazon_ads__portfolio_report
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[budget_amount]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • budget_amount: Directly copied to the output
23. model.amazon_ads.int_amazon_ads__portfolio_history
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[budget_amount]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • budget_amount: Directly copied
Column Lineage
%3 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp budget_currency_code 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history budget_currency_code 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp:f0->36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0 21. model.amazon_ads.amazon_ads__portfolio_report 21. model.amazon_ads.amazon_ads__portfolio_report budget_currency_code 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->21. model.amazon_ads.amazon_ads__portfolio_report:f0 23. model.amazon_ads.int_amazon_ads__portfolio_history 23. model.amazon_ads.int_amazon_ads__portfolio_history budget_currency_code 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->23. model.amazon_ads.int_amazon_ads__portfolio_history:f0
36. model.amazon_ads_source.stg_amazon_ads__portfolio_history
  • Input Column: 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp[budget_currency_code]
    • Cleaning Cast to TEXT data type
    • Output Columns:
      • budget_currency_code: Directly mapped after casting to TEXT
21. model.amazon_ads.amazon_ads__portfolio_report
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[budget_currency_code]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • budget_currency_code: Directly copied to the output
23. model.amazon_ads.int_amazon_ads__portfolio_history
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[budget_currency_code]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • budget_currency_code: Directly copied
Column Lineage
%3 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp budget_end_date 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history budget_end_date 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp:f0->36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0 21. model.amazon_ads.amazon_ads__portfolio_report 21. model.amazon_ads.amazon_ads__portfolio_report budget_end_date 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->21. model.amazon_ads.amazon_ads__portfolio_report:f0 23. model.amazon_ads.int_amazon_ads__portfolio_history 23. model.amazon_ads.int_amazon_ads__portfolio_history budget_end_date 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->23. model.amazon_ads.int_amazon_ads__portfolio_history:f0
36. model.amazon_ads_source.stg_amazon_ads__portfolio_history
  • Input Column: 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp[budget_end_date]
    • Cleaning Cast to DATE data type
    • Output Columns:
      • budget_end_date: Directly mapped after casting to DATE
21. model.amazon_ads.amazon_ads__portfolio_report
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[budget_end_date]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • budget_end_date: Directly copied to the output
23. model.amazon_ads.int_amazon_ads__portfolio_history
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[budget_end_date]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • budget_end_date: Directly copied
Column Lineage
%3 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp budget_start_date 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history budget_start_date 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp:f0->36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0 21. model.amazon_ads.amazon_ads__portfolio_report 21. model.amazon_ads.amazon_ads__portfolio_report budget_start_date 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->21. model.amazon_ads.amazon_ads__portfolio_report:f0 23. model.amazon_ads.int_amazon_ads__portfolio_history 23. model.amazon_ads.int_amazon_ads__portfolio_history budget_start_date 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->23. model.amazon_ads.int_amazon_ads__portfolio_history:f0
36. model.amazon_ads_source.stg_amazon_ads__portfolio_history
  • Input Column: 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp[budget_start_date]
    • Cleaning Cast to DATE data type
    • Output Columns:
      • budget_start_date: Directly mapped after casting to DATE
21. model.amazon_ads.amazon_ads__portfolio_report
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[budget_start_date]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • budget_start_date: Directly copied to the output
23. model.amazon_ads.int_amazon_ads__portfolio_history
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[budget_start_date]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • budget_start_date: Directly copied
Column Lineage
%3 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp budget_policy 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history budget_policy 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp:f0->36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0 21. model.amazon_ads.amazon_ads__portfolio_report 21. model.amazon_ads.amazon_ads__portfolio_report budget_policy 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->21. model.amazon_ads.amazon_ads__portfolio_report:f0 23. model.amazon_ads.int_amazon_ads__portfolio_history 23. model.amazon_ads.int_amazon_ads__portfolio_history budget_policy 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->23. model.amazon_ads.int_amazon_ads__portfolio_history:f0
36. model.amazon_ads_source.stg_amazon_ads__portfolio_history
  • Input Column: 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp[budget_policy]
    • Cleaning Cast to TEXT data type
    • Output Columns:
      • budget_policy: Directly mapped after casting to TEXT
21. model.amazon_ads.amazon_ads__portfolio_report
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[budget_policy]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • budget_policy: Directly copied to the output
23. model.amazon_ads.int_amazon_ads__portfolio_history
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[budget_policy]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • budget_policy: Directly copied
Column Lineage
%3 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp in_budget 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history in_budget 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp:f0->36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0 21. model.amazon_ads.amazon_ads__portfolio_report 21. model.amazon_ads.amazon_ads__portfolio_report in_budget 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->21. model.amazon_ads.amazon_ads__portfolio_report:f0 23. model.amazon_ads.int_amazon_ads__portfolio_history 23. model.amazon_ads.int_amazon_ads__portfolio_history in_budget 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->23. model.amazon_ads.int_amazon_ads__portfolio_history:f0
36. model.amazon_ads_source.stg_amazon_ads__portfolio_history
  • Input Column: 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp[in_budget]
    • Cleaning Cast to BOOLEAN data type
    • Output Columns:
      • in_budget: Directly mapped after casting to BOOLEAN
21. model.amazon_ads.amazon_ads__portfolio_report
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[in_budget]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • in_budget: Directly copied to the output
23. model.amazon_ads.int_amazon_ads__portfolio_history
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[in_budget]
    • Direct This column is directly copied without any transformation
    • Output Columns:
      • in_budget: Directly copied to the output
Column Lineage
%3 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp profile_id 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history profile_id 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp:f0->36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0 23. model.amazon_ads.int_amazon_ads__portfolio_history 23. model.amazon_ads.int_amazon_ads__portfolio_history profile_id 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->23. model.amazon_ads.int_amazon_ads__portfolio_history:f0
36. model.amazon_ads_source.stg_amazon_ads__portfolio_history
  • Input Column: 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp[profile_id]
    • Cleaning The column is cast as INT in the fields CTE and then as TEXT in the final CTE
    • Output Columns:
      • profile_id: Mapped after casting
23. model.amazon_ads.int_amazon_ads__portfolio_history
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[profile_id]
    • Direct This column is directly copied without any transformation
    • Output Columns:
      • profile_id: Directly copied to the output
Column Lineage
%3 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp serving_status 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history serving_status 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp:f0->36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0 21. model.amazon_ads.amazon_ads__portfolio_report 21. model.amazon_ads.amazon_ads__portfolio_report serving_status 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->21. model.amazon_ads.amazon_ads__portfolio_report:f0 23. model.amazon_ads.int_amazon_ads__portfolio_history 23. model.amazon_ads.int_amazon_ads__portfolio_history serving_status 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->23. model.amazon_ads.int_amazon_ads__portfolio_history:f0
36. model.amazon_ads_source.stg_amazon_ads__portfolio_history
  • Input Column: 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp[serving_status]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • serving_status: Directly mapped
21. model.amazon_ads.amazon_ads__portfolio_report
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[serving_status]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • serving_status: Directly copied to the output
23. model.amazon_ads.int_amazon_ads__portfolio_history
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[serving_status]
    • Direct This column is directly copied without any transformation
    • Output Columns:
      • serving_status: Directly copied to the output
Column Lineage
%3 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp state 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history state 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp:f0->36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0 21. model.amazon_ads.amazon_ads__portfolio_report 21. model.amazon_ads.amazon_ads__portfolio_report state 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->21. model.amazon_ads.amazon_ads__portfolio_report:f0 23. model.amazon_ads.int_amazon_ads__portfolio_history 23. model.amazon_ads.int_amazon_ads__portfolio_history state 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->23. model.amazon_ads.int_amazon_ads__portfolio_history:f0
36. model.amazon_ads_source.stg_amazon_ads__portfolio_history
  • Input Column: 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp[state]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • state: Directly mapped
21. model.amazon_ads.amazon_ads__portfolio_report
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[state]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • state: Directly copied to the output
23. model.amazon_ads.int_amazon_ads__portfolio_history
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[state]
    • Direct This column is directly copied without any transformation
    • Output Columns:
      • state: Directly copied to the output
Column Lineage
%3 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history is_most_recent_record 23. model.amazon_ads.int_amazon_ads__portfolio_history 23. model.amazon_ads.int_amazon_ads__portfolio_history is_most_recent_record 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->23. model.amazon_ads.int_amazon_ads__portfolio_history:f0
23. model.amazon_ads.int_amazon_ads__portfolio_history
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[is_most_recent_record]
    • Filtering This column is used to filter the data to include only the most recent records
    • Direct After filtering, this column is directly copied to the output
    • Output Columns:
      • is_most_recent_record: Directly copied to the output after being used for filtering
37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of TEXT type. It's likely used as a placeholder or template for further development or testing purposes.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp id last_updated_date _fivetran_synced budget_amount budget_currency_code budget_end_date budget_policy budget_start_date creation_date in_budget name profile_id serving_status state 285. source.amazon_ads_source.amazon_ads.portfolio_history 285. source.amazon_ads_source.amazon_ads.portfolio_history
Name Type Comment
id integer None
last_updated_date text None
_fivetran_synced text None
budget_amount integer None
budget_currency_code integer None
budget_end_date integer None
budget_policy integer None
budget_start_date integer None
creation_date text None
in_budget boolean None
name text None
profile_id integer None
serving_status text None
state text None
Column Lineage
%3 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp id 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history portfolio_id 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp:f0->36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0 21. model.amazon_ads.amazon_ads__portfolio_report 21. model.amazon_ads.amazon_ads__portfolio_report portfolio_id 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->21. model.amazon_ads.amazon_ads__portfolio_report:f0 23. model.amazon_ads.int_amazon_ads__portfolio_history 23. model.amazon_ads.int_amazon_ads__portfolio_history portfolio_id 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->23. model.amazon_ads.int_amazon_ads__portfolio_history:f0 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report portfolio_id 23. model.amazon_ads.int_amazon_ads__portfolio_history:f0->22. model.amazon_ads.amazon_ads__search_report:f0 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report portfolio_id 23. model.amazon_ads.int_amazon_ads__portfolio_history:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0 17. model.amazon_ads.amazon_ads__ad_group_report 17. model.amazon_ads.amazon_ads__ad_group_report portfolio_id 23. model.amazon_ads.int_amazon_ads__portfolio_history:f0->17. model.amazon_ads.amazon_ads__ad_group_report:f0 19. model.amazon_ads.amazon_ads__campaign_report 19. model.amazon_ads.amazon_ads__campaign_report portfolio_id 23. model.amazon_ads.int_amazon_ads__portfolio_history:f0->19. model.amazon_ads.amazon_ads__campaign_report:f0 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report portfolio_id 23. model.amazon_ads.int_amazon_ads__portfolio_history:f0->18. model.amazon_ads.amazon_ads__ad_report:f0
36. model.amazon_ads_source.stg_amazon_ads__portfolio_history
  • Input Column: 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp[id]
    • Cleaning Cast to TEXT data type
    • Deduplication Used in ROW_NUMBER() window function for identifying the most recent record
    • Output Columns:
      • portfolio_id: Directly mapped after casting to TEXT
21. model.amazon_ads.amazon_ads__portfolio_report
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[portfolio_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with the campaigns table
    • Output Columns:
      • portfolio_id: Directly copied to the output
23. model.amazon_ads.int_amazon_ads__portfolio_history
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[portfolio_id]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • portfolio_id: Directly copied
17. model.amazon_ads.amazon_ads__ad_group_report
  • Input Column: 23. model.amazon_ads.int_amazon_ads__portfolio_history[portfolio_id]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with other tables
    • Output Columns:
      • portfolio_id: Directly copied to the output
18. model.amazon_ads.amazon_ads__ad_report
  • Input Column: 23. model.amazon_ads.int_amazon_ads__portfolio_history[portfolio_id]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the campaigns table
    • Output Columns:
      • portfolio_id: Directly copied to the output
19. model.amazon_ads.amazon_ads__campaign_report
  • Input Column: 23. model.amazon_ads.int_amazon_ads__portfolio_history[portfolio_id]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the campaigns table
    • Output Columns:
      • portfolio_id: Directly copied to the output
20. model.amazon_ads.amazon_ads__keyword_report
  • Input Column: 23. model.amazon_ads.int_amazon_ads__portfolio_history[portfolio_id]
    • Integration used as part of the join condition with the campaigns table
    • Direct directly copied to the output
    • Output Columns:
      • portfolio_id: directly copied
22. model.amazon_ads.amazon_ads__search_report
  • Input Column: 23. model.amazon_ads.int_amazon_ads__portfolio_history[portfolio_id]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the campaigns table
    • Output Columns:
      • portfolio_id: Directly copied to the output
Column Lineage
%3 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp last_updated_date 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history last_updated_date 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp:f0->36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0 23. model.amazon_ads.int_amazon_ads__portfolio_history 23. model.amazon_ads.int_amazon_ads__portfolio_history last_updated_date 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->23. model.amazon_ads.int_amazon_ads__portfolio_history:f0
36. model.amazon_ads_source.stg_amazon_ads__portfolio_history
  • Input Column: 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp[last_updated_date]
    • Cleaning Cast to TIMESTAMP data type
    • Deduplication Used in ROW_NUMBER() window function for ordering and identifying the most recent record
    • Output Columns:
      • last_updated_date: Directly mapped after casting to TIMESTAMP
23. model.amazon_ads.int_amazon_ads__portfolio_history
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[last_updated_date]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • last_updated_date: Directly copied
Column Lineage
%3 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp budget_amount 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history budget_amount 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp:f0->36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0 21. model.amazon_ads.amazon_ads__portfolio_report 21. model.amazon_ads.amazon_ads__portfolio_report budget_amount 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->21. model.amazon_ads.amazon_ads__portfolio_report:f0 23. model.amazon_ads.int_amazon_ads__portfolio_history 23. model.amazon_ads.int_amazon_ads__portfolio_history budget_amount 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->23. model.amazon_ads.int_amazon_ads__portfolio_history:f0
36. model.amazon_ads_source.stg_amazon_ads__portfolio_history
  • Input Column: 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp[budget_amount]
    • Cleaning Cast to FLOAT data type
    • Output Columns:
      • budget_amount: Directly mapped after casting to FLOAT
21. model.amazon_ads.amazon_ads__portfolio_report
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[budget_amount]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • budget_amount: Directly copied to the output
23. model.amazon_ads.int_amazon_ads__portfolio_history
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[budget_amount]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • budget_amount: Directly copied
Column Lineage
%3 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp budget_currency_code 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history budget_currency_code 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp:f0->36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0 21. model.amazon_ads.amazon_ads__portfolio_report 21. model.amazon_ads.amazon_ads__portfolio_report budget_currency_code 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->21. model.amazon_ads.amazon_ads__portfolio_report:f0 23. model.amazon_ads.int_amazon_ads__portfolio_history 23. model.amazon_ads.int_amazon_ads__portfolio_history budget_currency_code 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->23. model.amazon_ads.int_amazon_ads__portfolio_history:f0
36. model.amazon_ads_source.stg_amazon_ads__portfolio_history
  • Input Column: 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp[budget_currency_code]
    • Cleaning Cast to TEXT data type
    • Output Columns:
      • budget_currency_code: Directly mapped after casting to TEXT
21. model.amazon_ads.amazon_ads__portfolio_report
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[budget_currency_code]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • budget_currency_code: Directly copied to the output
23. model.amazon_ads.int_amazon_ads__portfolio_history
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[budget_currency_code]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • budget_currency_code: Directly copied
Column Lineage
%3 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp budget_end_date 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history budget_end_date 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp:f0->36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0 21. model.amazon_ads.amazon_ads__portfolio_report 21. model.amazon_ads.amazon_ads__portfolio_report budget_end_date 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->21. model.amazon_ads.amazon_ads__portfolio_report:f0 23. model.amazon_ads.int_amazon_ads__portfolio_history 23. model.amazon_ads.int_amazon_ads__portfolio_history budget_end_date 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->23. model.amazon_ads.int_amazon_ads__portfolio_history:f0
36. model.amazon_ads_source.stg_amazon_ads__portfolio_history
  • Input Column: 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp[budget_end_date]
    • Cleaning Cast to DATE data type
    • Output Columns:
      • budget_end_date: Directly mapped after casting to DATE
21. model.amazon_ads.amazon_ads__portfolio_report
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[budget_end_date]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • budget_end_date: Directly copied to the output
23. model.amazon_ads.int_amazon_ads__portfolio_history
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[budget_end_date]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • budget_end_date: Directly copied
Column Lineage
%3 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp budget_policy 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history budget_policy 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp:f0->36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0 21. model.amazon_ads.amazon_ads__portfolio_report 21. model.amazon_ads.amazon_ads__portfolio_report budget_policy 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->21. model.amazon_ads.amazon_ads__portfolio_report:f0 23. model.amazon_ads.int_amazon_ads__portfolio_history 23. model.amazon_ads.int_amazon_ads__portfolio_history budget_policy 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->23. model.amazon_ads.int_amazon_ads__portfolio_history:f0
36. model.amazon_ads_source.stg_amazon_ads__portfolio_history
  • Input Column: 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp[budget_policy]
    • Cleaning Cast to TEXT data type
    • Output Columns:
      • budget_policy: Directly mapped after casting to TEXT
21. model.amazon_ads.amazon_ads__portfolio_report
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[budget_policy]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • budget_policy: Directly copied to the output
23. model.amazon_ads.int_amazon_ads__portfolio_history
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[budget_policy]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • budget_policy: Directly copied
Column Lineage
%3 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp budget_start_date 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history budget_start_date 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp:f0->36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0 21. model.amazon_ads.amazon_ads__portfolio_report 21. model.amazon_ads.amazon_ads__portfolio_report budget_start_date 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->21. model.amazon_ads.amazon_ads__portfolio_report:f0 23. model.amazon_ads.int_amazon_ads__portfolio_history 23. model.amazon_ads.int_amazon_ads__portfolio_history budget_start_date 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->23. model.amazon_ads.int_amazon_ads__portfolio_history:f0
36. model.amazon_ads_source.stg_amazon_ads__portfolio_history
  • Input Column: 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp[budget_start_date]
    • Cleaning Cast to DATE data type
    • Output Columns:
      • budget_start_date: Directly mapped after casting to DATE
21. model.amazon_ads.amazon_ads__portfolio_report
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[budget_start_date]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • budget_start_date: Directly copied to the output
23. model.amazon_ads.int_amazon_ads__portfolio_history
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[budget_start_date]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • budget_start_date: Directly copied
Column Lineage
%3 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp creation_date 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history creation_date 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp:f0->36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0 23. model.amazon_ads.int_amazon_ads__portfolio_history 23. model.amazon_ads.int_amazon_ads__portfolio_history creation_date 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->23. model.amazon_ads.int_amazon_ads__portfolio_history:f0
36. model.amazon_ads_source.stg_amazon_ads__portfolio_history
  • Input Column: 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp[creation_date]
    • Cleaning Cast to TIMESTAMP data type
    • Output Columns:
      • creation_date: Directly mapped after casting to TIMESTAMP
23. model.amazon_ads.int_amazon_ads__portfolio_history
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[creation_date]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • creation_date: Directly copied
Column Lineage
%3 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp in_budget 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history in_budget 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp:f0->36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0 21. model.amazon_ads.amazon_ads__portfolio_report 21. model.amazon_ads.amazon_ads__portfolio_report in_budget 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->21. model.amazon_ads.amazon_ads__portfolio_report:f0 23. model.amazon_ads.int_amazon_ads__portfolio_history 23. model.amazon_ads.int_amazon_ads__portfolio_history in_budget 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->23. model.amazon_ads.int_amazon_ads__portfolio_history:f0
36. model.amazon_ads_source.stg_amazon_ads__portfolio_history
  • Input Column: 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp[in_budget]
    • Cleaning Cast to BOOLEAN data type
    • Output Columns:
      • in_budget: Directly mapped after casting to BOOLEAN
21. model.amazon_ads.amazon_ads__portfolio_report
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[in_budget]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • in_budget: Directly copied to the output
23. model.amazon_ads.int_amazon_ads__portfolio_history
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[in_budget]
    • Direct This column is directly copied without any transformation
    • Output Columns:
      • in_budget: Directly copied to the output
Column Lineage
%3 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp name 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history portfolio_name 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp:f0->36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0 21. model.amazon_ads.amazon_ads__portfolio_report 21. model.amazon_ads.amazon_ads__portfolio_report portfolio_name 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->21. model.amazon_ads.amazon_ads__portfolio_report:f0 23. model.amazon_ads.int_amazon_ads__portfolio_history 23. model.amazon_ads.int_amazon_ads__portfolio_history portfolio_name 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->23. model.amazon_ads.int_amazon_ads__portfolio_history:f0 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report portfolio_name 23. model.amazon_ads.int_amazon_ads__portfolio_history:f0->22. model.amazon_ads.amazon_ads__search_report:f0 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report portfolio_name 23. model.amazon_ads.int_amazon_ads__portfolio_history:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0 17. model.amazon_ads.amazon_ads__ad_group_report 17. model.amazon_ads.amazon_ads__ad_group_report portfolio_name 23. model.amazon_ads.int_amazon_ads__portfolio_history:f0->17. model.amazon_ads.amazon_ads__ad_group_report:f0 19. model.amazon_ads.amazon_ads__campaign_report 19. model.amazon_ads.amazon_ads__campaign_report portfolio_name 23. model.amazon_ads.int_amazon_ads__portfolio_history:f0->19. model.amazon_ads.amazon_ads__campaign_report:f0 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report portfolio_name 23. model.amazon_ads.int_amazon_ads__portfolio_history:f0->18. model.amazon_ads.amazon_ads__ad_report:f0
36. model.amazon_ads_source.stg_amazon_ads__portfolio_history
  • Input Column: 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • portfolio_name: Directly mapped and renamed
21. model.amazon_ads.amazon_ads__portfolio_report
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[portfolio_name]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • portfolio_name: Directly copied to the output
23. model.amazon_ads.int_amazon_ads__portfolio_history
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[portfolio_name]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • portfolio_name: Directly copied
17. model.amazon_ads.amazon_ads__ad_group_report
  • Input Column: 23. model.amazon_ads.int_amazon_ads__portfolio_history[portfolio_name]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with other tables
    • Output Columns:
      • portfolio_name: Directly copied to the output
18. model.amazon_ads.amazon_ads__ad_report
  • Input Column: 23. model.amazon_ads.int_amazon_ads__portfolio_history[portfolio_name]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the campaigns table
    • Output Columns:
      • portfolio_name: Directly copied to the output
19. model.amazon_ads.amazon_ads__campaign_report
  • Input Column: 23. model.amazon_ads.int_amazon_ads__portfolio_history[portfolio_name]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the campaigns table
    • Output Columns:
      • portfolio_name: Directly copied to the output
20. model.amazon_ads.amazon_ads__keyword_report
  • Input Column: 23. model.amazon_ads.int_amazon_ads__portfolio_history[portfolio_name]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the campaigns table
    • Output Columns:
      • portfolio_name: Directly copied to the output
22. model.amazon_ads.amazon_ads__search_report
  • Input Column: 23. model.amazon_ads.int_amazon_ads__portfolio_history[portfolio_name]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the campaigns table
    • Output Columns:
      • portfolio_name: Directly copied to the output
Column Lineage
%3 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp profile_id 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history profile_id 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp:f0->36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0 23. model.amazon_ads.int_amazon_ads__portfolio_history 23. model.amazon_ads.int_amazon_ads__portfolio_history profile_id 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->23. model.amazon_ads.int_amazon_ads__portfolio_history:f0
36. model.amazon_ads_source.stg_amazon_ads__portfolio_history
  • Input Column: 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp[profile_id]
    • Cleaning The column is cast as INT in the fields CTE and then as TEXT in the final CTE
    • Output Columns:
      • profile_id: Mapped after casting
23. model.amazon_ads.int_amazon_ads__portfolio_history
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[profile_id]
    • Direct This column is directly copied without any transformation
    • Output Columns:
      • profile_id: Directly copied to the output
Column Lineage
%3 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp serving_status 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history serving_status 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp:f0->36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0 21. model.amazon_ads.amazon_ads__portfolio_report 21. model.amazon_ads.amazon_ads__portfolio_report serving_status 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->21. model.amazon_ads.amazon_ads__portfolio_report:f0 23. model.amazon_ads.int_amazon_ads__portfolio_history 23. model.amazon_ads.int_amazon_ads__portfolio_history serving_status 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->23. model.amazon_ads.int_amazon_ads__portfolio_history:f0
36. model.amazon_ads_source.stg_amazon_ads__portfolio_history
  • Input Column: 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp[serving_status]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • serving_status: Directly mapped
21. model.amazon_ads.amazon_ads__portfolio_report
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[serving_status]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • serving_status: Directly copied to the output
23. model.amazon_ads.int_amazon_ads__portfolio_history
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[serving_status]
    • Direct This column is directly copied without any transformation
    • Output Columns:
      • serving_status: Directly copied to the output
Column Lineage
%3 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp state 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history state 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp:f0->36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0 21. model.amazon_ads.amazon_ads__portfolio_report 21. model.amazon_ads.amazon_ads__portfolio_report state 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->21. model.amazon_ads.amazon_ads__portfolio_report:f0 23. model.amazon_ads.int_amazon_ads__portfolio_history 23. model.amazon_ads.int_amazon_ads__portfolio_history state 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history:f0->23. model.amazon_ads.int_amazon_ads__portfolio_history:f0
36. model.amazon_ads_source.stg_amazon_ads__portfolio_history
  • Input Column: 37. model.amazon_ads_source.stg_amazon_ads__portfolio_history_tmp[state]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • state: Directly mapped
21. model.amazon_ads.amazon_ads__portfolio_report
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[state]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • state: Directly copied to the output
23. model.amazon_ads.int_amazon_ads__portfolio_history
  • Input Column: 36. model.amazon_ads_source.stg_amazon_ads__portfolio_history[state]
    • Direct This column is directly copied without any transformation
    • Output Columns:
      • state: Directly copied to the output
38. model.amazon_ads_source.stg_amazon_ads__product_ad_history

This SQL query stages data from a temporary table, casts various fields to specific data types, and creates a final table with transformed columns. It also adds a boolean column to identify the most recent record for each unique combination of source_relation and id.

CleaningDeduplicationOther
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_amazon_ads_source.stg_amazon_ads__product_ad_history_tmp
), fields AS (
  SELECT
    CAST(NULL AS INT) AS ad_group_id,
    CAST(NULL AS TEXT) AS asin,
    CAST(NULL AS INT) AS campaign_id,
    CAST(NULL AS TIMESTAMP) AS creation_date,
    CAST(NULL AS TEXT) AS id,
    CAST(NULL AS TIMESTAMP) AS last_updated_date,
    CAST(NULL AS TEXT) AS serving_status,
    CAST(NULL AS TEXT) AS sku,
    CAST(NULL AS TEXT) AS state,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    CAST(id AS TEXT) AS ad_id,
    CAST(ad_group_id AS TEXT) AS ad_group_id,
    asin,
    CAST(campaign_id AS TEXT) AS campaign_id,
    creation_date,
    last_updated_date,
    serving_status,
    sku,
    state,
    ROW_NUMBER() OVER (PARTITION BY source_relation, id ORDER BY last_updated_date DESC) = 1 AS is_most_recent_record
  FROM fields
)
SELECT
  *
FROM final
%3 38. model.amazon_ads_source.stg_amazon_ads__product_ad_history 38. model.amazon_ads_source.stg_amazon_ads__product_ad_history source_relation ad_id last_updated_date ad_group_id campaign_id asin creation_date sku serving_status state is_most_recent_record 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp id last_updated_date ad_group_id asin campaign_id creation_date serving_status sku state 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp:f0->38. model.amazon_ads_source.stg_amazon_ads__product_ad_history:f1 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp:f1->38. model.amazon_ads_source.stg_amazon_ads__product_ad_history:f2 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp:f2->38. model.amazon_ads_source.stg_amazon_ads__product_ad_history:f3 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp:f3->38. model.amazon_ads_source.stg_amazon_ads__product_ad_history:f5 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp:f4->38. model.amazon_ads_source.stg_amazon_ads__product_ad_history:f4 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp:f5->38. model.amazon_ads_source.stg_amazon_ads__product_ad_history:f6 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp:f6->38. model.amazon_ads_source.stg_amazon_ads__product_ad_history:f8 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp:f7->38. model.amazon_ads_source.stg_amazon_ads__product_ad_history:f7 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp:f8->38. model.amazon_ads_source.stg_amazon_ads__product_ad_history:f9
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
ad_id text The ID representing the ad, if present in the source data.
last_updated_date text Date of last update to record.
ad_group_id text The ID representing the ad group, if present in the source data.
campaign_id text The ID representing the campaign, if present in the source data.
asin text The ASIN associated with the ad.
creation_date text The date of creation of the record.
sku integer The product SKU associated with the ad.
serving_status text The current serving status of the record.
state text The state of the record (enabled, paused, or archived).
is_most_recent_record boolean Boolean indicating whether record was the most recent instance.
Column Lineage
%3 38. model.amazon_ads_source.stg_amazon_ads__product_ad_history 38. model.amazon_ads_source.stg_amazon_ads__product_ad_history source_relation 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report source_relation 38. model.amazon_ads_source.stg_amazon_ads__product_ad_history:f0->18. model.amazon_ads.amazon_ads__ad_report:f0
18. model.amazon_ads.amazon_ads__ad_report
  • Input Column: 38. model.amazon_ads_source.stg_amazon_ads__product_ad_history[source_relation]
    • Integration used to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
Column Lineage
%3 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp id 38. model.amazon_ads_source.stg_amazon_ads__product_ad_history 38. model.amazon_ads_source.stg_amazon_ads__product_ad_history ad_id 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp:f0->38. model.amazon_ads_source.stg_amazon_ads__product_ad_history:f0 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report ad_id 38. model.amazon_ads_source.stg_amazon_ads__product_ad_history:f0->18. model.amazon_ads.amazon_ads__ad_report:f0
38. model.amazon_ads_source.stg_amazon_ads__product_ad_history
  • Input Column: 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp[id]
    • Cleaning Cast to TEXT datatype
    • Deduplication Used in ROW_NUMBER() function for identifying most recent record
    • Output Columns:
      • ad_id: Directly mapped after casting
18. model.amazon_ads.amazon_ads__ad_report
  • Input Column: 38. model.amazon_ads_source.stg_amazon_ads__product_ad_history[ad_id]
    • Integration used to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • ad_id: directly copied
Column Lineage
%3 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp last_updated_date 38. model.amazon_ads_source.stg_amazon_ads__product_ad_history 38. model.amazon_ads_source.stg_amazon_ads__product_ad_history last_updated_date 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp:f0->38. model.amazon_ads_source.stg_amazon_ads__product_ad_history:f0
38. model.amazon_ads_source.stg_amazon_ads__product_ad_history
  • Input Column: 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp[last_updated_date]
    • Cleaning Cast to TIMESTAMP datatype
    • Deduplication Used in ROW_NUMBER() function for ordering and identifying most recent record
    • Output Columns:
      • last_updated_date: Directly mapped after casting
Column Lineage
%3 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp ad_group_id 38. model.amazon_ads_source.stg_amazon_ads__product_ad_history 38. model.amazon_ads_source.stg_amazon_ads__product_ad_history ad_group_id 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp:f0->38. model.amazon_ads_source.stg_amazon_ads__product_ad_history:f0
38. model.amazon_ads_source.stg_amazon_ads__product_ad_history
  • Input Column: 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp[ad_group_id]
    • Cleaning Cast to TEXT datatype
    • Output Columns:
      • ad_group_id: Directly mapped after casting
Column Lineage
%3 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp campaign_id 38. model.amazon_ads_source.stg_amazon_ads__product_ad_history 38. model.amazon_ads_source.stg_amazon_ads__product_ad_history campaign_id 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp:f0->38. model.amazon_ads_source.stg_amazon_ads__product_ad_history:f0
38. model.amazon_ads_source.stg_amazon_ads__product_ad_history
  • Input Column: 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp[campaign_id]
    • Cleaning Cast to TEXT datatype
    • Output Columns:
      • campaign_id: Directly mapped after casting
Column Lineage
%3 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp asin 38. model.amazon_ads_source.stg_amazon_ads__product_ad_history 38. model.amazon_ads_source.stg_amazon_ads__product_ad_history asin 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp:f0->38. model.amazon_ads_source.stg_amazon_ads__product_ad_history:f0
38. model.amazon_ads_source.stg_amazon_ads__product_ad_history
  • Input Column: 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp[asin]
    • Direct Copied without transformation
    • Output Columns:
      • asin: Directly mapped
Column Lineage
%3 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp creation_date 38. model.amazon_ads_source.stg_amazon_ads__product_ad_history 38. model.amazon_ads_source.stg_amazon_ads__product_ad_history creation_date 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp:f0->38. model.amazon_ads_source.stg_amazon_ads__product_ad_history:f0
38. model.amazon_ads_source.stg_amazon_ads__product_ad_history
  • Input Column: 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp[creation_date]
    • Cleaning Cast to TIMESTAMP datatype
    • Output Columns:
      • creation_date: Directly mapped after casting
Column Lineage
%3 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp sku 38. model.amazon_ads_source.stg_amazon_ads__product_ad_history 38. model.amazon_ads_source.stg_amazon_ads__product_ad_history sku 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp:f0->38. model.amazon_ads_source.stg_amazon_ads__product_ad_history:f0
38. model.amazon_ads_source.stg_amazon_ads__product_ad_history
  • Input Column: 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp[sku]
    • Direct Copied without transformation
    • Output Columns:
      • sku: Directly mapped
Column Lineage
%3 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp serving_status 38. model.amazon_ads_source.stg_amazon_ads__product_ad_history 38. model.amazon_ads_source.stg_amazon_ads__product_ad_history serving_status 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp:f0->38. model.amazon_ads_source.stg_amazon_ads__product_ad_history:f0 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report serving_status 38. model.amazon_ads_source.stg_amazon_ads__product_ad_history:f0->18. model.amazon_ads.amazon_ads__ad_report:f0
38. model.amazon_ads_source.stg_amazon_ads__product_ad_history
  • Input Column: 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp[serving_status]
    • Direct Copied without transformation
    • Output Columns:
      • serving_status: Directly mapped
18. model.amazon_ads.amazon_ads__ad_report
  • Input Column: 38. model.amazon_ads_source.stg_amazon_ads__product_ad_history[serving_status]
    • Direct directly copied to the output
    • Output Columns:
      • serving_status: directly copied
Column Lineage
%3 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp state 38. model.amazon_ads_source.stg_amazon_ads__product_ad_history 38. model.amazon_ads_source.stg_amazon_ads__product_ad_history state 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp:f0->38. model.amazon_ads_source.stg_amazon_ads__product_ad_history:f0 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report state 38. model.amazon_ads_source.stg_amazon_ads__product_ad_history:f0->18. model.amazon_ads.amazon_ads__ad_report:f0
38. model.amazon_ads_source.stg_amazon_ads__product_ad_history
  • Input Column: 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp[state]
    • Direct Copied without transformation
    • Output Columns:
      • state: Directly mapped
18. model.amazon_ads.amazon_ads__ad_report
  • Input Column: 38. model.amazon_ads_source.stg_amazon_ads__product_ad_history[state]
    • Direct directly copied to the output
    • Output Columns:
      • state: directly copied
39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of type TEXT. It's likely used as a placeholder or template for further operations in a dbt (data build tool) model.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp id last_updated_date _fivetran_synced ad_group_id asin campaign_id creation_date serving_status sku state 286. source.amazon_ads_source.amazon_ads.product_ad_history 286. source.amazon_ads_source.amazon_ads.product_ad_history
Name Type Comment
id integer None
last_updated_date text None
_fivetran_synced text None
ad_group_id integer None
asin text None
campaign_id integer None
creation_date text None
serving_status text None
sku integer None
state text None
Column Lineage
%3 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp id 38. model.amazon_ads_source.stg_amazon_ads__product_ad_history 38. model.amazon_ads_source.stg_amazon_ads__product_ad_history ad_id 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp:f0->38. model.amazon_ads_source.stg_amazon_ads__product_ad_history:f0 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report ad_id 38. model.amazon_ads_source.stg_amazon_ads__product_ad_history:f0->18. model.amazon_ads.amazon_ads__ad_report:f0
38. model.amazon_ads_source.stg_amazon_ads__product_ad_history
  • Input Column: 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp[id]
    • Cleaning Cast to TEXT datatype
    • Deduplication Used in ROW_NUMBER() function for identifying most recent record
    • Output Columns:
      • ad_id: Directly mapped after casting
18. model.amazon_ads.amazon_ads__ad_report
  • Input Column: 38. model.amazon_ads_source.stg_amazon_ads__product_ad_history[ad_id]
    • Integration used to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • ad_id: directly copied
Column Lineage
%3 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp last_updated_date 38. model.amazon_ads_source.stg_amazon_ads__product_ad_history 38. model.amazon_ads_source.stg_amazon_ads__product_ad_history last_updated_date 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp:f0->38. model.amazon_ads_source.stg_amazon_ads__product_ad_history:f0
38. model.amazon_ads_source.stg_amazon_ads__product_ad_history
  • Input Column: 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp[last_updated_date]
    • Cleaning Cast to TIMESTAMP datatype
    • Deduplication Used in ROW_NUMBER() function for ordering and identifying most recent record
    • Output Columns:
      • last_updated_date: Directly mapped after casting
Column Lineage
%3 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp ad_group_id 38. model.amazon_ads_source.stg_amazon_ads__product_ad_history 38. model.amazon_ads_source.stg_amazon_ads__product_ad_history ad_group_id 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp:f0->38. model.amazon_ads_source.stg_amazon_ads__product_ad_history:f0
38. model.amazon_ads_source.stg_amazon_ads__product_ad_history
  • Input Column: 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp[ad_group_id]
    • Cleaning Cast to TEXT datatype
    • Output Columns:
      • ad_group_id: Directly mapped after casting
Column Lineage
%3 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp asin 38. model.amazon_ads_source.stg_amazon_ads__product_ad_history 38. model.amazon_ads_source.stg_amazon_ads__product_ad_history asin 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp:f0->38. model.amazon_ads_source.stg_amazon_ads__product_ad_history:f0
38. model.amazon_ads_source.stg_amazon_ads__product_ad_history
  • Input Column: 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp[asin]
    • Direct Copied without transformation
    • Output Columns:
      • asin: Directly mapped
Column Lineage
%3 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp campaign_id 38. model.amazon_ads_source.stg_amazon_ads__product_ad_history 38. model.amazon_ads_source.stg_amazon_ads__product_ad_history campaign_id 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp:f0->38. model.amazon_ads_source.stg_amazon_ads__product_ad_history:f0
38. model.amazon_ads_source.stg_amazon_ads__product_ad_history
  • Input Column: 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp[campaign_id]
    • Cleaning Cast to TEXT datatype
    • Output Columns:
      • campaign_id: Directly mapped after casting
Column Lineage
%3 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp creation_date 38. model.amazon_ads_source.stg_amazon_ads__product_ad_history 38. model.amazon_ads_source.stg_amazon_ads__product_ad_history creation_date 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp:f0->38. model.amazon_ads_source.stg_amazon_ads__product_ad_history:f0
38. model.amazon_ads_source.stg_amazon_ads__product_ad_history
  • Input Column: 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp[creation_date]
    • Cleaning Cast to TIMESTAMP datatype
    • Output Columns:
      • creation_date: Directly mapped after casting
Column Lineage
%3 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp serving_status 38. model.amazon_ads_source.stg_amazon_ads__product_ad_history 38. model.amazon_ads_source.stg_amazon_ads__product_ad_history serving_status 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp:f0->38. model.amazon_ads_source.stg_amazon_ads__product_ad_history:f0 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report serving_status 38. model.amazon_ads_source.stg_amazon_ads__product_ad_history:f0->18. model.amazon_ads.amazon_ads__ad_report:f0
38. model.amazon_ads_source.stg_amazon_ads__product_ad_history
  • Input Column: 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp[serving_status]
    • Direct Copied without transformation
    • Output Columns:
      • serving_status: Directly mapped
18. model.amazon_ads.amazon_ads__ad_report
  • Input Column: 38. model.amazon_ads_source.stg_amazon_ads__product_ad_history[serving_status]
    • Direct directly copied to the output
    • Output Columns:
      • serving_status: directly copied
Column Lineage
%3 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp sku 38. model.amazon_ads_source.stg_amazon_ads__product_ad_history 38. model.amazon_ads_source.stg_amazon_ads__product_ad_history sku 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp:f0->38. model.amazon_ads_source.stg_amazon_ads__product_ad_history:f0
38. model.amazon_ads_source.stg_amazon_ads__product_ad_history
  • Input Column: 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp[sku]
    • Direct Copied without transformation
    • Output Columns:
      • sku: Directly mapped
Column Lineage
%3 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp state 38. model.amazon_ads_source.stg_amazon_ads__product_ad_history 38. model.amazon_ads_source.stg_amazon_ads__product_ad_history state 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp:f0->38. model.amazon_ads_source.stg_amazon_ads__product_ad_history:f0 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report state 38. model.amazon_ads_source.stg_amazon_ads__product_ad_history:f0->18. model.amazon_ads.amazon_ads__ad_report:f0
38. model.amazon_ads_source.stg_amazon_ads__product_ad_history
  • Input Column: 39. model.amazon_ads_source.stg_amazon_ads__product_ad_history_tmp[state]
    • Direct Copied without transformation
    • Output Columns:
      • state: Directly mapped
18. model.amazon_ads.amazon_ads__ad_report
  • Input Column: 38. model.amazon_ads_source.stg_amazon_ads__product_ad_history[state]
    • Direct directly copied to the output
    • Output Columns:
      • state: directly copied
40. model.amazon_ads_source.stg_amazon_ads__profile

This SQL query stages data from a temporary table for Amazon Ads profiles. It defines a set of fields with specific data types, casts some fields, and renames the 'id' field to 'profile_id'. The query also adds a 'source_relation' field and ensures all fields are properly typed for downstream use.

CleaningOther
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_amazon_ads_source.stg_amazon_ads__profile_tmp
), fields AS (
  SELECT
    CAST(NULL AS INT) AS id,
    CAST(NULL AS TEXT) AS account_id,
    CAST(NULL AS TEXT) AS account_marketplace_string_id,
    CAST(NULL AS TEXT) AS account_name,
    CAST(NULL AS TEXT) AS account_sub_type,
    CAST(NULL AS TEXT) AS account_type,
    CAST(NULL AS BOOLEAN) AS account_valid_payment_method,
    CAST(NULL AS TEXT) AS country_code,
    CAST(NULL AS TEXT) AS currency_code,
    CAST(NULL AS INT) AS daily_budget,
    CAST(NULL AS TEXT) AS timezone,
    CAST(NULL AS BOOLEAN) AS _fivetran_deleted,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    CAST(id AS TEXT) AS profile_id,
    CAST(account_id AS TEXT) AS account_id,
    account_marketplace_string_id,
    account_name,
    account_sub_type,
    account_type,
    account_valid_payment_method,
    country_code,
    currency_code,
    daily_budget,
    timezone,
    _fivetran_deleted
  FROM fields
)
SELECT
  *
FROM final
%3 40. model.amazon_ads_source.stg_amazon_ads__profile 40. model.amazon_ads_source.stg_amazon_ads__profile source_relation _fivetran_deleted profile_id account_id account_marketplace_string_id account_name account_sub_type account_type account_valid_payment_method country_code currency_code daily_budget timezone 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp id _fivetran_deleted account_id account_marketplace_string_id account_name account_sub_type account_type account_valid_payment_method country_code currency_code daily_budget timezone 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp:f0->40. model.amazon_ads_source.stg_amazon_ads__profile:f2 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp:f1->40. model.amazon_ads_source.stg_amazon_ads__profile:f1 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp:f2->40. model.amazon_ads_source.stg_amazon_ads__profile:f3 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp:f3->40. model.amazon_ads_source.stg_amazon_ads__profile:f4 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp:f4->40. model.amazon_ads_source.stg_amazon_ads__profile:f5 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp:f5->40. model.amazon_ads_source.stg_amazon_ads__profile:f6 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp:f6->40. model.amazon_ads_source.stg_amazon_ads__profile:f7 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp:f7->40. model.amazon_ads_source.stg_amazon_ads__profile:f8 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp:f8->40. model.amazon_ads_source.stg_amazon_ads__profile:f9 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp:f9->40. model.amazon_ads_source.stg_amazon_ads__profile:f10 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp:f10->40. model.amazon_ads_source.stg_amazon_ads__profile:f11 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp:f11->40. model.amazon_ads_source.stg_amazon_ads__profile:f12
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
_fivetran_deleted boolean Boolean created by Fivetran to indicate whether the record has been deleted.
profile_id text The profile ID associated with your Amazon Ads account. Advertisers who operate in more than one marketplace (for example, Amazon.com, Amazon.co.uk, Amazon.co.jp) will have one profile associated with each marketplace.
account_id text The ID representing the account.
account_marketplace_string_id text The identifier of the marketplace to which the account is associated.
account_name text The name of the account, if present in the source data.
account_sub_type integer The account subtype.
account_type text One of seller, vendor, or agency.
account_valid_payment_method boolean For Vendors, this returns if the Advertiser has set up a valid payment method.
country_code text The code for a given country.
currency_code text The currency used for all monetary values for entities under this profile.
daily_budget integer Daily budget for Sponsored Product campaigns for seller type accounts.
timezone text The time zone used for all date-based campaign management and reporting.
Column Lineage
%3 40. model.amazon_ads_source.stg_amazon_ads__profile 40. model.amazon_ads_source.stg_amazon_ads__profile source_relation 21. model.amazon_ads.amazon_ads__portfolio_report 21. model.amazon_ads.amazon_ads__portfolio_report source_relation 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->21. model.amazon_ads.amazon_ads__portfolio_report:f0 16. model.amazon_ads.amazon_ads__account_report 16. model.amazon_ads.amazon_ads__account_report source_relation 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->16. model.amazon_ads.amazon_ads__account_report:f0 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report source_relation 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->22. model.amazon_ads.amazon_ads__search_report:f0 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report source_relation 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0 17. model.amazon_ads.amazon_ads__ad_group_report 17. model.amazon_ads.amazon_ads__ad_group_report source_relation 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->17. model.amazon_ads.amazon_ads__ad_group_report:f0 19. model.amazon_ads.amazon_ads__campaign_report 19. model.amazon_ads.amazon_ads__campaign_report source_relation 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->19. model.amazon_ads.amazon_ads__campaign_report:f0 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report source_relation 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->18. model.amazon_ads.amazon_ads__ad_report:f0
16. model.amazon_ads.amazon_ads__account_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[source_relation]
    • Integration used as part of the join condition with campaigns table
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
17. model.amazon_ads.amazon_ads__ad_group_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[source_relation]
    • Integration used to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
18. model.amazon_ads.amazon_ads__ad_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[source_relation]
    • Integration Used to join with other tables
    • Output Columns:
      • source_relation: Directly copied
19. model.amazon_ads.amazon_ads__campaign_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[source_relation]
    • Integration used as part of the join condition with other tables
    • Output Columns:
      • source_relation: directly copied
20. model.amazon_ads.amazon_ads__keyword_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[source_relation]
    • Integration used as part of the join condition with other tables
    • Output Columns:
      • source_relation: directly copied to output
21. model.amazon_ads.amazon_ads__portfolio_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[source_relation]
    • Integration Used as part of the join condition with other tables
    • Direct Directly copied to the output
    • Output Columns:
      • source_relation: Directly copied
22. model.amazon_ads.amazon_ads__search_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[source_relation]
    • Integration used to join with other tables
    • Output Columns:
      • source_relation: directly copied
Column Lineage
%3 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp _fivetran_deleted 40. model.amazon_ads_source.stg_amazon_ads__profile 40. model.amazon_ads_source.stg_amazon_ads__profile _fivetran_deleted 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp:f0->40. model.amazon_ads_source.stg_amazon_ads__profile:f0
40. model.amazon_ads_source.stg_amazon_ads__profile
  • Input Column: 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp[_fivetran_deleted]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • _fivetran_deleted: It is directly mapped
Column Lineage
%3 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp id 40. model.amazon_ads_source.stg_amazon_ads__profile 40. model.amazon_ads_source.stg_amazon_ads__profile profile_id 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp:f0->40. model.amazon_ads_source.stg_amazon_ads__profile:f0 21. model.amazon_ads.amazon_ads__portfolio_report 21. model.amazon_ads.amazon_ads__portfolio_report profile_id 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->21. model.amazon_ads.amazon_ads__portfolio_report:f0 16. model.amazon_ads.amazon_ads__account_report 16. model.amazon_ads.amazon_ads__account_report profile_id 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->16. model.amazon_ads.amazon_ads__account_report:f0 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report profile_id 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->22. model.amazon_ads.amazon_ads__search_report:f0 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report profile_id 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0 17. model.amazon_ads.amazon_ads__ad_group_report 17. model.amazon_ads.amazon_ads__ad_group_report profile_id 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->17. model.amazon_ads.amazon_ads__ad_group_report:f0 19. model.amazon_ads.amazon_ads__campaign_report 19. model.amazon_ads.amazon_ads__campaign_report profile_id 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->19. model.amazon_ads.amazon_ads__campaign_report:f0 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report profile_id 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->18. model.amazon_ads.amazon_ads__ad_report:f0
40. model.amazon_ads_source.stg_amazon_ads__profile
  • Input Column: 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp[id]
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • profile_id: It is directly mapped after casting to TEXT
16. model.amazon_ads.amazon_ads__account_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[profile_id]
    • Integration used as part of the join condition with campaigns table
    • Direct directly copied to the output
    • Output Columns:
      • profile_id: directly copied
17. model.amazon_ads.amazon_ads__ad_group_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[profile_id]
    • Integration used to join with campaigns table
    • Direct directly copied to the output
    • Output Columns:
      • profile_id: directly copied
18. model.amazon_ads.amazon_ads__ad_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[profile_id]
    • Integration Used to join with campaigns table
    • Direct Copied to output
    • Output Columns:
      • profile_id: Directly copied
19. model.amazon_ads.amazon_ads__campaign_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[profile_id]
    • Integration used as the key to join with other tables
    • Direct directly included in the output
    • Output Columns:
      • profile_id: directly copied
20. model.amazon_ads.amazon_ads__keyword_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[profile_id]
    • Integration used as part of the join condition with campaigns table
    • Direct copied to output
    • Output Columns:
      • profile_id: directly copied to output
21. model.amazon_ads.amazon_ads__portfolio_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[profile_id]
    • Integration Used as join key with other tables
    • Direct Directly copied to the output
    • Output Columns:
      • profile_id: Directly copied
22. model.amazon_ads.amazon_ads__search_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[profile_id]
    • Integration used to join with campaigns table
    • Direct directly selected in the output
    • Output Columns:
      • profile_id: directly copied
Column Lineage
%3 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp account_id 40. model.amazon_ads_source.stg_amazon_ads__profile 40. model.amazon_ads_source.stg_amazon_ads__profile account_id 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp:f0->40. model.amazon_ads_source.stg_amazon_ads__profile:f0 21. model.amazon_ads.amazon_ads__portfolio_report 21. model.amazon_ads.amazon_ads__portfolio_report account_id 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->21. model.amazon_ads.amazon_ads__portfolio_report:f0 16. model.amazon_ads.amazon_ads__account_report 16. model.amazon_ads.amazon_ads__account_report account_id 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->16. model.amazon_ads.amazon_ads__account_report:f0 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report account_id 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->22. model.amazon_ads.amazon_ads__search_report:f0 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report account_id 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0 17. model.amazon_ads.amazon_ads__ad_group_report 17. model.amazon_ads.amazon_ads__ad_group_report account_id 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->17. model.amazon_ads.amazon_ads__ad_group_report:f0 19. model.amazon_ads.amazon_ads__campaign_report 19. model.amazon_ads.amazon_ads__campaign_report account_id 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->19. model.amazon_ads.amazon_ads__campaign_report:f0 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report account_id 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->18. model.amazon_ads.amazon_ads__ad_report:f0
40. model.amazon_ads_source.stg_amazon_ads__profile
  • Input Column: 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp[account_id]
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • account_id: It is directly mapped after casting to TEXT
16. model.amazon_ads.amazon_ads__account_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[account_id]
    • Direct directly copied to the output
    • Output Columns:
      • account_id: directly copied
17. model.amazon_ads.amazon_ads__ad_group_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[account_id]
    • Direct directly copied to the output
    • Output Columns:
      • account_id: directly copied
18. model.amazon_ads.amazon_ads__ad_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[account_id]
    • Direct Copied to output
    • Output Columns:
      • account_id: Directly copied
19. model.amazon_ads.amazon_ads__campaign_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[account_id]
    • Direct directly included in the output
    • Output Columns:
      • account_id: directly copied
20. model.amazon_ads.amazon_ads__keyword_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[account_id]
    • Direct copied to output
    • Output Columns:
      • account_id: directly copied to output
21. model.amazon_ads.amazon_ads__portfolio_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[account_id]
    • Direct Directly copied to the output
    • Output Columns:
      • account_id: Directly copied
22. model.amazon_ads.amazon_ads__search_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[account_id]
    • Direct directly selected in the output
    • Output Columns:
      • account_id: directly copied
Column Lineage
%3 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp account_marketplace_string_id 40. model.amazon_ads_source.stg_amazon_ads__profile 40. model.amazon_ads_source.stg_amazon_ads__profile account_marketplace_string_id 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp:f0->40. model.amazon_ads_source.stg_amazon_ads__profile:f0
40. model.amazon_ads_source.stg_amazon_ads__profile
  • Input Column: 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp[account_marketplace_string_id]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • account_marketplace_string_id: It is directly mapped
Column Lineage
%3 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp account_name 40. model.amazon_ads_source.stg_amazon_ads__profile 40. model.amazon_ads_source.stg_amazon_ads__profile account_name 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp:f0->40. model.amazon_ads_source.stg_amazon_ads__profile:f0 21. model.amazon_ads.amazon_ads__portfolio_report 21. model.amazon_ads.amazon_ads__portfolio_report account_name 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->21. model.amazon_ads.amazon_ads__portfolio_report:f0 16. model.amazon_ads.amazon_ads__account_report 16. model.amazon_ads.amazon_ads__account_report account_name 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->16. model.amazon_ads.amazon_ads__account_report:f0 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report account_name 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->22. model.amazon_ads.amazon_ads__search_report:f0 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report account_name 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0 17. model.amazon_ads.amazon_ads__ad_group_report 17. model.amazon_ads.amazon_ads__ad_group_report account_name 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->17. model.amazon_ads.amazon_ads__ad_group_report:f0 19. model.amazon_ads.amazon_ads__campaign_report 19. model.amazon_ads.amazon_ads__campaign_report account_name 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->19. model.amazon_ads.amazon_ads__campaign_report:f0 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report account_name 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->18. model.amazon_ads.amazon_ads__ad_report:f0
40. model.amazon_ads_source.stg_amazon_ads__profile
  • Input Column: 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp[account_name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • account_name: It is directly mapped
16. model.amazon_ads.amazon_ads__account_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[account_name]
    • Direct directly copied to the output
    • Output Columns:
      • account_name: directly copied
17. model.amazon_ads.amazon_ads__ad_group_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[account_name]
    • Direct directly copied to the output
    • Output Columns:
      • account_name: directly copied
18. model.amazon_ads.amazon_ads__ad_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[account_name]
    • Direct Copied to output
    • Output Columns:
      • account_name: Directly copied
19. model.amazon_ads.amazon_ads__campaign_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[account_name]
    • Direct directly included in the output
    • Output Columns:
      • account_name: directly copied
20. model.amazon_ads.amazon_ads__keyword_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[account_name]
    • Direct copied to output
    • Output Columns:
      • account_name: directly copied to output
21. model.amazon_ads.amazon_ads__portfolio_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[account_name]
    • Direct Directly copied to the output
    • Output Columns:
      • account_name: Directly copied
22. model.amazon_ads.amazon_ads__search_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[account_name]
    • Direct directly selected in the output
    • Output Columns:
      • account_name: directly copied
Column Lineage
%3 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp account_sub_type 40. model.amazon_ads_source.stg_amazon_ads__profile 40. model.amazon_ads_source.stg_amazon_ads__profile account_sub_type 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp:f0->40. model.amazon_ads_source.stg_amazon_ads__profile:f0
40. model.amazon_ads_source.stg_amazon_ads__profile
  • Input Column: 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp[account_sub_type]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • account_sub_type: It is directly mapped
Column Lineage
%3 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp account_type 40. model.amazon_ads_source.stg_amazon_ads__profile 40. model.amazon_ads_source.stg_amazon_ads__profile account_type 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp:f0->40. model.amazon_ads_source.stg_amazon_ads__profile:f0
40. model.amazon_ads_source.stg_amazon_ads__profile
  • Input Column: 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp[account_type]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • account_type: It is directly mapped
Column Lineage
%3 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp account_valid_payment_method 40. model.amazon_ads_source.stg_amazon_ads__profile 40. model.amazon_ads_source.stg_amazon_ads__profile account_valid_payment_method 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp:f0->40. model.amazon_ads_source.stg_amazon_ads__profile:f0
40. model.amazon_ads_source.stg_amazon_ads__profile
  • Input Column: 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp[account_valid_payment_method]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • account_valid_payment_method: It is directly mapped
Column Lineage
%3 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp country_code 40. model.amazon_ads_source.stg_amazon_ads__profile 40. model.amazon_ads_source.stg_amazon_ads__profile country_code 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp:f0->40. model.amazon_ads_source.stg_amazon_ads__profile:f0 21. model.amazon_ads.amazon_ads__portfolio_report 21. model.amazon_ads.amazon_ads__portfolio_report country_code 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->21. model.amazon_ads.amazon_ads__portfolio_report:f0 16. model.amazon_ads.amazon_ads__account_report 16. model.amazon_ads.amazon_ads__account_report country_code 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->16. model.amazon_ads.amazon_ads__account_report:f0 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report country_code 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->22. model.amazon_ads.amazon_ads__search_report:f0 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report country_code 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0 17. model.amazon_ads.amazon_ads__ad_group_report 17. model.amazon_ads.amazon_ads__ad_group_report country_code 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->17. model.amazon_ads.amazon_ads__ad_group_report:f0 19. model.amazon_ads.amazon_ads__campaign_report 19. model.amazon_ads.amazon_ads__campaign_report country_code 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->19. model.amazon_ads.amazon_ads__campaign_report:f0 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report country_code 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->18. model.amazon_ads.amazon_ads__ad_report:f0
40. model.amazon_ads_source.stg_amazon_ads__profile
  • Input Column: 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp[country_code]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • country_code: It is directly mapped
16. model.amazon_ads.amazon_ads__account_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[country_code]
    • Direct directly copied to the output
    • Output Columns:
      • country_code: directly copied
17. model.amazon_ads.amazon_ads__ad_group_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[country_code]
    • Direct directly copied to the output
    • Output Columns:
      • country_code: directly copied
18. model.amazon_ads.amazon_ads__ad_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[country_code]
    • Direct Copied to output
    • Output Columns:
      • country_code: Directly copied
19. model.amazon_ads.amazon_ads__campaign_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[country_code]
    • Direct directly included in the output
    • Output Columns:
      • country_code: directly copied
20. model.amazon_ads.amazon_ads__keyword_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[country_code]
    • Direct copied to output
    • Output Columns:
      • country_code: directly copied to output
21. model.amazon_ads.amazon_ads__portfolio_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[country_code]
    • Direct Directly copied to the output
    • Output Columns:
      • country_code: Directly copied
22. model.amazon_ads.amazon_ads__search_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[country_code]
    • Direct directly selected in the output
    • Output Columns:
      • country_code: directly copied
Column Lineage
%3 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp currency_code 40. model.amazon_ads_source.stg_amazon_ads__profile 40. model.amazon_ads_source.stg_amazon_ads__profile currency_code 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp:f0->40. model.amazon_ads_source.stg_amazon_ads__profile:f0 21. model.amazon_ads.amazon_ads__portfolio_report 21. model.amazon_ads.amazon_ads__portfolio_report budget_currency_code 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->21. model.amazon_ads.amazon_ads__portfolio_report:f0
40. model.amazon_ads_source.stg_amazon_ads__profile
  • Input Column: 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp[currency_code]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • currency_code: Directly mapped after casting to TEXT
21. model.amazon_ads.amazon_ads__portfolio_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[currency_code]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the profile information when joining with other tables
    • Output Columns:
      • budget_currency_code: It is directly copied to this output column
Column Lineage
%3 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp daily_budget 40. model.amazon_ads_source.stg_amazon_ads__profile 40. model.amazon_ads_source.stg_amazon_ads__profile daily_budget 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp:f0->40. model.amazon_ads_source.stg_amazon_ads__profile:f0
40. model.amazon_ads_source.stg_amazon_ads__profile
  • Input Column: 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp[daily_budget]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT type
    • Output Columns:
      • daily_budget: Directly mapped after casting to INT
Column Lineage
%3 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp timezone 40. model.amazon_ads_source.stg_amazon_ads__profile 40. model.amazon_ads_source.stg_amazon_ads__profile timezone 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp:f0->40. model.amazon_ads_source.stg_amazon_ads__profile:f0
40. model.amazon_ads_source.stg_amazon_ads__profile
  • Input Column: 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp[timezone]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • timezone: Directly mapped after casting to TEXT
41. model.amazon_ads_source.stg_amazon_ads__profile_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of type TEXT. It's likely used as a placeholder or template for further development or to establish a schema structure without actually populating data.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp id _fivetran_deleted _fivetran_synced account_id account_marketplace_string_id account_name account_sub_type account_type account_valid_payment_method country_code currency_code daily_budget timezone 287. source.amazon_ads_source.amazon_ads.profile 287. source.amazon_ads_source.amazon_ads.profile
Name Type Comment
id integer None
_fivetran_deleted boolean None
_fivetran_synced text None
account_id text None
account_marketplace_string_id text None
account_name text None
account_sub_type integer None
account_type text None
account_valid_payment_method boolean None
country_code text None
currency_code text None
daily_budget integer None
timezone text None
Column Lineage
%3 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp id 40. model.amazon_ads_source.stg_amazon_ads__profile 40. model.amazon_ads_source.stg_amazon_ads__profile profile_id 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp:f0->40. model.amazon_ads_source.stg_amazon_ads__profile:f0 21. model.amazon_ads.amazon_ads__portfolio_report 21. model.amazon_ads.amazon_ads__portfolio_report profile_id 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->21. model.amazon_ads.amazon_ads__portfolio_report:f0 16. model.amazon_ads.amazon_ads__account_report 16. model.amazon_ads.amazon_ads__account_report profile_id 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->16. model.amazon_ads.amazon_ads__account_report:f0 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report profile_id 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->22. model.amazon_ads.amazon_ads__search_report:f0 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report profile_id 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0 17. model.amazon_ads.amazon_ads__ad_group_report 17. model.amazon_ads.amazon_ads__ad_group_report profile_id 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->17. model.amazon_ads.amazon_ads__ad_group_report:f0 19. model.amazon_ads.amazon_ads__campaign_report 19. model.amazon_ads.amazon_ads__campaign_report profile_id 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->19. model.amazon_ads.amazon_ads__campaign_report:f0 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report profile_id 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->18. model.amazon_ads.amazon_ads__ad_report:f0
40. model.amazon_ads_source.stg_amazon_ads__profile
  • Input Column: 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp[id]
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • profile_id: It is directly mapped after casting to TEXT
16. model.amazon_ads.amazon_ads__account_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[profile_id]
    • Integration used as part of the join condition with campaigns table
    • Direct directly copied to the output
    • Output Columns:
      • profile_id: directly copied
17. model.amazon_ads.amazon_ads__ad_group_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[profile_id]
    • Integration used to join with campaigns table
    • Direct directly copied to the output
    • Output Columns:
      • profile_id: directly copied
18. model.amazon_ads.amazon_ads__ad_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[profile_id]
    • Integration Used to join with campaigns table
    • Direct Copied to output
    • Output Columns:
      • profile_id: Directly copied
19. model.amazon_ads.amazon_ads__campaign_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[profile_id]
    • Integration used as the key to join with other tables
    • Direct directly included in the output
    • Output Columns:
      • profile_id: directly copied
20. model.amazon_ads.amazon_ads__keyword_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[profile_id]
    • Integration used as part of the join condition with campaigns table
    • Direct copied to output
    • Output Columns:
      • profile_id: directly copied to output
21. model.amazon_ads.amazon_ads__portfolio_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[profile_id]
    • Integration Used as join key with other tables
    • Direct Directly copied to the output
    • Output Columns:
      • profile_id: Directly copied
22. model.amazon_ads.amazon_ads__search_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[profile_id]
    • Integration used to join with campaigns table
    • Direct directly selected in the output
    • Output Columns:
      • profile_id: directly copied
Column Lineage
%3 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp _fivetran_deleted 40. model.amazon_ads_source.stg_amazon_ads__profile 40. model.amazon_ads_source.stg_amazon_ads__profile _fivetran_deleted 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp:f0->40. model.amazon_ads_source.stg_amazon_ads__profile:f0
40. model.amazon_ads_source.stg_amazon_ads__profile
  • Input Column: 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp[_fivetran_deleted]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • _fivetran_deleted: It is directly mapped
Column Lineage
%3 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp account_id 40. model.amazon_ads_source.stg_amazon_ads__profile 40. model.amazon_ads_source.stg_amazon_ads__profile account_id 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp:f0->40. model.amazon_ads_source.stg_amazon_ads__profile:f0 21. model.amazon_ads.amazon_ads__portfolio_report 21. model.amazon_ads.amazon_ads__portfolio_report account_id 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->21. model.amazon_ads.amazon_ads__portfolio_report:f0 16. model.amazon_ads.amazon_ads__account_report 16. model.amazon_ads.amazon_ads__account_report account_id 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->16. model.amazon_ads.amazon_ads__account_report:f0 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report account_id 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->22. model.amazon_ads.amazon_ads__search_report:f0 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report account_id 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0 17. model.amazon_ads.amazon_ads__ad_group_report 17. model.amazon_ads.amazon_ads__ad_group_report account_id 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->17. model.amazon_ads.amazon_ads__ad_group_report:f0 19. model.amazon_ads.amazon_ads__campaign_report 19. model.amazon_ads.amazon_ads__campaign_report account_id 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->19. model.amazon_ads.amazon_ads__campaign_report:f0 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report account_id 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->18. model.amazon_ads.amazon_ads__ad_report:f0
40. model.amazon_ads_source.stg_amazon_ads__profile
  • Input Column: 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp[account_id]
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • account_id: It is directly mapped after casting to TEXT
16. model.amazon_ads.amazon_ads__account_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[account_id]
    • Direct directly copied to the output
    • Output Columns:
      • account_id: directly copied
17. model.amazon_ads.amazon_ads__ad_group_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[account_id]
    • Direct directly copied to the output
    • Output Columns:
      • account_id: directly copied
18. model.amazon_ads.amazon_ads__ad_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[account_id]
    • Direct Copied to output
    • Output Columns:
      • account_id: Directly copied
19. model.amazon_ads.amazon_ads__campaign_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[account_id]
    • Direct directly included in the output
    • Output Columns:
      • account_id: directly copied
20. model.amazon_ads.amazon_ads__keyword_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[account_id]
    • Direct copied to output
    • Output Columns:
      • account_id: directly copied to output
21. model.amazon_ads.amazon_ads__portfolio_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[account_id]
    • Direct Directly copied to the output
    • Output Columns:
      • account_id: Directly copied
22. model.amazon_ads.amazon_ads__search_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[account_id]
    • Direct directly selected in the output
    • Output Columns:
      • account_id: directly copied
Column Lineage
%3 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp account_marketplace_string_id 40. model.amazon_ads_source.stg_amazon_ads__profile 40. model.amazon_ads_source.stg_amazon_ads__profile account_marketplace_string_id 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp:f0->40. model.amazon_ads_source.stg_amazon_ads__profile:f0
40. model.amazon_ads_source.stg_amazon_ads__profile
  • Input Column: 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp[account_marketplace_string_id]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • account_marketplace_string_id: It is directly mapped
Column Lineage
%3 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp account_name 40. model.amazon_ads_source.stg_amazon_ads__profile 40. model.amazon_ads_source.stg_amazon_ads__profile account_name 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp:f0->40. model.amazon_ads_source.stg_amazon_ads__profile:f0 21. model.amazon_ads.amazon_ads__portfolio_report 21. model.amazon_ads.amazon_ads__portfolio_report account_name 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->21. model.amazon_ads.amazon_ads__portfolio_report:f0 16. model.amazon_ads.amazon_ads__account_report 16. model.amazon_ads.amazon_ads__account_report account_name 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->16. model.amazon_ads.amazon_ads__account_report:f0 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report account_name 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->22. model.amazon_ads.amazon_ads__search_report:f0 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report account_name 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0 17. model.amazon_ads.amazon_ads__ad_group_report 17. model.amazon_ads.amazon_ads__ad_group_report account_name 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->17. model.amazon_ads.amazon_ads__ad_group_report:f0 19. model.amazon_ads.amazon_ads__campaign_report 19. model.amazon_ads.amazon_ads__campaign_report account_name 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->19. model.amazon_ads.amazon_ads__campaign_report:f0 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report account_name 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->18. model.amazon_ads.amazon_ads__ad_report:f0
40. model.amazon_ads_source.stg_amazon_ads__profile
  • Input Column: 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp[account_name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • account_name: It is directly mapped
16. model.amazon_ads.amazon_ads__account_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[account_name]
    • Direct directly copied to the output
    • Output Columns:
      • account_name: directly copied
17. model.amazon_ads.amazon_ads__ad_group_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[account_name]
    • Direct directly copied to the output
    • Output Columns:
      • account_name: directly copied
18. model.amazon_ads.amazon_ads__ad_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[account_name]
    • Direct Copied to output
    • Output Columns:
      • account_name: Directly copied
19. model.amazon_ads.amazon_ads__campaign_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[account_name]
    • Direct directly included in the output
    • Output Columns:
      • account_name: directly copied
20. model.amazon_ads.amazon_ads__keyword_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[account_name]
    • Direct copied to output
    • Output Columns:
      • account_name: directly copied to output
21. model.amazon_ads.amazon_ads__portfolio_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[account_name]
    • Direct Directly copied to the output
    • Output Columns:
      • account_name: Directly copied
22. model.amazon_ads.amazon_ads__search_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[account_name]
    • Direct directly selected in the output
    • Output Columns:
      • account_name: directly copied
Column Lineage
%3 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp account_sub_type 40. model.amazon_ads_source.stg_amazon_ads__profile 40. model.amazon_ads_source.stg_amazon_ads__profile account_sub_type 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp:f0->40. model.amazon_ads_source.stg_amazon_ads__profile:f0
40. model.amazon_ads_source.stg_amazon_ads__profile
  • Input Column: 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp[account_sub_type]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • account_sub_type: It is directly mapped
Column Lineage
%3 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp account_type 40. model.amazon_ads_source.stg_amazon_ads__profile 40. model.amazon_ads_source.stg_amazon_ads__profile account_type 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp:f0->40. model.amazon_ads_source.stg_amazon_ads__profile:f0
40. model.amazon_ads_source.stg_amazon_ads__profile
  • Input Column: 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp[account_type]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • account_type: It is directly mapped
Column Lineage
%3 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp account_valid_payment_method 40. model.amazon_ads_source.stg_amazon_ads__profile 40. model.amazon_ads_source.stg_amazon_ads__profile account_valid_payment_method 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp:f0->40. model.amazon_ads_source.stg_amazon_ads__profile:f0
40. model.amazon_ads_source.stg_amazon_ads__profile
  • Input Column: 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp[account_valid_payment_method]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • account_valid_payment_method: It is directly mapped
Column Lineage
%3 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp country_code 40. model.amazon_ads_source.stg_amazon_ads__profile 40. model.amazon_ads_source.stg_amazon_ads__profile country_code 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp:f0->40. model.amazon_ads_source.stg_amazon_ads__profile:f0 21. model.amazon_ads.amazon_ads__portfolio_report 21. model.amazon_ads.amazon_ads__portfolio_report country_code 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->21. model.amazon_ads.amazon_ads__portfolio_report:f0 16. model.amazon_ads.amazon_ads__account_report 16. model.amazon_ads.amazon_ads__account_report country_code 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->16. model.amazon_ads.amazon_ads__account_report:f0 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report country_code 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->22. model.amazon_ads.amazon_ads__search_report:f0 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report country_code 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0 17. model.amazon_ads.amazon_ads__ad_group_report 17. model.amazon_ads.amazon_ads__ad_group_report country_code 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->17. model.amazon_ads.amazon_ads__ad_group_report:f0 19. model.amazon_ads.amazon_ads__campaign_report 19. model.amazon_ads.amazon_ads__campaign_report country_code 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->19. model.amazon_ads.amazon_ads__campaign_report:f0 18. model.amazon_ads.amazon_ads__ad_report 18. model.amazon_ads.amazon_ads__ad_report country_code 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->18. model.amazon_ads.amazon_ads__ad_report:f0
40. model.amazon_ads_source.stg_amazon_ads__profile
  • Input Column: 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp[country_code]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • country_code: It is directly mapped
16. model.amazon_ads.amazon_ads__account_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[country_code]
    • Direct directly copied to the output
    • Output Columns:
      • country_code: directly copied
17. model.amazon_ads.amazon_ads__ad_group_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[country_code]
    • Direct directly copied to the output
    • Output Columns:
      • country_code: directly copied
18. model.amazon_ads.amazon_ads__ad_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[country_code]
    • Direct Copied to output
    • Output Columns:
      • country_code: Directly copied
19. model.amazon_ads.amazon_ads__campaign_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[country_code]
    • Direct directly included in the output
    • Output Columns:
      • country_code: directly copied
20. model.amazon_ads.amazon_ads__keyword_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[country_code]
    • Direct copied to output
    • Output Columns:
      • country_code: directly copied to output
21. model.amazon_ads.amazon_ads__portfolio_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[country_code]
    • Direct Directly copied to the output
    • Output Columns:
      • country_code: Directly copied
22. model.amazon_ads.amazon_ads__search_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[country_code]
    • Direct directly selected in the output
    • Output Columns:
      • country_code: directly copied
Column Lineage
%3 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp currency_code 40. model.amazon_ads_source.stg_amazon_ads__profile 40. model.amazon_ads_source.stg_amazon_ads__profile currency_code 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp:f0->40. model.amazon_ads_source.stg_amazon_ads__profile:f0 21. model.amazon_ads.amazon_ads__portfolio_report 21. model.amazon_ads.amazon_ads__portfolio_report budget_currency_code 40. model.amazon_ads_source.stg_amazon_ads__profile:f0->21. model.amazon_ads.amazon_ads__portfolio_report:f0
40. model.amazon_ads_source.stg_amazon_ads__profile
  • Input Column: 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp[currency_code]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • currency_code: Directly mapped after casting to TEXT
21. model.amazon_ads.amazon_ads__portfolio_report
  • Input Column: 40. model.amazon_ads_source.stg_amazon_ads__profile[currency_code]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the profile information when joining with other tables
    • Output Columns:
      • budget_currency_code: It is directly copied to this output column
Column Lineage
%3 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp daily_budget 40. model.amazon_ads_source.stg_amazon_ads__profile 40. model.amazon_ads_source.stg_amazon_ads__profile daily_budget 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp:f0->40. model.amazon_ads_source.stg_amazon_ads__profile:f0
40. model.amazon_ads_source.stg_amazon_ads__profile
  • Input Column: 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp[daily_budget]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT type
    • Output Columns:
      • daily_budget: Directly mapped after casting to INT
Column Lineage
%3 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp timezone 40. model.amazon_ads_source.stg_amazon_ads__profile 40. model.amazon_ads_source.stg_amazon_ads__profile timezone 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp:f0->40. model.amazon_ads_source.stg_amazon_ads__profile:f0
40. model.amazon_ads_source.stg_amazon_ads__profile
  • Input Column: 41. model.amazon_ads_source.stg_amazon_ads__profile_tmp[timezone]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • timezone: Directly mapped after casting to TEXT
42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report

This SQL query stages data from a temporary table, casts various fields to specific data types, and renames some columns. It primarily serves to clean and standardize the data structure for the Amazon Ads search term ad keyword report.

CleaningOther
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp
), fields AS (
  SELECT
    CAST(NULL AS INT) AS ad_group_id,
    CAST(NULL AS TEXT) AS ad_keyword_status,
    CAST(NULL AS FLOAT) AS campaign_budget_amount,
    CAST(NULL AS TEXT) AS campaign_budget_currency_code,
    CAST(NULL AS TEXT) AS campaign_budget_type,
    CAST(NULL AS INT) AS campaign_id,
    CAST(NULL AS INT) AS clicks,
    CAST(NULL AS FLOAT) AS cost,
    CAST(NULL AS DATE) AS date,
    CAST(NULL AS INT) AS impressions,
    CAST(NULL AS FLOAT) AS keyword_bid,
    CAST(NULL AS INT) AS keyword_id,
    CAST(NULL AS TEXT) AS search_term,
    CAST(NULL AS TEXT) AS targeting,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    CAST(ad_group_id AS TEXT) AS ad_group_id,
    ad_keyword_status,
    campaign_budget_amount,
    campaign_budget_currency_code,
    campaign_budget_type,
    CAST(campaign_id AS TEXT) AS campaign_id,
    clicks,
    cost,
    date AS date_day,
    impressions,
    keyword_bid,
    CAST(keyword_id AS TEXT) AS keyword_id,
    search_term,
    targeting
  FROM fields
)
SELECT
  *
FROM final
%3 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report source_relation date_day ad_group_id ad_keyword_status campaign_budget_amount campaign_budget_currency_code campaign_budget_type campaign_id keyword_bid keyword_id clicks impressions cost search_term targeting 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp ad_group_id campaign_id date keyword_id campaign_budget_amount campaign_budget_currency_code campaign_budget_type clicks cost impressions keyword_bid search_term targeting 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp:f0->42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f2 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp:f1->42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f7 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp:f2->42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f1 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp:f3->42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f9 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp:f4->42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f4 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp:f5->42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f5 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp:f6->42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f6 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp:f7->42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f10 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp:f8->42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f12 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp:f9->42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f11 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp:f10->42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f8 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp:f11->42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f13 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp:f12->42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f14
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
date_day date The date of the report.
ad_group_id text The ID representing the ad group, if present in the source data.
ad_keyword_status text Current status of a keyword.
campaign_budget_amount double precision Total budget allocated to the campaign.
campaign_budget_currency_code text The currency code associated with the campaign.
campaign_budget_type text One of: daily or lifetime.
campaign_id text The ID representing the campaign, if present in the source data.
keyword_bid double precision Bid associated with a keyword or targeting expression.
keyword_id text The ID representing the keyword, if present in the source data.
clicks integer The count of clicks.
impressions integer The count of impressions.
cost double precision Total cost of ad clicks.
search_term text The search term used by the customer.
targeting text A string representation of the expression object used in the targeting clause.
Column Lineage
%3 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report source_relation 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report source_relation 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f0->22. model.amazon_ads.amazon_ads__search_report:f0
22. model.amazon_ads.amazon_ads__search_report
  • Input Column: 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join conditions with other tables
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
Column Lineage
%3 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp date 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report date_day 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp:f0->42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f0 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report date_day 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f0->22. model.amazon_ads.amazon_ads__search_report:f0
42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report
  • Input Column: 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp[date]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • date_day: It is directly mapped and renamed
22. model.amazon_ads.amazon_ads__search_report
  • Input Column: 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp ad_group_id 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report ad_group_id 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp:f0->42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f0 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report ad_group_id 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f0->22. model.amazon_ads.amazon_ads__search_report:f0
42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report
  • Input Column: 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp[ad_group_id]
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • ad_group_id: It is directly mapped after casting
22. model.amazon_ads.amazon_ads__search_report
  • Input Column: 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report[ad_group_id]
    • Direct The column is directly copied without any transformation
    • Integration Used to join with the ad_groups table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • ad_group_id: Directly copied to the output
Column Lineage
%3 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp campaign_budget_amount 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report campaign_budget_amount 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp:f0->42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f0
42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report
  • Input Column: 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp[campaign_budget_amount]
    • Cleaning The column is cast to FLOAT type
    • Output Columns:
      • campaign_budget_amount: It is directly mapped after casting
Column Lineage
%3 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp campaign_budget_currency_code 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report campaign_budget_currency_code 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp:f0->42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f0
42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report
  • Input Column: 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp[campaign_budget_currency_code]
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • campaign_budget_currency_code: It is directly mapped after casting
Column Lineage
%3 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp campaign_budget_type 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report campaign_budget_type 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp:f0->42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f0
42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report
  • Input Column: 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp[campaign_budget_type]
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • campaign_budget_type: It is directly mapped after casting
Column Lineage
%3 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp campaign_id 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report campaign_id 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp:f0->42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f0 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report campaign_id 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f0->22. model.amazon_ads.amazon_ads__search_report:f0
42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report
  • Input Column: 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp[campaign_id]
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • campaign_id: It is directly mapped after casting
22. model.amazon_ads.amazon_ads__search_report
  • Input Column: 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report[campaign_id]
    • Direct The column is directly copied without any transformation
    • Integration Used to join with the campaigns table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • campaign_id: Directly copied to the output
Column Lineage
%3 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp keyword_bid 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report keyword_bid 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp:f0->42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f0
42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report
  • Input Column: 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp[keyword_bid]
    • Cleaning The column is cast to FLOAT data type
    • Output Columns:
      • keyword_bid: It is directly mapped after casting
Column Lineage
%3 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp keyword_id 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report keyword_id 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp:f0->42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f0 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report keyword_id 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f0->22. model.amazon_ads.amazon_ads__search_report:f0
42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report
  • Input Column: 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp[keyword_id]
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • keyword_id: It is directly mapped after casting
22. model.amazon_ads.amazon_ads__search_report
  • Input Column: 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report[keyword_id]
    • Direct The column is directly copied without any transformation
    • Integration Used to join with the keywords table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • keyword_id: Directly copied to the output
Column Lineage
%3 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp clicks 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report clicks 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp:f0->42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f0 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report clicks 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f0->22. model.amazon_ads.amazon_ads__search_report:f0
42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report
  • Input Column: 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp[clicks]
    • Cleaning The column is cast to INT type
    • Output Columns:
      • clicks: It is directly mapped after casting
22. model.amazon_ads.amazon_ads__search_report
  • Input Column: 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report[clicks]
    • Aggregation The clicks are summed up in the GROUP BY clause
    • Output Columns:
      • clicks: Directly mapped after aggregation
Column Lineage
%3 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp impressions 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report impressions 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp:f0->42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f0 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report impressions 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f0->22. model.amazon_ads.amazon_ads__search_report:f0
42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report
  • Input Column: 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp[impressions]
    • Cleaning The column is cast to INT data type
    • Output Columns:
      • impressions: It is directly mapped after casting
22. model.amazon_ads.amazon_ads__search_report
  • Input Column: 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report[impressions]
    • Aggregation The impressions are summed up in the GROUP BY clause
    • Output Columns:
      • impressions: Directly mapped after aggregation
Column Lineage
%3 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp cost 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report cost 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp:f0->42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f0 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report cost 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f0->22. model.amazon_ads.amazon_ads__search_report:f0
42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report
  • Input Column: 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp[cost]
    • Cleaning The column is cast to FLOAT type
    • Output Columns:
      • cost: It is directly mapped after casting
22. model.amazon_ads.amazon_ads__search_report
  • Input Column: 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report[cost]
    • Aggregation The cost is summed up in the GROUP BY clause
    • Output Columns:
      • cost: Directly mapped after aggregation
Column Lineage
%3 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp search_term 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report search_term 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp:f0->42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f0 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report search_term 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f0->22. model.amazon_ads.amazon_ads__search_report:f0
42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report
  • Input Column: 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp[search_term]
    • Cleaning The column is cast to TEXT data type
    • Output Columns:
      • search_term: It is directly mapped after casting
22. model.amazon_ads.amazon_ads__search_report
  • Input Column: 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report[search_term]
    • Direct The search_term is directly selected without transformation
    • Integration It's part of the GROUP BY clause, implying it's used for joining or integrating data
    • Output Columns:
      • search_term: Directly copied to the output
Column Lineage
%3 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp targeting 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report targeting 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp:f0->42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f0 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report targeting 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f0->22. model.amazon_ads.amazon_ads__search_report:f0
42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report
  • Input Column: 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp[targeting]
    • Cleaning The column is cast to TEXT data type
    • Output Columns:
      • targeting: It is directly mapped after casting
22. model.amazon_ads.amazon_ads__search_report
  • Input Column: 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report[targeting]
    • Direct The targeting is directly selected without transformation
    • Integration It's part of the GROUP BY clause, implying it's used for joining or integrating data
    • Output Columns:
      • targeting: Directly copied to the output
43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of type TEXT. It's likely used as a placeholder or template for a staging table in a dbt (data build tool) project, specifically for Amazon Ads search term and keyword report data.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp ad_group_id campaign_id date keyword_id _fivetran_synced campaign_budget_amount campaign_budget_currency_code campaign_budget_type clicks cost impressions keyword_bid search_term targeting 288. source.amazon_ads_source.amazon_ads.search_term_ad_keyword_report 288. source.amazon_ads_source.amazon_ads.search_term_ad_keyword_report
Name Type Comment
ad_group_id integer None
campaign_id integer None
date date None
keyword_id integer None
_fivetran_synced timestamp without time zone None
campaign_budget_amount double precision None
campaign_budget_currency_code text None
campaign_budget_type text None
clicks integer None
cost double precision None
impressions integer None
keyword_bid double precision None
search_term text None
targeting text None
Column Lineage
%3 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp ad_group_id 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report ad_group_id 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp:f0->42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f0 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report ad_group_id 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f0->22. model.amazon_ads.amazon_ads__search_report:f0
42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report
  • Input Column: 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp[ad_group_id]
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • ad_group_id: It is directly mapped after casting
22. model.amazon_ads.amazon_ads__search_report
  • Input Column: 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report[ad_group_id]
    • Direct The column is directly copied without any transformation
    • Integration Used to join with the ad_groups table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • ad_group_id: Directly copied to the output
Column Lineage
%3 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp campaign_id 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report campaign_id 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp:f0->42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f0 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report campaign_id 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f0->22. model.amazon_ads.amazon_ads__search_report:f0
42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report
  • Input Column: 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp[campaign_id]
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • campaign_id: It is directly mapped after casting
22. model.amazon_ads.amazon_ads__search_report
  • Input Column: 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report[campaign_id]
    • Direct The column is directly copied without any transformation
    • Integration Used to join with the campaigns table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • campaign_id: Directly copied to the output
Column Lineage
%3 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp date 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report date_day 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp:f0->42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f0 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report date_day 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f0->22. model.amazon_ads.amazon_ads__search_report:f0
42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report
  • Input Column: 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp[date]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • date_day: It is directly mapped and renamed
22. model.amazon_ads.amazon_ads__search_report
  • Input Column: 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp keyword_id 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report keyword_id 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp:f0->42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f0 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report keyword_id 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f0->22. model.amazon_ads.amazon_ads__search_report:f0
42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report
  • Input Column: 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp[keyword_id]
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • keyword_id: It is directly mapped after casting
22. model.amazon_ads.amazon_ads__search_report
  • Input Column: 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report[keyword_id]
    • Direct The column is directly copied without any transformation
    • Integration Used to join with the keywords table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • keyword_id: Directly copied to the output
Column Lineage
%3 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp campaign_budget_amount 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report campaign_budget_amount 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp:f0->42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f0
42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report
  • Input Column: 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp[campaign_budget_amount]
    • Cleaning The column is cast to FLOAT type
    • Output Columns:
      • campaign_budget_amount: It is directly mapped after casting
Column Lineage
%3 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp campaign_budget_currency_code 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report campaign_budget_currency_code 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp:f0->42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f0
42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report
  • Input Column: 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp[campaign_budget_currency_code]
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • campaign_budget_currency_code: It is directly mapped after casting
Column Lineage
%3 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp campaign_budget_type 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report campaign_budget_type 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp:f0->42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f0
42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report
  • Input Column: 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp[campaign_budget_type]
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • campaign_budget_type: It is directly mapped after casting
Column Lineage
%3 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp clicks 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report clicks 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp:f0->42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f0 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report clicks 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f0->22. model.amazon_ads.amazon_ads__search_report:f0
42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report
  • Input Column: 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp[clicks]
    • Cleaning The column is cast to INT type
    • Output Columns:
      • clicks: It is directly mapped after casting
22. model.amazon_ads.amazon_ads__search_report
  • Input Column: 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report[clicks]
    • Aggregation The clicks are summed up in the GROUP BY clause
    • Output Columns:
      • clicks: Directly mapped after aggregation
Column Lineage
%3 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp cost 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report cost 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp:f0->42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f0 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report cost 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f0->22. model.amazon_ads.amazon_ads__search_report:f0
42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report
  • Input Column: 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp[cost]
    • Cleaning The column is cast to FLOAT type
    • Output Columns:
      • cost: It is directly mapped after casting
22. model.amazon_ads.amazon_ads__search_report
  • Input Column: 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report[cost]
    • Aggregation The cost is summed up in the GROUP BY clause
    • Output Columns:
      • cost: Directly mapped after aggregation
Column Lineage
%3 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp impressions 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report impressions 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp:f0->42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f0 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report impressions 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f0->22. model.amazon_ads.amazon_ads__search_report:f0
42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report
  • Input Column: 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp[impressions]
    • Cleaning The column is cast to INT data type
    • Output Columns:
      • impressions: It is directly mapped after casting
22. model.amazon_ads.amazon_ads__search_report
  • Input Column: 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report[impressions]
    • Aggregation The impressions are summed up in the GROUP BY clause
    • Output Columns:
      • impressions: Directly mapped after aggregation
Column Lineage
%3 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp keyword_bid 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report keyword_bid 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp:f0->42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f0
42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report
  • Input Column: 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp[keyword_bid]
    • Cleaning The column is cast to FLOAT data type
    • Output Columns:
      • keyword_bid: It is directly mapped after casting
Column Lineage
%3 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp search_term 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report search_term 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp:f0->42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f0 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report search_term 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f0->22. model.amazon_ads.amazon_ads__search_report:f0
42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report
  • Input Column: 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp[search_term]
    • Cleaning The column is cast to TEXT data type
    • Output Columns:
      • search_term: It is directly mapped after casting
22. model.amazon_ads.amazon_ads__search_report
  • Input Column: 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report[search_term]
    • Direct The search_term is directly selected without transformation
    • Integration It's part of the GROUP BY clause, implying it's used for joining or integrating data
    • Output Columns:
      • search_term: Directly copied to the output
Column Lineage
%3 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp targeting 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report targeting 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp:f0->42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f0 22. model.amazon_ads.amazon_ads__search_report 22. model.amazon_ads.amazon_ads__search_report targeting 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report:f0->22. model.amazon_ads.amazon_ads__search_report:f0
42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report
  • Input Column: 43. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report_tmp[targeting]
    • Cleaning The column is cast to TEXT data type
    • Output Columns:
      • targeting: It is directly mapped after casting
22. model.amazon_ads.amazon_ads__search_report
  • Input Column: 42. model.amazon_ads_source.stg_amazon_ads__search_term_ad_keyword_report[targeting]
    • Direct The targeting is directly selected without transformation
    • Integration It's part of the GROUP BY clause, implying it's used for joining or integrating data
    • Output Columns:
      • targeting: Directly copied to the output
44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report

This SQL query performs data type casting and column renaming on a staging table for Amazon Ads targeting keyword report data. It creates a CTE with null values for all fields, then casts some fields to different data types in the final select statement. The query also adds a source_relation column and renames the 'date' column to 'date_day'.

CleaningOther
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp
), fields AS (
  SELECT
    CAST(NULL AS INT) AS ad_group_id,
    CAST(NULL AS TEXT) AS ad_keyword_status,
    CAST(NULL AS FLOAT) AS campaign_budget_amount,
    CAST(NULL AS TEXT) AS campaign_budget_currency_code,
    CAST(NULL AS TEXT) AS campaign_budget_type,
    CAST(NULL AS INT) AS campaign_id,
    CAST(NULL AS INT) AS clicks,
    CAST(NULL AS FLOAT) AS cost,
    CAST(NULL AS DATE) AS date,
    CAST(NULL AS INT) AS impressions,
    CAST(NULL AS FLOAT) AS keyword_bid,
    CAST(NULL AS INT) AS keyword_id,
    CAST(NULL AS TEXT) AS keyword_type,
    CAST(NULL AS TEXT) AS match_type,
    CAST(NULL AS TEXT) AS targeting,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    CAST(ad_group_id AS TEXT) AS ad_group_id,
    ad_keyword_status,
    campaign_budget_amount,
    campaign_budget_currency_code,
    campaign_budget_type,
    CAST(campaign_id AS TEXT) AS campaign_id,
    clicks,
    cost,
    date AS date_day,
    impressions,
    keyword_bid,
    CAST(keyword_id AS TEXT) AS keyword_id,
    keyword_type,
    match_type,
    targeting
  FROM fields
)
SELECT
  *
FROM final
%3 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report source_relation date_day ad_group_id ad_keyword_status campaign_budget_amount campaign_budget_currency_code campaign_budget_type campaign_id keyword_bid keyword_id clicks impressions cost keyword_type match_type targeting 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp ad_group_id campaign_id date keyword_id ad_keyword_status campaign_budget_amount campaign_budget_currency_code campaign_budget_type clicks cost impressions keyword_bid keyword_type match_type targeting 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp:f0->44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f2 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp:f1->44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f7 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp:f2->44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f1 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp:f3->44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f9 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp:f4->44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f3 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp:f5->44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f4 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp:f6->44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f5 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp:f7->44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f6 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp:f8->44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f10 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp:f9->44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f12 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp:f10->44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f11 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp:f11->44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f8 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp:f12->44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f13 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp:f13->44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f14 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp:f14->44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f15
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
date_day date The date of the report.
ad_group_id text The ID representing the ad group, if present in the source data.
ad_keyword_status text Current status of a keyword.
campaign_budget_amount double precision Total budget allocated to the campaign.
campaign_budget_currency_code text The currency code associated with the campaign.
campaign_budget_type text One of: daily or lifetime.
campaign_id text The ID representing the campaign, if present in the source data.
keyword_bid double precision Bid associated with a keyword or targeting expression.
keyword_id text The ID representing the keyword, if present in the source data.
clicks integer The count of clicks.
impressions integer The count of impressions.
cost double precision Total cost of ad clicks.
keyword_type text Type of matching for the keyword used in bid. One of: BROAD, PHRASE, or EXACT.
match_type text Type of matching for the keyword used in bid. One of: BROAD, PHRASE, or EXACT.
targeting text A string representation of the expression object used in the targeting clause.
Column Lineage
%3 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report source_relation 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report source_relation 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0
20. model.amazon_ads.amazon_ads__keyword_report
  • Input Column: 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with other tables
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
Column Lineage
%3 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp date 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report date_day 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp:f0->44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f0 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report date_day 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0
44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report
  • Input Column: 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp[date]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • date_day: Renamed from 'date' to 'date_day'
20. model.amazon_ads.amazon_ads__keyword_report
  • Input Column: 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp ad_group_id 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report ad_group_id 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp:f0->44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f0 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report ad_group_id 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0
44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report
  • Input Column: 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp[ad_group_id]
    • Cleaning The column is cast to TEXT data type
    • Output Columns:
      • ad_group_id: Directly mapped after casting to TEXT
20. model.amazon_ads.amazon_ads__keyword_report
  • Input Column: 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report[ad_group_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with the ad_groups table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • ad_group_id: Directly copied to the output
Column Lineage
%3 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp ad_keyword_status 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report ad_keyword_status 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp:f0->44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f0
44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report
  • Input Column: 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp[ad_keyword_status]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • ad_keyword_status: Directly mapped without changes
Column Lineage
%3 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp campaign_budget_amount 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report campaign_budget_amount 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp:f0->44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f0
44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report
  • Input Column: 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp[campaign_budget_amount]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • campaign_budget_amount: Directly mapped without changes
Column Lineage
%3 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp campaign_budget_currency_code 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report campaign_budget_currency_code 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp:f0->44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f0
44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report
  • Input Column: 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp[campaign_budget_currency_code]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • campaign_budget_currency_code: Directly mapped without changes
Column Lineage
%3 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp campaign_budget_type 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report campaign_budget_type 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp:f0->44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f0
44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report
  • Input Column: 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp[campaign_budget_type]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • campaign_budget_type: Directly mapped without changes
Column Lineage
%3 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp campaign_id 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report campaign_id 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp:f0->44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f0 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report campaign_id 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0
44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report
  • Input Column: 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp[campaign_id]
    • Cleaning The column is cast to TEXT data type
    • Output Columns:
      • campaign_id: Directly mapped after casting to TEXT
20. model.amazon_ads.amazon_ads__keyword_report
  • Input Column: 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report[campaign_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with the campaigns table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • campaign_id: Directly copied to the output
Column Lineage
%3 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp keyword_bid 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report keyword_bid 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp:f0->44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f0 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report keyword_bid 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0
44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report
  • Input Column: 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp[keyword_bid]
    • Direct The keyword_bid column is directly copied without any transformation
    • Cleaning The column is cast as FLOAT in the fields CTE
    • Output Columns:
      • keyword_bid: Directly mapped to the output 'keyword_bid' column
20. model.amazon_ads.amazon_ads__keyword_report
  • Input Column: 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report[keyword_bid]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • keyword_bid: Directly copied to the output
Column Lineage
%3 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp keyword_id 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report keyword_id 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp:f0->44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f0 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report keyword_id 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0
44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report
  • Input Column: 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp[keyword_id]
    • Cleaning The column is cast to TEXT data type
    • Output Columns:
      • keyword_id: Directly mapped after casting to TEXT
20. model.amazon_ads.amazon_ads__keyword_report
  • Input Column: 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report[keyword_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with the keywords table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • keyword_id: Directly copied to the output
Column Lineage
%3 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp clicks 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report clicks 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp:f0->44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f0 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report clicks 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0
44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report
  • Input Column: 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp[clicks]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • clicks: Directly mapped without changes
20. model.amazon_ads.amazon_ads__keyword_report
  • Input Column: 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report[clicks]
    • Aggregation The clicks are summed up in the GROUP BY clause
    • Output Columns:
      • clicks: Directly mapped after aggregation
Column Lineage
%3 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp impressions 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report impressions 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp:f0->44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f0 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report impressions 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0
44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report
  • Input Column: 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp[impressions]
    • Direct The impressions column is directly copied without any transformation
    • Cleaning The column is cast as INT in the fields CTE
    • Output Columns:
      • impressions: Directly mapped to the output 'impressions' column
20. model.amazon_ads.amazon_ads__keyword_report
  • Input Column: 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report[impressions]
    • Aggregation The impressions are summed up in the GROUP BY clause
    • Output Columns:
      • impressions: Directly mapped after aggregation
Column Lineage
%3 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp cost 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report cost 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp:f0->44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f0 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report cost 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0
44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report
  • Input Column: 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp[cost]
    • Direct The cost column is directly copied without any transformation
    • Cleaning The column is cast as FLOAT in the fields CTE
    • Output Columns:
      • cost: Directly mapped to the output 'cost' column
20. model.amazon_ads.amazon_ads__keyword_report
  • Input Column: 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report[cost]
    • Aggregation The cost is summed up in the GROUP BY clause
    • Output Columns:
      • cost: Directly mapped after aggregation
Column Lineage
%3 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp keyword_type 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report keyword_type 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp:f0->44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f0 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report keyword_type 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0
44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report
  • Input Column: 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp[keyword_type]
    • Direct The keyword_type column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • keyword_type: Directly mapped to the output 'keyword_type' column
20. model.amazon_ads.amazon_ads__keyword_report
  • Input Column: 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report[keyword_type]
    • Direct The keyword_type is directly selected without transformation
    • Output Columns:
      • keyword_type: Directly copied
Column Lineage
%3 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp match_type 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report match_type 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp:f0->44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f0 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report match_type 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0
44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report
  • Input Column: 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp[match_type]
    • Direct The match_type column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • match_type: Directly mapped to the output 'match_type' column
20. model.amazon_ads.amazon_ads__keyword_report
  • Input Column: 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report[match_type]
    • Direct The match_type is directly selected without transformation
    • Output Columns:
      • match_type: Directly copied
Column Lineage
%3 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp targeting 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report targeting 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp:f0->44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f0
44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report
  • Input Column: 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp[targeting]
    • Direct The targeting column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • targeting: Directly mapped to the output 'targeting' column
45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of TEXT data type, initialized to NULL. The query is limited to 0 rows, effectively creating a schema-only representation of the table without any data.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp ad_group_id campaign_id date keyword_id _fivetran_synced ad_keyword_status campaign_budget_amount campaign_budget_currency_code campaign_budget_type clicks cost impressions keyword_bid keyword_type match_type targeting 289. source.amazon_ads_source.amazon_ads.targeting_keyword_report 289. source.amazon_ads_source.amazon_ads.targeting_keyword_report
Name Type Comment
ad_group_id integer None
campaign_id integer None
date date None
keyword_id integer None
_fivetran_synced timestamp without time zone None
ad_keyword_status text None
campaign_budget_amount double precision None
campaign_budget_currency_code text None
campaign_budget_type text None
clicks integer None
cost double precision None
impressions integer None
keyword_bid double precision None
keyword_type text None
match_type text None
targeting text None
Column Lineage
%3 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp ad_group_id 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report ad_group_id 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp:f0->44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f0 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report ad_group_id 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0
44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report
  • Input Column: 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp[ad_group_id]
    • Cleaning The column is cast to TEXT data type
    • Output Columns:
      • ad_group_id: Directly mapped after casting to TEXT
20. model.amazon_ads.amazon_ads__keyword_report
  • Input Column: 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report[ad_group_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with the ad_groups table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • ad_group_id: Directly copied to the output
Column Lineage
%3 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp campaign_id 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report campaign_id 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp:f0->44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f0 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report campaign_id 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0
44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report
  • Input Column: 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp[campaign_id]
    • Cleaning The column is cast to TEXT data type
    • Output Columns:
      • campaign_id: Directly mapped after casting to TEXT
20. model.amazon_ads.amazon_ads__keyword_report
  • Input Column: 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report[campaign_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with the campaigns table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • campaign_id: Directly copied to the output
Column Lineage
%3 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp date 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report date_day 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp:f0->44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f0 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report date_day 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0
44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report
  • Input Column: 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp[date]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • date_day: Renamed from 'date' to 'date_day'
20. model.amazon_ads.amazon_ads__keyword_report
  • Input Column: 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp keyword_id 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report keyword_id 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp:f0->44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f0 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report keyword_id 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0
44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report
  • Input Column: 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp[keyword_id]
    • Cleaning The column is cast to TEXT data type
    • Output Columns:
      • keyword_id: Directly mapped after casting to TEXT
20. model.amazon_ads.amazon_ads__keyword_report
  • Input Column: 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report[keyword_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with the keywords table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • keyword_id: Directly copied to the output
Column Lineage
%3 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp ad_keyword_status 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report ad_keyword_status 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp:f0->44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f0
44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report
  • Input Column: 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp[ad_keyword_status]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • ad_keyword_status: Directly mapped without changes
Column Lineage
%3 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp campaign_budget_amount 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report campaign_budget_amount 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp:f0->44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f0
44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report
  • Input Column: 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp[campaign_budget_amount]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • campaign_budget_amount: Directly mapped without changes
Column Lineage
%3 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp campaign_budget_currency_code 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report campaign_budget_currency_code 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp:f0->44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f0
44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report
  • Input Column: 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp[campaign_budget_currency_code]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • campaign_budget_currency_code: Directly mapped without changes
Column Lineage
%3 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp campaign_budget_type 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report campaign_budget_type 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp:f0->44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f0
44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report
  • Input Column: 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp[campaign_budget_type]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • campaign_budget_type: Directly mapped without changes
Column Lineage
%3 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp clicks 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report clicks 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp:f0->44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f0 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report clicks 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0
44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report
  • Input Column: 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp[clicks]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • clicks: Directly mapped without changes
20. model.amazon_ads.amazon_ads__keyword_report
  • Input Column: 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report[clicks]
    • Aggregation The clicks are summed up in the GROUP BY clause
    • Output Columns:
      • clicks: Directly mapped after aggregation
Column Lineage
%3 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp cost 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report cost 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp:f0->44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f0 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report cost 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0
44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report
  • Input Column: 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp[cost]
    • Direct The cost column is directly copied without any transformation
    • Cleaning The column is cast as FLOAT in the fields CTE
    • Output Columns:
      • cost: Directly mapped to the output 'cost' column
20. model.amazon_ads.amazon_ads__keyword_report
  • Input Column: 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report[cost]
    • Aggregation The cost is summed up in the GROUP BY clause
    • Output Columns:
      • cost: Directly mapped after aggregation
Column Lineage
%3 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp impressions 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report impressions 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp:f0->44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f0 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report impressions 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0
44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report
  • Input Column: 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp[impressions]
    • Direct The impressions column is directly copied without any transformation
    • Cleaning The column is cast as INT in the fields CTE
    • Output Columns:
      • impressions: Directly mapped to the output 'impressions' column
20. model.amazon_ads.amazon_ads__keyword_report
  • Input Column: 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report[impressions]
    • Aggregation The impressions are summed up in the GROUP BY clause
    • Output Columns:
      • impressions: Directly mapped after aggregation
Column Lineage
%3 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp keyword_bid 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report keyword_bid 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp:f0->44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f0 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report keyword_bid 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0
44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report
  • Input Column: 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp[keyword_bid]
    • Direct The keyword_bid column is directly copied without any transformation
    • Cleaning The column is cast as FLOAT in the fields CTE
    • Output Columns:
      • keyword_bid: Directly mapped to the output 'keyword_bid' column
20. model.amazon_ads.amazon_ads__keyword_report
  • Input Column: 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report[keyword_bid]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • keyword_bid: Directly copied to the output
Column Lineage
%3 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp keyword_type 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report keyword_type 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp:f0->44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f0 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report keyword_type 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0
44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report
  • Input Column: 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp[keyword_type]
    • Direct The keyword_type column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • keyword_type: Directly mapped to the output 'keyword_type' column
20. model.amazon_ads.amazon_ads__keyword_report
  • Input Column: 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report[keyword_type]
    • Direct The keyword_type is directly selected without transformation
    • Output Columns:
      • keyword_type: Directly copied
Column Lineage
%3 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp match_type 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report match_type 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp:f0->44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f0 20. model.amazon_ads.amazon_ads__keyword_report 20. model.amazon_ads.amazon_ads__keyword_report match_type 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f0->20. model.amazon_ads.amazon_ads__keyword_report:f0
44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report
  • Input Column: 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp[match_type]
    • Direct The match_type column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • match_type: Directly mapped to the output 'match_type' column
20. model.amazon_ads.amazon_ads__keyword_report
  • Input Column: 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report[match_type]
    • Direct The match_type is directly selected without transformation
    • Output Columns:
      • match_type: Directly copied
Column Lineage
%3 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp targeting 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report 44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report targeting 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp:f0->44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report:f0
44. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report
  • Input Column: 45. model.amazon_ads_source.stg_amazon_ads__targeting_keyword_report_tmp[targeting]
    • Direct The targeting column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • targeting: Directly mapped to the output 'targeting' column
46. model.apple_search_ads.apple_search_ads__ad_group_report

This SQL query integrates data from multiple tables related to Apple Search Ads, including ad group reports, ad group history, campaign history, and organization information. It joins these tables based on common identifiers and source relations, filters for the most recent records in history tables, and aggregates metrics such as taps, downloads, impressions, and spend. The result is a comprehensive view of ad performance data grouped by various dimensions like organization, campaign, ad group, and date.

FilteringIntegrationAggregation
SQL Query
WITH report AS (
  SELECT
    *
  FROM TEST.PUBLIC_apple_search_ads_source.stg_apple_search_ads__ad_group_report
), ad_group AS (
  SELECT
    *
  FROM TEST.PUBLIC_apple_search_ads_source.stg_apple_search_ads__ad_group_history
  WHERE
    is_most_recent_record = TRUE
), campaign AS (
  SELECT
    *
  FROM TEST.PUBLIC_apple_search_ads_source.stg_apple_search_ads__campaign_history
  WHERE
    is_most_recent_record = TRUE
), organization AS (
  SELECT
    *
  FROM TEST.PUBLIC_apple_search_ads_source.stg_apple_search_ads__organization
), joined AS (
  SELECT
    report.source_relation,
    report.date_day,
    organization.organization_id,
    organization.organization_name,
    campaign.campaign_id,
    campaign.campaign_name,
    ad_group.ad_group_id,
    ad_group.ad_group_name,
    report.currency,
    ad_group.ad_group_status,
    ad_group.start_at,
    ad_group.end_at,
    SUM(report.taps) AS taps,
    SUM(report.new_downloads) AS new_downloads,
    SUM(report.redownloads) AS redownloads,
    SUM(report.new_downloads + report.redownloads) AS total_downloads,
    SUM(report.impressions) AS impressions,
    SUM(report.spend) AS spend
  FROM report
  JOIN ad_group
    ON report.ad_group_id = ad_group.ad_group_id
    AND report.source_relation = ad_group.source_relation
  JOIN campaign
    ON ad_group.campaign_id = campaign.campaign_id
    AND ad_group.source_relation = campaign.source_relation
  JOIN organization
    ON ad_group.organization_id = organization.organization_id
    AND ad_group.source_relation = organization.source_relation
  GROUP BY
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10,
    11,
    12
)
SELECT
  *
FROM joined
%3 46. model.apple_search_ads.apple_search_ads__ad_group_report 46. model.apple_search_ads.apple_search_ads__ad_group_report source_relation organization_id organization_name campaign_id campaign_name ad_group_id ad_group_name ad_group_status start_at end_at date_day currency taps new_downloads redownloads total_downloads impressions spend 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history source_relation ad_group_id start_at end_at ad_group_name status ad_group_status 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history:f0->46. model.apple_search_ads.apple_search_ads__ad_group_report:f0 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history:f1->46. model.apple_search_ads.apple_search_ads__ad_group_report:f5 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history:f2->46. model.apple_search_ads.apple_search_ads__ad_group_report:f8 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history:f3->46. model.apple_search_ads.apple_search_ads__ad_group_report:f9 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history:f4->46. model.apple_search_ads.apple_search_ads__ad_group_report:f6 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history:f5->46. model.apple_search_ads.apple_search_ads__ad_group_report:f7 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history:f6->46. model.apple_search_ads.apple_search_ads__ad_group_report:f7 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report source_relation ad_group_id date_day impressions spend currency new_downloads redownloads taps 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report:f0->46. model.apple_search_ads.apple_search_ads__ad_group_report:f0 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report:f1->46. model.apple_search_ads.apple_search_ads__ad_group_report:f5 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report:f2->46. model.apple_search_ads.apple_search_ads__ad_group_report:f10 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report:f3->46. model.apple_search_ads.apple_search_ads__ad_group_report:f16 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report:f4->46. model.apple_search_ads.apple_search_ads__ad_group_report:f17 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report:f5->46. model.apple_search_ads.apple_search_ads__ad_group_report:f11 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report:f6->46. model.apple_search_ads.apple_search_ads__ad_group_report:f13 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report:f6->46. model.apple_search_ads.apple_search_ads__ad_group_report:f15 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report:f7->46. model.apple_search_ads.apple_search_ads__ad_group_report:f14 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report:f7->46. model.apple_search_ads.apple_search_ads__ad_group_report:f15 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report:f8->46. model.apple_search_ads.apple_search_ads__ad_group_report:f12 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history source_relation campaign_id campaign_name 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0->46. model.apple_search_ads.apple_search_ads__ad_group_report:f0 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f1->46. model.apple_search_ads.apple_search_ads__ad_group_report:f3 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f2->46. model.apple_search_ads.apple_search_ads__ad_group_report:f4 68. model.apple_search_ads_source.stg_apple_search_ads__organization 68. model.apple_search_ads_source.stg_apple_search_ads__organization source_relation organization_id organization_name 68. model.apple_search_ads_source.stg_apple_search_ads__organization:f0->46. model.apple_search_ads.apple_search_ads__ad_group_report:f0 68. model.apple_search_ads_source.stg_apple_search_ads__organization:f1->46. model.apple_search_ads.apple_search_ads__ad_group_report:f1 68. model.apple_search_ads_source.stg_apple_search_ads__organization:f2->46. model.apple_search_ads.apple_search_ads__ad_group_report:f2
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
organization_id integer Organization ID associated with this record.
organization_name text Organization name associated with this record.
campaign_id integer Campaign ID associated with this record.
campaign_name text Campaign name associated with this record.
ad_group_id integer Ad group ID associated with this record.
ad_group_name text Ad group name associated with this record.
ad_group_status text The status of the ad group associated with this record.
start_at timestamp without time zone The start timestamp for this ad group.
end_at timestamp without time zone The end timestamp for this ad group.
date_day date Date of the report.
currency text This currency value should match the respective organization's currency value.
taps bigint Number of taps on ad group on given day.
new_downloads bigint App downloads from new users who have never before installed app of ad group in a given day.
redownloads bigint Number of user downloads where user deletes app and downloads the same app again following a tap on an ad on the App Store, or downloads the same app to an additional device of ad group in a given day.
total_downloads bigint The sum of new_downloads and redownloads.
impressions bigint The number of impressions of ad group in a given day.
spend double precision The spend on ad group in the given day.
Column Lineage
%3 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history source_relation 46. model.apple_search_ads.apple_search_ads__ad_group_report 46. model.apple_search_ads.apple_search_ads__ad_group_report source_relation 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history:f0->46. model.apple_search_ads.apple_search_ads__ad_group_report:f0 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report source_relation 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report:f0->46. model.apple_search_ads.apple_search_ads__ad_group_report:f0 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history source_relation 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0->46. model.apple_search_ads.apple_search_ads__ad_group_report:f0 68. model.apple_search_ads_source.stg_apple_search_ads__organization 68. model.apple_search_ads_source.stg_apple_search_ads__organization source_relation 68. model.apple_search_ads_source.stg_apple_search_ads__organization:f0->46. model.apple_search_ads.apple_search_ads__ad_group_report:f0
46. model.apple_search_ads.apple_search_ads__ad_group_report
  • Input Column: 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history[source_relation]
    • Integration used as a key to join tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join conditions with other tables
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
  • Input Column: 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 68. model.apple_search_ads_source.stg_apple_search_ads__organization[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
Column Lineage
%3 68. model.apple_search_ads_source.stg_apple_search_ads__organization 68. model.apple_search_ads_source.stg_apple_search_ads__organization organization_id 46. model.apple_search_ads.apple_search_ads__ad_group_report 46. model.apple_search_ads.apple_search_ads__ad_group_report organization_id 68. model.apple_search_ads_source.stg_apple_search_ads__organization:f0->46. model.apple_search_ads.apple_search_ads__ad_group_report:f0 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp id 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp:f0->68. model.apple_search_ads_source.stg_apple_search_ads__organization:f0
68. model.apple_search_ads_source.stg_apple_search_ads__organization
  • Input Column: 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp[id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT in the fields CTE
    • Output Columns:
      • organization_id: Directly mapped and renamed
46. model.apple_search_ads.apple_search_ads__ad_group_report
  • Input Column: 68. model.apple_search_ads_source.stg_apple_search_ads__organization[organization_id]
    • Integration used as the key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • organization_id: directly copied
Column Lineage
%3 68. model.apple_search_ads_source.stg_apple_search_ads__organization 68. model.apple_search_ads_source.stg_apple_search_ads__organization organization_name 46. model.apple_search_ads.apple_search_ads__ad_group_report 46. model.apple_search_ads.apple_search_ads__ad_group_report organization_name 68. model.apple_search_ads_source.stg_apple_search_ads__organization:f0->46. model.apple_search_ads.apple_search_ads__ad_group_report:f0 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp name 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp:f0->68. model.apple_search_ads_source.stg_apple_search_ads__organization:f0
68. model.apple_search_ads_source.stg_apple_search_ads__organization
  • Input Column: 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp[name]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • organization_name: Directly mapped and renamed
46. model.apple_search_ads.apple_search_ads__ad_group_report
  • Input Column: 68. model.apple_search_ads_source.stg_apple_search_ads__organization[organization_name]
    • Direct directly copied to the output
    • Output Columns:
      • organization_name: directly copied
Column Lineage
%3 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history campaign_id 46. model.apple_search_ads.apple_search_ads__ad_group_report 46. model.apple_search_ads.apple_search_ads__ad_group_report campaign_id 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0->46. model.apple_search_ads.apple_search_ads__ad_group_report:f0 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp id 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp:f0->60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0
60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history
  • Input Column: 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp[id]
    • Cleaning The column is cast to INT type
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • campaign_id: Directly mapped after casting
46. model.apple_search_ads.apple_search_ads__ad_group_report
  • Input Column: 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history[campaign_id]
    • Integration used as a join key with the ad_group table
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
Column Lineage
%3 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history campaign_name 46. model.apple_search_ads.apple_search_ads__ad_group_report 46. model.apple_search_ads.apple_search_ads__ad_group_report campaign_name 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0->46. model.apple_search_ads.apple_search_ads__ad_group_report:f0 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp name 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp:f0->60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0
60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history
  • Input Column: 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp[name]
    • Cleaning The column is cast as TEXT and renamed
    • Output Columns:
      • campaign_name: Directly mapped after renaming
46. model.apple_search_ads.apple_search_ads__ad_group_report
  • Input Column: 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history[campaign_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_name: directly copied
Column Lineage
%3 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history ad_group_id 46. model.apple_search_ads.apple_search_ads__ad_group_report 46. model.apple_search_ads.apple_search_ads__ad_group_report ad_group_id 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history:f0->46. model.apple_search_ads.apple_search_ads__ad_group_report:f0 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report ad_group_id 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report:f0->46. model.apple_search_ads.apple_search_ads__ad_group_report:f0 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp id 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp:f0->52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history:f0 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp ad_group_id 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp:f0->54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report:f0
52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history
  • Input Column: 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp[id]
    • Cleaning The column is cast to INT type.
    • Deduplication Used in ROW_NUMBER() function to identify the most recent record.
    • Output Columns:
      • ad_group_id: Directly mapped after casting.
54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report
  • Input Column: 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp[ad_group_id]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • ad_group_id: Directly mapped to the output column
46. model.apple_search_ads.apple_search_ads__ad_group_report
  • Input Column: 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history[ad_group_id]
    • Integration used as a key to join tables
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_id: directly copied
  • Input Column: 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report[ad_group_id]
    • Integration Used as a key to join with the ad_group table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • ad_group_id: Directly copied to the output
Column Lineage
%3 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history ad_group_name 46. model.apple_search_ads.apple_search_ads__ad_group_report 46. model.apple_search_ads.apple_search_ads__ad_group_report ad_group_name 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history:f0->46. model.apple_search_ads.apple_search_ads__ad_group_report:f0 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp name 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp:f0->52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history:f0
52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history
  • Input Column: 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • ad_group_name: Directly mapped after casting
46. model.apple_search_ads.apple_search_ads__ad_group_report
  • Input Column: 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history[ad_group_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_name: directly copied
Column Lineage
%3 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history ad_group_status status 46. model.apple_search_ads.apple_search_ads__ad_group_report 46. model.apple_search_ads.apple_search_ads__ad_group_report ad_group_status 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history:f1->46. model.apple_search_ads.apple_search_ads__ad_group_report:f0 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history:f0->46. model.apple_search_ads.apple_search_ads__ad_group_report:f0 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp status 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp:f0->52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history:f0
52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history
  • Input Column: 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp[status]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • ad_group_status: Directly mapped after casting
46. model.apple_search_ads.apple_search_ads__ad_group_report
  • Input Column: 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history[status]
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_status: directly copied and renamed
  • Input Column: 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history[ad_group_status]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition to link the ad_group table with other tables
    • Output Columns:
      • ad_group_status: It is directly copied to the output column 'ad_group_status'
Column Lineage
%3 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history start_at 46. model.apple_search_ads.apple_search_ads__ad_group_report 46. model.apple_search_ads.apple_search_ads__ad_group_report start_at 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history:f0->46. model.apple_search_ads.apple_search_ads__ad_group_report:f0 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp start_time 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp:f0->52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history:f0
52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history
  • Input Column: 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp[start_time]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TIMESTAMP type
    • Output Columns:
      • start_at: Directly mapped after casting
46. model.apple_search_ads.apple_search_ads__ad_group_report
  • Input Column: 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history[start_at]
    • Direct directly copied to the output
    • Output Columns:
      • start_at: directly copied
Column Lineage
%3 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history end_at 46. model.apple_search_ads.apple_search_ads__ad_group_report 46. model.apple_search_ads.apple_search_ads__ad_group_report end_at 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history:f0->46. model.apple_search_ads.apple_search_ads__ad_group_report:f0 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp end_time 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp:f0->52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history:f0
52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history
  • Input Column: 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp[end_time]
    • Cleaning The column is cast to TIMESTAMP type.
    • Output Columns:
      • end_at: Directly mapped after casting.
46. model.apple_search_ads.apple_search_ads__ad_group_report
  • Input Column: 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history[end_at]
    • Direct directly copied to the output
    • Output Columns:
      • end_at: directly copied
Column Lineage
%3 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report date_day 46. model.apple_search_ads.apple_search_ads__ad_group_report 46. model.apple_search_ads.apple_search_ads__ad_group_report date_day 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report:f0->46. model.apple_search_ads.apple_search_ads__ad_group_report:f0 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp date 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp:f0->54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report:f0
54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report
  • Input Column: 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp[date]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as DATE type
    • Output Columns:
      • date_day: Directly mapped to the output column after casting
46. model.apple_search_ads.apple_search_ads__ad_group_report
  • Input Column: 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report currency 46. model.apple_search_ads.apple_search_ads__ad_group_report 46. model.apple_search_ads.apple_search_ads__ad_group_report currency 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report:f0->46. model.apple_search_ads.apple_search_ads__ad_group_report:f0 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp local_spend_currency 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp:f0->54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report:f0
54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report
  • Input Column: 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp[local_spend_currency]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • currency: Directly mapped
46. model.apple_search_ads.apple_search_ads__ad_group_report
  • Input Column: 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report[currency]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • currency: Directly copied to the output
Column Lineage
%3 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report taps 46. model.apple_search_ads.apple_search_ads__ad_group_report 46. model.apple_search_ads.apple_search_ads__ad_group_report taps 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report:f0->46. model.apple_search_ads.apple_search_ads__ad_group_report:f0 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp taps 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp:f0->54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report:f0
54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report
  • Input Column: 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp[taps]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT
    • Output Columns:
      • taps: Directly mapped after casting
46. model.apple_search_ads.apple_search_ads__ad_group_report
  • Input Column: 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report[taps]
    • Aggregation Summed up in the SELECT clause
    • Output Columns:
      • taps: Aggregated sum in the output
Column Lineage
%3 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report new_downloads 46. model.apple_search_ads.apple_search_ads__ad_group_report 46. model.apple_search_ads.apple_search_ads__ad_group_report new_downloads total_downloads 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report:f0->46. model.apple_search_ads.apple_search_ads__ad_group_report:f0 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report:f0->46. model.apple_search_ads.apple_search_ads__ad_group_report:f1 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp new_downloads 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp:f0->54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report:f0
54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report
  • Input Column: 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp[new_downloads]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT
    • Output Columns:
      • new_downloads: Directly mapped after casting
46. model.apple_search_ads.apple_search_ads__ad_group_report
  • Input Column: 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report[new_downloads]
    • Aggregation Summed up in the SELECT clause
    • Other Used in calculation of total_downloads
    • Output Columns:
      • new_downloads: Aggregated sum in the output
      • total_downloads: Part of the sum calculation
Column Lineage
%3 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report redownloads 46. model.apple_search_ads.apple_search_ads__ad_group_report 46. model.apple_search_ads.apple_search_ads__ad_group_report redownloads total_downloads 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report:f0->46. model.apple_search_ads.apple_search_ads__ad_group_report:f0 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report:f0->46. model.apple_search_ads.apple_search_ads__ad_group_report:f1 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp redownloads 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp:f0->54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report:f0
54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report
  • Input Column: 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp[redownloads]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT
    • Output Columns:
      • redownloads: Directly mapped after casting
46. model.apple_search_ads.apple_search_ads__ad_group_report
  • Input Column: 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report[redownloads]
    • Aggregation Summed up in the SELECT clause
    • Other Used in calculation of total_downloads
    • Output Columns:
      • redownloads: Aggregated sum in the output
      • total_downloads: Part of the sum calculation
Column Lineage
%3 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report new_downloads redownloads 46. model.apple_search_ads.apple_search_ads__ad_group_report 46. model.apple_search_ads.apple_search_ads__ad_group_report new_downloads redownloads total_downloads 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report:f0->46. model.apple_search_ads.apple_search_ads__ad_group_report:f0 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report:f0->46. model.apple_search_ads.apple_search_ads__ad_group_report:f2 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report:f1->46. model.apple_search_ads.apple_search_ads__ad_group_report:f1 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report:f1->46. model.apple_search_ads.apple_search_ads__ad_group_report:f2 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp new_downloads redownloads 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp:f0->54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report:f0 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp:f1->54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report:f1
54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report
  • Input Column: 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp[new_downloads]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT
    • Output Columns:
      • new_downloads: Directly mapped after casting
  • Input Column: 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp[redownloads]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT
    • Output Columns:
      • redownloads: Directly mapped after casting
46. model.apple_search_ads.apple_search_ads__ad_group_report
  • Input Column: 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report[new_downloads]
    • Aggregation Summed up in the SELECT clause
    • Other Used in calculation of total_downloads
    • Output Columns:
      • new_downloads: Aggregated sum in the output
      • total_downloads: Part of the sum calculation
  • Input Column: 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report[redownloads]
    • Aggregation Summed up in the SELECT clause
    • Other Used in calculation of total_downloads
    • Output Columns:
      • redownloads: Aggregated sum in the output
      • total_downloads: Part of the sum calculation
Column Lineage
%3 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report impressions 46. model.apple_search_ads.apple_search_ads__ad_group_report 46. model.apple_search_ads.apple_search_ads__ad_group_report impressions 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report:f0->46. model.apple_search_ads.apple_search_ads__ad_group_report:f0 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp impressions 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp:f0->54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report:f0
54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report
  • Input Column: 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp[impressions]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT type
    • Output Columns:
      • impressions: Directly mapped to the output column after casting
46. model.apple_search_ads.apple_search_ads__ad_group_report
  • Input Column: 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report[impressions]
    • Aggregation Summed up in the SELECT clause
    • Output Columns:
      • impressions: Aggregated sum in the output
Column Lineage
%3 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report spend 46. model.apple_search_ads.apple_search_ads__ad_group_report 46. model.apple_search_ads.apple_search_ads__ad_group_report spend 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report:f0->46. model.apple_search_ads.apple_search_ads__ad_group_report:f0 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp local_spend_amount 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp:f0->54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report:f0
54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report
  • Input Column: 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp[local_spend_amount]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as DECIMAL(28, 6)
    • Output Columns:
      • spend: Directly mapped after casting
46. model.apple_search_ads.apple_search_ads__ad_group_report
  • Input Column: 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report[spend]
    • Aggregation Summed up in the SELECT clause
    • Output Columns:
      • spend: Aggregated sum in the output
47. model.apple_search_ads.apple_search_ads__ad_report

This SQL query integrates data from multiple Apple Search Ads related tables (ad report, ad history, ad group history, campaign history, and organization) to create a comprehensive ad performance report. It joins these tables based on various ID fields and the source relation, filters for the most recent records in history tables, and aggregates metrics such as taps, downloads, impressions, and spend. The result is a detailed view of ad performance across different organizational levels (organization, campaign, ad group, and individual ad) for each date and currency.

FilteringIntegrationAggregation
SQL Query
WITH report AS (
  SELECT
    *
  FROM TEST.PUBLIC_apple_search_ads_source.stg_apple_search_ads__ad_report
), ad AS (
  SELECT
    *
  FROM TEST.PUBLIC_apple_search_ads_source.stg_apple_search_ads__ad_history
  WHERE
    is_most_recent_record = TRUE
), ad_group AS (
  SELECT
    *
  FROM TEST.PUBLIC_apple_search_ads_source.stg_apple_search_ads__ad_group_history
  WHERE
    is_most_recent_record = TRUE
), campaign AS (
  SELECT
    *
  FROM TEST.PUBLIC_apple_search_ads_source.stg_apple_search_ads__campaign_history
  WHERE
    is_most_recent_record = TRUE
), organization AS (
  SELECT
    *
  FROM TEST.PUBLIC_apple_search_ads_source.stg_apple_search_ads__organization
), joined AS (
  SELECT
    report.source_relation,
    report.date_day,
    organization.organization_id,
    organization.organization_name,
    campaign.campaign_id,
    campaign.campaign_name,
    ad_group.ad_group_id,
    ad_group.ad_group_name,
    ad.ad_id,
    ad.ad_name,
    report.currency,
    ad.ad_status,
    SUM(report.taps) AS taps,
    SUM(report.new_downloads) AS new_downloads,
    SUM(report.redownloads) AS redownloads,
    SUM(report.new_downloads + report.redownloads) AS total_downloads,
    SUM(report.impressions) AS impressions,
    SUM(report.spend) AS spend
  FROM report
  JOIN ad
    ON report.ad_id = ad.ad_id AND report.source_relation = ad.source_relation
  JOIN ad_group
    ON report.ad_group_id = ad_group.ad_group_id
    AND report.source_relation = ad_group.source_relation
  JOIN campaign
    ON report.campaign_id = campaign.campaign_id
    AND report.source_relation = campaign.source_relation
  JOIN organization
    ON ad.organization_id = organization.organization_id
    AND ad.source_relation = organization.source_relation
  GROUP BY
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10,
    11,
    12
)
SELECT
  *
FROM joined
%3 47. model.apple_search_ads.apple_search_ads__ad_report 47. model.apple_search_ads.apple_search_ads__ad_report source_relation organization_id organization_name campaign_id campaign_name ad_group_id ad_group_name ad_id ad_name ad_status date_day currency taps new_downloads redownloads total_downloads impressions spend 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history source_relation ad_group_id ad_group_name 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history:f0->47. model.apple_search_ads.apple_search_ads__ad_report:f0 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history:f1->47. model.apple_search_ads.apple_search_ads__ad_report:f5 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history:f2->47. model.apple_search_ads.apple_search_ads__ad_report:f6 56. model.apple_search_ads_source.stg_apple_search_ads__ad_history 56. model.apple_search_ads_source.stg_apple_search_ads__ad_history source_relation ad_name ad_id ad_status 56. model.apple_search_ads_source.stg_apple_search_ads__ad_history:f0->47. model.apple_search_ads.apple_search_ads__ad_report:f0 56. model.apple_search_ads_source.stg_apple_search_ads__ad_history:f1->47. model.apple_search_ads.apple_search_ads__ad_report:f8 56. model.apple_search_ads_source.stg_apple_search_ads__ad_history:f2->47. model.apple_search_ads.apple_search_ads__ad_report:f7 56. model.apple_search_ads_source.stg_apple_search_ads__ad_history:f3->47. model.apple_search_ads.apple_search_ads__ad_report:f9 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report source_relation date_day campaign_id ad_group_id ad_id impressions spend currency new_downloads redownloads taps 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report:f0->47. model.apple_search_ads.apple_search_ads__ad_report:f0 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report:f1->47. model.apple_search_ads.apple_search_ads__ad_report:f10 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report:f2->47. model.apple_search_ads.apple_search_ads__ad_report:f3 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report:f3->47. model.apple_search_ads.apple_search_ads__ad_report:f5 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report:f4->47. model.apple_search_ads.apple_search_ads__ad_report:f7 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report:f5->47. model.apple_search_ads.apple_search_ads__ad_report:f16 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report:f6->47. model.apple_search_ads.apple_search_ads__ad_report:f17 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report:f7->47. model.apple_search_ads.apple_search_ads__ad_report:f11 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report:f8->47. model.apple_search_ads.apple_search_ads__ad_report:f13 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report:f8->47. model.apple_search_ads.apple_search_ads__ad_report:f15 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report:f9->47. model.apple_search_ads.apple_search_ads__ad_report:f14 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report:f9->47. model.apple_search_ads.apple_search_ads__ad_report:f15 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report:f10->47. model.apple_search_ads.apple_search_ads__ad_report:f12 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history source_relation campaign_id campaign_name 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0->47. model.apple_search_ads.apple_search_ads__ad_report:f0 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f1->47. model.apple_search_ads.apple_search_ads__ad_report:f3 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f2->47. model.apple_search_ads.apple_search_ads__ad_report:f4 68. model.apple_search_ads_source.stg_apple_search_ads__organization 68. model.apple_search_ads_source.stg_apple_search_ads__organization source_relation organization_id organization_name 68. model.apple_search_ads_source.stg_apple_search_ads__organization:f0->47. model.apple_search_ads.apple_search_ads__ad_report:f0 68. model.apple_search_ads_source.stg_apple_search_ads__organization:f1->47. model.apple_search_ads.apple_search_ads__ad_report:f1 68. model.apple_search_ads_source.stg_apple_search_ads__organization:f2->47. model.apple_search_ads.apple_search_ads__ad_report:f2
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
organization_id integer Organization ID associated with this record.
organization_name text Organization name associated with this record.
campaign_id integer Campaign ID associated with this record.
campaign_name text Campaign name associated with this record.
ad_group_id integer Ad group ID associated with this record.
ad_group_name text Ad group name associated with this record.
ad_id integer Ad ID associated with this record.
ad_name text Ad name associated with this record.
ad_status text The status of the ad associated with this record.
date_day date Date of the report.
currency text This currency value should match the respective organization's currency value.
taps bigint Number of taps on ad group on given day.
new_downloads bigint App downloads from new users who have never before installed app of ad group in a given day.
redownloads bigint Number of user downloads where user deletes app and downloads the same app again following a tap on an ad on the App Store, or downloads the same app to an additional device of ad group in a given day.
total_downloads bigint The sum of new_downloads and redownloads.
impressions bigint The number of impressions of ad group in a given day.
spend numeric The spend on ad group in the given day.
Column Lineage
%3 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history source_relation 47. model.apple_search_ads.apple_search_ads__ad_report 47. model.apple_search_ads.apple_search_ads__ad_report source_relation 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history:f0->47. model.apple_search_ads.apple_search_ads__ad_report:f0 56. model.apple_search_ads_source.stg_apple_search_ads__ad_history 56. model.apple_search_ads_source.stg_apple_search_ads__ad_history source_relation 56. model.apple_search_ads_source.stg_apple_search_ads__ad_history:f0->47. model.apple_search_ads.apple_search_ads__ad_report:f0 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report source_relation 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report:f0->47. model.apple_search_ads.apple_search_ads__ad_report:f0 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history source_relation 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0->47. model.apple_search_ads.apple_search_ads__ad_report:f0 68. model.apple_search_ads_source.stg_apple_search_ads__organization 68. model.apple_search_ads_source.stg_apple_search_ads__organization source_relation 68. model.apple_search_ads_source.stg_apple_search_ads__organization:f0->47. model.apple_search_ads.apple_search_ads__ad_report:f0 59. model.apple_search_ads_source.stg_apple_search_ads__ad_report_tmp 59. model.apple_search_ads_source.stg_apple_search_ads__ad_report_tmp _dbt_source_relation 59. model.apple_search_ads_source.stg_apple_search_ads__ad_report_tmp:f0->58. model.apple_search_ads_source.stg_apple_search_ads__ad_report:f0
58. model.apple_search_ads_source.stg_apple_search_ads__ad_report
  • Input Column: 59. model.apple_search_ads_source.stg_apple_search_ads__ad_report_tmp[_dbt_source_relation]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cleaned by casting it to TEXT type
    • Output Columns:
      • source_relation: It is directly mapped to the 'source_relation' output column after being cast to TEXT
47. model.apple_search_ads.apple_search_ads__ad_report
  • Input Column: 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history[source_relation]
    • Integration used as a key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 56. model.apple_search_ads_source.stg_apple_search_ads__ad_history[source_relation]
    • Integration used as a key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with other tables
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
  • Input Column: 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 68. model.apple_search_ads_source.stg_apple_search_ads__organization[source_relation]
    • Integration used as a key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
Column Lineage
%3 68. model.apple_search_ads_source.stg_apple_search_ads__organization 68. model.apple_search_ads_source.stg_apple_search_ads__organization organization_id 47. model.apple_search_ads.apple_search_ads__ad_report 47. model.apple_search_ads.apple_search_ads__ad_report organization_id 68. model.apple_search_ads_source.stg_apple_search_ads__organization:f0->47. model.apple_search_ads.apple_search_ads__ad_report:f0 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp id 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp:f0->68. model.apple_search_ads_source.stg_apple_search_ads__organization:f0
68. model.apple_search_ads_source.stg_apple_search_ads__organization
  • Input Column: 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp[id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT in the fields CTE
    • Output Columns:
      • organization_id: Directly mapped and renamed
47. model.apple_search_ads.apple_search_ads__ad_report
  • Input Column: 68. model.apple_search_ads_source.stg_apple_search_ads__organization[organization_id]
    • Integration used as a key to join with the ad table
    • Direct directly copied to the output
    • Output Columns:
      • organization_id: directly copied
Column Lineage
%3 68. model.apple_search_ads_source.stg_apple_search_ads__organization 68. model.apple_search_ads_source.stg_apple_search_ads__organization organization_name 47. model.apple_search_ads.apple_search_ads__ad_report 47. model.apple_search_ads.apple_search_ads__ad_report organization_name 68. model.apple_search_ads_source.stg_apple_search_ads__organization:f0->47. model.apple_search_ads.apple_search_ads__ad_report:f0 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp name 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp:f0->68. model.apple_search_ads_source.stg_apple_search_ads__organization:f0
68. model.apple_search_ads_source.stg_apple_search_ads__organization
  • Input Column: 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp[name]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • organization_name: Directly mapped and renamed
47. model.apple_search_ads.apple_search_ads__ad_report
  • Input Column: 68. model.apple_search_ads_source.stg_apple_search_ads__organization[organization_name]
    • Direct directly copied to the output
    • Output Columns:
      • organization_name: directly copied
Column Lineage
%3 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report campaign_id 47. model.apple_search_ads.apple_search_ads__ad_report 47. model.apple_search_ads.apple_search_ads__ad_report campaign_id 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report:f0->47. model.apple_search_ads.apple_search_ads__ad_report:f0 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history campaign_id 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0->47. model.apple_search_ads.apple_search_ads__ad_report:f0 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp id 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp:f0->60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0
60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history
  • Input Column: 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp[id]
    • Cleaning The column is cast to INT type
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • campaign_id: Directly mapped after casting
47. model.apple_search_ads.apple_search_ads__ad_report
  • Input Column: 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report[campaign_id]
    • Integration Used as the key to join with the campaign history table
    • Output Columns:
      • campaign_id: Directly copied to the output after joining
  • Input Column: 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history[campaign_id]
    • Integration used as the key to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
Column Lineage
%3 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history campaign_name 47. model.apple_search_ads.apple_search_ads__ad_report 47. model.apple_search_ads.apple_search_ads__ad_report campaign_name 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0->47. model.apple_search_ads.apple_search_ads__ad_report:f0 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp name 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp:f0->60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0
60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history
  • Input Column: 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp[name]
    • Cleaning The column is cast as TEXT and renamed
    • Output Columns:
      • campaign_name: Directly mapped after renaming
47. model.apple_search_ads.apple_search_ads__ad_report
  • Input Column: 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history[campaign_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_name: directly copied
Column Lineage
%3 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history ad_group_id 47. model.apple_search_ads.apple_search_ads__ad_report 47. model.apple_search_ads.apple_search_ads__ad_report ad_group_id 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history:f0->47. model.apple_search_ads.apple_search_ads__ad_report:f0 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report ad_group_id 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report:f0->47. model.apple_search_ads.apple_search_ads__ad_report:f0 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp id 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp:f0->52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history:f0
52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history
  • Input Column: 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp[id]
    • Cleaning The column is cast to INT type.
    • Deduplication Used in ROW_NUMBER() function to identify the most recent record.
    • Output Columns:
      • ad_group_id: Directly mapped after casting.
47. model.apple_search_ads.apple_search_ads__ad_report
  • Input Column: 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history[ad_group_id]
    • Integration used as a key to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_id: directly copied
  • Input Column: 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report[ad_group_id]
    • Integration Used as the key to join with the ad group history table
    • Output Columns:
      • ad_group_id: Directly copied to the output after joining
Column Lineage
%3 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history ad_group_name 47. model.apple_search_ads.apple_search_ads__ad_report 47. model.apple_search_ads.apple_search_ads__ad_report ad_group_name 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history:f0->47. model.apple_search_ads.apple_search_ads__ad_report:f0 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp name 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp:f0->52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history:f0
52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history
  • Input Column: 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • ad_group_name: Directly mapped after casting
47. model.apple_search_ads.apple_search_ads__ad_report
  • Input Column: 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history[ad_group_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_name: directly copied
Column Lineage
%3 56. model.apple_search_ads_source.stg_apple_search_ads__ad_history 56. model.apple_search_ads_source.stg_apple_search_ads__ad_history ad_id is_most_recent_record 47. model.apple_search_ads.apple_search_ads__ad_report 47. model.apple_search_ads.apple_search_ads__ad_report ad_id 56. model.apple_search_ads_source.stg_apple_search_ads__ad_history:f0->47. model.apple_search_ads.apple_search_ads__ad_report:f0 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report ad_id 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report:f0->47. model.apple_search_ads.apple_search_ads__ad_report:f0 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp id 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp:f0->56. model.apple_search_ads_source.stg_apple_search_ads__ad_history:f0 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp:f0->56. model.apple_search_ads_source.stg_apple_search_ads__ad_history:f1
56. model.apple_search_ads_source.stg_apple_search_ads__ad_history
  • Input Column: 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp[id]
    • Cleaning The column is cast as INT
    • Direct It is directly copied to the output
    • Deduplication Used in the PARTITION BY clause of ROW_NUMBER() function
    • Output Columns:
      • ad_id: Directly mapped after casting
      • is_most_recent_record: Used to determine the most recent record for each id
47. model.apple_search_ads.apple_search_ads__ad_report
  • Input Column: 56. model.apple_search_ads_source.stg_apple_search_ads__ad_history[ad_id]
    • Integration used as a key to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • ad_id: directly copied
  • Input Column: 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report[ad_id]
    • Integration Used as the key to join with the ad history table
    • Output Columns:
      • ad_id: Directly copied to the output after joining
Column Lineage
%3 56. model.apple_search_ads_source.stg_apple_search_ads__ad_history 56. model.apple_search_ads_source.stg_apple_search_ads__ad_history ad_name 47. model.apple_search_ads.apple_search_ads__ad_report 47. model.apple_search_ads.apple_search_ads__ad_report ad_name 56. model.apple_search_ads_source.stg_apple_search_ads__ad_history:f0->47. model.apple_search_ads.apple_search_ads__ad_report:f0 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp name 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp:f0->56. model.apple_search_ads_source.stg_apple_search_ads__ad_history:f0
56. model.apple_search_ads_source.stg_apple_search_ads__ad_history
  • Input Column: 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp[name]
    • Cleaning The column is cast as TEXT
    • Direct It is directly copied to the output
    • Output Columns:
      • ad_name: Directly mapped after casting
47. model.apple_search_ads.apple_search_ads__ad_report
  • Input Column: 56. model.apple_search_ads_source.stg_apple_search_ads__ad_history[ad_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_name: directly copied
Column Lineage
%3 56. model.apple_search_ads_source.stg_apple_search_ads__ad_history 56. model.apple_search_ads_source.stg_apple_search_ads__ad_history ad_status 47. model.apple_search_ads.apple_search_ads__ad_report 47. model.apple_search_ads.apple_search_ads__ad_report ad_status 56. model.apple_search_ads_source.stg_apple_search_ads__ad_history:f0->47. model.apple_search_ads.apple_search_ads__ad_report:f0 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp status 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp:f0->56. model.apple_search_ads_source.stg_apple_search_ads__ad_history:f0
56. model.apple_search_ads_source.stg_apple_search_ads__ad_history
  • Input Column: 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp[status]
    • Cleaning The column is cast as TEXT
    • Direct It is directly copied to the output
    • Output Columns:
      • ad_status: Directly mapped after casting
47. model.apple_search_ads.apple_search_ads__ad_report
  • Input Column: 56. model.apple_search_ads_source.stg_apple_search_ads__ad_history[ad_status]
    • Direct directly copied to the output
    • Output Columns:
      • ad_status: directly copied
Column Lineage
%3 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report date_day 47. model.apple_search_ads.apple_search_ads__ad_report 47. model.apple_search_ads.apple_search_ads__ad_report date_day 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report:f0->47. model.apple_search_ads.apple_search_ads__ad_report:f0
47. model.apple_search_ads.apple_search_ads__ad_report
  • Input Column: 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report currency 47. model.apple_search_ads.apple_search_ads__ad_report 47. model.apple_search_ads.apple_search_ads__ad_report currency 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report:f0->47. model.apple_search_ads.apple_search_ads__ad_report:f0
47. model.apple_search_ads.apple_search_ads__ad_report
  • Input Column: 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report[currency]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • currency: Directly copied to the output
Column Lineage
%3 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report taps 47. model.apple_search_ads.apple_search_ads__ad_report 47. model.apple_search_ads.apple_search_ads__ad_report taps 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report:f0->47. model.apple_search_ads.apple_search_ads__ad_report:f0
47. model.apple_search_ads.apple_search_ads__ad_report
  • Input Column: 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report[taps]
    • Aggregation The column is summed up in the GROUP BY clause
    • Integration The column is part of the report table which is joined with other tables
    • Output Columns:
      • taps: The sum of 'taps' is directly mapped to the output column 'taps'
Column Lineage
%3 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report new_downloads 47. model.apple_search_ads.apple_search_ads__ad_report 47. model.apple_search_ads.apple_search_ads__ad_report new_downloads total_downloads 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report:f0->47. model.apple_search_ads.apple_search_ads__ad_report:f0 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report:f0->47. model.apple_search_ads.apple_search_ads__ad_report:f1
47. model.apple_search_ads.apple_search_ads__ad_report
  • Input Column: 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report[new_downloads]
    • Aggregation Summed up in the SELECT statement
    • Other Used in calculation of total_downloads
    • Output Columns:
      • new_downloads: Aggregated sum in the output
      • total_downloads: Part of the sum calculation
Column Lineage
%3 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report redownloads 47. model.apple_search_ads.apple_search_ads__ad_report 47. model.apple_search_ads.apple_search_ads__ad_report redownloads total_downloads 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report:f0->47. model.apple_search_ads.apple_search_ads__ad_report:f0 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report:f0->47. model.apple_search_ads.apple_search_ads__ad_report:f1
47. model.apple_search_ads.apple_search_ads__ad_report
  • Input Column: 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report[redownloads]
    • Aggregation Summed up in the SELECT statement
    • Other Used in calculation of total_downloads
    • Output Columns:
      • redownloads: Aggregated sum in the output
      • total_downloads: Part of the sum calculation
Column Lineage
%3 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report new_downloads redownloads 47. model.apple_search_ads.apple_search_ads__ad_report 47. model.apple_search_ads.apple_search_ads__ad_report new_downloads redownloads total_downloads 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report:f0->47. model.apple_search_ads.apple_search_ads__ad_report:f0 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report:f0->47. model.apple_search_ads.apple_search_ads__ad_report:f2 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report:f1->47. model.apple_search_ads.apple_search_ads__ad_report:f1 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report:f1->47. model.apple_search_ads.apple_search_ads__ad_report:f2
47. model.apple_search_ads.apple_search_ads__ad_report
  • Input Column: 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report[new_downloads]
    • Aggregation Summed up in the SELECT statement
    • Other Used in calculation of total_downloads
    • Output Columns:
      • new_downloads: Aggregated sum in the output
      • total_downloads: Part of the sum calculation
  • Input Column: 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report[redownloads]
    • Aggregation Summed up in the SELECT statement
    • Other Used in calculation of total_downloads
    • Output Columns:
      • redownloads: Aggregated sum in the output
      • total_downloads: Part of the sum calculation
Column Lineage
%3 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report impressions 47. model.apple_search_ads.apple_search_ads__ad_report 47. model.apple_search_ads.apple_search_ads__ad_report impressions 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report:f0->47. model.apple_search_ads.apple_search_ads__ad_report:f0
47. model.apple_search_ads.apple_search_ads__ad_report
  • Input Column: 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report[impressions]
    • Aggregation Summed up in the SELECT statement
    • Output Columns:
      • impressions: Aggregated sum in the output
Column Lineage
%3 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report spend 47. model.apple_search_ads.apple_search_ads__ad_report 47. model.apple_search_ads.apple_search_ads__ad_report spend 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report:f0->47. model.apple_search_ads.apple_search_ads__ad_report:f0
47. model.apple_search_ads.apple_search_ads__ad_report
  • Input Column: 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report[spend]
    • Aggregation Summed up in the SELECT statement
    • Output Columns:
      • spend: Aggregated sum in the output
48. model.apple_search_ads.apple_search_ads__campaign_report

This SQL query integrates data from three tables: campaign report, campaign history, and organization. It joins these tables based on campaign_id and organization_id, filtering for the most recent campaign records. The query then aggregates data at the campaign level, calculating metrics such as taps, downloads, impressions, and spend. The result is a comprehensive campaign report with organizational details and key performance indicators.

IntegrationFilteringAggregation
SQL Query
WITH report AS (
  SELECT
    *
  FROM TEST.PUBLIC_apple_search_ads_source.stg_apple_search_ads__campaign_report
), campaign AS (
  SELECT
    *
  FROM TEST.PUBLIC_apple_search_ads_source.stg_apple_search_ads__campaign_history
  WHERE
    is_most_recent_record = TRUE
), organization AS (
  SELECT
    *
  FROM TEST.PUBLIC_apple_search_ads_source.stg_apple_search_ads__organization
), joined AS (
  SELECT
    report.source_relation,
    report.date_day,
    campaign.organization_id,
    organization.organization_name,
    campaign.campaign_id,
    campaign.campaign_name,
    report.currency,
    campaign.campaign_status,
    campaign.start_at,
    campaign.end_at,
    SUM(report.taps) AS taps,
    SUM(report.new_downloads) AS new_downloads,
    SUM(report.redownloads) AS redownloads,
    SUM(report.new_downloads + report.redownloads) AS total_downloads,
    SUM(report.impressions) AS impressions,
    SUM(report.spend) AS spend
  FROM report
  JOIN campaign
    ON report.campaign_id = campaign.campaign_id
    AND report.source_relation = campaign.source_relation
  JOIN organization
    ON campaign.organization_id = organization.organization_id
    AND campaign.source_relation = organization.source_relation
  GROUP BY
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10
)
SELECT
  *
FROM joined
%3 48. model.apple_search_ads.apple_search_ads__campaign_report 48. model.apple_search_ads.apple_search_ads__campaign_report source_relation organization_id organization_name campaign_id campaign_name campaign_status start_at end_at date_day currency taps new_downloads redownloads total_downloads impressions spend 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history source_relation campaign_id start_at end_at campaign_name organization_id campaign_status 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0->48. model.apple_search_ads.apple_search_ads__campaign_report:f0 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f1->48. model.apple_search_ads.apple_search_ads__campaign_report:f3 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f2->48. model.apple_search_ads.apple_search_ads__campaign_report:f6 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f3->48. model.apple_search_ads.apple_search_ads__campaign_report:f7 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f4->48. model.apple_search_ads.apple_search_ads__campaign_report:f4 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f5->48. model.apple_search_ads.apple_search_ads__campaign_report:f1 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f6->48. model.apple_search_ads.apple_search_ads__campaign_report:f5 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report source_relation campaign_id date_day impressions spend currency new_downloads redownloads taps 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0->48. model.apple_search_ads.apple_search_ads__campaign_report:f0 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f1->48. model.apple_search_ads.apple_search_ads__campaign_report:f3 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f2->48. model.apple_search_ads.apple_search_ads__campaign_report:f8 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f3->48. model.apple_search_ads.apple_search_ads__campaign_report:f14 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f4->48. model.apple_search_ads.apple_search_ads__campaign_report:f15 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f5->48. model.apple_search_ads.apple_search_ads__campaign_report:f9 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f6->48. model.apple_search_ads.apple_search_ads__campaign_report:f11 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f6->48. model.apple_search_ads.apple_search_ads__campaign_report:f13 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f7->48. model.apple_search_ads.apple_search_ads__campaign_report:f12 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f7->48. model.apple_search_ads.apple_search_ads__campaign_report:f13 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f8->48. model.apple_search_ads.apple_search_ads__campaign_report:f10 68. model.apple_search_ads_source.stg_apple_search_ads__organization 68. model.apple_search_ads_source.stg_apple_search_ads__organization source_relation organization_id organization_name 68. model.apple_search_ads_source.stg_apple_search_ads__organization:f0->48. model.apple_search_ads.apple_search_ads__campaign_report:f0 68. model.apple_search_ads_source.stg_apple_search_ads__organization:f1->48. model.apple_search_ads.apple_search_ads__campaign_report:f1 68. model.apple_search_ads_source.stg_apple_search_ads__organization:f2->48. model.apple_search_ads.apple_search_ads__campaign_report:f2
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
organization_id integer Organization ID associated with this record.
organization_name text Organization name associated with this record.
campaign_id integer Campaign ID associated with this record.
campaign_name text Campaign name associated with this record.
campaign_status text The status of the campaign associted with this record.
start_at timestamp without time zone The start timestamp of this campaign.
end_at timestamp without time zone The end timestamp of this campaign.
date_day date Date of the report.
currency text This currency value should match the respective organization's currency value.
taps bigint Number of taps on campaign on given day.
new_downloads bigint App downloads from new users who have never before installed app of campaign in a given day.
redownloads bigint Number of user downloads where user deletes app and downloads the same app again following a tap on an ad on the App Store, or downloads the same app to an additional device of campaign in a given day.
total_downloads bigint The sum of new_downloads and redownloads.
impressions bigint The number of impressions of campaign in a given day.
spend double precision The spend on campaign in the given day.
Column Lineage
%3 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history source_relation 48. model.apple_search_ads.apple_search_ads__campaign_report 48. model.apple_search_ads.apple_search_ads__campaign_report source_relation 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0->48. model.apple_search_ads.apple_search_ads__campaign_report:f0 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report source_relation 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0->48. model.apple_search_ads.apple_search_ads__campaign_report:f0 68. model.apple_search_ads_source.stg_apple_search_ads__organization 68. model.apple_search_ads_source.stg_apple_search_ads__organization source_relation 68. model.apple_search_ads_source.stg_apple_search_ads__organization:f0->48. model.apple_search_ads.apple_search_ads__campaign_report:f0
48. model.apple_search_ads.apple_search_ads__campaign_report
  • Input Column: 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with other tables
    • Output Columns:
      • source_relation: Directly copied to output
  • Input Column: 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with campaign and organization tables
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
  • Input Column: 68. model.apple_search_ads_source.stg_apple_search_ads__organization[source_relation]
    • Integration used as part of the join condition with campaign table
    • Output Columns:
      • source_relation: directly copied to output
Column Lineage
%3 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history organization_id 48. model.apple_search_ads.apple_search_ads__campaign_report 48. model.apple_search_ads.apple_search_ads__campaign_report organization_id 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0->48. model.apple_search_ads.apple_search_ads__campaign_report:f0 68. model.apple_search_ads_source.stg_apple_search_ads__organization 68. model.apple_search_ads_source.stg_apple_search_ads__organization organization_id 68. model.apple_search_ads_source.stg_apple_search_ads__organization:f0->48. model.apple_search_ads.apple_search_ads__campaign_report:f0 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp organiation_id 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp:f0->60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp id 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp:f0->68. model.apple_search_ads_source.stg_apple_search_ads__organization:f0
60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history
  • Input Column: 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp[organiation_id]
    • Cleaning The column is cast as INT
    • Output Columns:
      • organization_id: Directly mapped
68. model.apple_search_ads_source.stg_apple_search_ads__organization
  • Input Column: 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp[id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT in the fields CTE
    • Output Columns:
      • organization_id: Directly mapped and renamed
48. model.apple_search_ads.apple_search_ads__campaign_report
  • Input Column: 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history[organization_id]
    • Integration Used as a key to join with the organization table
    • Direct Directly copied to the output
    • Output Columns:
      • organization_id: Directly copied to output
  • Input Column: 68. model.apple_search_ads_source.stg_apple_search_ads__organization[organization_id]
    • Integration used as part of the join condition with campaign table
    • Output Columns:
      • organization_id: directly copied to output
Column Lineage
%3 68. model.apple_search_ads_source.stg_apple_search_ads__organization 68. model.apple_search_ads_source.stg_apple_search_ads__organization organization_name 48. model.apple_search_ads.apple_search_ads__campaign_report 48. model.apple_search_ads.apple_search_ads__campaign_report organization_name 68. model.apple_search_ads_source.stg_apple_search_ads__organization:f0->48. model.apple_search_ads.apple_search_ads__campaign_report:f0 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp name 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp:f0->68. model.apple_search_ads_source.stg_apple_search_ads__organization:f0
68. model.apple_search_ads_source.stg_apple_search_ads__organization
  • Input Column: 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp[name]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • organization_name: Directly mapped and renamed
48. model.apple_search_ads.apple_search_ads__campaign_report
  • Input Column: 68. model.apple_search_ads_source.stg_apple_search_ads__organization[organization_name]
    • Direct directly selected in the final output
    • Output Columns:
      • organization_name: directly copied to output
Column Lineage
%3 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history campaign_id 48. model.apple_search_ads.apple_search_ads__campaign_report 48. model.apple_search_ads.apple_search_ads__campaign_report campaign_id 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0->48. model.apple_search_ads.apple_search_ads__campaign_report:f0 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report campaign_id 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0->48. model.apple_search_ads.apple_search_ads__campaign_report:f0 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp id 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp:f0->60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp id 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp:f0->62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0
60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history
  • Input Column: 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp[id]
    • Cleaning The column is cast to INT type
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • campaign_id: Directly mapped after casting
62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report
  • Input Column: 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp[id]
    • Direct The id column is directly copied without transformation
    • Output Columns:
      • campaign_id: Directly mapped to campaign_id in the output
48. model.apple_search_ads.apple_search_ads__campaign_report
  • Input Column: 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history[campaign_id]
    • Integration Used as a key to join with the campaign report table
    • Direct Directly copied to the output
    • Output Columns:
      • campaign_id: Directly copied to output
  • Input Column: 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report[campaign_id]
    • Integration Used as the key to join with the campaign table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • campaign_id: Directly copied to the output
Column Lineage
%3 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history campaign_name 48. model.apple_search_ads.apple_search_ads__campaign_report 48. model.apple_search_ads.apple_search_ads__campaign_report campaign_name 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0->48. model.apple_search_ads.apple_search_ads__campaign_report:f0 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp name 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp:f0->60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0
60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history
  • Input Column: 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp[name]
    • Cleaning The column is cast as TEXT and renamed
    • Output Columns:
      • campaign_name: Directly mapped after renaming
48. model.apple_search_ads.apple_search_ads__campaign_report
  • Input Column: 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history[campaign_name]
    • Direct Directly copied to the output
    • Output Columns:
      • campaign_name: Directly copied to output
Column Lineage
%3 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history campaign_status 48. model.apple_search_ads.apple_search_ads__campaign_report 48. model.apple_search_ads.apple_search_ads__campaign_report campaign_status 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0->48. model.apple_search_ads.apple_search_ads__campaign_report:f0 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp status 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp:f0->60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0
60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history
  • Input Column: 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp[status]
    • Direct The status column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the 'fields' CTE
    • Output Columns:
      • campaign_status: The 'status' column is directly mapped to 'campaign_status' in the final output
48. model.apple_search_ads.apple_search_ads__campaign_report
  • Input Column: 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history[campaign_status]
    • Direct Directly copied to the output
    • Output Columns:
      • campaign_status: Directly copied to output
Column Lineage
%3 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history start_at 48. model.apple_search_ads.apple_search_ads__campaign_report 48. model.apple_search_ads.apple_search_ads__campaign_report start_at 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0->48. model.apple_search_ads.apple_search_ads__campaign_report:f0 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp start_time 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp:f0->60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0
60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history
  • Input Column: 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp[start_time]
    • Cleaning The column is cast as TIMESTAMP
    • Output Columns:
      • start_at: Directly mapped after renaming
48. model.apple_search_ads.apple_search_ads__campaign_report
  • Input Column: 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history[start_at]
    • Direct Directly copied to the output
    • Output Columns:
      • start_at: Directly copied to output
Column Lineage
%3 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history end_at 48. model.apple_search_ads.apple_search_ads__campaign_report 48. model.apple_search_ads.apple_search_ads__campaign_report end_at 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0->48. model.apple_search_ads.apple_search_ads__campaign_report:f0 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp end_time 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp:f0->60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0
60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history
  • Input Column: 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp[end_time]
    • Cleaning The column is cast to TIMESTAMP type
    • Output Columns:
      • end_at: Directly mapped after casting
48. model.apple_search_ads.apple_search_ads__campaign_report
  • Input Column: 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history[end_at]
    • Direct Directly copied to the output
    • Output Columns:
      • end_at: Directly copied to output
Column Lineage
%3 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report date_day 48. model.apple_search_ads.apple_search_ads__campaign_report 48. model.apple_search_ads.apple_search_ads__campaign_report date_day 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0->48. model.apple_search_ads.apple_search_ads__campaign_report:f0 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp date 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp:f0->62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0
62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report
  • Input Column: 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp[date]
    • Direct The date column is directly copied without transformation
    • Output Columns:
      • date_day: Directly mapped to date_day in the output
48. model.apple_search_ads.apple_search_ads__campaign_report
  • Input Column: 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report currency 48. model.apple_search_ads.apple_search_ads__campaign_report 48. model.apple_search_ads.apple_search_ads__campaign_report currency 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0->48. model.apple_search_ads.apple_search_ads__campaign_report:f0 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp local_spend_currency 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp:f0->62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0
62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report
  • Input Column: 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp[local_spend_currency]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • currency: Directly mapped
48. model.apple_search_ads.apple_search_ads__campaign_report
  • Input Column: 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report[currency]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • currency: Directly copied to the output
Column Lineage
%3 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report taps 48. model.apple_search_ads.apple_search_ads__campaign_report 48. model.apple_search_ads.apple_search_ads__campaign_report taps 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0->48. model.apple_search_ads.apple_search_ads__campaign_report:f0 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp taps 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp:f0->62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0
62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report
  • Input Column: 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp[taps]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT
    • Output Columns:
      • taps: Directly mapped after casting
48. model.apple_search_ads.apple_search_ads__campaign_report
  • Input Column: 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report[taps]
    • Aggregation Summed up in the SELECT statement
    • Output Columns:
      • taps: Aggregated sum in the output
Column Lineage
%3 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report new_downloads 48. model.apple_search_ads.apple_search_ads__campaign_report 48. model.apple_search_ads.apple_search_ads__campaign_report new_downloads total_downloads 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0->48. model.apple_search_ads.apple_search_ads__campaign_report:f0 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0->48. model.apple_search_ads.apple_search_ads__campaign_report:f1 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp new_downloads 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp:f0->62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0
62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report
  • Input Column: 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp[new_downloads]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT
    • Output Columns:
      • new_downloads: Directly mapped after casting
48. model.apple_search_ads.apple_search_ads__campaign_report
  • Input Column: 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report[new_downloads]
    • Aggregation Summed up in the SELECT statement
    • Other Used in calculation of total_downloads
    • Output Columns:
      • new_downloads: Aggregated sum in the output
      • total_downloads: Part of the sum for this calculated field
Column Lineage
%3 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report redownloads 48. model.apple_search_ads.apple_search_ads__campaign_report 48. model.apple_search_ads.apple_search_ads__campaign_report redownloads total_downloads 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0->48. model.apple_search_ads.apple_search_ads__campaign_report:f0 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0->48. model.apple_search_ads.apple_search_ads__campaign_report:f1 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp redownloads 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp:f0->62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0
62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report
  • Input Column: 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp[redownloads]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT
    • Output Columns:
      • redownloads: Directly mapped after casting
48. model.apple_search_ads.apple_search_ads__campaign_report
  • Input Column: 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report[redownloads]
    • Aggregation Summed up in the SELECT statement
    • Other Used in calculation of total_downloads
    • Output Columns:
      • redownloads: Aggregated sum in the output
      • total_downloads: Part of the sum for this calculated field
Column Lineage
%3 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report new_downloads redownloads 48. model.apple_search_ads.apple_search_ads__campaign_report 48. model.apple_search_ads.apple_search_ads__campaign_report new_downloads redownloads total_downloads 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0->48. model.apple_search_ads.apple_search_ads__campaign_report:f0 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0->48. model.apple_search_ads.apple_search_ads__campaign_report:f2 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f1->48. model.apple_search_ads.apple_search_ads__campaign_report:f1 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f1->48. model.apple_search_ads.apple_search_ads__campaign_report:f2 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp new_downloads redownloads 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp:f0->62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp:f1->62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f1
62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report
  • Input Column: 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp[new_downloads]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT
    • Output Columns:
      • new_downloads: Directly mapped after casting
  • Input Column: 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp[redownloads]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT
    • Output Columns:
      • redownloads: Directly mapped after casting
48. model.apple_search_ads.apple_search_ads__campaign_report
  • Input Column: 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report[new_downloads]
    • Aggregation Summed up in the SELECT statement
    • Other Used in calculation of total_downloads
    • Output Columns:
      • new_downloads: Aggregated sum in the output
      • total_downloads: Part of the sum for this calculated field
  • Input Column: 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report[redownloads]
    • Aggregation Summed up in the SELECT statement
    • Other Used in calculation of total_downloads
    • Output Columns:
      • redownloads: Aggregated sum in the output
      • total_downloads: Part of the sum for this calculated field
Column Lineage
%3 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report impressions 48. model.apple_search_ads.apple_search_ads__campaign_report 48. model.apple_search_ads.apple_search_ads__campaign_report impressions 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0->48. model.apple_search_ads.apple_search_ads__campaign_report:f0 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp impressions 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp:f0->62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0
62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report
  • Input Column: 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp[impressions]
    • Direct The impressions column is directly copied without transformation
    • Output Columns:
      • impressions: Directly mapped to impressions in the output
48. model.apple_search_ads.apple_search_ads__campaign_report
  • Input Column: 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report[impressions]
    • Aggregation Summed up in the SELECT statement
    • Output Columns:
      • impressions: Aggregated sum in the output
Column Lineage
%3 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report spend 48. model.apple_search_ads.apple_search_ads__campaign_report 48. model.apple_search_ads.apple_search_ads__campaign_report spend 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0->48. model.apple_search_ads.apple_search_ads__campaign_report:f0 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp local_spend_amount 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp:f0->62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0
62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report
  • Input Column: 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp[local_spend_amount]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as DECIMAL(28, 6)
    • Output Columns:
      • spend: Directly mapped after casting
48. model.apple_search_ads.apple_search_ads__campaign_report
  • Input Column: 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report[spend]
    • Aggregation Summed up in the SELECT statement
    • Output Columns:
      • spend: Aggregated sum in the output
49. model.apple_search_ads.apple_search_ads__keyword_report

This SQL query joins multiple staging tables (keyword report, keyword history, ad group history, campaign history, and organization) to create a comprehensive report on Apple Search Ads performance. It filters for the most recent records in history tables, integrates data across different levels (organization, campaign, ad group, keyword), and aggregates metrics such as taps, downloads, impressions, and spend. The result is a detailed view of keyword performance within the context of ad groups, campaigns, and organizations.

FilteringIntegrationAggregation
SQL Query
WITH report AS (
  SELECT
    *
  FROM TEST.PUBLIC_apple_search_ads_source.stg_apple_search_ads__keyword_report
), keyword AS (
  SELECT
    *
  FROM TEST.PUBLIC_apple_search_ads_source.stg_apple_search_ads__keyword_history
  WHERE
    is_most_recent_record = TRUE
), ad_group AS (
  SELECT
    *
  FROM TEST.PUBLIC_apple_search_ads_source.stg_apple_search_ads__ad_group_history
  WHERE
    is_most_recent_record = TRUE
), campaign AS (
  SELECT
    *
  FROM TEST.PUBLIC_apple_search_ads_source.stg_apple_search_ads__campaign_history
  WHERE
    is_most_recent_record = TRUE
), organization AS (
  SELECT
    *
  FROM TEST.PUBLIC_apple_search_ads_source.stg_apple_search_ads__organization
), joined AS (
  SELECT
    report.source_relation,
    report.date_day,
    organization.organization_id,
    organization.organization_name,
    campaign.campaign_id,
    campaign.campaign_name,
    ad_group.ad_group_id,
    ad_group.ad_group_name,
    keyword.keyword_id,
    keyword.keyword_text,
    keyword.match_type,
    report.currency,
    keyword.keyword_status,
    SUM(report.taps) AS taps,
    SUM(report.new_downloads) AS new_downloads,
    SUM(report.redownloads) AS redownloads,
    SUM(report.new_downloads + report.redownloads) AS total_downloads,
    SUM(report.impressions) AS impressions,
    SUM(report.spend) AS spend
  FROM report
  JOIN keyword
    ON report.keyword_id = keyword.keyword_id
    AND report.source_relation = keyword.source_relation
  JOIN ad_group
    ON keyword.ad_group_id = ad_group.ad_group_id
    AND keyword.source_relation = ad_group.source_relation
  JOIN campaign
    ON ad_group.campaign_id = campaign.campaign_id
    AND ad_group.source_relation = campaign.source_relation
  JOIN organization
    ON ad_group.organization_id = organization.organization_id
    AND ad_group.source_relation = organization.source_relation
  GROUP BY
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10,
    11,
    12,
    13
)
SELECT
  *
FROM joined
%3 49. model.apple_search_ads.apple_search_ads__keyword_report 49. model.apple_search_ads.apple_search_ads__keyword_report source_relation organization_id organization_name campaign_id campaign_name ad_group_id ad_group_name keyword_id keyword_text match_type date_day currency keyword_status taps new_downloads redownloads total_downloads impressions spend 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history source_relation ad_group_id ad_group_name 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history:f0->49. model.apple_search_ads.apple_search_ads__keyword_report:f0 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history:f1->49. model.apple_search_ads.apple_search_ads__keyword_report:f5 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history:f2->49. model.apple_search_ads.apple_search_ads__keyword_report:f6 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history source_relation campaign_id campaign_name 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0->49. model.apple_search_ads.apple_search_ads__keyword_report:f0 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f1->49. model.apple_search_ads.apple_search_ads__keyword_report:f3 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f2->49. model.apple_search_ads.apple_search_ads__keyword_report:f4 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history source_relation keyword_id match_type status keyword_text keyword_status 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history:f0->49. model.apple_search_ads.apple_search_ads__keyword_report:f0 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history:f1->49. model.apple_search_ads.apple_search_ads__keyword_report:f7 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history:f2->49. model.apple_search_ads.apple_search_ads__keyword_report:f9 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history:f3->49. model.apple_search_ads.apple_search_ads__keyword_report:f12 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history:f4->49. model.apple_search_ads.apple_search_ads__keyword_report:f8 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history:f5->49. model.apple_search_ads.apple_search_ads__keyword_report:f12 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report source_relation keyword_id date_day impressions spend currency new_downloads redownloads taps 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report:f0->49. model.apple_search_ads.apple_search_ads__keyword_report:f0 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report:f1->49. model.apple_search_ads.apple_search_ads__keyword_report:f7 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report:f2->49. model.apple_search_ads.apple_search_ads__keyword_report:f10 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report:f3->49. model.apple_search_ads.apple_search_ads__keyword_report:f17 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report:f4->49. model.apple_search_ads.apple_search_ads__keyword_report:f18 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report:f5->49. model.apple_search_ads.apple_search_ads__keyword_report:f11 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report:f6->49. model.apple_search_ads.apple_search_ads__keyword_report:f14 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report:f6->49. model.apple_search_ads.apple_search_ads__keyword_report:f16 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report:f7->49. model.apple_search_ads.apple_search_ads__keyword_report:f15 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report:f7->49. model.apple_search_ads.apple_search_ads__keyword_report:f16 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report:f8->49. model.apple_search_ads.apple_search_ads__keyword_report:f13 68. model.apple_search_ads_source.stg_apple_search_ads__organization 68. model.apple_search_ads_source.stg_apple_search_ads__organization source_relation organization_id organization_name 68. model.apple_search_ads_source.stg_apple_search_ads__organization:f0->49. model.apple_search_ads.apple_search_ads__keyword_report:f0 68. model.apple_search_ads_source.stg_apple_search_ads__organization:f1->49. model.apple_search_ads.apple_search_ads__keyword_report:f1 68. model.apple_search_ads_source.stg_apple_search_ads__organization:f2->49. model.apple_search_ads.apple_search_ads__keyword_report:f2
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
organization_id integer Organization ID associated with this record.
organization_name text Organization name associated with this record.
campaign_id integer Campaign ID associated with this record.
campaign_name text Campaign name associated with this record.
ad_group_id integer Ad group ID associated with this record.
ad_group_name text Ad group name associated with this record.
keyword_id integer Creative set name associatd with this record.
keyword_text text Creative set ID associated with this record.
match_type text Controls how ads are matched to user searches; EXACT or BROAD.
date_day date Date of the report.
currency text This currency value should match the respective organization's currency value.
keyword_status text The status of the keyword associated with this record.
taps bigint Number of taps on keyword on given day.
new_downloads bigint App downloads from new users who have never before installed app of keyword in a given day.
redownloads bigint Number of user downloads where user deletes app and downloads the same app again following a tap on an ad on the App Store, or downloads the same app to an additional device of keyword in a given day.
total_downloads bigint The sum of new_downloads and redownloads.
impressions bigint The number of impressions of keyword in a given day.
spend double precision The spend on keyword in the given day.
Column Lineage
%3 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history source_relation 49. model.apple_search_ads.apple_search_ads__keyword_report 49. model.apple_search_ads.apple_search_ads__keyword_report source_relation 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history:f0->49. model.apple_search_ads.apple_search_ads__keyword_report:f0 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history source_relation 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0->49. model.apple_search_ads.apple_search_ads__keyword_report:f0 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history source_relation 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history:f0->49. model.apple_search_ads.apple_search_ads__keyword_report:f0 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report source_relation 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report:f0->49. model.apple_search_ads.apple_search_ads__keyword_report:f0 68. model.apple_search_ads_source.stg_apple_search_ads__organization 68. model.apple_search_ads_source.stg_apple_search_ads__organization source_relation 68. model.apple_search_ads_source.stg_apple_search_ads__organization:f0->49. model.apple_search_ads.apple_search_ads__keyword_report:f0
49. model.apple_search_ads.apple_search_ads__keyword_report
  • Input Column: 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history[source_relation]
    • Integration used to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history[source_relation]
    • Integration used as part of the join condition
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history[source_relation]
    • Integration used as a key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with other tables
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
  • Input Column: 68. model.apple_search_ads_source.stg_apple_search_ads__organization[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
Column Lineage
%3 68. model.apple_search_ads_source.stg_apple_search_ads__organization 68. model.apple_search_ads_source.stg_apple_search_ads__organization organization_id 49. model.apple_search_ads.apple_search_ads__keyword_report 49. model.apple_search_ads.apple_search_ads__keyword_report organization_id 68. model.apple_search_ads_source.stg_apple_search_ads__organization:f0->49. model.apple_search_ads.apple_search_ads__keyword_report:f0 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp id 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp:f0->68. model.apple_search_ads_source.stg_apple_search_ads__organization:f0
68. model.apple_search_ads_source.stg_apple_search_ads__organization
  • Input Column: 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp[id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT in the fields CTE
    • Output Columns:
      • organization_id: Directly mapped and renamed
49. model.apple_search_ads.apple_search_ads__keyword_report
  • Input Column: 68. model.apple_search_ads_source.stg_apple_search_ads__organization[organization_id]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • organization_id: directly copied
Column Lineage
%3 68. model.apple_search_ads_source.stg_apple_search_ads__organization 68. model.apple_search_ads_source.stg_apple_search_ads__organization organization_name 49. model.apple_search_ads.apple_search_ads__keyword_report 49. model.apple_search_ads.apple_search_ads__keyword_report organization_name 68. model.apple_search_ads_source.stg_apple_search_ads__organization:f0->49. model.apple_search_ads.apple_search_ads__keyword_report:f0 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp name 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp:f0->68. model.apple_search_ads_source.stg_apple_search_ads__organization:f0
68. model.apple_search_ads_source.stg_apple_search_ads__organization
  • Input Column: 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp[name]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • organization_name: Directly mapped and renamed
49. model.apple_search_ads.apple_search_ads__keyword_report
  • Input Column: 68. model.apple_search_ads_source.stg_apple_search_ads__organization[organization_name]
    • Direct directly copied to the output
    • Output Columns:
      • organization_name: directly copied
Column Lineage
%3 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history campaign_id 49. model.apple_search_ads.apple_search_ads__keyword_report 49. model.apple_search_ads.apple_search_ads__keyword_report campaign_id 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0->49. model.apple_search_ads.apple_search_ads__keyword_report:f0 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp id 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp:f0->60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0
60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history
  • Input Column: 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp[id]
    • Cleaning The column is cast to INT type
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • campaign_id: Directly mapped after casting
49. model.apple_search_ads.apple_search_ads__keyword_report
  • Input Column: 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history[campaign_id]
    • Integration used as a join key to connect with other tables
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
Column Lineage
%3 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history campaign_name 49. model.apple_search_ads.apple_search_ads__keyword_report 49. model.apple_search_ads.apple_search_ads__keyword_report campaign_name 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0->49. model.apple_search_ads.apple_search_ads__keyword_report:f0 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp name 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp:f0->60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0
60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history
  • Input Column: 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp[name]
    • Cleaning The column is cast as TEXT and renamed
    • Output Columns:
      • campaign_name: Directly mapped after renaming
49. model.apple_search_ads.apple_search_ads__keyword_report
  • Input Column: 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history[campaign_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_name: directly copied
Column Lineage
%3 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history ad_group_id 49. model.apple_search_ads.apple_search_ads__keyword_report 49. model.apple_search_ads.apple_search_ads__keyword_report ad_group_id 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history:f0->49. model.apple_search_ads.apple_search_ads__keyword_report:f0 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp id 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp:f0->52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history:f0
52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history
  • Input Column: 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp[id]
    • Cleaning The column is cast to INT type.
    • Deduplication Used in ROW_NUMBER() function to identify the most recent record.
    • Output Columns:
      • ad_group_id: Directly mapped after casting.
49. model.apple_search_ads.apple_search_ads__keyword_report
  • Input Column: 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history[ad_group_id]
    • Integration used to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_id: directly copied
Column Lineage
%3 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history ad_group_name 49. model.apple_search_ads.apple_search_ads__keyword_report 49. model.apple_search_ads.apple_search_ads__keyword_report ad_group_name 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history:f0->49. model.apple_search_ads.apple_search_ads__keyword_report:f0 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp name 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp:f0->52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history:f0
52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history
  • Input Column: 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • ad_group_name: Directly mapped after casting
49. model.apple_search_ads.apple_search_ads__keyword_report
  • Input Column: 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history[ad_group_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_name: directly copied
Column Lineage
%3 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history keyword_id 49. model.apple_search_ads.apple_search_ads__keyword_report 49. model.apple_search_ads.apple_search_ads__keyword_report keyword_id 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history:f0->49. model.apple_search_ads.apple_search_ads__keyword_report:f0 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report keyword_id 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report:f0->49. model.apple_search_ads.apple_search_ads__keyword_report:f0 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp id 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp:f0->64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history:f0 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp id 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp:f0->66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report:f0
64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history
  • Input Column: 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp[id]
    • Direct The column is directly copied without transformation
    • Deduplication Used in the ROW_NUMBER() window function to identify the most recent record
    • Output Columns:
      • keyword_id: Directly mapped
66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report
  • Input Column: 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp[id]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as INT type
    • Output Columns:
      • keyword_id: Directly mapped after casting
49. model.apple_search_ads.apple_search_ads__keyword_report
  • Input Column: 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history[keyword_id]
    • Integration used as a key to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • keyword_id: directly copied
  • Input Column: 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report[keyword_id]
    • Integration Used as the key to join with the keyword history table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • keyword_id: Indirectly mapped, as it's used to join with keyword history table
Column Lineage
%3 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history keyword_text 49. model.apple_search_ads.apple_search_ads__keyword_report 49. model.apple_search_ads.apple_search_ads__keyword_report keyword_text 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history:f0->49. model.apple_search_ads.apple_search_ads__keyword_report:f0 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp text 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp:f0->64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history:f0
64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history
  • Input Column: 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp[text]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • keyword_text: Directly mapped
49. model.apple_search_ads.apple_search_ads__keyword_report
  • Input Column: 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history[keyword_text]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition to link keyword data with other tables
    • Output Columns:
      • keyword_text: It is directly mapped to the output column 'keyword_text'
Column Lineage
%3 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history match_type 49. model.apple_search_ads.apple_search_ads__keyword_report 49. model.apple_search_ads.apple_search_ads__keyword_report match_type 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history:f0->49. model.apple_search_ads.apple_search_ads__keyword_report:f0 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp match_type 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp:f0->64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history:f0
64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history
  • Input Column: 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp[match_type]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • match_type: Directly mapped
49. model.apple_search_ads.apple_search_ads__keyword_report
  • Input Column: 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history[match_type]
    • Direct directly copied to the output
    • Output Columns:
      • match_type: directly copied
Column Lineage
%3 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report date_day 49. model.apple_search_ads.apple_search_ads__keyword_report 49. model.apple_search_ads.apple_search_ads__keyword_report date_day 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report:f0->49. model.apple_search_ads.apple_search_ads__keyword_report:f0 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp date 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp:f0->66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report:f0
66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report
  • Input Column: 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp[date]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as DATE type
    • Output Columns:
      • date_day: Directly mapped after casting
49. model.apple_search_ads.apple_search_ads__keyword_report
  • Input Column: 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report currency 49. model.apple_search_ads.apple_search_ads__keyword_report 49. model.apple_search_ads.apple_search_ads__keyword_report currency 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report:f0->49. model.apple_search_ads.apple_search_ads__keyword_report:f0 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp local_spend_currency 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp:f0->66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report:f0
66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report
  • Input Column: 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp[local_spend_currency]
    • Cleaning The column is cast as TEXT in the fields CTE
    • Direct The column is directly copied to the final output
    • Output Columns:
      • currency: Directly mapped after renaming
49. model.apple_search_ads.apple_search_ads__keyword_report
  • Input Column: 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report[currency]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • currency: Directly copied to the output
Column Lineage
%3 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history keyword_status status 49. model.apple_search_ads.apple_search_ads__keyword_report 49. model.apple_search_ads.apple_search_ads__keyword_report keyword_status 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history:f1->49. model.apple_search_ads.apple_search_ads__keyword_report:f0 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history:f0->49. model.apple_search_ads.apple_search_ads__keyword_report:f0 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp status 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp:f0->64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history:f0
64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history
  • Input Column: 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp[status]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • keyword_status: Directly mapped
49. model.apple_search_ads.apple_search_ads__keyword_report
  • Input Column: 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history[status]
    • Direct directly copied to the output
    • Cleaning possibly renamed from 'status' to 'keyword_status'
    • Output Columns:
      • keyword_status: directly copied and possibly renamed
  • Input Column: 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history[keyword_status]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition to link keyword data with other tables
    • Output Columns:
      • keyword_status: It is directly mapped to the output column 'keyword_status'
Column Lineage
%3 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report taps 49. model.apple_search_ads.apple_search_ads__keyword_report 49. model.apple_search_ads.apple_search_ads__keyword_report taps 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report:f0->49. model.apple_search_ads.apple_search_ads__keyword_report:f0 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp taps 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp:f0->66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report:f0
66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report
  • Input Column: 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp[taps]
    • Cleaning The column is cast as INT in the fields CTE
    • Direct The column is directly copied to the final output
    • Output Columns:
      • taps: Directly mapped without renaming
49. model.apple_search_ads.apple_search_ads__keyword_report
  • Input Column: 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report[taps]
    • Aggregation The column is summed up in the SELECT statement
    • Output Columns:
      • taps: Aggregated sum in the output
Column Lineage
%3 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report new_downloads 49. model.apple_search_ads.apple_search_ads__keyword_report 49. model.apple_search_ads.apple_search_ads__keyword_report new_downloads total_downloads 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report:f0->49. model.apple_search_ads.apple_search_ads__keyword_report:f0 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report:f0->49. model.apple_search_ads.apple_search_ads__keyword_report:f1 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp new_downloads 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp:f0->66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report:f0
66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report
  • Input Column: 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp[new_downloads]
    • Cleaning The column is cast as INT in the fields CTE
    • Direct The column is directly copied to the final output
    • Output Columns:
      • new_downloads: Directly mapped without renaming
49. model.apple_search_ads.apple_search_ads__keyword_report
  • Input Column: 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report[new_downloads]
    • Aggregation The column is summed up in the SELECT statement
    • Featurization Used to calculate total_downloads
    • Output Columns:
      • new_downloads: Aggregated sum in the output
      • total_downloads: Part of the sum for this derived column
Column Lineage
%3 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report redownloads 49. model.apple_search_ads.apple_search_ads__keyword_report 49. model.apple_search_ads.apple_search_ads__keyword_report redownloads total_downloads 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report:f0->49. model.apple_search_ads.apple_search_ads__keyword_report:f0 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report:f0->49. model.apple_search_ads.apple_search_ads__keyword_report:f1 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp redownloads 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp:f0->66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report:f0
66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report
  • Input Column: 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp[redownloads]
    • Cleaning The column is cast as INT in the fields CTE
    • Direct The column is directly copied to the final output
    • Output Columns:
      • redownloads: Directly mapped without renaming
49. model.apple_search_ads.apple_search_ads__keyword_report
  • Input Column: 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report[redownloads]
    • Aggregation The column is summed up in the SELECT statement
    • Featurization Used to calculate total_downloads
    • Output Columns:
      • redownloads: Aggregated sum in the output
      • total_downloads: Part of the sum for this derived column
Column Lineage
%3 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report new_downloads redownloads 49. model.apple_search_ads.apple_search_ads__keyword_report 49. model.apple_search_ads.apple_search_ads__keyword_report new_downloads redownloads total_downloads 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report:f0->49. model.apple_search_ads.apple_search_ads__keyword_report:f0 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report:f0->49. model.apple_search_ads.apple_search_ads__keyword_report:f2 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report:f1->49. model.apple_search_ads.apple_search_ads__keyword_report:f1 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report:f1->49. model.apple_search_ads.apple_search_ads__keyword_report:f2 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp new_downloads redownloads 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp:f0->66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report:f0 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp:f1->66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report:f1
66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report
  • Input Column: 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp[new_downloads]
    • Cleaning The column is cast as INT in the fields CTE
    • Direct The column is directly copied to the final output
    • Output Columns:
      • new_downloads: Directly mapped without renaming
  • Input Column: 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp[redownloads]
    • Cleaning The column is cast as INT in the fields CTE
    • Direct The column is directly copied to the final output
    • Output Columns:
      • redownloads: Directly mapped without renaming
49. model.apple_search_ads.apple_search_ads__keyword_report
  • Input Column: 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report[new_downloads]
    • Aggregation The column is summed up in the SELECT statement
    • Featurization Used to calculate total_downloads
    • Output Columns:
      • new_downloads: Aggregated sum in the output
      • total_downloads: Part of the sum for this derived column
  • Input Column: 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report[redownloads]
    • Aggregation The column is summed up in the SELECT statement
    • Featurization Used to calculate total_downloads
    • Output Columns:
      • redownloads: Aggregated sum in the output
      • total_downloads: Part of the sum for this derived column
Column Lineage
%3 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report impressions 49. model.apple_search_ads.apple_search_ads__keyword_report 49. model.apple_search_ads.apple_search_ads__keyword_report impressions 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report:f0->49. model.apple_search_ads.apple_search_ads__keyword_report:f0 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp impressions 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp:f0->66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report:f0
66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report
  • Input Column: 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp[impressions]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as INT type
    • Output Columns:
      • impressions: Directly mapped after casting
49. model.apple_search_ads.apple_search_ads__keyword_report
  • Input Column: 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report[impressions]
    • Aggregation The column is summed up in the SELECT statement
    • Output Columns:
      • impressions: Aggregated sum in the output
Column Lineage
%3 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report spend 49. model.apple_search_ads.apple_search_ads__keyword_report 49. model.apple_search_ads.apple_search_ads__keyword_report spend 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report:f0->49. model.apple_search_ads.apple_search_ads__keyword_report:f0 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp local_spend_amount 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp:f0->66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report:f0
66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report
  • Input Column: 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp[local_spend_amount]
    • Cleaning The column is cast as DECIMAL(28, 6) in the fields CTE
    • Direct The column is directly copied to the final output
    • Output Columns:
      • spend: Directly mapped after renaming
49. model.apple_search_ads.apple_search_ads__keyword_report
  • Input Column: 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report[spend]
    • Aggregation The column is summed up in the SELECT statement
    • Output Columns:
      • spend: Aggregated sum in the output
50. model.apple_search_ads.apple_search_ads__organization_report

This query integrates data from three sources: campaign reports, campaign history, and organization information. It joins these tables, filters for the most recent campaign records, and then aggregates various metrics (taps, downloads, impressions, and spend) at the organization level, grouped by date and organization details.

IntegrationFilteringAggregation
SQL Query
WITH report AS (
  SELECT
    *
  FROM TEST.PUBLIC_apple_search_ads_source.stg_apple_search_ads__campaign_report
), campaign AS (
  SELECT
    *
  FROM TEST.PUBLIC_apple_search_ads_source.stg_apple_search_ads__campaign_history
  WHERE
    is_most_recent_record = TRUE
), organization AS (
  SELECT
    *
  FROM TEST.PUBLIC_apple_search_ads_source.stg_apple_search_ads__organization
), joined AS (
  SELECT
    report.source_relation,
    report.date_day,
    organization.organization_id,
    organization.organization_name,
    organization.currency,
    SUM(report.taps) AS taps,
    SUM(report.new_downloads) AS new_downloads,
    SUM(report.redownloads) AS redownloads,
    SUM(report.new_downloads + report.redownloads) AS total_downloads,
    SUM(report.impressions) AS impressions,
    SUM(report.spend) AS spend
  FROM report
  JOIN campaign
    ON report.campaign_id = campaign.campaign_id
    AND report.source_relation = campaign.source_relation
  JOIN organization
    ON campaign.organization_id = organization.organization_id
    AND campaign.source_relation = organization.source_relation
  GROUP BY
    1,
    2,
    3,
    4,
    5
)
SELECT
  *
FROM joined
%3 50. model.apple_search_ads.apple_search_ads__organization_report 50. model.apple_search_ads.apple_search_ads__organization_report source_relation organization_id organization_name date_day currency taps new_downloads redownloads total_downloads impressions spend 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history source_relation 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0->50. model.apple_search_ads.apple_search_ads__organization_report:f0 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report source_relation date_day impressions spend new_downloads redownloads taps 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0->50. model.apple_search_ads.apple_search_ads__organization_report:f0 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f1->50. model.apple_search_ads.apple_search_ads__organization_report:f3 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f2->50. model.apple_search_ads.apple_search_ads__organization_report:f9 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f3->50. model.apple_search_ads.apple_search_ads__organization_report:f10 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f4->50. model.apple_search_ads.apple_search_ads__organization_report:f6 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f4->50. model.apple_search_ads.apple_search_ads__organization_report:f8 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f5->50. model.apple_search_ads.apple_search_ads__organization_report:f7 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f5->50. model.apple_search_ads.apple_search_ads__organization_report:f8 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f6->50. model.apple_search_ads.apple_search_ads__organization_report:f5 68. model.apple_search_ads_source.stg_apple_search_ads__organization 68. model.apple_search_ads_source.stg_apple_search_ads__organization source_relation organization_id currency organization_name 68. model.apple_search_ads_source.stg_apple_search_ads__organization:f0->50. model.apple_search_ads.apple_search_ads__organization_report:f0 68. model.apple_search_ads_source.stg_apple_search_ads__organization:f1->50. model.apple_search_ads.apple_search_ads__organization_report:f1 68. model.apple_search_ads_source.stg_apple_search_ads__organization:f2->50. model.apple_search_ads.apple_search_ads__organization_report:f4 68. model.apple_search_ads_source.stg_apple_search_ads__organization:f3->50. model.apple_search_ads.apple_search_ads__organization_report:f2
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
organization_id integer Organization ID associated with this record.
organization_name text Organization name associated with this record.
date_day date Date of the report.
currency text This currency value should match the respective organization's currency value.
taps bigint Number of taps on organization on given day.
new_downloads bigint App downloads from new users who have never before installed app of organization in a given day.
redownloads bigint Number of user downloads where user deletes app and downloads the same app again following a tap on an ad on the App Store, or downloads the same app to an additional device of organization in a given day.
total_downloads bigint The sum of new_downloads and redownloads.
impressions bigint The number of impressions of organization in a given day.
spend double precision The spend on organization in the given day.
Column Lineage
%3 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history source_relation 50. model.apple_search_ads.apple_search_ads__organization_report 50. model.apple_search_ads.apple_search_ads__organization_report source_relation 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0->50. model.apple_search_ads.apple_search_ads__organization_report:f0 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report source_relation 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0->50. model.apple_search_ads.apple_search_ads__organization_report:f0 68. model.apple_search_ads_source.stg_apple_search_ads__organization 68. model.apple_search_ads_source.stg_apple_search_ads__organization source_relation 68. model.apple_search_ads_source.stg_apple_search_ads__organization:f0->50. model.apple_search_ads.apple_search_ads__organization_report:f0
50. model.apple_search_ads.apple_search_ads__organization_report
  • Input Column: 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history[source_relation]
    • Direct The column is directly copied without transformation
    • Integration Used as a key to join with other tables
    • Output Columns:
      • source_relation: Directly copied to output
  • Input Column: 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with campaign and organization tables
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
  • Input Column: 68. model.apple_search_ads_source.stg_apple_search_ads__organization[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as a key to join tables
    • Output Columns:
      • source_relation: Directly copied to the output
Column Lineage
%3 68. model.apple_search_ads_source.stg_apple_search_ads__organization 68. model.apple_search_ads_source.stg_apple_search_ads__organization organization_id 50. model.apple_search_ads.apple_search_ads__organization_report 50. model.apple_search_ads.apple_search_ads__organization_report organization_id 68. model.apple_search_ads_source.stg_apple_search_ads__organization:f0->50. model.apple_search_ads.apple_search_ads__organization_report:f0 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp id 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp:f0->68. model.apple_search_ads_source.stg_apple_search_ads__organization:f0
68. model.apple_search_ads_source.stg_apple_search_ads__organization
  • Input Column: 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp[id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT in the fields CTE
    • Output Columns:
      • organization_id: Directly mapped and renamed
50. model.apple_search_ads.apple_search_ads__organization_report
  • Input Column: 68. model.apple_search_ads_source.stg_apple_search_ads__organization[organization_id]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as a key to join tables
    • Aggregation The column is grouped by in the final SELECT
    • Output Columns:
      • organization_id: Directly copied to the output
Column Lineage
%3 68. model.apple_search_ads_source.stg_apple_search_ads__organization 68. model.apple_search_ads_source.stg_apple_search_ads__organization organization_name 50. model.apple_search_ads.apple_search_ads__organization_report 50. model.apple_search_ads.apple_search_ads__organization_report organization_name 68. model.apple_search_ads_source.stg_apple_search_ads__organization:f0->50. model.apple_search_ads.apple_search_ads__organization_report:f0 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp name 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp:f0->68. model.apple_search_ads_source.stg_apple_search_ads__organization:f0
68. model.apple_search_ads_source.stg_apple_search_ads__organization
  • Input Column: 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp[name]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • organization_name: Directly mapped and renamed
50. model.apple_search_ads.apple_search_ads__organization_report
  • Input Column: 68. model.apple_search_ads_source.stg_apple_search_ads__organization[organization_name]
    • Direct The column is directly copied without any transformation
    • Aggregation The column is grouped by in the final SELECT
    • Output Columns:
      • organization_name: Directly copied to the output
Column Lineage
%3 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report date_day 50. model.apple_search_ads.apple_search_ads__organization_report 50. model.apple_search_ads.apple_search_ads__organization_report date_day 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0->50. model.apple_search_ads.apple_search_ads__organization_report:f0 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp date 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp:f0->62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0
62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report
  • Input Column: 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp[date]
    • Direct The date column is directly copied without transformation
    • Output Columns:
      • date_day: Directly mapped to date_day in the output
50. model.apple_search_ads.apple_search_ads__organization_report
  • Input Column: 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 68. model.apple_search_ads_source.stg_apple_search_ads__organization 68. model.apple_search_ads_source.stg_apple_search_ads__organization currency 50. model.apple_search_ads.apple_search_ads__organization_report 50. model.apple_search_ads.apple_search_ads__organization_report currency 68. model.apple_search_ads_source.stg_apple_search_ads__organization:f0->50. model.apple_search_ads.apple_search_ads__organization_report:f0 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp currency 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp:f0->68. model.apple_search_ads_source.stg_apple_search_ads__organization:f0
68. model.apple_search_ads_source.stg_apple_search_ads__organization
  • Input Column: 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp[currency]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • currency: Directly mapped
50. model.apple_search_ads.apple_search_ads__organization_report
  • Input Column: 68. model.apple_search_ads_source.stg_apple_search_ads__organization[currency]
    • Direct The column is directly copied without any transformation
    • Aggregation The column is grouped by in the final SELECT
    • Output Columns:
      • currency: Directly copied to the output
Column Lineage
%3 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report taps 50. model.apple_search_ads.apple_search_ads__organization_report 50. model.apple_search_ads.apple_search_ads__organization_report taps 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0->50. model.apple_search_ads.apple_search_ads__organization_report:f0 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp taps 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp:f0->62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0
62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report
  • Input Column: 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp[taps]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT
    • Output Columns:
      • taps: Directly mapped after casting
50. model.apple_search_ads.apple_search_ads__organization_report
  • Input Column: 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report[taps]
    • Aggregation Summed up in the SELECT statement
    • Output Columns:
      • taps: Aggregated sum of taps
Column Lineage
%3 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report new_downloads 50. model.apple_search_ads.apple_search_ads__organization_report 50. model.apple_search_ads.apple_search_ads__organization_report new_downloads total_downloads 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0->50. model.apple_search_ads.apple_search_ads__organization_report:f0 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0->50. model.apple_search_ads.apple_search_ads__organization_report:f1 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp new_downloads 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp:f0->62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0
62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report
  • Input Column: 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp[new_downloads]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT
    • Output Columns:
      • new_downloads: Directly mapped after casting
50. model.apple_search_ads.apple_search_ads__organization_report
  • Input Column: 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report[new_downloads]
    • Aggregation Summed up in the SELECT statement
    • Other Used in calculating total_downloads
    • Output Columns:
      • new_downloads: Aggregated sum of new_downloads
      • total_downloads: Part of the sum for total_downloads
Column Lineage
%3 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report redownloads 50. model.apple_search_ads.apple_search_ads__organization_report 50. model.apple_search_ads.apple_search_ads__organization_report redownloads total_downloads 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0->50. model.apple_search_ads.apple_search_ads__organization_report:f0 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0->50. model.apple_search_ads.apple_search_ads__organization_report:f1 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp redownloads 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp:f0->62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0
62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report
  • Input Column: 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp[redownloads]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT
    • Output Columns:
      • redownloads: Directly mapped after casting
50. model.apple_search_ads.apple_search_ads__organization_report
  • Input Column: 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report[redownloads]
    • Aggregation Summed up in the SELECT statement
    • Other Used in calculating total_downloads
    • Output Columns:
      • redownloads: Aggregated sum of redownloads
      • total_downloads: Part of the sum for total_downloads
Column Lineage
%3 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report new_downloads redownloads 50. model.apple_search_ads.apple_search_ads__organization_report 50. model.apple_search_ads.apple_search_ads__organization_report new_downloads redownloads total_downloads 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0->50. model.apple_search_ads.apple_search_ads__organization_report:f0 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0->50. model.apple_search_ads.apple_search_ads__organization_report:f2 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f1->50. model.apple_search_ads.apple_search_ads__organization_report:f1 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f1->50. model.apple_search_ads.apple_search_ads__organization_report:f2 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp new_downloads redownloads 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp:f0->62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp:f1->62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f1
62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report
  • Input Column: 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp[new_downloads]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT
    • Output Columns:
      • new_downloads: Directly mapped after casting
  • Input Column: 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp[redownloads]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT
    • Output Columns:
      • redownloads: Directly mapped after casting
50. model.apple_search_ads.apple_search_ads__organization_report
  • Input Column: 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report[new_downloads]
    • Aggregation Summed up in the SELECT statement
    • Other Used in calculating total_downloads
    • Output Columns:
      • new_downloads: Aggregated sum of new_downloads
      • total_downloads: Part of the sum for total_downloads
  • Input Column: 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report[redownloads]
    • Aggregation Summed up in the SELECT statement
    • Other Used in calculating total_downloads
    • Output Columns:
      • redownloads: Aggregated sum of redownloads
      • total_downloads: Part of the sum for total_downloads
Column Lineage
%3 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report impressions 50. model.apple_search_ads.apple_search_ads__organization_report 50. model.apple_search_ads.apple_search_ads__organization_report impressions 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0->50. model.apple_search_ads.apple_search_ads__organization_report:f0 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp impressions 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp:f0->62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0
62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report
  • Input Column: 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp[impressions]
    • Direct The impressions column is directly copied without transformation
    • Output Columns:
      • impressions: Directly mapped to impressions in the output
50. model.apple_search_ads.apple_search_ads__organization_report
  • Input Column: 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report[impressions]
    • Aggregation Summed up in the SELECT statement
    • Output Columns:
      • impressions: Aggregated sum of impressions
Column Lineage
%3 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report spend 50. model.apple_search_ads.apple_search_ads__organization_report 50. model.apple_search_ads.apple_search_ads__organization_report spend 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0->50. model.apple_search_ads.apple_search_ads__organization_report:f0 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp local_spend_amount 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp:f0->62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0
62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report
  • Input Column: 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp[local_spend_amount]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as DECIMAL(28, 6)
    • Output Columns:
      • spend: Directly mapped after casting
50. model.apple_search_ads.apple_search_ads__organization_report
  • Input Column: 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report[spend]
    • Aggregation Summed up in the SELECT statement
    • Output Columns:
      • spend: Aggregated sum of spend
51. model.apple_search_ads.apple_search_ads__search_term_report

This SQL query integrates data from three tables: search term report, campaign history, and organization. It joins these tables based on specific conditions, filters out null search terms, and aggregates various metrics (taps, downloads, impressions, spend) grouped by several dimensions including date, organization, campaign, ad group, keyword, and search term. The query provides a comprehensive view of search term performance across different organizational and campaign structures.

IntegrationFilteringAggregation
SQL Query
WITH report AS (
  SELECT
    *
  FROM TEST.PUBLIC_apple_search_ads_source.stg_apple_search_ads__search_term_report
), campaign AS (
  SELECT
    *
  FROM TEST.PUBLIC_apple_search_ads_source.stg_apple_search_ads__campaign_history
  WHERE
    is_most_recent_record = TRUE
), organization AS (
  SELECT
    *
  FROM TEST.PUBLIC_apple_search_ads_source.stg_apple_search_ads__organization
), joined AS (
  SELECT
    report.source_relation,
    report.date_day,
    organization.organization_id,
    organization.organization_name,
    campaign.campaign_id,
    campaign.campaign_name,
    report.ad_group_id,
    report.ad_group_name,
    report.keyword_id,
    report.keyword_text,
    report.search_term_text,
    report.match_type,
    report.currency,
    SUM(report.taps) AS taps,
    SUM(report.new_downloads) AS new_downloads,
    SUM(report.redownloads) AS redownloads,
    SUM(report.new_downloads + report.redownloads) AS total_downloads,
    SUM(report.impressions) AS impressions,
    SUM(report.spend) AS spend
  FROM report
  JOIN campaign
    ON report.campaign_id = campaign.campaign_id
    AND report.source_relation = campaign.source_relation
  JOIN organization
    ON campaign.organization_id = organization.organization_id
    AND campaign.source_relation = organization.source_relation
  WHERE
    NOT report.search_term_text IS NULL
  GROUP BY
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10,
    11,
    12,
    13
)
SELECT
  *
FROM joined
%3 51. model.apple_search_ads.apple_search_ads__search_term_report 51. model.apple_search_ads.apple_search_ads__search_term_report source_relation organization_id organization_name campaign_id campaign_name ad_group_id ad_group_name match_type date_day search_term_text currency taps new_downloads redownloads total_downloads impressions spend keyword_id keyword_text 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history source_relation campaign_id campaign_name 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0->51. model.apple_search_ads.apple_search_ads__search_term_report:f0 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f1->51. model.apple_search_ads.apple_search_ads__search_term_report:f3 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f2->51. model.apple_search_ads.apple_search_ads__search_term_report:f4 68. model.apple_search_ads_source.stg_apple_search_ads__organization 68. model.apple_search_ads_source.stg_apple_search_ads__organization source_relation organization_id organization_name 68. model.apple_search_ads_source.stg_apple_search_ads__organization:f0->51. model.apple_search_ads.apple_search_ads__search_term_report:f0 68. model.apple_search_ads_source.stg_apple_search_ads__organization:f1->51. model.apple_search_ads.apple_search_ads__search_term_report:f1 68. model.apple_search_ads_source.stg_apple_search_ads__organization:f2->51. model.apple_search_ads.apple_search_ads__search_term_report:f2 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report source_relation ad_group_id date_day ad_group_name keyword_text keyword_id spend currency match_type search_term_text impressions taps new_downloads redownloads 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0->51. model.apple_search_ads.apple_search_ads__search_term_report:f0 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f1->51. model.apple_search_ads.apple_search_ads__search_term_report:f5 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f2->51. model.apple_search_ads.apple_search_ads__search_term_report:f8 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f3->51. model.apple_search_ads.apple_search_ads__search_term_report:f6 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f4->51. model.apple_search_ads.apple_search_ads__search_term_report:f18 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f5->51. model.apple_search_ads.apple_search_ads__search_term_report:f17 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f6->51. model.apple_search_ads.apple_search_ads__search_term_report:f16 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f7->51. model.apple_search_ads.apple_search_ads__search_term_report:f10 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f8->51. model.apple_search_ads.apple_search_ads__search_term_report:f7 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f9->51. model.apple_search_ads.apple_search_ads__search_term_report:f9 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f10->51. model.apple_search_ads.apple_search_ads__search_term_report:f15 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f11->51. model.apple_search_ads.apple_search_ads__search_term_report:f11 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f12->51. model.apple_search_ads.apple_search_ads__search_term_report:f12 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f12->51. model.apple_search_ads.apple_search_ads__search_term_report:f14 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f13->51. model.apple_search_ads.apple_search_ads__search_term_report:f13 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f13->51. model.apple_search_ads.apple_search_ads__search_term_report:f14
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
organization_id integer Organization ID associated with this record.
organization_name text Organization name associated with this record.
campaign_id integer Campaign ID associated with this record.
campaign_name text Campaign name associated with this record.
ad_group_id integer Ad group ID associated with this record.
ad_group_name text Ad group name associated with this record.
match_type text Controls how ads are matched to user searches; EXACT or BROAD.
date_day date Date of the report.
search_term_text text Search term text.
currency text This currency value should match the respective organization's currency value.
taps bigint Number of taps on organization on given day.
new_downloads bigint App downloads from new users who have never before installed app of organization in a given day.
redownloads bigint Number of user downloads where user deletes app and downloads the same app again following a tap on an ad on the App Store, or downloads the same app to an additional device of organization in a given day.
total_downloads bigint The sum of new_downloads and redownloads.
impressions bigint The number of impressions of organization in a given day.
spend double precision The spend on organization in the given day.
keyword_id integer None
keyword_text text None
Column Lineage
%3 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history source_relation 51. model.apple_search_ads.apple_search_ads__search_term_report 51. model.apple_search_ads.apple_search_ads__search_term_report source_relation 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0->51. model.apple_search_ads.apple_search_ads__search_term_report:f0 68. model.apple_search_ads_source.stg_apple_search_ads__organization 68. model.apple_search_ads_source.stg_apple_search_ads__organization source_relation 68. model.apple_search_ads_source.stg_apple_search_ads__organization:f0->51. model.apple_search_ads.apple_search_ads__search_term_report:f0 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report source_relation 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0->51. model.apple_search_ads.apple_search_ads__search_term_report:f0
51. model.apple_search_ads.apple_search_ads__search_term_report
  • Input Column: 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history[source_relation]
    • Integration Used as a key to join with other tables
    • Direct Directly copied to the output
    • Output Columns:
      • source_relation: Directly copied
  • Input Column: 68. model.apple_search_ads_source.stg_apple_search_ads__organization[source_relation]
    • Integration Used as a join condition to link organization data with campaign data
    • Direct Directly selected in the final output
    • Output Columns:
      • source_relation: Directly copied to the output
  • Input Column: 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with other tables
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to output
Column Lineage
%3 68. model.apple_search_ads_source.stg_apple_search_ads__organization 68. model.apple_search_ads_source.stg_apple_search_ads__organization organization_id 51. model.apple_search_ads.apple_search_ads__search_term_report 51. model.apple_search_ads.apple_search_ads__search_term_report organization_id 68. model.apple_search_ads_source.stg_apple_search_ads__organization:f0->51. model.apple_search_ads.apple_search_ads__search_term_report:f0 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp id 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp:f0->68. model.apple_search_ads_source.stg_apple_search_ads__organization:f0
68. model.apple_search_ads_source.stg_apple_search_ads__organization
  • Input Column: 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp[id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT in the fields CTE
    • Output Columns:
      • organization_id: Directly mapped and renamed
51. model.apple_search_ads.apple_search_ads__search_term_report
  • Input Column: 68. model.apple_search_ads_source.stg_apple_search_ads__organization[organization_id]
    • Integration Used as a join condition to link organization data with campaign data
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • organization_id: Directly copied to the output
Column Lineage
%3 68. model.apple_search_ads_source.stg_apple_search_ads__organization 68. model.apple_search_ads_source.stg_apple_search_ads__organization organization_name 51. model.apple_search_ads.apple_search_ads__search_term_report 51. model.apple_search_ads.apple_search_ads__search_term_report organization_name 68. model.apple_search_ads_source.stg_apple_search_ads__organization:f0->51. model.apple_search_ads.apple_search_ads__search_term_report:f0 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp name 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp:f0->68. model.apple_search_ads_source.stg_apple_search_ads__organization:f0
68. model.apple_search_ads_source.stg_apple_search_ads__organization
  • Input Column: 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp[name]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • organization_name: Directly mapped and renamed
51. model.apple_search_ads.apple_search_ads__search_term_report
  • Input Column: 68. model.apple_search_ads_source.stg_apple_search_ads__organization[organization_name]
    • Direct Directly selected in the final output
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • organization_name: Directly copied to the output
Column Lineage
%3 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history campaign_id 51. model.apple_search_ads.apple_search_ads__search_term_report 51. model.apple_search_ads.apple_search_ads__search_term_report campaign_id 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0->51. model.apple_search_ads.apple_search_ads__search_term_report:f0 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp id 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp:f0->60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0
60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history
  • Input Column: 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp[id]
    • Cleaning The column is cast to INT type
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • campaign_id: Directly mapped after casting
51. model.apple_search_ads.apple_search_ads__search_term_report
  • Input Column: 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history[campaign_id]
    • Integration Used as a key to join with the report table
    • Direct Directly copied to the output
    • Output Columns:
      • campaign_id: Directly copied
Column Lineage
%3 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history campaign_name 51. model.apple_search_ads.apple_search_ads__search_term_report 51. model.apple_search_ads.apple_search_ads__search_term_report campaign_name 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0->51. model.apple_search_ads.apple_search_ads__search_term_report:f0 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp name 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp:f0->60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0
60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history
  • Input Column: 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp[name]
    • Cleaning The column is cast as TEXT and renamed
    • Output Columns:
      • campaign_name: Directly mapped after renaming
51. model.apple_search_ads.apple_search_ads__search_term_report
  • Input Column: 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history[campaign_name]
    • Direct Directly copied to the output
    • Output Columns:
      • campaign_name: Directly copied
Column Lineage
%3 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report ad_group_id 51. model.apple_search_ads.apple_search_ads__search_term_report 51. model.apple_search_ads.apple_search_ads__search_term_report ad_group_id 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0->51. model.apple_search_ads.apple_search_ads__search_term_report:f0 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp ad_group_id 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp:f0->70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0
70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report
  • Input Column: 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp[ad_group_id]
    • Cleaning The column is cast to INT data type
    • Direct The column is directly copied to the output
    • Output Columns:
      • ad_group_id: Directly copied after casting
51. model.apple_search_ads.apple_search_ads__search_term_report
  • Input Column: 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report[ad_group_id]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • ad_group_id: Directly copied to output
Column Lineage
%3 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report ad_group_name 51. model.apple_search_ads.apple_search_ads__search_term_report 51. model.apple_search_ads.apple_search_ads__search_term_report ad_group_name 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0->51. model.apple_search_ads.apple_search_ads__search_term_report:f0 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp ad_group_name 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp:f0->70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0
70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report
  • Input Column: 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp[ad_group_name]
    • Cleaning The column is cast to TEXT data type
    • Direct The column is directly copied to the output
    • Output Columns:
      • ad_group_name: Directly copied after casting
51. model.apple_search_ads.apple_search_ads__search_term_report
  • Input Column: 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report[ad_group_name]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • ad_group_name: Directly copied to output
Column Lineage
%3 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report match_type 51. model.apple_search_ads.apple_search_ads__search_term_report 51. model.apple_search_ads.apple_search_ads__search_term_report match_type 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0->51. model.apple_search_ads.apple_search_ads__search_term_report:f0 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp match_type 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp:f0->70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0
70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report
  • Input Column: 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp[match_type]
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • match_type: Directly mapped after casting
51. model.apple_search_ads.apple_search_ads__search_term_report
  • Input Column: 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report[match_type]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the grouping in the final SELECT statement
    • Output Columns:
      • match_type: Directly mapped
Column Lineage
%3 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report date_day 51. model.apple_search_ads.apple_search_ads__search_term_report 51. model.apple_search_ads.apple_search_ads__search_term_report date_day 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0->51. model.apple_search_ads.apple_search_ads__search_term_report:f0 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp date 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp:f0->70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0
70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report
  • Input Column: 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp[date]
    • Cleaning The column is cast to DATE data type
    • Direct The column is directly copied to the output
    • Output Columns:
      • date_day: Directly copied after casting and renamed
51. model.apple_search_ads.apple_search_ads__search_term_report
  • Input Column: 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to output
Column Lineage
%3 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report search_term_text 51. model.apple_search_ads.apple_search_ads__search_term_report 51. model.apple_search_ads.apple_search_ads__search_term_report search_term_text 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0->51. model.apple_search_ads.apple_search_ads__search_term_report:f0 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp search_term_text 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp:f0->70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0
70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report
  • Input Column: 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp[search_term_text]
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • search_term_text: Directly mapped after casting
51. model.apple_search_ads.apple_search_ads__search_term_report
  • Input Column: 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report[search_term_text]
    • Direct The column is directly copied without any transformation
    • Filtering The column is filtered to exclude NULL values
    • Integration The column is used as part of the grouping in the final SELECT statement
    • Output Columns:
      • search_term_text: Directly mapped
Column Lineage
%3 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report currency 51. model.apple_search_ads.apple_search_ads__search_term_report 51. model.apple_search_ads.apple_search_ads__search_term_report currency 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0->51. model.apple_search_ads.apple_search_ads__search_term_report:f0 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp local_spend_currency 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp:f0->70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0
70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report
  • Input Column: 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp[local_spend_currency]
    • Cleaning The column is cast as TEXT and renamed
    • Output Columns:
      • currency: Directly mapped after casting and renaming
51. model.apple_search_ads.apple_search_ads__search_term_report
  • Input Column: 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report[currency]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the grouping in the final SELECT statement
    • Output Columns:
      • currency: Directly mapped
Column Lineage
%3 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report taps 51. model.apple_search_ads.apple_search_ads__search_term_report 51. model.apple_search_ads.apple_search_ads__search_term_report taps 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0->51. model.apple_search_ads.apple_search_ads__search_term_report:f0 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp taps 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp:f0->70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0
70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report
  • Input Column: 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp[taps]
    • Cleaning The column is cast as INT
    • Output Columns:
      • taps: Directly mapped after casting
51. model.apple_search_ads.apple_search_ads__search_term_report
  • Input Column: 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report[taps]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • taps: Aggregated sum of taps
Column Lineage
%3 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report new_downloads 51. model.apple_search_ads.apple_search_ads__search_term_report 51. model.apple_search_ads.apple_search_ads__search_term_report new_downloads total_downloads 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0->51. model.apple_search_ads.apple_search_ads__search_term_report:f0 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0->51. model.apple_search_ads.apple_search_ads__search_term_report:f1 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp new_downloads 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp:f0->70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0
70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report
  • Input Column: 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp[new_downloads]
    • Cleaning The column is cast as INT
    • Output Columns:
      • new_downloads: Directly mapped after casting
51. model.apple_search_ads.apple_search_ads__search_term_report
  • Input Column: 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report[new_downloads]
    • Aggregation The column is summed up in the final SELECT statement
    • Other It's also used in combination with redownloads to calculate total_downloads
    • Output Columns:
      • new_downloads: Aggregated sum of new_downloads
      • total_downloads: Part of the calculation for total_downloads
Column Lineage
%3 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report redownloads 51. model.apple_search_ads.apple_search_ads__search_term_report 51. model.apple_search_ads.apple_search_ads__search_term_report redownloads total_downloads 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0->51. model.apple_search_ads.apple_search_ads__search_term_report:f0 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0->51. model.apple_search_ads.apple_search_ads__search_term_report:f1 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp redownloads 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp:f0->70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0
70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report
  • Input Column: 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp[redownloads]
    • Cleaning The column is cast as INT
    • Output Columns:
      • redownloads: Directly mapped after casting
51. model.apple_search_ads.apple_search_ads__search_term_report
  • Input Column: 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report[redownloads]
    • Aggregation The column is summed up in the GROUP BY clause
    • Other It's also used in a calculation to derive total_downloads
    • Output Columns:
      • redownloads: It is directly mapped to the output 'redownloads' column after aggregation
      • total_downloads: It contributes to the calculation of total_downloads (new_downloads + redownloads)
Column Lineage
%3 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report new_downloads redownloads 51. model.apple_search_ads.apple_search_ads__search_term_report 51. model.apple_search_ads.apple_search_ads__search_term_report new_downloads redownloads total_downloads 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0->51. model.apple_search_ads.apple_search_ads__search_term_report:f0 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0->51. model.apple_search_ads.apple_search_ads__search_term_report:f2 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f1->51. model.apple_search_ads.apple_search_ads__search_term_report:f1 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f1->51. model.apple_search_ads.apple_search_ads__search_term_report:f2 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp new_downloads redownloads 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp:f0->70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp:f1->70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f1
70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report
  • Input Column: 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp[new_downloads]
    • Cleaning The column is cast as INT
    • Output Columns:
      • new_downloads: Directly mapped after casting
  • Input Column: 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp[redownloads]
    • Cleaning The column is cast as INT
    • Output Columns:
      • redownloads: Directly mapped after casting
51. model.apple_search_ads.apple_search_ads__search_term_report
  • Input Column: 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report[new_downloads]
    • Aggregation The column is summed up in the final SELECT statement
    • Other It's also used in combination with redownloads to calculate total_downloads
    • Output Columns:
      • new_downloads: Aggregated sum of new_downloads
      • total_downloads: Part of the calculation for total_downloads
  • Input Column: 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report[redownloads]
    • Aggregation The column is summed up in the GROUP BY clause
    • Other It's also used in a calculation to derive total_downloads
    • Output Columns:
      • redownloads: It is directly mapped to the output 'redownloads' column after aggregation
      • total_downloads: It contributes to the calculation of total_downloads (new_downloads + redownloads)
Column Lineage
%3 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report impressions 51. model.apple_search_ads.apple_search_ads__search_term_report 51. model.apple_search_ads.apple_search_ads__search_term_report impressions 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0->51. model.apple_search_ads.apple_search_ads__search_term_report:f0 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp impressions 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp:f0->70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0
70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report
  • Input Column: 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp[impressions]
    • Cleaning The column is cast to INT
    • Direct The column is directly copied to the output
    • Output Columns:
      • impressions: Directly mapped after casting
51. model.apple_search_ads.apple_search_ads__search_term_report
  • Input Column: 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report[impressions]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • impressions: Aggregated sum of impressions
Column Lineage
%3 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report spend 51. model.apple_search_ads.apple_search_ads__search_term_report 51. model.apple_search_ads.apple_search_ads__search_term_report spend 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0->51. model.apple_search_ads.apple_search_ads__search_term_report:f0 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp local_spend_amount 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp:f0->70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0
70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report
  • Input Column: 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp[local_spend_amount]
    • Cleaning The column is cast as DECIMAL(28, 6) and renamed
    • Output Columns:
      • spend: Directly mapped after casting and renaming
51. model.apple_search_ads.apple_search_ads__search_term_report
  • Input Column: 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report[spend]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • spend: Aggregated sum of spend
Column Lineage
%3 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report keyword_id 51. model.apple_search_ads.apple_search_ads__search_term_report 51. model.apple_search_ads.apple_search_ads__search_term_report keyword_id 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0->51. model.apple_search_ads.apple_search_ads__search_term_report:f0 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp keyword_id 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp:f0->70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0
70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report
  • Input Column: 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp[keyword_id]
    • Cleaning The column is cast to INT
    • Direct The column is directly copied to the output
    • Output Columns:
      • keyword_id: Directly mapped after casting
51. model.apple_search_ads.apple_search_ads__search_term_report
  • Input Column: 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report[keyword_id]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the grouping in the final SELECT statement
    • Output Columns:
      • keyword_id: Directly mapped
Column Lineage
%3 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report keyword_text 51. model.apple_search_ads.apple_search_ads__search_term_report 51. model.apple_search_ads.apple_search_ads__search_term_report keyword_text 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0->51. model.apple_search_ads.apple_search_ads__search_term_report:f0 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp keyword 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp:f0->70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0
70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report
  • Input Column: 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp[keyword]
    • Cleaning The column is cast to TEXT and renamed
    • Output Columns:
      • keyword_text: Directly mapped after casting
51. model.apple_search_ads.apple_search_ads__search_term_report
  • Input Column: 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report[keyword_text]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • keyword_text: Directly copied to output
52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history

This SQL query stages data from an Apple Search Ads source table. It casts columns to specific data types, renames some columns, and adds a flag to identify the most recent record for each ad group. The query doesn't perform any filtering or aggregation but focuses on structuring and preparing the data for further use.

CleaningDeduplicationOther
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp
), fields AS (
  SELECT
    CAST(NULL AS INT) AS campaign_id,
    CAST(NULL AS TIMESTAMP) AS end_time,
    CAST(NULL AS INT) AS id,
    CAST(NULL AS TIMESTAMP) AS modification_time,
    CAST(NULL AS TEXT) AS name,
    CAST(NULL AS INT) AS organization_id,
    CAST(NULL AS TIMESTAMP) AS start_time,
    CAST(NULL AS TEXT) AS status,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    modification_time AS modified_at,
    organization_id,
    campaign_id,
    name AS ad_group_name,
    id AS ad_group_id,
    status AS ad_group_status,
    start_time AS start_at,
    end_time AS end_at,
    ROW_NUMBER() OVER (PARTITION BY source_relation, id ORDER BY modification_time DESC) = 1 AS is_most_recent_record
  FROM fields
)
SELECT
  *
FROM final
%3 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history source_relation modified_at is_most_recent_record ad_group_id campaign_id start_at end_at ad_group_name organization_id status ad_group_status 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp id modification_time campaign_id end_time name organization_id start_time status 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp:f0->52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history:f3 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp:f1->52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history:f1 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp:f2->52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history:f4 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp:f3->52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history:f6 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp:f4->52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history:f7 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp:f5->52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history:f8 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp:f6->52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history:f5 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp:f7->52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history:f10
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
modified_at timestamp without time zone Timestamp of when the ad group object was last modified.
is_most_recent_record boolean Boolean indicating whether record was the most recent instance.
ad_group_id integer Ad group ID associated with the record.
campaign_id integer Campaign ID associated with the record.
start_at timestamp without time zone The designated ad group start time.
end_at timestamp without time zone The designated ad group end time.
ad_group_name text Ad group name.
organization_id integer Organization ID associated with the record.
status None The current status of the ad group, values include ENABLED and PAUSED.
ad_group_status text None
Column Lineage
%3 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history source_relation 47. model.apple_search_ads.apple_search_ads__ad_report 47. model.apple_search_ads.apple_search_ads__ad_report source_relation 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history:f0->47. model.apple_search_ads.apple_search_ads__ad_report:f0 46. model.apple_search_ads.apple_search_ads__ad_group_report 46. model.apple_search_ads.apple_search_ads__ad_group_report source_relation 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history:f0->46. model.apple_search_ads.apple_search_ads__ad_group_report:f0 49. model.apple_search_ads.apple_search_ads__keyword_report 49. model.apple_search_ads.apple_search_ads__keyword_report source_relation 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history:f0->49. model.apple_search_ads.apple_search_ads__keyword_report:f0
46. model.apple_search_ads.apple_search_ads__ad_group_report
  • Input Column: 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history[source_relation]
    • Integration used as a key to join tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
47. model.apple_search_ads.apple_search_ads__ad_report
  • Input Column: 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history[source_relation]
    • Integration used as a key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
49. model.apple_search_ads.apple_search_ads__keyword_report
  • Input Column: 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history[source_relation]
    • Integration used to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
Column Lineage
%3 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp modification_time 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history modified_at 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp:f0->52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history:f0
52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history
  • Input Column: 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp[modification_time]
    • Cleaning The column is cast to TIMESTAMP type.
    • Deduplication Used in ROW_NUMBER() function to order records.
    • Output Columns:
      • modified_at: Directly mapped after casting.
Column Lineage
%3 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp id 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history ad_group_id 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp:f0->52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history:f0 47. model.apple_search_ads.apple_search_ads__ad_report 47. model.apple_search_ads.apple_search_ads__ad_report ad_group_id 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history:f0->47. model.apple_search_ads.apple_search_ads__ad_report:f0 46. model.apple_search_ads.apple_search_ads__ad_group_report 46. model.apple_search_ads.apple_search_ads__ad_group_report ad_group_id 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history:f0->46. model.apple_search_ads.apple_search_ads__ad_group_report:f0 49. model.apple_search_ads.apple_search_ads__keyword_report 49. model.apple_search_ads.apple_search_ads__keyword_report ad_group_id 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history:f0->49. model.apple_search_ads.apple_search_ads__keyword_report:f0
52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history
  • Input Column: 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp[id]
    • Cleaning The column is cast to INT type.
    • Deduplication Used in ROW_NUMBER() function to identify the most recent record.
    • Output Columns:
      • ad_group_id: Directly mapped after casting.
46. model.apple_search_ads.apple_search_ads__ad_group_report
  • Input Column: 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history[ad_group_id]
    • Integration used as a key to join tables
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_id: directly copied
47. model.apple_search_ads.apple_search_ads__ad_report
  • Input Column: 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history[ad_group_id]
    • Integration used as a key to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_id: directly copied
49. model.apple_search_ads.apple_search_ads__keyword_report
  • Input Column: 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history[ad_group_id]
    • Integration used to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_id: directly copied
Column Lineage
%3 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp campaign_id 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history campaign_id 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp:f0->52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history:f0
52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history
  • Input Column: 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp[campaign_id]
    • Cleaning The column is cast to INT type.
    • Output Columns:
      • campaign_id: Directly mapped after casting.
Column Lineage
%3 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp start_time 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history start_at 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp:f0->52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history:f0 46. model.apple_search_ads.apple_search_ads__ad_group_report 46. model.apple_search_ads.apple_search_ads__ad_group_report start_at 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history:f0->46. model.apple_search_ads.apple_search_ads__ad_group_report:f0
52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history
  • Input Column: 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp[start_time]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TIMESTAMP type
    • Output Columns:
      • start_at: Directly mapped after casting
46. model.apple_search_ads.apple_search_ads__ad_group_report
  • Input Column: 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history[start_at]
    • Direct directly copied to the output
    • Output Columns:
      • start_at: directly copied
Column Lineage
%3 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp end_time 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history end_at 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp:f0->52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history:f0 46. model.apple_search_ads.apple_search_ads__ad_group_report 46. model.apple_search_ads.apple_search_ads__ad_group_report end_at 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history:f0->46. model.apple_search_ads.apple_search_ads__ad_group_report:f0
52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history
  • Input Column: 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp[end_time]
    • Cleaning The column is cast to TIMESTAMP type.
    • Output Columns:
      • end_at: Directly mapped after casting.
46. model.apple_search_ads.apple_search_ads__ad_group_report
  • Input Column: 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history[end_at]
    • Direct directly copied to the output
    • Output Columns:
      • end_at: directly copied
Column Lineage
%3 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp name 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history ad_group_name 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp:f0->52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history:f0 47. model.apple_search_ads.apple_search_ads__ad_report 47. model.apple_search_ads.apple_search_ads__ad_report ad_group_name 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history:f0->47. model.apple_search_ads.apple_search_ads__ad_report:f0 46. model.apple_search_ads.apple_search_ads__ad_group_report 46. model.apple_search_ads.apple_search_ads__ad_group_report ad_group_name 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history:f0->46. model.apple_search_ads.apple_search_ads__ad_group_report:f0 49. model.apple_search_ads.apple_search_ads__keyword_report 49. model.apple_search_ads.apple_search_ads__keyword_report ad_group_name 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history:f0->49. model.apple_search_ads.apple_search_ads__keyword_report:f0
52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history
  • Input Column: 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • ad_group_name: Directly mapped after casting
46. model.apple_search_ads.apple_search_ads__ad_group_report
  • Input Column: 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history[ad_group_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_name: directly copied
47. model.apple_search_ads.apple_search_ads__ad_report
  • Input Column: 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history[ad_group_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_name: directly copied
49. model.apple_search_ads.apple_search_ads__keyword_report
  • Input Column: 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history[ad_group_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_name: directly copied
Column Lineage
%3 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp organization_id 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history organization_id 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp:f0->52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history:f0
52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history
  • Input Column: 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp[organization_id]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as INT type
    • Output Columns:
      • organization_id: Directly mapped after casting
Column Lineage
%3 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history status 46. model.apple_search_ads.apple_search_ads__ad_group_report 46. model.apple_search_ads.apple_search_ads__ad_group_report ad_group_status 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history:f0->46. model.apple_search_ads.apple_search_ads__ad_group_report:f0
46. model.apple_search_ads.apple_search_ads__ad_group_report
  • Input Column: 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history[status]
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_status: directly copied and renamed
Column Lineage
%3 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp status 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history ad_group_status 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp:f0->52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history:f0 46. model.apple_search_ads.apple_search_ads__ad_group_report 46. model.apple_search_ads.apple_search_ads__ad_group_report ad_group_status 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history:f0->46. model.apple_search_ads.apple_search_ads__ad_group_report:f0
52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history
  • Input Column: 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp[status]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • ad_group_status: Directly mapped after casting
46. model.apple_search_ads.apple_search_ads__ad_group_report
  • Input Column: 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history[ad_group_status]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition to link the ad_group table with other tables
    • Output Columns:
      • ad_group_status: It is directly copied to the output column 'ad_group_status'
53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of type TEXT, which is set to NULL. The query is limited to 0 rows, effectively creating a schema-only representation of the table without any actual data.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp id modification_time automated_keywords_opt_in campaign_id cpa_goal_amount cpa_goal_currency default_cpc_bid_amount default_cpc_bid_currency deleted end_time name organization_id serving_state_reasons serving_status start_time status storefronts 290. source.apple_search_ads_source.apple_search_ads.ad_group_history 290. source.apple_search_ads_source.apple_search_ads.ad_group_history
Name Type Comment
id integer None
modification_time timestamp without time zone None
automated_keywords_opt_in boolean None
campaign_id integer None
cpa_goal_amount integer None
cpa_goal_currency integer None
default_cpc_bid_amount integer None
default_cpc_bid_currency integer None
deleted boolean None
end_time timestamp without time zone None
name text None
organization_id integer None
serving_state_reasons integer None
serving_status text None
start_time timestamp without time zone None
status text None
storefronts integer None
Column Lineage
%3 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp id 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history ad_group_id 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp:f0->52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history:f0 47. model.apple_search_ads.apple_search_ads__ad_report 47. model.apple_search_ads.apple_search_ads__ad_report ad_group_id 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history:f0->47. model.apple_search_ads.apple_search_ads__ad_report:f0 46. model.apple_search_ads.apple_search_ads__ad_group_report 46. model.apple_search_ads.apple_search_ads__ad_group_report ad_group_id 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history:f0->46. model.apple_search_ads.apple_search_ads__ad_group_report:f0 49. model.apple_search_ads.apple_search_ads__keyword_report 49. model.apple_search_ads.apple_search_ads__keyword_report ad_group_id 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history:f0->49. model.apple_search_ads.apple_search_ads__keyword_report:f0
52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history
  • Input Column: 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp[id]
    • Cleaning The column is cast to INT type.
    • Deduplication Used in ROW_NUMBER() function to identify the most recent record.
    • Output Columns:
      • ad_group_id: Directly mapped after casting.
46. model.apple_search_ads.apple_search_ads__ad_group_report
  • Input Column: 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history[ad_group_id]
    • Integration used as a key to join tables
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_id: directly copied
47. model.apple_search_ads.apple_search_ads__ad_report
  • Input Column: 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history[ad_group_id]
    • Integration used as a key to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_id: directly copied
49. model.apple_search_ads.apple_search_ads__keyword_report
  • Input Column: 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history[ad_group_id]
    • Integration used to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_id: directly copied
Column Lineage
%3 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp modification_time 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history modified_at 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp:f0->52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history:f0
52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history
  • Input Column: 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp[modification_time]
    • Cleaning The column is cast to TIMESTAMP type.
    • Deduplication Used in ROW_NUMBER() function to order records.
    • Output Columns:
      • modified_at: Directly mapped after casting.
Column Lineage
%3 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp campaign_id 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history campaign_id 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp:f0->52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history:f0
52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history
  • Input Column: 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp[campaign_id]
    • Cleaning The column is cast to INT type.
    • Output Columns:
      • campaign_id: Directly mapped after casting.
Column Lineage
%3 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp end_time 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history end_at 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp:f0->52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history:f0 46. model.apple_search_ads.apple_search_ads__ad_group_report 46. model.apple_search_ads.apple_search_ads__ad_group_report end_at 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history:f0->46. model.apple_search_ads.apple_search_ads__ad_group_report:f0
52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history
  • Input Column: 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp[end_time]
    • Cleaning The column is cast to TIMESTAMP type.
    • Output Columns:
      • end_at: Directly mapped after casting.
46. model.apple_search_ads.apple_search_ads__ad_group_report
  • Input Column: 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history[end_at]
    • Direct directly copied to the output
    • Output Columns:
      • end_at: directly copied
Column Lineage
%3 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp name 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history ad_group_name 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp:f0->52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history:f0 47. model.apple_search_ads.apple_search_ads__ad_report 47. model.apple_search_ads.apple_search_ads__ad_report ad_group_name 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history:f0->47. model.apple_search_ads.apple_search_ads__ad_report:f0 46. model.apple_search_ads.apple_search_ads__ad_group_report 46. model.apple_search_ads.apple_search_ads__ad_group_report ad_group_name 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history:f0->46. model.apple_search_ads.apple_search_ads__ad_group_report:f0 49. model.apple_search_ads.apple_search_ads__keyword_report 49. model.apple_search_ads.apple_search_ads__keyword_report ad_group_name 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history:f0->49. model.apple_search_ads.apple_search_ads__keyword_report:f0
52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history
  • Input Column: 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • ad_group_name: Directly mapped after casting
46. model.apple_search_ads.apple_search_ads__ad_group_report
  • Input Column: 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history[ad_group_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_name: directly copied
47. model.apple_search_ads.apple_search_ads__ad_report
  • Input Column: 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history[ad_group_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_name: directly copied
49. model.apple_search_ads.apple_search_ads__keyword_report
  • Input Column: 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history[ad_group_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_name: directly copied
Column Lineage
%3 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp organization_id 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history organization_id 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp:f0->52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history:f0
52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history
  • Input Column: 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp[organization_id]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as INT type
    • Output Columns:
      • organization_id: Directly mapped after casting
Column Lineage
%3 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp start_time 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history start_at 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp:f0->52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history:f0 46. model.apple_search_ads.apple_search_ads__ad_group_report 46. model.apple_search_ads.apple_search_ads__ad_group_report start_at 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history:f0->46. model.apple_search_ads.apple_search_ads__ad_group_report:f0
52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history
  • Input Column: 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp[start_time]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TIMESTAMP type
    • Output Columns:
      • start_at: Directly mapped after casting
46. model.apple_search_ads.apple_search_ads__ad_group_report
  • Input Column: 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history[start_at]
    • Direct directly copied to the output
    • Output Columns:
      • start_at: directly copied
Column Lineage
%3 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp status 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history ad_group_status 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp:f0->52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history:f0 46. model.apple_search_ads.apple_search_ads__ad_group_report 46. model.apple_search_ads.apple_search_ads__ad_group_report ad_group_status 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history:f0->46. model.apple_search_ads.apple_search_ads__ad_group_report:f0
52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history
  • Input Column: 53. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history_tmp[status]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • ad_group_status: Directly mapped after casting
46. model.apple_search_ads.apple_search_ads__ad_group_report
  • Input Column: 52. model.apple_search_ads_source.stg_apple_search_ads__ad_group_history[ad_group_status]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition to link the ad_group table with other tables
    • Output Columns:
      • ad_group_status: It is directly copied to the output column 'ad_group_status'
54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report

This SQL query creates a staging table for Apple Search Ads ad group reports. It starts with a base table, then defines a set of fields with specific data types (mostly set to NULL or empty values). Finally, it selects and renames some of these fields, preparing the data for further processing or analysis.

CleaningOther
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp
), fields AS (
  SELECT
    CAST(NULL AS INT) AS ad_group_id,
    CAST(NULL AS DATE) AS date,
    CAST(NULL AS INT) AS impressions,
    CAST(NULL AS DECIMAL(28, 6)) AS local_spend_amount,
    CAST(NULL AS TEXT) AS local_spend_currency,
    CAST(NULL AS INT) AS new_downloads,
    CAST(NULL AS INT) AS redownloads,
    CAST(NULL AS INT) AS taps,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    date AS date_day,
    ad_group_id,
    impressions,
    local_spend_amount AS spend,
    local_spend_currency AS currency,
    new_downloads,
    redownloads,
    taps
  FROM fields
)
SELECT
  *
FROM final
%3 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report source_relation ad_group_id date_day impressions spend currency new_downloads redownloads taps 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp ad_group_id date impressions local_spend_amount local_spend_currency new_downloads redownloads taps 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp:f0->54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report:f1 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp:f1->54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report:f2 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp:f2->54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report:f3 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp:f3->54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report:f4 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp:f4->54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report:f5 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp:f5->54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report:f6 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp:f6->54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report:f7 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp:f7->54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report:f8
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
ad_group_id integer Ad group ID associated with the record.
date_day date Date for daily report aggregation.
impressions integer Number of times your ad appeared in App Store search results.
spend double precision The sum of costs associated with the number of impressions served. Spend is measured in the currency used in the campaign.
currency text This currency value should match the respective organization's currency value.
new_downloads integer App downloads from new users who have never before installed the respective app.
redownloads integer Occurs when a user downloads respective app, deletes it, and downloads the same app again following a tap on an ad on the App Store, or downloads the same app to an additional device.
taps integer The number of times ad was tapped by users within the reporting time period.
Column Lineage
%3 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report source_relation 46. model.apple_search_ads.apple_search_ads__ad_group_report 46. model.apple_search_ads.apple_search_ads__ad_group_report source_relation 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report:f0->46. model.apple_search_ads.apple_search_ads__ad_group_report:f0
46. model.apple_search_ads.apple_search_ads__ad_group_report
  • Input Column: 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join conditions with other tables
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
Column Lineage
%3 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp ad_group_id 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report ad_group_id 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp:f0->54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report:f0 46. model.apple_search_ads.apple_search_ads__ad_group_report 46. model.apple_search_ads.apple_search_ads__ad_group_report ad_group_id 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report:f0->46. model.apple_search_ads.apple_search_ads__ad_group_report:f0
54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report
  • Input Column: 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp[ad_group_id]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • ad_group_id: Directly mapped to the output column
46. model.apple_search_ads.apple_search_ads__ad_group_report
  • Input Column: 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report[ad_group_id]
    • Integration Used as a key to join with the ad_group table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • ad_group_id: Directly copied to the output
Column Lineage
%3 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp date 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report date_day 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp:f0->54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report:f0 46. model.apple_search_ads.apple_search_ads__ad_group_report 46. model.apple_search_ads.apple_search_ads__ad_group_report date_day 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report:f0->46. model.apple_search_ads.apple_search_ads__ad_group_report:f0
54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report
  • Input Column: 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp[date]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as DATE type
    • Output Columns:
      • date_day: Directly mapped to the output column after casting
46. model.apple_search_ads.apple_search_ads__ad_group_report
  • Input Column: 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp impressions 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report impressions 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp:f0->54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report:f0 46. model.apple_search_ads.apple_search_ads__ad_group_report 46. model.apple_search_ads.apple_search_ads__ad_group_report impressions 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report:f0->46. model.apple_search_ads.apple_search_ads__ad_group_report:f0
54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report
  • Input Column: 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp[impressions]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT type
    • Output Columns:
      • impressions: Directly mapped to the output column after casting
46. model.apple_search_ads.apple_search_ads__ad_group_report
  • Input Column: 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report[impressions]
    • Aggregation Summed up in the SELECT clause
    • Output Columns:
      • impressions: Aggregated sum in the output
Column Lineage
%3 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp local_spend_amount 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report spend 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp:f0->54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report:f0 46. model.apple_search_ads.apple_search_ads__ad_group_report 46. model.apple_search_ads.apple_search_ads__ad_group_report spend 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report:f0->46. model.apple_search_ads.apple_search_ads__ad_group_report:f0
54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report
  • Input Column: 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp[local_spend_amount]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as DECIMAL(28, 6)
    • Output Columns:
      • spend: Directly mapped after casting
46. model.apple_search_ads.apple_search_ads__ad_group_report
  • Input Column: 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report[spend]
    • Aggregation Summed up in the SELECT clause
    • Output Columns:
      • spend: Aggregated sum in the output
Column Lineage
%3 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp local_spend_currency 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report currency 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp:f0->54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report:f0 46. model.apple_search_ads.apple_search_ads__ad_group_report 46. model.apple_search_ads.apple_search_ads__ad_group_report currency 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report:f0->46. model.apple_search_ads.apple_search_ads__ad_group_report:f0
54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report
  • Input Column: 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp[local_spend_currency]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • currency: Directly mapped
46. model.apple_search_ads.apple_search_ads__ad_group_report
  • Input Column: 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report[currency]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • currency: Directly copied to the output
Column Lineage
%3 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp new_downloads 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report new_downloads 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp:f0->54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report:f0 46. model.apple_search_ads.apple_search_ads__ad_group_report 46. model.apple_search_ads.apple_search_ads__ad_group_report new_downloads total_downloads 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report:f0->46. model.apple_search_ads.apple_search_ads__ad_group_report:f0 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report:f0->46. model.apple_search_ads.apple_search_ads__ad_group_report:f1
54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report
  • Input Column: 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp[new_downloads]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT
    • Output Columns:
      • new_downloads: Directly mapped after casting
46. model.apple_search_ads.apple_search_ads__ad_group_report
  • Input Column: 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report[new_downloads]
    • Aggregation Summed up in the SELECT clause
    • Other Used in calculation of total_downloads
    • Output Columns:
      • new_downloads: Aggregated sum in the output
      • total_downloads: Part of the sum calculation
Column Lineage
%3 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp redownloads 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report redownloads 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp:f0->54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report:f0 46. model.apple_search_ads.apple_search_ads__ad_group_report 46. model.apple_search_ads.apple_search_ads__ad_group_report redownloads total_downloads 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report:f0->46. model.apple_search_ads.apple_search_ads__ad_group_report:f0 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report:f0->46. model.apple_search_ads.apple_search_ads__ad_group_report:f1
54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report
  • Input Column: 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp[redownloads]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT
    • Output Columns:
      • redownloads: Directly mapped after casting
46. model.apple_search_ads.apple_search_ads__ad_group_report
  • Input Column: 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report[redownloads]
    • Aggregation Summed up in the SELECT clause
    • Other Used in calculation of total_downloads
    • Output Columns:
      • redownloads: Aggregated sum in the output
      • total_downloads: Part of the sum calculation
Column Lineage
%3 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp taps 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report taps 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp:f0->54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report:f0 46. model.apple_search_ads.apple_search_ads__ad_group_report 46. model.apple_search_ads.apple_search_ads__ad_group_report taps 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report:f0->46. model.apple_search_ads.apple_search_ads__ad_group_report:f0
54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report
  • Input Column: 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp[taps]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT
    • Output Columns:
      • taps: Directly mapped after casting
46. model.apple_search_ads.apple_search_ads__ad_group_report
  • Input Column: 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report[taps]
    • Aggregation Summed up in the SELECT clause
    • Output Columns:
      • taps: Aggregated sum in the output
55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of type TEXT, which is set to NULL. The LIMIT 0 clause ensures no rows are returned. This query appears to be a placeholder or template for further development.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp ad_group_id date avg_cpa_amount avg_cpa_currency avg_cpt_amount avg_cpt_currency conversion_rate conversions impressions lat_off_installs lat_on_installs local_spend_amount local_spend_currency new_downloads redownloads tap_through_rate taps 291. source.apple_search_ads_source.apple_search_ads.ad_group_report 291. source.apple_search_ads_source.apple_search_ads.ad_group_report
Name Type Comment
ad_group_id integer None
date date None
avg_cpa_amount double precision None
avg_cpa_currency text None
avg_cpt_amount double precision None
avg_cpt_currency text None
conversion_rate double precision None
conversions integer None
impressions integer None
lat_off_installs integer None
lat_on_installs integer None
local_spend_amount double precision None
local_spend_currency text None
new_downloads integer None
redownloads integer None
tap_through_rate double precision None
taps integer None
Column Lineage
%3 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp ad_group_id 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report ad_group_id 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp:f0->54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report:f0 46. model.apple_search_ads.apple_search_ads__ad_group_report 46. model.apple_search_ads.apple_search_ads__ad_group_report ad_group_id 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report:f0->46. model.apple_search_ads.apple_search_ads__ad_group_report:f0
54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report
  • Input Column: 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp[ad_group_id]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • ad_group_id: Directly mapped to the output column
46. model.apple_search_ads.apple_search_ads__ad_group_report
  • Input Column: 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report[ad_group_id]
    • Integration Used as a key to join with the ad_group table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • ad_group_id: Directly copied to the output
Column Lineage
%3 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp date 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report date_day 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp:f0->54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report:f0 46. model.apple_search_ads.apple_search_ads__ad_group_report 46. model.apple_search_ads.apple_search_ads__ad_group_report date_day 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report:f0->46. model.apple_search_ads.apple_search_ads__ad_group_report:f0
54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report
  • Input Column: 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp[date]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as DATE type
    • Output Columns:
      • date_day: Directly mapped to the output column after casting
46. model.apple_search_ads.apple_search_ads__ad_group_report
  • Input Column: 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp impressions 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report impressions 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp:f0->54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report:f0 46. model.apple_search_ads.apple_search_ads__ad_group_report 46. model.apple_search_ads.apple_search_ads__ad_group_report impressions 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report:f0->46. model.apple_search_ads.apple_search_ads__ad_group_report:f0
54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report
  • Input Column: 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp[impressions]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT type
    • Output Columns:
      • impressions: Directly mapped to the output column after casting
46. model.apple_search_ads.apple_search_ads__ad_group_report
  • Input Column: 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report[impressions]
    • Aggregation Summed up in the SELECT clause
    • Output Columns:
      • impressions: Aggregated sum in the output
Column Lineage
%3 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp local_spend_amount 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report spend 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp:f0->54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report:f0 46. model.apple_search_ads.apple_search_ads__ad_group_report 46. model.apple_search_ads.apple_search_ads__ad_group_report spend 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report:f0->46. model.apple_search_ads.apple_search_ads__ad_group_report:f0
54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report
  • Input Column: 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp[local_spend_amount]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as DECIMAL(28, 6)
    • Output Columns:
      • spend: Directly mapped after casting
46. model.apple_search_ads.apple_search_ads__ad_group_report
  • Input Column: 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report[spend]
    • Aggregation Summed up in the SELECT clause
    • Output Columns:
      • spend: Aggregated sum in the output
Column Lineage
%3 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp local_spend_currency 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report currency 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp:f0->54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report:f0 46. model.apple_search_ads.apple_search_ads__ad_group_report 46. model.apple_search_ads.apple_search_ads__ad_group_report currency 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report:f0->46. model.apple_search_ads.apple_search_ads__ad_group_report:f0
54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report
  • Input Column: 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp[local_spend_currency]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • currency: Directly mapped
46. model.apple_search_ads.apple_search_ads__ad_group_report
  • Input Column: 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report[currency]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • currency: Directly copied to the output
Column Lineage
%3 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp new_downloads 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report new_downloads 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp:f0->54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report:f0 46. model.apple_search_ads.apple_search_ads__ad_group_report 46. model.apple_search_ads.apple_search_ads__ad_group_report new_downloads total_downloads 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report:f0->46. model.apple_search_ads.apple_search_ads__ad_group_report:f0 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report:f0->46. model.apple_search_ads.apple_search_ads__ad_group_report:f1
54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report
  • Input Column: 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp[new_downloads]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT
    • Output Columns:
      • new_downloads: Directly mapped after casting
46. model.apple_search_ads.apple_search_ads__ad_group_report
  • Input Column: 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report[new_downloads]
    • Aggregation Summed up in the SELECT clause
    • Other Used in calculation of total_downloads
    • Output Columns:
      • new_downloads: Aggregated sum in the output
      • total_downloads: Part of the sum calculation
Column Lineage
%3 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp redownloads 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report redownloads 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp:f0->54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report:f0 46. model.apple_search_ads.apple_search_ads__ad_group_report 46. model.apple_search_ads.apple_search_ads__ad_group_report redownloads total_downloads 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report:f0->46. model.apple_search_ads.apple_search_ads__ad_group_report:f0 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report:f0->46. model.apple_search_ads.apple_search_ads__ad_group_report:f1
54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report
  • Input Column: 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp[redownloads]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT
    • Output Columns:
      • redownloads: Directly mapped after casting
46. model.apple_search_ads.apple_search_ads__ad_group_report
  • Input Column: 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report[redownloads]
    • Aggregation Summed up in the SELECT clause
    • Other Used in calculation of total_downloads
    • Output Columns:
      • redownloads: Aggregated sum in the output
      • total_downloads: Part of the sum calculation
Column Lineage
%3 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp taps 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report taps 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp:f0->54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report:f0 46. model.apple_search_ads.apple_search_ads__ad_group_report 46. model.apple_search_ads.apple_search_ads__ad_group_report taps 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report:f0->46. model.apple_search_ads.apple_search_ads__ad_group_report:f0
54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report
  • Input Column: 55. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report_tmp[taps]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT
    • Output Columns:
      • taps: Directly mapped after casting
46. model.apple_search_ads.apple_search_ads__ad_group_report
  • Input Column: 54. model.apple_search_ads_source.stg_apple_search_ads__ad_group_report[taps]
    • Aggregation Summed up in the SELECT clause
    • Output Columns:
      • taps: Aggregated sum in the output
56. model.apple_search_ads_source.stg_apple_search_ads__ad_history

This SQL query performs a series of transformations on data from the 'stg_apple_search_ads__ad_history_tmp' table. It casts several columns to specific data types, renames some columns, and adds a flag to identify the most recent record for each ad. The query also includes a 'source_relation' column, though it's set to an empty string in this case.

CleaningDeduplicationOther
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_apple_search_ads_source.stg_apple_search_ads__ad_history_tmp
), fields AS (
  SELECT
    CAST(NULL AS INT) AS ad_group_id,
    CAST(NULL AS INT) AS campaign_id,
    CAST(NULL AS TIMESTAMP) AS creation_time,
    CAST(NULL AS INT) AS id,
    CAST(NULL AS TIMESTAMP) AS modification_time,
    CAST(NULL AS TEXT) AS name,
    CAST(NULL AS INT) AS org_id,
    CAST(NULL AS TEXT) AS status,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    creation_time AS created_at,
    modification_time AS modified_at,
    org_id AS organization_id,
    campaign_id,
    ad_group_id,
    name AS ad_name,
    id AS ad_id,
    status AS ad_status,
    ROW_NUMBER() OVER (PARTITION BY source_relation, id ORDER BY modification_time DESC) = 1 AS is_most_recent_record
  FROM fields
)
SELECT
  *
FROM final
%3 56. model.apple_search_ads_source.stg_apple_search_ads__ad_history 56. model.apple_search_ads_source.stg_apple_search_ads__ad_history source_relation created_at modified_at organization_id campaign_id ad_group_id ad_name ad_id ad_status is_most_recent_record 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp creation_time modification_time org_id campaign_id ad_group_id name id status 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp:f0->56. model.apple_search_ads_source.stg_apple_search_ads__ad_history:f1 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp:f1->56. model.apple_search_ads_source.stg_apple_search_ads__ad_history:f2 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp:f1->56. model.apple_search_ads_source.stg_apple_search_ads__ad_history:f9 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp:f2->56. model.apple_search_ads_source.stg_apple_search_ads__ad_history:f3 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp:f3->56. model.apple_search_ads_source.stg_apple_search_ads__ad_history:f4 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp:f4->56. model.apple_search_ads_source.stg_apple_search_ads__ad_history:f5 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp:f5->56. model.apple_search_ads_source.stg_apple_search_ads__ad_history:f6 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp:f6->56. model.apple_search_ads_source.stg_apple_search_ads__ad_history:f7 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp:f6->56. model.apple_search_ads_source.stg_apple_search_ads__ad_history:f9 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp:f7->56. model.apple_search_ads_source.stg_apple_search_ads__ad_history:f8
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
created_at timestamp without time zone Timestamp of when ad was created.
modified_at timestamp without time zone Timestamp of when the ad object was last modified.
organization_id integer Organization ID associated with the record.
campaign_id integer Campaign ID associated with the record.
ad_group_id integer Ad group ID associated with the record.
ad_name text Ad name associated with the record.
ad_id integer Ad ID associated with the record.
ad_status text The current status of the ad, values include ENABLED and PAUSED.
is_most_recent_record boolean None
Column Lineage
%3 56. model.apple_search_ads_source.stg_apple_search_ads__ad_history 56. model.apple_search_ads_source.stg_apple_search_ads__ad_history source_relation 47. model.apple_search_ads.apple_search_ads__ad_report 47. model.apple_search_ads.apple_search_ads__ad_report source_relation 56. model.apple_search_ads_source.stg_apple_search_ads__ad_history:f0->47. model.apple_search_ads.apple_search_ads__ad_report:f0
47. model.apple_search_ads.apple_search_ads__ad_report
  • Input Column: 56. model.apple_search_ads_source.stg_apple_search_ads__ad_history[source_relation]
    • Integration used as a key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
Column Lineage
%3 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp creation_time 56. model.apple_search_ads_source.stg_apple_search_ads__ad_history 56. model.apple_search_ads_source.stg_apple_search_ads__ad_history created_at 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp:f0->56. model.apple_search_ads_source.stg_apple_search_ads__ad_history:f0
56. model.apple_search_ads_source.stg_apple_search_ads__ad_history
  • Input Column: 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp[creation_time]
    • Cleaning The column is cast as TIMESTAMP
    • Direct It is directly copied to the output
    • Output Columns:
      • created_at: Directly mapped after casting
Column Lineage
%3 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp modification_time 56. model.apple_search_ads_source.stg_apple_search_ads__ad_history 56. model.apple_search_ads_source.stg_apple_search_ads__ad_history is_most_recent_record modified_at 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp:f0->56. model.apple_search_ads_source.stg_apple_search_ads__ad_history:f1 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp:f0->56. model.apple_search_ads_source.stg_apple_search_ads__ad_history:f0
56. model.apple_search_ads_source.stg_apple_search_ads__ad_history
  • Input Column: 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp[modification_time]
    • Cleaning The column is cast as TIMESTAMP
    • Direct It is directly copied to the output
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • modified_at: Directly mapped after casting
      • is_most_recent_record: Used to determine the most recent record
Column Lineage
%3 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp org_id 56. model.apple_search_ads_source.stg_apple_search_ads__ad_history 56. model.apple_search_ads_source.stg_apple_search_ads__ad_history organization_id 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp:f0->56. model.apple_search_ads_source.stg_apple_search_ads__ad_history:f0
56. model.apple_search_ads_source.stg_apple_search_ads__ad_history
  • Input Column: 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp[org_id]
    • Cleaning The column is cast as INT
    • Direct It is directly copied to the output
    • Output Columns:
      • organization_id: Directly mapped after casting
Column Lineage
%3 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp campaign_id 56. model.apple_search_ads_source.stg_apple_search_ads__ad_history 56. model.apple_search_ads_source.stg_apple_search_ads__ad_history campaign_id 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp:f0->56. model.apple_search_ads_source.stg_apple_search_ads__ad_history:f0
56. model.apple_search_ads_source.stg_apple_search_ads__ad_history
  • Input Column: 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp[campaign_id]
    • Cleaning The column is cast as INT
    • Direct It is directly copied to the output
    • Output Columns:
      • campaign_id: Directly mapped after casting
Column Lineage
%3 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp ad_group_id 56. model.apple_search_ads_source.stg_apple_search_ads__ad_history 56. model.apple_search_ads_source.stg_apple_search_ads__ad_history ad_group_id 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp:f0->56. model.apple_search_ads_source.stg_apple_search_ads__ad_history:f0
56. model.apple_search_ads_source.stg_apple_search_ads__ad_history
  • Input Column: 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp[ad_group_id]
    • Cleaning The column is cast as INT
    • Direct It is directly copied to the output
    • Output Columns:
      • ad_group_id: Directly mapped after casting
Column Lineage
%3 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp name 56. model.apple_search_ads_source.stg_apple_search_ads__ad_history 56. model.apple_search_ads_source.stg_apple_search_ads__ad_history ad_name 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp:f0->56. model.apple_search_ads_source.stg_apple_search_ads__ad_history:f0 47. model.apple_search_ads.apple_search_ads__ad_report 47. model.apple_search_ads.apple_search_ads__ad_report ad_name 56. model.apple_search_ads_source.stg_apple_search_ads__ad_history:f0->47. model.apple_search_ads.apple_search_ads__ad_report:f0
56. model.apple_search_ads_source.stg_apple_search_ads__ad_history
  • Input Column: 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp[name]
    • Cleaning The column is cast as TEXT
    • Direct It is directly copied to the output
    • Output Columns:
      • ad_name: Directly mapped after casting
47. model.apple_search_ads.apple_search_ads__ad_report
  • Input Column: 56. model.apple_search_ads_source.stg_apple_search_ads__ad_history[ad_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_name: directly copied
Column Lineage
%3 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp id 56. model.apple_search_ads_source.stg_apple_search_ads__ad_history 56. model.apple_search_ads_source.stg_apple_search_ads__ad_history ad_id is_most_recent_record 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp:f0->56. model.apple_search_ads_source.stg_apple_search_ads__ad_history:f0 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp:f0->56. model.apple_search_ads_source.stg_apple_search_ads__ad_history:f1 47. model.apple_search_ads.apple_search_ads__ad_report 47. model.apple_search_ads.apple_search_ads__ad_report ad_id 56. model.apple_search_ads_source.stg_apple_search_ads__ad_history:f0->47. model.apple_search_ads.apple_search_ads__ad_report:f0
56. model.apple_search_ads_source.stg_apple_search_ads__ad_history
  • Input Column: 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp[id]
    • Cleaning The column is cast as INT
    • Direct It is directly copied to the output
    • Deduplication Used in the PARTITION BY clause of ROW_NUMBER() function
    • Output Columns:
      • ad_id: Directly mapped after casting
      • is_most_recent_record: Used to determine the most recent record for each id
47. model.apple_search_ads.apple_search_ads__ad_report
  • Input Column: 56. model.apple_search_ads_source.stg_apple_search_ads__ad_history[ad_id]
    • Integration used as a key to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • ad_id: directly copied
Column Lineage
%3 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp status 56. model.apple_search_ads_source.stg_apple_search_ads__ad_history 56. model.apple_search_ads_source.stg_apple_search_ads__ad_history ad_status 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp:f0->56. model.apple_search_ads_source.stg_apple_search_ads__ad_history:f0 47. model.apple_search_ads.apple_search_ads__ad_report 47. model.apple_search_ads.apple_search_ads__ad_report ad_status 56. model.apple_search_ads_source.stg_apple_search_ads__ad_history:f0->47. model.apple_search_ads.apple_search_ads__ad_report:f0
56. model.apple_search_ads_source.stg_apple_search_ads__ad_history
  • Input Column: 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp[status]
    • Cleaning The column is cast as TEXT
    • Direct It is directly copied to the output
    • Output Columns:
      • ad_status: Directly mapped after casting
47. model.apple_search_ads.apple_search_ads__ad_report
  • Input Column: 56. model.apple_search_ads_source.stg_apple_search_ads__ad_history[ad_status]
    • Direct directly copied to the output
    • Output Columns:
      • ad_status: directly copied
Column Lineage
%3 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp id modification_time 56. model.apple_search_ads_source.stg_apple_search_ads__ad_history 56. model.apple_search_ads_source.stg_apple_search_ads__ad_history ad_id is_most_recent_record modified_at 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp:f1->56. model.apple_search_ads_source.stg_apple_search_ads__ad_history:f2 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp:f1->56. model.apple_search_ads_source.stg_apple_search_ads__ad_history:f1 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp:f0->56. model.apple_search_ads_source.stg_apple_search_ads__ad_history:f0 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp:f0->56. model.apple_search_ads_source.stg_apple_search_ads__ad_history:f1
56. model.apple_search_ads_source.stg_apple_search_ads__ad_history
  • Input Column: 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp[modification_time]
    • Cleaning The column is cast as TIMESTAMP
    • Direct It is directly copied to the output
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • modified_at: Directly mapped after casting
      • is_most_recent_record: Used to determine the most recent record
  • Input Column: 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp[id]
    • Cleaning The column is cast as INT
    • Direct It is directly copied to the output
    • Deduplication Used in the PARTITION BY clause of ROW_NUMBER() function
    • Output Columns:
      • ad_id: Directly mapped after casting
      • is_most_recent_record: Used to determine the most recent record for each id
57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of TEXT data type. It's likely used as a placeholder or template for further development or testing purposes.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp creation_time modification_time org_id campaign_id ad_group_id name id creative_id creative_type status 292. source.apple_search_ads_source.apple_search_ads.ad_history 292. source.apple_search_ads_source.apple_search_ads.ad_history
Name Type Comment
creation_time timestamp without time zone None
modification_time timestamp without time zone None
org_id integer None
campaign_id integer None
ad_group_id integer None
name text None
id integer None
creative_id integer None
creative_type text None
status text None
Column Lineage
%3 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp creation_time 56. model.apple_search_ads_source.stg_apple_search_ads__ad_history 56. model.apple_search_ads_source.stg_apple_search_ads__ad_history created_at 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp:f0->56. model.apple_search_ads_source.stg_apple_search_ads__ad_history:f0
56. model.apple_search_ads_source.stg_apple_search_ads__ad_history
  • Input Column: 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp[creation_time]
    • Cleaning The column is cast as TIMESTAMP
    • Direct It is directly copied to the output
    • Output Columns:
      • created_at: Directly mapped after casting
Column Lineage
%3 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp modification_time 56. model.apple_search_ads_source.stg_apple_search_ads__ad_history 56. model.apple_search_ads_source.stg_apple_search_ads__ad_history is_most_recent_record modified_at 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp:f0->56. model.apple_search_ads_source.stg_apple_search_ads__ad_history:f1 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp:f0->56. model.apple_search_ads_source.stg_apple_search_ads__ad_history:f0
56. model.apple_search_ads_source.stg_apple_search_ads__ad_history
  • Input Column: 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp[modification_time]
    • Cleaning The column is cast as TIMESTAMP
    • Direct It is directly copied to the output
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • modified_at: Directly mapped after casting
      • is_most_recent_record: Used to determine the most recent record
Column Lineage
%3 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp org_id 56. model.apple_search_ads_source.stg_apple_search_ads__ad_history 56. model.apple_search_ads_source.stg_apple_search_ads__ad_history organization_id 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp:f0->56. model.apple_search_ads_source.stg_apple_search_ads__ad_history:f0
56. model.apple_search_ads_source.stg_apple_search_ads__ad_history
  • Input Column: 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp[org_id]
    • Cleaning The column is cast as INT
    • Direct It is directly copied to the output
    • Output Columns:
      • organization_id: Directly mapped after casting
Column Lineage
%3 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp campaign_id 56. model.apple_search_ads_source.stg_apple_search_ads__ad_history 56. model.apple_search_ads_source.stg_apple_search_ads__ad_history campaign_id 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp:f0->56. model.apple_search_ads_source.stg_apple_search_ads__ad_history:f0
56. model.apple_search_ads_source.stg_apple_search_ads__ad_history
  • Input Column: 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp[campaign_id]
    • Cleaning The column is cast as INT
    • Direct It is directly copied to the output
    • Output Columns:
      • campaign_id: Directly mapped after casting
Column Lineage
%3 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp ad_group_id 56. model.apple_search_ads_source.stg_apple_search_ads__ad_history 56. model.apple_search_ads_source.stg_apple_search_ads__ad_history ad_group_id 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp:f0->56. model.apple_search_ads_source.stg_apple_search_ads__ad_history:f0
56. model.apple_search_ads_source.stg_apple_search_ads__ad_history
  • Input Column: 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp[ad_group_id]
    • Cleaning The column is cast as INT
    • Direct It is directly copied to the output
    • Output Columns:
      • ad_group_id: Directly mapped after casting
Column Lineage
%3 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp name 56. model.apple_search_ads_source.stg_apple_search_ads__ad_history 56. model.apple_search_ads_source.stg_apple_search_ads__ad_history ad_name 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp:f0->56. model.apple_search_ads_source.stg_apple_search_ads__ad_history:f0 47. model.apple_search_ads.apple_search_ads__ad_report 47. model.apple_search_ads.apple_search_ads__ad_report ad_name 56. model.apple_search_ads_source.stg_apple_search_ads__ad_history:f0->47. model.apple_search_ads.apple_search_ads__ad_report:f0
56. model.apple_search_ads_source.stg_apple_search_ads__ad_history
  • Input Column: 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp[name]
    • Cleaning The column is cast as TEXT
    • Direct It is directly copied to the output
    • Output Columns:
      • ad_name: Directly mapped after casting
47. model.apple_search_ads.apple_search_ads__ad_report
  • Input Column: 56. model.apple_search_ads_source.stg_apple_search_ads__ad_history[ad_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_name: directly copied
Column Lineage
%3 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp id 56. model.apple_search_ads_source.stg_apple_search_ads__ad_history 56. model.apple_search_ads_source.stg_apple_search_ads__ad_history ad_id is_most_recent_record 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp:f0->56. model.apple_search_ads_source.stg_apple_search_ads__ad_history:f0 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp:f0->56. model.apple_search_ads_source.stg_apple_search_ads__ad_history:f1 47. model.apple_search_ads.apple_search_ads__ad_report 47. model.apple_search_ads.apple_search_ads__ad_report ad_id 56. model.apple_search_ads_source.stg_apple_search_ads__ad_history:f0->47. model.apple_search_ads.apple_search_ads__ad_report:f0
56. model.apple_search_ads_source.stg_apple_search_ads__ad_history
  • Input Column: 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp[id]
    • Cleaning The column is cast as INT
    • Direct It is directly copied to the output
    • Deduplication Used in the PARTITION BY clause of ROW_NUMBER() function
    • Output Columns:
      • ad_id: Directly mapped after casting
      • is_most_recent_record: Used to determine the most recent record for each id
47. model.apple_search_ads.apple_search_ads__ad_report
  • Input Column: 56. model.apple_search_ads_source.stg_apple_search_ads__ad_history[ad_id]
    • Integration used as a key to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • ad_id: directly copied
Column Lineage
%3 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp status 56. model.apple_search_ads_source.stg_apple_search_ads__ad_history 56. model.apple_search_ads_source.stg_apple_search_ads__ad_history ad_status 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp:f0->56. model.apple_search_ads_source.stg_apple_search_ads__ad_history:f0 47. model.apple_search_ads.apple_search_ads__ad_report 47. model.apple_search_ads.apple_search_ads__ad_report ad_status 56. model.apple_search_ads_source.stg_apple_search_ads__ad_history:f0->47. model.apple_search_ads.apple_search_ads__ad_report:f0
56. model.apple_search_ads_source.stg_apple_search_ads__ad_history
  • Input Column: 57. model.apple_search_ads_source.stg_apple_search_ads__ad_history_tmp[status]
    • Cleaning The column is cast as TEXT
    • Direct It is directly copied to the output
    • Output Columns:
      • ad_status: Directly mapped after casting
47. model.apple_search_ads.apple_search_ads__ad_report
  • Input Column: 56. model.apple_search_ads_source.stg_apple_search_ads__ad_history[ad_status]
    • Direct directly copied to the output
    • Output Columns:
      • ad_status: directly copied
58. model.apple_search_ads_source.stg_apple_search_ads__ad_report

This SQL query creates a staging table for Apple Search Ads ad report data. It starts by selecting all columns from a temporary table, then defines a set of fields with specific data types (mostly casting to NULL or empty values). Finally, it selects and renames some of these fields, structuring the data for further use in the data pipeline.

CleaningOther
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_apple_search_ads_source.stg_apple_search_ads__ad_report_tmp
), fields AS (
  SELECT
    CAST(NULL AS INT) AS ad_group_id,
    CAST(NULL AS INT) AS ad_id,
    CAST(NULL AS INT) AS campaign_id,
    CAST(NULL AS DATE) AS date,
    CAST(NULL AS INT) AS impressions,
    CAST(NULL AS DECIMAL(28, 6)) AS local_spend_amount,
    CAST(NULL AS TEXT) AS local_spend_currency,
    CAST(NULL AS INT) AS new_downloads,
    CAST(NULL AS INT) AS redownloads,
    CAST(NULL AS INT) AS taps,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    date AS date_day,
    campaign_id,
    ad_group_id,
    ad_id,
    impressions,
    local_spend_amount AS spend,
    local_spend_currency AS currency,
    new_downloads,
    redownloads,
    taps
  FROM fields
)
SELECT
  *
FROM final
%3 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report source_relation date_day campaign_id ad_group_id ad_id impressions spend currency new_downloads redownloads taps 59. model.apple_search_ads_source.stg_apple_search_ads__ad_report_tmp 59. model.apple_search_ads_source.stg_apple_search_ads__ad_report_tmp _dbt_source_relation 59. model.apple_search_ads_source.stg_apple_search_ads__ad_report_tmp:f0->58. model.apple_search_ads_source.stg_apple_search_ads__ad_report:f0
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
date_day date Date for daily report aggregation.
campaign_id integer Campaign ID associated with the record.
ad_group_id integer Ad group ID associated with the record.
ad_id integer Ad ID associated with the record.
impressions integer Number of times your ad appeared in App Store search results.
spend numeric(28,6) The sum of costs associated with the number of impressions served; Spend is measured in the currency used in the campaign.
currency text This currency value should match the respective organization's currency value.
new_downloads integer App downloads from new users who have never before installed the respective app.
redownloads integer Occurs when a user downloads respective app, deletes it, and downloads the same app again following a tap on an ad on the App Store, or downloads the same app to an additional device.
taps integer The number of times ad was tapped by users within the reporting time period.
Column Lineage
%3 59. model.apple_search_ads_source.stg_apple_search_ads__ad_report_tmp 59. model.apple_search_ads_source.stg_apple_search_ads__ad_report_tmp _dbt_source_relation 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report source_relation 59. model.apple_search_ads_source.stg_apple_search_ads__ad_report_tmp:f0->58. model.apple_search_ads_source.stg_apple_search_ads__ad_report:f0 47. model.apple_search_ads.apple_search_ads__ad_report 47. model.apple_search_ads.apple_search_ads__ad_report source_relation 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report:f0->47. model.apple_search_ads.apple_search_ads__ad_report:f0
58. model.apple_search_ads_source.stg_apple_search_ads__ad_report
  • Input Column: 59. model.apple_search_ads_source.stg_apple_search_ads__ad_report_tmp[_dbt_source_relation]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cleaned by casting it to TEXT type
    • Output Columns:
      • source_relation: It is directly mapped to the 'source_relation' output column after being cast to TEXT
47. model.apple_search_ads.apple_search_ads__ad_report
  • Input Column: 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with other tables
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
Column Lineage
%3 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report date_day 47. model.apple_search_ads.apple_search_ads__ad_report 47. model.apple_search_ads.apple_search_ads__ad_report date_day 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report:f0->47. model.apple_search_ads.apple_search_ads__ad_report:f0
47. model.apple_search_ads.apple_search_ads__ad_report
  • Input Column: 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report campaign_id 47. model.apple_search_ads.apple_search_ads__ad_report 47. model.apple_search_ads.apple_search_ads__ad_report campaign_id 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report:f0->47. model.apple_search_ads.apple_search_ads__ad_report:f0
47. model.apple_search_ads.apple_search_ads__ad_report
  • Input Column: 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report[campaign_id]
    • Integration Used as the key to join with the campaign history table
    • Output Columns:
      • campaign_id: Directly copied to the output after joining
Column Lineage
%3 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report ad_group_id 47. model.apple_search_ads.apple_search_ads__ad_report 47. model.apple_search_ads.apple_search_ads__ad_report ad_group_id 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report:f0->47. model.apple_search_ads.apple_search_ads__ad_report:f0
47. model.apple_search_ads.apple_search_ads__ad_report
  • Input Column: 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report[ad_group_id]
    • Integration Used as the key to join with the ad group history table
    • Output Columns:
      • ad_group_id: Directly copied to the output after joining
Column Lineage
%3 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report ad_id 47. model.apple_search_ads.apple_search_ads__ad_report 47. model.apple_search_ads.apple_search_ads__ad_report ad_id 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report:f0->47. model.apple_search_ads.apple_search_ads__ad_report:f0
47. model.apple_search_ads.apple_search_ads__ad_report
  • Input Column: 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report[ad_id]
    • Integration Used as the key to join with the ad history table
    • Output Columns:
      • ad_id: Directly copied to the output after joining
Column Lineage
%3 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report impressions 47. model.apple_search_ads.apple_search_ads__ad_report 47. model.apple_search_ads.apple_search_ads__ad_report impressions 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report:f0->47. model.apple_search_ads.apple_search_ads__ad_report:f0
47. model.apple_search_ads.apple_search_ads__ad_report
  • Input Column: 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report[impressions]
    • Aggregation Summed up in the SELECT statement
    • Output Columns:
      • impressions: Aggregated sum in the output
Column Lineage
%3 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report spend 47. model.apple_search_ads.apple_search_ads__ad_report 47. model.apple_search_ads.apple_search_ads__ad_report spend 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report:f0->47. model.apple_search_ads.apple_search_ads__ad_report:f0
47. model.apple_search_ads.apple_search_ads__ad_report
  • Input Column: 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report[spend]
    • Aggregation Summed up in the SELECT statement
    • Output Columns:
      • spend: Aggregated sum in the output
Column Lineage
%3 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report currency 47. model.apple_search_ads.apple_search_ads__ad_report 47. model.apple_search_ads.apple_search_ads__ad_report currency 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report:f0->47. model.apple_search_ads.apple_search_ads__ad_report:f0
47. model.apple_search_ads.apple_search_ads__ad_report
  • Input Column: 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report[currency]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • currency: Directly copied to the output
Column Lineage
%3 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report new_downloads 47. model.apple_search_ads.apple_search_ads__ad_report 47. model.apple_search_ads.apple_search_ads__ad_report new_downloads total_downloads 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report:f0->47. model.apple_search_ads.apple_search_ads__ad_report:f0 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report:f0->47. model.apple_search_ads.apple_search_ads__ad_report:f1
47. model.apple_search_ads.apple_search_ads__ad_report
  • Input Column: 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report[new_downloads]
    • Aggregation Summed up in the SELECT statement
    • Other Used in calculation of total_downloads
    • Output Columns:
      • new_downloads: Aggregated sum in the output
      • total_downloads: Part of the sum calculation
Column Lineage
%3 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report redownloads 47. model.apple_search_ads.apple_search_ads__ad_report 47. model.apple_search_ads.apple_search_ads__ad_report redownloads total_downloads 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report:f0->47. model.apple_search_ads.apple_search_ads__ad_report:f0 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report:f0->47. model.apple_search_ads.apple_search_ads__ad_report:f1
47. model.apple_search_ads.apple_search_ads__ad_report
  • Input Column: 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report[redownloads]
    • Aggregation Summed up in the SELECT statement
    • Other Used in calculation of total_downloads
    • Output Columns:
      • redownloads: Aggregated sum in the output
      • total_downloads: Part of the sum calculation
Column Lineage
%3 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report taps 47. model.apple_search_ads.apple_search_ads__ad_report 47. model.apple_search_ads.apple_search_ads__ad_report taps 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report:f0->47. model.apple_search_ads.apple_search_ads__ad_report:f0
47. model.apple_search_ads.apple_search_ads__ad_report
  • Input Column: 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report[taps]
    • Aggregation The column is summed up in the GROUP BY clause
    • Integration The column is part of the report table which is joined with other tables
    • Output Columns:
      • taps: The sum of 'taps' is directly mapped to the output column 'taps'
59. model.apple_search_ads_source.stg_apple_search_ads__ad_report_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of type TEXT. It's likely used as a placeholder or template for further operations in a dbt (data build tool) model.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 59. model.apple_search_ads_source.stg_apple_search_ads__ad_report_tmp 59. model.apple_search_ads_source.stg_apple_search_ads__ad_report_tmp _dbt_source_relation 293. source.apple_search_ads_source.apple_search_ads.ad_level_report 293. source.apple_search_ads_source.apple_search_ads.ad_level_report
Name Type Comment
_dbt_source_relation text None
Column Lineage
%3 59. model.apple_search_ads_source.stg_apple_search_ads__ad_report_tmp 59. model.apple_search_ads_source.stg_apple_search_ads__ad_report_tmp _dbt_source_relation 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report source_relation 59. model.apple_search_ads_source.stg_apple_search_ads__ad_report_tmp:f0->58. model.apple_search_ads_source.stg_apple_search_ads__ad_report:f0 47. model.apple_search_ads.apple_search_ads__ad_report 47. model.apple_search_ads.apple_search_ads__ad_report source_relation 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report:f0->47. model.apple_search_ads.apple_search_ads__ad_report:f0
58. model.apple_search_ads_source.stg_apple_search_ads__ad_report
  • Input Column: 59. model.apple_search_ads_source.stg_apple_search_ads__ad_report_tmp[_dbt_source_relation]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cleaned by casting it to TEXT type
    • Output Columns:
      • source_relation: It is directly mapped to the 'source_relation' output column after being cast to TEXT
47. model.apple_search_ads.apple_search_ads__ad_report
  • Input Column: 58. model.apple_search_ads_source.stg_apple_search_ads__ad_report[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with other tables
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history

This SQL query stages data from a temporary table, casts several fields to specific data types, renames some columns, and adds a flag to identify the most recent record for each campaign. It prepares the data for further processing or analysis by structuring and cleaning the raw data from the source.

CleaningDeduplicationOther
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp
), fields AS (
  SELECT
    CAST(NULL AS TIMESTAMP) AS end_time,
    CAST(NULL AS INT) AS id,
    CAST(NULL AS TIMESTAMP) AS modification_time,
    CAST(NULL AS TEXT) AS name,
    CAST(NULL AS INT) AS organization_id,
    CAST(NULL AS TIMESTAMP) AS start_time,
    CAST(NULL AS TEXT) AS status,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    modification_time AS modified_at,
    organization_id,
    name AS campaign_name,
    id AS campaign_id,
    status AS campaign_status,
    start_time AS start_at,
    end_time AS end_at,
    ROW_NUMBER() OVER (PARTITION BY source_relation, id ORDER BY modification_time DESC) = 1 AS is_most_recent_record
  FROM fields
)
SELECT
  *
FROM final
%3 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history source_relation modified_at is_most_recent_record campaign_id start_at end_at campaign_name organization_id status campaign_status 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp id modification_time end_time name organiation_id start_time status 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp:f0->60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f3 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp:f1->60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f1 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp:f2->60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f5 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp:f3->60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f6 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp:f4->60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f7 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp:f5->60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f4 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp:f6->60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f9
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
modified_at timestamp without time zone Timestamp of when the campaign object was last modified.
is_most_recent_record boolean Boolean representing whether a record is the most recent version of that record.
campaign_id integer Campaign ID associated with the record.
start_at timestamp without time zone The designated ad group start time (ad group with the earliest start time associated with this campaign).
end_at timestamp without time zone The designated campaign end time (ad group with the latest start time associated with this campaign).
campaign_name text Campaign name for the record.
organization_id integer Organization ID associated with the record.
status None The current status of the campaign, values include ENABLED and PAUSED.
campaign_status text None
Column Lineage
%3 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history source_relation 50. model.apple_search_ads.apple_search_ads__organization_report 50. model.apple_search_ads.apple_search_ads__organization_report source_relation 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0->50. model.apple_search_ads.apple_search_ads__organization_report:f0 47. model.apple_search_ads.apple_search_ads__ad_report 47. model.apple_search_ads.apple_search_ads__ad_report source_relation 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0->47. model.apple_search_ads.apple_search_ads__ad_report:f0 51. model.apple_search_ads.apple_search_ads__search_term_report 51. model.apple_search_ads.apple_search_ads__search_term_report source_relation 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0->51. model.apple_search_ads.apple_search_ads__search_term_report:f0 46. model.apple_search_ads.apple_search_ads__ad_group_report 46. model.apple_search_ads.apple_search_ads__ad_group_report source_relation 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0->46. model.apple_search_ads.apple_search_ads__ad_group_report:f0 49. model.apple_search_ads.apple_search_ads__keyword_report 49. model.apple_search_ads.apple_search_ads__keyword_report source_relation 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0->49. model.apple_search_ads.apple_search_ads__keyword_report:f0 48. model.apple_search_ads.apple_search_ads__campaign_report 48. model.apple_search_ads.apple_search_ads__campaign_report source_relation 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0->48. model.apple_search_ads.apple_search_ads__campaign_report:f0
46. model.apple_search_ads.apple_search_ads__ad_group_report
  • Input Column: 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
47. model.apple_search_ads.apple_search_ads__ad_report
  • Input Column: 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
48. model.apple_search_ads.apple_search_ads__campaign_report
  • Input Column: 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with other tables
    • Output Columns:
      • source_relation: Directly copied to output
49. model.apple_search_ads.apple_search_ads__keyword_report
  • Input Column: 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history[source_relation]
    • Integration used as part of the join condition
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
50. model.apple_search_ads.apple_search_ads__organization_report
  • Input Column: 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history[source_relation]
    • Direct The column is directly copied without transformation
    • Integration Used as a key to join with other tables
    • Output Columns:
      • source_relation: Directly copied to output
51. model.apple_search_ads.apple_search_ads__search_term_report
  • Input Column: 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history[source_relation]
    • Integration Used as a key to join with other tables
    • Direct Directly copied to the output
    • Output Columns:
      • source_relation: Directly copied
Column Lineage
%3 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp modification_time 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history modified_at 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp:f0->60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0
60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history
  • Input Column: 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp[modification_time]
    • Cleaning The column is cast to TIMESTAMP type
    • Deduplication Used in the ROW_NUMBER() function to order records
    • Output Columns:
      • modified_at: Directly mapped after casting
Column Lineage
%3 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp id 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history campaign_id 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp:f0->60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0 47. model.apple_search_ads.apple_search_ads__ad_report 47. model.apple_search_ads.apple_search_ads__ad_report campaign_id 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0->47. model.apple_search_ads.apple_search_ads__ad_report:f0 51. model.apple_search_ads.apple_search_ads__search_term_report 51. model.apple_search_ads.apple_search_ads__search_term_report campaign_id 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0->51. model.apple_search_ads.apple_search_ads__search_term_report:f0 46. model.apple_search_ads.apple_search_ads__ad_group_report 46. model.apple_search_ads.apple_search_ads__ad_group_report campaign_id 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0->46. model.apple_search_ads.apple_search_ads__ad_group_report:f0 49. model.apple_search_ads.apple_search_ads__keyword_report 49. model.apple_search_ads.apple_search_ads__keyword_report campaign_id 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0->49. model.apple_search_ads.apple_search_ads__keyword_report:f0 48. model.apple_search_ads.apple_search_ads__campaign_report 48. model.apple_search_ads.apple_search_ads__campaign_report campaign_id 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0->48. model.apple_search_ads.apple_search_ads__campaign_report:f0
60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history
  • Input Column: 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp[id]
    • Cleaning The column is cast to INT type
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • campaign_id: Directly mapped after casting
46. model.apple_search_ads.apple_search_ads__ad_group_report
  • Input Column: 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history[campaign_id]
    • Integration used as a join key with the ad_group table
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
47. model.apple_search_ads.apple_search_ads__ad_report
  • Input Column: 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history[campaign_id]
    • Integration used as the key to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
48. model.apple_search_ads.apple_search_ads__campaign_report
  • Input Column: 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history[campaign_id]
    • Integration Used as a key to join with the campaign report table
    • Direct Directly copied to the output
    • Output Columns:
      • campaign_id: Directly copied to output
49. model.apple_search_ads.apple_search_ads__keyword_report
  • Input Column: 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history[campaign_id]
    • Integration used as a join key to connect with other tables
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
51. model.apple_search_ads.apple_search_ads__search_term_report
  • Input Column: 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history[campaign_id]
    • Integration Used as a key to join with the report table
    • Direct Directly copied to the output
    • Output Columns:
      • campaign_id: Directly copied
Column Lineage
%3 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp start_time 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history start_at 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp:f0->60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0 48. model.apple_search_ads.apple_search_ads__campaign_report 48. model.apple_search_ads.apple_search_ads__campaign_report start_at 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0->48. model.apple_search_ads.apple_search_ads__campaign_report:f0
60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history
  • Input Column: 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp[start_time]
    • Cleaning The column is cast as TIMESTAMP
    • Output Columns:
      • start_at: Directly mapped after renaming
48. model.apple_search_ads.apple_search_ads__campaign_report
  • Input Column: 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history[start_at]
    • Direct Directly copied to the output
    • Output Columns:
      • start_at: Directly copied to output
Column Lineage
%3 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp end_time 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history end_at 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp:f0->60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0 48. model.apple_search_ads.apple_search_ads__campaign_report 48. model.apple_search_ads.apple_search_ads__campaign_report end_at 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0->48. model.apple_search_ads.apple_search_ads__campaign_report:f0
60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history
  • Input Column: 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp[end_time]
    • Cleaning The column is cast to TIMESTAMP type
    • Output Columns:
      • end_at: Directly mapped after casting
48. model.apple_search_ads.apple_search_ads__campaign_report
  • Input Column: 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history[end_at]
    • Direct Directly copied to the output
    • Output Columns:
      • end_at: Directly copied to output
Column Lineage
%3 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp name 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history campaign_name 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp:f0->60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0 47. model.apple_search_ads.apple_search_ads__ad_report 47. model.apple_search_ads.apple_search_ads__ad_report campaign_name 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0->47. model.apple_search_ads.apple_search_ads__ad_report:f0 51. model.apple_search_ads.apple_search_ads__search_term_report 51. model.apple_search_ads.apple_search_ads__search_term_report campaign_name 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0->51. model.apple_search_ads.apple_search_ads__search_term_report:f0 46. model.apple_search_ads.apple_search_ads__ad_group_report 46. model.apple_search_ads.apple_search_ads__ad_group_report campaign_name 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0->46. model.apple_search_ads.apple_search_ads__ad_group_report:f0 49. model.apple_search_ads.apple_search_ads__keyword_report 49. model.apple_search_ads.apple_search_ads__keyword_report campaign_name 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0->49. model.apple_search_ads.apple_search_ads__keyword_report:f0 48. model.apple_search_ads.apple_search_ads__campaign_report 48. model.apple_search_ads.apple_search_ads__campaign_report campaign_name 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0->48. model.apple_search_ads.apple_search_ads__campaign_report:f0
60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history
  • Input Column: 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp[name]
    • Cleaning The column is cast as TEXT and renamed
    • Output Columns:
      • campaign_name: Directly mapped after renaming
46. model.apple_search_ads.apple_search_ads__ad_group_report
  • Input Column: 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history[campaign_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_name: directly copied
47. model.apple_search_ads.apple_search_ads__ad_report
  • Input Column: 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history[campaign_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_name: directly copied
48. model.apple_search_ads.apple_search_ads__campaign_report
  • Input Column: 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history[campaign_name]
    • Direct Directly copied to the output
    • Output Columns:
      • campaign_name: Directly copied to output
49. model.apple_search_ads.apple_search_ads__keyword_report
  • Input Column: 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history[campaign_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_name: directly copied
51. model.apple_search_ads.apple_search_ads__search_term_report
  • Input Column: 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history[campaign_name]
    • Direct Directly copied to the output
    • Output Columns:
      • campaign_name: Directly copied
Column Lineage
%3 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp organiation_id 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history organization_id 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp:f0->60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0 48. model.apple_search_ads.apple_search_ads__campaign_report 48. model.apple_search_ads.apple_search_ads__campaign_report organization_id 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0->48. model.apple_search_ads.apple_search_ads__campaign_report:f0
60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history
  • Input Column: 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp[organiation_id]
    • Cleaning The column is cast as INT
    • Output Columns:
      • organization_id: Directly mapped
48. model.apple_search_ads.apple_search_ads__campaign_report
  • Input Column: 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history[organization_id]
    • Integration Used as a key to join with the organization table
    • Direct Directly copied to the output
    • Output Columns:
      • organization_id: Directly copied to output
Column Lineage
%3 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp status 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history campaign_status 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp:f0->60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0 48. model.apple_search_ads.apple_search_ads__campaign_report 48. model.apple_search_ads.apple_search_ads__campaign_report campaign_status 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0->48. model.apple_search_ads.apple_search_ads__campaign_report:f0
60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history
  • Input Column: 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp[status]
    • Direct The status column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the 'fields' CTE
    • Output Columns:
      • campaign_status: The 'status' column is directly mapped to 'campaign_status' in the final output
48. model.apple_search_ads.apple_search_ads__campaign_report
  • Input Column: 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history[campaign_status]
    • Direct Directly copied to the output
    • Output Columns:
      • campaign_status: Directly copied to output
61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of type TEXT. It's likely used as a placeholder or template for a staging table in a dbt (data build tool) project, specifically for Apple Search Ads campaign history data.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp id modification_time adam_id budget_amount budget_currency budget_orders daily_budget_amount daily_budget_currency deleted end_time loc_invoice_detail_buyer_email loc_invoice_detail_buyer_name loc_invoice_detail_client_name loc_invoice_detail_order_number name organiation_id payment_model serving_state_reasons serving_status start_time status 294. source.apple_search_ads_source.apple_search_ads.campaign_history 294. source.apple_search_ads_source.apple_search_ads.campaign_history
Name Type Comment
id integer None
modification_time timestamp without time zone None
adam_id integer None
budget_amount integer None
budget_currency text None
budget_orders text None
daily_budget_amount integer None
daily_budget_currency text None
deleted boolean None
end_time timestamp without time zone None
loc_invoice_detail_buyer_email integer None
loc_invoice_detail_buyer_name integer None
loc_invoice_detail_client_name integer None
loc_invoice_detail_order_number integer None
name text None
organiation_id integer None
payment_model text None
serving_state_reasons text None
serving_status text None
start_time timestamp without time zone None
status text None
Column Lineage
%3 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp id 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history campaign_id 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp:f0->60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0 47. model.apple_search_ads.apple_search_ads__ad_report 47. model.apple_search_ads.apple_search_ads__ad_report campaign_id 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0->47. model.apple_search_ads.apple_search_ads__ad_report:f0 51. model.apple_search_ads.apple_search_ads__search_term_report 51. model.apple_search_ads.apple_search_ads__search_term_report campaign_id 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0->51. model.apple_search_ads.apple_search_ads__search_term_report:f0 46. model.apple_search_ads.apple_search_ads__ad_group_report 46. model.apple_search_ads.apple_search_ads__ad_group_report campaign_id 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0->46. model.apple_search_ads.apple_search_ads__ad_group_report:f0 49. model.apple_search_ads.apple_search_ads__keyword_report 49. model.apple_search_ads.apple_search_ads__keyword_report campaign_id 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0->49. model.apple_search_ads.apple_search_ads__keyword_report:f0 48. model.apple_search_ads.apple_search_ads__campaign_report 48. model.apple_search_ads.apple_search_ads__campaign_report campaign_id 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0->48. model.apple_search_ads.apple_search_ads__campaign_report:f0
60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history
  • Input Column: 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp[id]
    • Cleaning The column is cast to INT type
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • campaign_id: Directly mapped after casting
46. model.apple_search_ads.apple_search_ads__ad_group_report
  • Input Column: 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history[campaign_id]
    • Integration used as a join key with the ad_group table
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
47. model.apple_search_ads.apple_search_ads__ad_report
  • Input Column: 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history[campaign_id]
    • Integration used as the key to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
48. model.apple_search_ads.apple_search_ads__campaign_report
  • Input Column: 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history[campaign_id]
    • Integration Used as a key to join with the campaign report table
    • Direct Directly copied to the output
    • Output Columns:
      • campaign_id: Directly copied to output
49. model.apple_search_ads.apple_search_ads__keyword_report
  • Input Column: 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history[campaign_id]
    • Integration used as a join key to connect with other tables
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
51. model.apple_search_ads.apple_search_ads__search_term_report
  • Input Column: 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history[campaign_id]
    • Integration Used as a key to join with the report table
    • Direct Directly copied to the output
    • Output Columns:
      • campaign_id: Directly copied
Column Lineage
%3 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp modification_time 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history modified_at 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp:f0->60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0
60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history
  • Input Column: 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp[modification_time]
    • Cleaning The column is cast to TIMESTAMP type
    • Deduplication Used in the ROW_NUMBER() function to order records
    • Output Columns:
      • modified_at: Directly mapped after casting
Column Lineage
%3 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp end_time 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history end_at 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp:f0->60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0 48. model.apple_search_ads.apple_search_ads__campaign_report 48. model.apple_search_ads.apple_search_ads__campaign_report end_at 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0->48. model.apple_search_ads.apple_search_ads__campaign_report:f0
60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history
  • Input Column: 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp[end_time]
    • Cleaning The column is cast to TIMESTAMP type
    • Output Columns:
      • end_at: Directly mapped after casting
48. model.apple_search_ads.apple_search_ads__campaign_report
  • Input Column: 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history[end_at]
    • Direct Directly copied to the output
    • Output Columns:
      • end_at: Directly copied to output
Column Lineage
%3 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp name 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history campaign_name 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp:f0->60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0 47. model.apple_search_ads.apple_search_ads__ad_report 47. model.apple_search_ads.apple_search_ads__ad_report campaign_name 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0->47. model.apple_search_ads.apple_search_ads__ad_report:f0 51. model.apple_search_ads.apple_search_ads__search_term_report 51. model.apple_search_ads.apple_search_ads__search_term_report campaign_name 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0->51. model.apple_search_ads.apple_search_ads__search_term_report:f0 46. model.apple_search_ads.apple_search_ads__ad_group_report 46. model.apple_search_ads.apple_search_ads__ad_group_report campaign_name 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0->46. model.apple_search_ads.apple_search_ads__ad_group_report:f0 49. model.apple_search_ads.apple_search_ads__keyword_report 49. model.apple_search_ads.apple_search_ads__keyword_report campaign_name 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0->49. model.apple_search_ads.apple_search_ads__keyword_report:f0 48. model.apple_search_ads.apple_search_ads__campaign_report 48. model.apple_search_ads.apple_search_ads__campaign_report campaign_name 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0->48. model.apple_search_ads.apple_search_ads__campaign_report:f0
60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history
  • Input Column: 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp[name]
    • Cleaning The column is cast as TEXT and renamed
    • Output Columns:
      • campaign_name: Directly mapped after renaming
46. model.apple_search_ads.apple_search_ads__ad_group_report
  • Input Column: 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history[campaign_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_name: directly copied
47. model.apple_search_ads.apple_search_ads__ad_report
  • Input Column: 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history[campaign_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_name: directly copied
48. model.apple_search_ads.apple_search_ads__campaign_report
  • Input Column: 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history[campaign_name]
    • Direct Directly copied to the output
    • Output Columns:
      • campaign_name: Directly copied to output
49. model.apple_search_ads.apple_search_ads__keyword_report
  • Input Column: 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history[campaign_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_name: directly copied
51. model.apple_search_ads.apple_search_ads__search_term_report
  • Input Column: 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history[campaign_name]
    • Direct Directly copied to the output
    • Output Columns:
      • campaign_name: Directly copied
Column Lineage
%3 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp organiation_id 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history organization_id 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp:f0->60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0 48. model.apple_search_ads.apple_search_ads__campaign_report 48. model.apple_search_ads.apple_search_ads__campaign_report organization_id 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0->48. model.apple_search_ads.apple_search_ads__campaign_report:f0
60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history
  • Input Column: 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp[organiation_id]
    • Cleaning The column is cast as INT
    • Output Columns:
      • organization_id: Directly mapped
48. model.apple_search_ads.apple_search_ads__campaign_report
  • Input Column: 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history[organization_id]
    • Integration Used as a key to join with the organization table
    • Direct Directly copied to the output
    • Output Columns:
      • organization_id: Directly copied to output
Column Lineage
%3 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp start_time 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history start_at 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp:f0->60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0 48. model.apple_search_ads.apple_search_ads__campaign_report 48. model.apple_search_ads.apple_search_ads__campaign_report start_at 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0->48. model.apple_search_ads.apple_search_ads__campaign_report:f0
60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history
  • Input Column: 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp[start_time]
    • Cleaning The column is cast as TIMESTAMP
    • Output Columns:
      • start_at: Directly mapped after renaming
48. model.apple_search_ads.apple_search_ads__campaign_report
  • Input Column: 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history[start_at]
    • Direct Directly copied to the output
    • Output Columns:
      • start_at: Directly copied to output
Column Lineage
%3 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp status 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history campaign_status 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp:f0->60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0 48. model.apple_search_ads.apple_search_ads__campaign_report 48. model.apple_search_ads.apple_search_ads__campaign_report campaign_status 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history:f0->48. model.apple_search_ads.apple_search_ads__campaign_report:f0
60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history
  • Input Column: 61. model.apple_search_ads_source.stg_apple_search_ads__campaign_history_tmp[status]
    • Direct The status column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the 'fields' CTE
    • Output Columns:
      • campaign_status: The 'status' column is directly mapped to 'campaign_status' in the final output
48. model.apple_search_ads.apple_search_ads__campaign_report
  • Input Column: 60. model.apple_search_ads_source.stg_apple_search_ads__campaign_history[campaign_status]
    • Direct Directly copied to the output
    • Output Columns:
      • campaign_status: Directly copied to output
62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report

This SQL query creates a staging table for Apple Search Ads campaign reports. It starts by selecting all columns from a temporary table, then defines a set of fields with specific data types and null values. Finally, it renames and reorganizes these fields into a final structure. The query doesn't perform any data transformation or filtering; it's primarily setting up a structure for the data.

CleaningOther
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp
), fields AS (
  SELECT
    CAST(NULL AS DATE) AS date,
    CAST(NULL AS INT) AS id,
    CAST(NULL AS INT) AS impressions,
    CAST(NULL AS DECIMAL(28, 6)) AS local_spend_amount,
    CAST(NULL AS TEXT) AS local_spend_currency,
    CAST(NULL AS INT) AS new_downloads,
    CAST(NULL AS INT) AS redownloads,
    CAST(NULL AS INT) AS taps,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    date AS date_day,
    id AS campaign_id,
    impressions,
    local_spend_amount AS spend,
    local_spend_currency AS currency,
    new_downloads,
    redownloads,
    taps
  FROM fields
)
SELECT
  *
FROM final
%3 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report source_relation campaign_id date_day impressions spend currency new_downloads redownloads taps 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp date id impressions local_spend_amount local_spend_currency new_downloads redownloads taps 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp:f0->62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f2 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp:f1->62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f1 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp:f2->62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f3 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp:f3->62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f4 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp:f4->62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f5 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp:f5->62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f6 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp:f6->62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f7 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp:f7->62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f8
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
campaign_id integer Campaign ID associated with the record.
date_day date Date for daily report aggregation.
impressions integer Number of times your ad appeared in App Store search results.
spend double precision The sum of costs associated with the number of impressions served; Spend is measured in the currency used in the campaign.
currency text This currency value should match the respective organization's currency value.
new_downloads integer App downloads from new users who have never before installed the respective app.
redownloads integer Occurs when a user downloads respective app, deletes it, and downloads the same app again following a tap on an ad on the App Store, or downloads the same app to an additional device.
taps integer The number of times ad was tapped by users within the reporting time period.
Column Lineage
%3 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report source_relation 50. model.apple_search_ads.apple_search_ads__organization_report 50. model.apple_search_ads.apple_search_ads__organization_report source_relation 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0->50. model.apple_search_ads.apple_search_ads__organization_report:f0 48. model.apple_search_ads.apple_search_ads__campaign_report 48. model.apple_search_ads.apple_search_ads__campaign_report source_relation 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0->48. model.apple_search_ads.apple_search_ads__campaign_report:f0
48. model.apple_search_ads.apple_search_ads__campaign_report
  • Input Column: 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with campaign and organization tables
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
50. model.apple_search_ads.apple_search_ads__organization_report
  • Input Column: 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with campaign and organization tables
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
Column Lineage
%3 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp id 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report campaign_id 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp:f0->62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0 48. model.apple_search_ads.apple_search_ads__campaign_report 48. model.apple_search_ads.apple_search_ads__campaign_report campaign_id 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0->48. model.apple_search_ads.apple_search_ads__campaign_report:f0
62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report
  • Input Column: 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp[id]
    • Direct The id column is directly copied without transformation
    • Output Columns:
      • campaign_id: Directly mapped to campaign_id in the output
48. model.apple_search_ads.apple_search_ads__campaign_report
  • Input Column: 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report[campaign_id]
    • Integration Used as the key to join with the campaign table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • campaign_id: Directly copied to the output
Column Lineage
%3 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp date 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report date_day 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp:f0->62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0 50. model.apple_search_ads.apple_search_ads__organization_report 50. model.apple_search_ads.apple_search_ads__organization_report date_day 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0->50. model.apple_search_ads.apple_search_ads__organization_report:f0 48. model.apple_search_ads.apple_search_ads__campaign_report 48. model.apple_search_ads.apple_search_ads__campaign_report date_day 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0->48. model.apple_search_ads.apple_search_ads__campaign_report:f0
62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report
  • Input Column: 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp[date]
    • Direct The date column is directly copied without transformation
    • Output Columns:
      • date_day: Directly mapped to date_day in the output
48. model.apple_search_ads.apple_search_ads__campaign_report
  • Input Column: 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
50. model.apple_search_ads.apple_search_ads__organization_report
  • Input Column: 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp impressions 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report impressions 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp:f0->62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0 50. model.apple_search_ads.apple_search_ads__organization_report 50. model.apple_search_ads.apple_search_ads__organization_report impressions 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0->50. model.apple_search_ads.apple_search_ads__organization_report:f0 48. model.apple_search_ads.apple_search_ads__campaign_report 48. model.apple_search_ads.apple_search_ads__campaign_report impressions 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0->48. model.apple_search_ads.apple_search_ads__campaign_report:f0
62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report
  • Input Column: 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp[impressions]
    • Direct The impressions column is directly copied without transformation
    • Output Columns:
      • impressions: Directly mapped to impressions in the output
48. model.apple_search_ads.apple_search_ads__campaign_report
  • Input Column: 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report[impressions]
    • Aggregation Summed up in the SELECT statement
    • Output Columns:
      • impressions: Aggregated sum in the output
50. model.apple_search_ads.apple_search_ads__organization_report
  • Input Column: 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report[impressions]
    • Aggregation Summed up in the SELECT statement
    • Output Columns:
      • impressions: Aggregated sum of impressions
Column Lineage
%3 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp local_spend_amount 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report spend 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp:f0->62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0 50. model.apple_search_ads.apple_search_ads__organization_report 50. model.apple_search_ads.apple_search_ads__organization_report spend 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0->50. model.apple_search_ads.apple_search_ads__organization_report:f0 48. model.apple_search_ads.apple_search_ads__campaign_report 48. model.apple_search_ads.apple_search_ads__campaign_report spend 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0->48. model.apple_search_ads.apple_search_ads__campaign_report:f0
62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report
  • Input Column: 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp[local_spend_amount]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as DECIMAL(28, 6)
    • Output Columns:
      • spend: Directly mapped after casting
48. model.apple_search_ads.apple_search_ads__campaign_report
  • Input Column: 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report[spend]
    • Aggregation Summed up in the SELECT statement
    • Output Columns:
      • spend: Aggregated sum in the output
50. model.apple_search_ads.apple_search_ads__organization_report
  • Input Column: 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report[spend]
    • Aggregation Summed up in the SELECT statement
    • Output Columns:
      • spend: Aggregated sum of spend
Column Lineage
%3 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp local_spend_currency 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report currency 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp:f0->62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0 48. model.apple_search_ads.apple_search_ads__campaign_report 48. model.apple_search_ads.apple_search_ads__campaign_report currency 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0->48. model.apple_search_ads.apple_search_ads__campaign_report:f0
62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report
  • Input Column: 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp[local_spend_currency]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • currency: Directly mapped
48. model.apple_search_ads.apple_search_ads__campaign_report
  • Input Column: 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report[currency]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • currency: Directly copied to the output
Column Lineage
%3 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp new_downloads 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report new_downloads 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp:f0->62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0 50. model.apple_search_ads.apple_search_ads__organization_report 50. model.apple_search_ads.apple_search_ads__organization_report new_downloads total_downloads 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0->50. model.apple_search_ads.apple_search_ads__organization_report:f0 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0->50. model.apple_search_ads.apple_search_ads__organization_report:f1 48. model.apple_search_ads.apple_search_ads__campaign_report 48. model.apple_search_ads.apple_search_ads__campaign_report new_downloads total_downloads 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0->48. model.apple_search_ads.apple_search_ads__campaign_report:f0 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0->48. model.apple_search_ads.apple_search_ads__campaign_report:f1
62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report
  • Input Column: 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp[new_downloads]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT
    • Output Columns:
      • new_downloads: Directly mapped after casting
48. model.apple_search_ads.apple_search_ads__campaign_report
  • Input Column: 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report[new_downloads]
    • Aggregation Summed up in the SELECT statement
    • Other Used in calculation of total_downloads
    • Output Columns:
      • new_downloads: Aggregated sum in the output
      • total_downloads: Part of the sum for this calculated field
50. model.apple_search_ads.apple_search_ads__organization_report
  • Input Column: 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report[new_downloads]
    • Aggregation Summed up in the SELECT statement
    • Other Used in calculating total_downloads
    • Output Columns:
      • new_downloads: Aggregated sum of new_downloads
      • total_downloads: Part of the sum for total_downloads
Column Lineage
%3 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp redownloads 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report redownloads 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp:f0->62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0 50. model.apple_search_ads.apple_search_ads__organization_report 50. model.apple_search_ads.apple_search_ads__organization_report redownloads total_downloads 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0->50. model.apple_search_ads.apple_search_ads__organization_report:f0 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0->50. model.apple_search_ads.apple_search_ads__organization_report:f1 48. model.apple_search_ads.apple_search_ads__campaign_report 48. model.apple_search_ads.apple_search_ads__campaign_report redownloads total_downloads 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0->48. model.apple_search_ads.apple_search_ads__campaign_report:f0 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0->48. model.apple_search_ads.apple_search_ads__campaign_report:f1
62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report
  • Input Column: 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp[redownloads]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT
    • Output Columns:
      • redownloads: Directly mapped after casting
48. model.apple_search_ads.apple_search_ads__campaign_report
  • Input Column: 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report[redownloads]
    • Aggregation Summed up in the SELECT statement
    • Other Used in calculation of total_downloads
    • Output Columns:
      • redownloads: Aggregated sum in the output
      • total_downloads: Part of the sum for this calculated field
50. model.apple_search_ads.apple_search_ads__organization_report
  • Input Column: 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report[redownloads]
    • Aggregation Summed up in the SELECT statement
    • Other Used in calculating total_downloads
    • Output Columns:
      • redownloads: Aggregated sum of redownloads
      • total_downloads: Part of the sum for total_downloads
Column Lineage
%3 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp taps 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report taps 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp:f0->62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0 50. model.apple_search_ads.apple_search_ads__organization_report 50. model.apple_search_ads.apple_search_ads__organization_report taps 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0->50. model.apple_search_ads.apple_search_ads__organization_report:f0 48. model.apple_search_ads.apple_search_ads__campaign_report 48. model.apple_search_ads.apple_search_ads__campaign_report taps 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0->48. model.apple_search_ads.apple_search_ads__campaign_report:f0
62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report
  • Input Column: 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp[taps]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT
    • Output Columns:
      • taps: Directly mapped after casting
48. model.apple_search_ads.apple_search_ads__campaign_report
  • Input Column: 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report[taps]
    • Aggregation Summed up in the SELECT statement
    • Output Columns:
      • taps: Aggregated sum in the output
50. model.apple_search_ads.apple_search_ads__organization_report
  • Input Column: 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report[taps]
    • Aggregation Summed up in the SELECT statement
    • Output Columns:
      • taps: Aggregated sum of taps
63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of type TEXT, which is set to NULL. The LIMIT 0 clause ensures no rows are returned. This appears to be a template or placeholder query, possibly used for initializing a temporary table structure in a data modeling process.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp date id avg_cpa_amount avg_cpa_currency avg_cpt_amount avg_cpt_currency conversion_rate conversions impressions lat_off_installs lat_on_installs local_spend_amount local_spend_currency new_downloads redownloads tap_through_rate taps 295. source.apple_search_ads_source.apple_search_ads.campaign_report 295. source.apple_search_ads_source.apple_search_ads.campaign_report
Name Type Comment
date date None
id integer None
avg_cpa_amount double precision None
avg_cpa_currency text None
avg_cpt_amount double precision None
avg_cpt_currency text None
conversion_rate double precision None
conversions integer None
impressions integer None
lat_off_installs integer None
lat_on_installs integer None
local_spend_amount double precision None
local_spend_currency text None
new_downloads integer None
redownloads integer None
tap_through_rate double precision None
taps integer None
Column Lineage
%3 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp date 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report date_day 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp:f0->62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0 50. model.apple_search_ads.apple_search_ads__organization_report 50. model.apple_search_ads.apple_search_ads__organization_report date_day 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0->50. model.apple_search_ads.apple_search_ads__organization_report:f0 48. model.apple_search_ads.apple_search_ads__campaign_report 48. model.apple_search_ads.apple_search_ads__campaign_report date_day 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0->48. model.apple_search_ads.apple_search_ads__campaign_report:f0
62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report
  • Input Column: 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp[date]
    • Direct The date column is directly copied without transformation
    • Output Columns:
      • date_day: Directly mapped to date_day in the output
48. model.apple_search_ads.apple_search_ads__campaign_report
  • Input Column: 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
50. model.apple_search_ads.apple_search_ads__organization_report
  • Input Column: 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp id 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report campaign_id 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp:f0->62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0 48. model.apple_search_ads.apple_search_ads__campaign_report 48. model.apple_search_ads.apple_search_ads__campaign_report campaign_id 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0->48. model.apple_search_ads.apple_search_ads__campaign_report:f0
62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report
  • Input Column: 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp[id]
    • Direct The id column is directly copied without transformation
    • Output Columns:
      • campaign_id: Directly mapped to campaign_id in the output
48. model.apple_search_ads.apple_search_ads__campaign_report
  • Input Column: 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report[campaign_id]
    • Integration Used as the key to join with the campaign table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • campaign_id: Directly copied to the output
Column Lineage
%3 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp impressions 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report impressions 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp:f0->62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0 50. model.apple_search_ads.apple_search_ads__organization_report 50. model.apple_search_ads.apple_search_ads__organization_report impressions 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0->50. model.apple_search_ads.apple_search_ads__organization_report:f0 48. model.apple_search_ads.apple_search_ads__campaign_report 48. model.apple_search_ads.apple_search_ads__campaign_report impressions 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0->48. model.apple_search_ads.apple_search_ads__campaign_report:f0
62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report
  • Input Column: 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp[impressions]
    • Direct The impressions column is directly copied without transformation
    • Output Columns:
      • impressions: Directly mapped to impressions in the output
48. model.apple_search_ads.apple_search_ads__campaign_report
  • Input Column: 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report[impressions]
    • Aggregation Summed up in the SELECT statement
    • Output Columns:
      • impressions: Aggregated sum in the output
50. model.apple_search_ads.apple_search_ads__organization_report
  • Input Column: 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report[impressions]
    • Aggregation Summed up in the SELECT statement
    • Output Columns:
      • impressions: Aggregated sum of impressions
Column Lineage
%3 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp local_spend_amount 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report spend 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp:f0->62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0 50. model.apple_search_ads.apple_search_ads__organization_report 50. model.apple_search_ads.apple_search_ads__organization_report spend 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0->50. model.apple_search_ads.apple_search_ads__organization_report:f0 48. model.apple_search_ads.apple_search_ads__campaign_report 48. model.apple_search_ads.apple_search_ads__campaign_report spend 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0->48. model.apple_search_ads.apple_search_ads__campaign_report:f0
62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report
  • Input Column: 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp[local_spend_amount]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as DECIMAL(28, 6)
    • Output Columns:
      • spend: Directly mapped after casting
48. model.apple_search_ads.apple_search_ads__campaign_report
  • Input Column: 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report[spend]
    • Aggregation Summed up in the SELECT statement
    • Output Columns:
      • spend: Aggregated sum in the output
50. model.apple_search_ads.apple_search_ads__organization_report
  • Input Column: 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report[spend]
    • Aggregation Summed up in the SELECT statement
    • Output Columns:
      • spend: Aggregated sum of spend
Column Lineage
%3 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp local_spend_currency 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report currency 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp:f0->62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0 48. model.apple_search_ads.apple_search_ads__campaign_report 48. model.apple_search_ads.apple_search_ads__campaign_report currency 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0->48. model.apple_search_ads.apple_search_ads__campaign_report:f0
62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report
  • Input Column: 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp[local_spend_currency]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • currency: Directly mapped
48. model.apple_search_ads.apple_search_ads__campaign_report
  • Input Column: 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report[currency]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • currency: Directly copied to the output
Column Lineage
%3 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp new_downloads 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report new_downloads 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp:f0->62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0 50. model.apple_search_ads.apple_search_ads__organization_report 50. model.apple_search_ads.apple_search_ads__organization_report new_downloads total_downloads 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0->50. model.apple_search_ads.apple_search_ads__organization_report:f0 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0->50. model.apple_search_ads.apple_search_ads__organization_report:f1 48. model.apple_search_ads.apple_search_ads__campaign_report 48. model.apple_search_ads.apple_search_ads__campaign_report new_downloads total_downloads 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0->48. model.apple_search_ads.apple_search_ads__campaign_report:f0 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0->48. model.apple_search_ads.apple_search_ads__campaign_report:f1
62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report
  • Input Column: 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp[new_downloads]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT
    • Output Columns:
      • new_downloads: Directly mapped after casting
48. model.apple_search_ads.apple_search_ads__campaign_report
  • Input Column: 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report[new_downloads]
    • Aggregation Summed up in the SELECT statement
    • Other Used in calculation of total_downloads
    • Output Columns:
      • new_downloads: Aggregated sum in the output
      • total_downloads: Part of the sum for this calculated field
50. model.apple_search_ads.apple_search_ads__organization_report
  • Input Column: 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report[new_downloads]
    • Aggregation Summed up in the SELECT statement
    • Other Used in calculating total_downloads
    • Output Columns:
      • new_downloads: Aggregated sum of new_downloads
      • total_downloads: Part of the sum for total_downloads
Column Lineage
%3 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp redownloads 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report redownloads 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp:f0->62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0 50. model.apple_search_ads.apple_search_ads__organization_report 50. model.apple_search_ads.apple_search_ads__organization_report redownloads total_downloads 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0->50. model.apple_search_ads.apple_search_ads__organization_report:f0 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0->50. model.apple_search_ads.apple_search_ads__organization_report:f1 48. model.apple_search_ads.apple_search_ads__campaign_report 48. model.apple_search_ads.apple_search_ads__campaign_report redownloads total_downloads 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0->48. model.apple_search_ads.apple_search_ads__campaign_report:f0 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0->48. model.apple_search_ads.apple_search_ads__campaign_report:f1
62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report
  • Input Column: 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp[redownloads]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT
    • Output Columns:
      • redownloads: Directly mapped after casting
48. model.apple_search_ads.apple_search_ads__campaign_report
  • Input Column: 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report[redownloads]
    • Aggregation Summed up in the SELECT statement
    • Other Used in calculation of total_downloads
    • Output Columns:
      • redownloads: Aggregated sum in the output
      • total_downloads: Part of the sum for this calculated field
50. model.apple_search_ads.apple_search_ads__organization_report
  • Input Column: 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report[redownloads]
    • Aggregation Summed up in the SELECT statement
    • Other Used in calculating total_downloads
    • Output Columns:
      • redownloads: Aggregated sum of redownloads
      • total_downloads: Part of the sum for total_downloads
Column Lineage
%3 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp taps 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report taps 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp:f0->62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0 50. model.apple_search_ads.apple_search_ads__organization_report 50. model.apple_search_ads.apple_search_ads__organization_report taps 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0->50. model.apple_search_ads.apple_search_ads__organization_report:f0 48. model.apple_search_ads.apple_search_ads__campaign_report 48. model.apple_search_ads.apple_search_ads__campaign_report taps 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report:f0->48. model.apple_search_ads.apple_search_ads__campaign_report:f0
62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report
  • Input Column: 63. model.apple_search_ads_source.stg_apple_search_ads__campaign_report_tmp[taps]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT
    • Output Columns:
      • taps: Directly mapped after casting
48. model.apple_search_ads.apple_search_ads__campaign_report
  • Input Column: 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report[taps]
    • Aggregation Summed up in the SELECT statement
    • Output Columns:
      • taps: Aggregated sum in the output
50. model.apple_search_ads.apple_search_ads__organization_report
  • Input Column: 62. model.apple_search_ads_source.stg_apple_search_ads__campaign_report[taps]
    • Aggregation Summed up in the SELECT statement
    • Output Columns:
      • taps: Aggregated sum of taps
64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history

This SQL query processes data from the 'apple_search_ads_source.stg_apple_search_ads__keyword_history' model. It starts by selecting all columns from a temporary table, then defines a set of fields with specific data types. The final select statement renames some columns, calculates a 'is_most_recent_record' flag using a window function, and selects all fields from this final transformation.

CleaningDeduplicationOther
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp
), fields AS (
  SELECT
    CAST(NULL AS INT) AS ad_group_id,
    CAST(NULL AS DECIMAL(28, 6)) AS bid_amount,
    CAST(NULL AS TEXT) AS bid_currency,
    CAST(NULL AS INT) AS campaign_id,
    CAST(NULL AS INT) AS id,
    CAST(NULL AS TEXT) AS match_type,
    CAST(NULL AS TIMESTAMP) AS modification_time,
    CAST(NULL AS TEXT) AS status,
    CAST(NULL AS TEXT) AS text,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    modification_time AS modified_at,
    campaign_id,
    ad_group_id,
    id AS keyword_id,
    bid_amount,
    bid_currency,
    match_type,
    status AS keyword_status,
    text AS keyword_text,
    ROW_NUMBER() OVER (PARTITION BY source_relation, id ORDER BY modification_time DESC) = 1 AS is_most_recent_record
  FROM fields
)
SELECT
  *
FROM final
%3 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history source_relation modified_at is_most_recent_record keyword_id campaign_id ad_group_id bid_amount bid_currency match_type status keyword_text keyword_status 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp id modification_time ad_group_id bid_amount bid_currency campaign_id match_type status text 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp:f0->64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history:f3 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp:f1->64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history:f1 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp:f2->64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history:f5 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp:f3->64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history:f6 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp:f4->64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history:f7 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp:f5->64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history:f4 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp:f6->64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history:f8 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp:f7->64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history:f11 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp:f8->64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history:f10
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
modified_at timestamp without time zone Timestamp of when the keyword object was last modified.
is_most_recent_record boolean Boolean representing whether a record is the most recent version of that record.
keyword_id integer Keyword ID associated with the record.
campaign_id integer Campaign ID associated with the record.
ad_group_id integer Ad group ID associated with the record.
bid_amount double precision The bid amount to display your ad for the matching text value.
bid_currency text This currency value should match the respective organization's currency value.
match_type text Controls how ads are matched to user searches; EXACT or BROAD.
status None The current status of the keyword, values include ENABLED and PAUSED.
keyword_text text The word or phrase to match in user searches, to show respective ad.
keyword_status text None
Column Lineage
%3 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history source_relation 49. model.apple_search_ads.apple_search_ads__keyword_report 49. model.apple_search_ads.apple_search_ads__keyword_report source_relation 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history:f0->49. model.apple_search_ads.apple_search_ads__keyword_report:f0
49. model.apple_search_ads.apple_search_ads__keyword_report
  • Input Column: 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history[source_relation]
    • Integration used as a key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
Column Lineage
%3 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp modification_time 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history modified_at 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp:f0->64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history:f0
64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history
  • Input Column: 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp[modification_time]
    • Direct The column is directly copied without transformation
    • Deduplication Used in the ROW_NUMBER() window function to order records
    • Output Columns:
      • modified_at: Directly mapped
Column Lineage
%3 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp id 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history keyword_id 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp:f0->64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history:f0 49. model.apple_search_ads.apple_search_ads__keyword_report 49. model.apple_search_ads.apple_search_ads__keyword_report keyword_id 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history:f0->49. model.apple_search_ads.apple_search_ads__keyword_report:f0
64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history
  • Input Column: 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp[id]
    • Direct The column is directly copied without transformation
    • Deduplication Used in the ROW_NUMBER() window function to identify the most recent record
    • Output Columns:
      • keyword_id: Directly mapped
49. model.apple_search_ads.apple_search_ads__keyword_report
  • Input Column: 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history[keyword_id]
    • Integration used as a key to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • keyword_id: directly copied
Column Lineage
%3 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp campaign_id 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history campaign_id 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp:f0->64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history:f0
64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history
  • Input Column: 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp[campaign_id]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • campaign_id: Directly mapped
Column Lineage
%3 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp ad_group_id 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history ad_group_id 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp:f0->64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history:f0
64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history
  • Input Column: 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp[ad_group_id]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • ad_group_id: Directly mapped
Column Lineage
%3 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp bid_amount 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history bid_amount 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp:f0->64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history:f0
64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history
  • Input Column: 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp[bid_amount]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • bid_amount: Directly mapped
Column Lineage
%3 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp bid_currency 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history bid_currency 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp:f0->64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history:f0
64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history
  • Input Column: 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp[bid_currency]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • bid_currency: Directly mapped
Column Lineage
%3 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp match_type 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history match_type 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp:f0->64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history:f0 49. model.apple_search_ads.apple_search_ads__keyword_report 49. model.apple_search_ads.apple_search_ads__keyword_report match_type 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history:f0->49. model.apple_search_ads.apple_search_ads__keyword_report:f0
64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history
  • Input Column: 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp[match_type]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • match_type: Directly mapped
49. model.apple_search_ads.apple_search_ads__keyword_report
  • Input Column: 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history[match_type]
    • Direct directly copied to the output
    • Output Columns:
      • match_type: directly copied
Column Lineage
%3 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history status 49. model.apple_search_ads.apple_search_ads__keyword_report 49. model.apple_search_ads.apple_search_ads__keyword_report keyword_status 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history:f0->49. model.apple_search_ads.apple_search_ads__keyword_report:f0
49. model.apple_search_ads.apple_search_ads__keyword_report
  • Input Column: 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history[status]
    • Direct directly copied to the output
    • Cleaning possibly renamed from 'status' to 'keyword_status'
    • Output Columns:
      • keyword_status: directly copied and possibly renamed
Column Lineage
%3 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp text 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history keyword_text 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp:f0->64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history:f0 49. model.apple_search_ads.apple_search_ads__keyword_report 49. model.apple_search_ads.apple_search_ads__keyword_report keyword_text 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history:f0->49. model.apple_search_ads.apple_search_ads__keyword_report:f0
64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history
  • Input Column: 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp[text]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • keyword_text: Directly mapped
49. model.apple_search_ads.apple_search_ads__keyword_report
  • Input Column: 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history[keyword_text]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition to link keyword data with other tables
    • Output Columns:
      • keyword_text: It is directly mapped to the output column 'keyword_text'
Column Lineage
%3 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp status 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history keyword_status 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp:f0->64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history:f0 49. model.apple_search_ads.apple_search_ads__keyword_report 49. model.apple_search_ads.apple_search_ads__keyword_report keyword_status 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history:f0->49. model.apple_search_ads.apple_search_ads__keyword_report:f0
64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history
  • Input Column: 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp[status]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • keyword_status: Directly mapped
49. model.apple_search_ads.apple_search_ads__keyword_report
  • Input Column: 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history[keyword_status]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition to link keyword data with other tables
    • Output Columns:
      • keyword_status: It is directly mapped to the output column 'keyword_status'
65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of type TEXT, which is set to NULL. The query doesn't retrieve any actual data as it has a LIMIT 0 clause.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp id modification_time ad_group_id bid_amount bid_currency campaign_id deleted match_type status text 296. source.apple_search_ads_source.apple_search_ads.keyword_history 296. source.apple_search_ads_source.apple_search_ads.keyword_history
Name Type Comment
id integer None
modification_time timestamp without time zone None
ad_group_id integer None
bid_amount double precision None
bid_currency text None
campaign_id integer None
deleted boolean None
match_type text None
status text None
text text None
Column Lineage
%3 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp id 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history keyword_id 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp:f0->64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history:f0 49. model.apple_search_ads.apple_search_ads__keyword_report 49. model.apple_search_ads.apple_search_ads__keyword_report keyword_id 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history:f0->49. model.apple_search_ads.apple_search_ads__keyword_report:f0
64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history
  • Input Column: 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp[id]
    • Direct The column is directly copied without transformation
    • Deduplication Used in the ROW_NUMBER() window function to identify the most recent record
    • Output Columns:
      • keyword_id: Directly mapped
49. model.apple_search_ads.apple_search_ads__keyword_report
  • Input Column: 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history[keyword_id]
    • Integration used as a key to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • keyword_id: directly copied
Column Lineage
%3 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp modification_time 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history modified_at 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp:f0->64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history:f0
64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history
  • Input Column: 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp[modification_time]
    • Direct The column is directly copied without transformation
    • Deduplication Used in the ROW_NUMBER() window function to order records
    • Output Columns:
      • modified_at: Directly mapped
Column Lineage
%3 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp ad_group_id 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history ad_group_id 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp:f0->64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history:f0
64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history
  • Input Column: 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp[ad_group_id]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • ad_group_id: Directly mapped
Column Lineage
%3 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp bid_amount 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history bid_amount 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp:f0->64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history:f0
64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history
  • Input Column: 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp[bid_amount]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • bid_amount: Directly mapped
Column Lineage
%3 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp bid_currency 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history bid_currency 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp:f0->64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history:f0
64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history
  • Input Column: 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp[bid_currency]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • bid_currency: Directly mapped
Column Lineage
%3 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp campaign_id 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history campaign_id 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp:f0->64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history:f0
64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history
  • Input Column: 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp[campaign_id]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • campaign_id: Directly mapped
Column Lineage
%3 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp match_type 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history match_type 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp:f0->64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history:f0 49. model.apple_search_ads.apple_search_ads__keyword_report 49. model.apple_search_ads.apple_search_ads__keyword_report match_type 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history:f0->49. model.apple_search_ads.apple_search_ads__keyword_report:f0
64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history
  • Input Column: 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp[match_type]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • match_type: Directly mapped
49. model.apple_search_ads.apple_search_ads__keyword_report
  • Input Column: 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history[match_type]
    • Direct directly copied to the output
    • Output Columns:
      • match_type: directly copied
Column Lineage
%3 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp status 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history keyword_status 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp:f0->64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history:f0 49. model.apple_search_ads.apple_search_ads__keyword_report 49. model.apple_search_ads.apple_search_ads__keyword_report keyword_status 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history:f0->49. model.apple_search_ads.apple_search_ads__keyword_report:f0
64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history
  • Input Column: 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp[status]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • keyword_status: Directly mapped
49. model.apple_search_ads.apple_search_ads__keyword_report
  • Input Column: 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history[keyword_status]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition to link keyword data with other tables
    • Output Columns:
      • keyword_status: It is directly mapped to the output column 'keyword_status'
Column Lineage
%3 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp text 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history keyword_text 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp:f0->64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history:f0 49. model.apple_search_ads.apple_search_ads__keyword_report 49. model.apple_search_ads.apple_search_ads__keyword_report keyword_text 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history:f0->49. model.apple_search_ads.apple_search_ads__keyword_report:f0
64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history
  • Input Column: 65. model.apple_search_ads_source.stg_apple_search_ads__keyword_history_tmp[text]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • keyword_text: Directly mapped
49. model.apple_search_ads.apple_search_ads__keyword_report
  • Input Column: 64. model.apple_search_ads_source.stg_apple_search_ads__keyword_history[keyword_text]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition to link keyword data with other tables
    • Output Columns:
      • keyword_text: It is directly mapped to the output column 'keyword_text'
66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report

This SQL query performs a data transformation on the 'stg_apple_search_ads__keyword_report' model. It starts by selecting all columns from a temporary table, then creates a fields CTE with null or empty values for specific columns. Finally, it renames and reorganizes these columns in the final CTE. The query doesn't perform any actual data manipulation or filtering, but rather sets up a structure for the data.

CleaningOther
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp
), fields AS (
  SELECT
    CAST(NULL AS DATE) AS date,
    CAST(NULL AS INT) AS id,
    CAST(NULL AS INT) AS impressions,
    CAST(NULL AS DECIMAL(28, 6)) AS local_spend_amount,
    CAST(NULL AS TEXT) AS local_spend_currency,
    CAST(NULL AS INT) AS new_downloads,
    CAST(NULL AS INT) AS redownloads,
    CAST(NULL AS INT) AS taps,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    date AS date_day,
    id AS keyword_id,
    impressions,
    local_spend_amount AS spend,
    local_spend_currency AS currency,
    new_downloads,
    redownloads,
    taps
  FROM fields
)
SELECT
  *
FROM final
%3 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report source_relation keyword_id date_day impressions spend currency new_downloads redownloads taps 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp date id impressions local_spend_amount local_spend_currency new_downloads redownloads taps 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp:f0->66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report:f2 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp:f1->66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report:f1 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp:f2->66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report:f3 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp:f3->66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report:f4 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp:f4->66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report:f5 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp:f5->66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report:f6 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp:f6->66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report:f7 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp:f7->66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report:f8
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
keyword_id integer Keyword ID associated with the record.
date_day date Date for daily report aggregation.
impressions integer Number of times your ad appeared in App Store search results.
spend double precision The sum of costs associated with the number of impressions served; Spend is measured in the currency used in the campaign.
currency text This currency value should match the respective organization's currency value.
new_downloads integer App downloads from new users who have never before installed the respective app.
redownloads integer Occurs when a user downloads respective app, deletes it, and downloads the same app again following a tap on an ad on the App Store, or downloads the same app to an additional device.
taps integer The number of times ad was tapped by users within the reporting time period.
Column Lineage
%3 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report source_relation 49. model.apple_search_ads.apple_search_ads__keyword_report 49. model.apple_search_ads.apple_search_ads__keyword_report source_relation 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report:f0->49. model.apple_search_ads.apple_search_ads__keyword_report:f0
49. model.apple_search_ads.apple_search_ads__keyword_report
  • Input Column: 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with other tables
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
Column Lineage
%3 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp id 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report keyword_id 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp:f0->66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report:f0 49. model.apple_search_ads.apple_search_ads__keyword_report 49. model.apple_search_ads.apple_search_ads__keyword_report keyword_id 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report:f0->49. model.apple_search_ads.apple_search_ads__keyword_report:f0
66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report
  • Input Column: 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp[id]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as INT type
    • Output Columns:
      • keyword_id: Directly mapped after casting
49. model.apple_search_ads.apple_search_ads__keyword_report
  • Input Column: 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report[keyword_id]
    • Integration Used as the key to join with the keyword history table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • keyword_id: Indirectly mapped, as it's used to join with keyword history table
Column Lineage
%3 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp date 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report date_day 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp:f0->66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report:f0 49. model.apple_search_ads.apple_search_ads__keyword_report 49. model.apple_search_ads.apple_search_ads__keyword_report date_day 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report:f0->49. model.apple_search_ads.apple_search_ads__keyword_report:f0
66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report
  • Input Column: 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp[date]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as DATE type
    • Output Columns:
      • date_day: Directly mapped after casting
49. model.apple_search_ads.apple_search_ads__keyword_report
  • Input Column: 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp impressions 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report impressions 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp:f0->66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report:f0 49. model.apple_search_ads.apple_search_ads__keyword_report 49. model.apple_search_ads.apple_search_ads__keyword_report impressions 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report:f0->49. model.apple_search_ads.apple_search_ads__keyword_report:f0
66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report
  • Input Column: 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp[impressions]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as INT type
    • Output Columns:
      • impressions: Directly mapped after casting
49. model.apple_search_ads.apple_search_ads__keyword_report
  • Input Column: 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report[impressions]
    • Aggregation The column is summed up in the SELECT statement
    • Output Columns:
      • impressions: Aggregated sum in the output
Column Lineage
%3 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp local_spend_amount 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report spend 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp:f0->66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report:f0 49. model.apple_search_ads.apple_search_ads__keyword_report 49. model.apple_search_ads.apple_search_ads__keyword_report spend 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report:f0->49. model.apple_search_ads.apple_search_ads__keyword_report:f0
66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report
  • Input Column: 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp[local_spend_amount]
    • Cleaning The column is cast as DECIMAL(28, 6) in the fields CTE
    • Direct The column is directly copied to the final output
    • Output Columns:
      • spend: Directly mapped after renaming
49. model.apple_search_ads.apple_search_ads__keyword_report
  • Input Column: 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report[spend]
    • Aggregation The column is summed up in the SELECT statement
    • Output Columns:
      • spend: Aggregated sum in the output
Column Lineage
%3 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp local_spend_currency 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report currency 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp:f0->66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report:f0 49. model.apple_search_ads.apple_search_ads__keyword_report 49. model.apple_search_ads.apple_search_ads__keyword_report currency 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report:f0->49. model.apple_search_ads.apple_search_ads__keyword_report:f0
66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report
  • Input Column: 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp[local_spend_currency]
    • Cleaning The column is cast as TEXT in the fields CTE
    • Direct The column is directly copied to the final output
    • Output Columns:
      • currency: Directly mapped after renaming
49. model.apple_search_ads.apple_search_ads__keyword_report
  • Input Column: 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report[currency]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • currency: Directly copied to the output
Column Lineage
%3 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp new_downloads 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report new_downloads 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp:f0->66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report:f0 49. model.apple_search_ads.apple_search_ads__keyword_report 49. model.apple_search_ads.apple_search_ads__keyword_report new_downloads total_downloads 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report:f0->49. model.apple_search_ads.apple_search_ads__keyword_report:f0 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report:f0->49. model.apple_search_ads.apple_search_ads__keyword_report:f1
66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report
  • Input Column: 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp[new_downloads]
    • Cleaning The column is cast as INT in the fields CTE
    • Direct The column is directly copied to the final output
    • Output Columns:
      • new_downloads: Directly mapped without renaming
49. model.apple_search_ads.apple_search_ads__keyword_report
  • Input Column: 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report[new_downloads]
    • Aggregation The column is summed up in the SELECT statement
    • Featurization Used to calculate total_downloads
    • Output Columns:
      • new_downloads: Aggregated sum in the output
      • total_downloads: Part of the sum for this derived column
Column Lineage
%3 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp redownloads 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report redownloads 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp:f0->66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report:f0 49. model.apple_search_ads.apple_search_ads__keyword_report 49. model.apple_search_ads.apple_search_ads__keyword_report redownloads total_downloads 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report:f0->49. model.apple_search_ads.apple_search_ads__keyword_report:f0 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report:f0->49. model.apple_search_ads.apple_search_ads__keyword_report:f1
66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report
  • Input Column: 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp[redownloads]
    • Cleaning The column is cast as INT in the fields CTE
    • Direct The column is directly copied to the final output
    • Output Columns:
      • redownloads: Directly mapped without renaming
49. model.apple_search_ads.apple_search_ads__keyword_report
  • Input Column: 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report[redownloads]
    • Aggregation The column is summed up in the SELECT statement
    • Featurization Used to calculate total_downloads
    • Output Columns:
      • redownloads: Aggregated sum in the output
      • total_downloads: Part of the sum for this derived column
Column Lineage
%3 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp taps 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report taps 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp:f0->66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report:f0 49. model.apple_search_ads.apple_search_ads__keyword_report 49. model.apple_search_ads.apple_search_ads__keyword_report taps 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report:f0->49. model.apple_search_ads.apple_search_ads__keyword_report:f0
66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report
  • Input Column: 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp[taps]
    • Cleaning The column is cast as INT in the fields CTE
    • Direct The column is directly copied to the final output
    • Output Columns:
      • taps: Directly mapped without renaming
49. model.apple_search_ads.apple_search_ads__keyword_report
  • Input Column: 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report[taps]
    • Aggregation The column is summed up in the SELECT statement
    • Output Columns:
      • taps: Aggregated sum in the output
67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of TEXT data type. The query doesn't select any actual data and limits the result to 0 rows. This type of query is often used as a placeholder or to define a schema without populating it with data.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp date id avg_cpa_amount avg_cpa_currency avg_cpt_amount avg_cpt_currency conversion_rate conversions impressions lat_off_installs lat_on_installs local_spend_amount local_spend_currency new_downloads redownloads tap_through_rate taps 297. source.apple_search_ads_source.apple_search_ads.keyword_report 297. source.apple_search_ads_source.apple_search_ads.keyword_report
Name Type Comment
date date None
id integer None
avg_cpa_amount double precision None
avg_cpa_currency text None
avg_cpt_amount double precision None
avg_cpt_currency text None
conversion_rate double precision None
conversions integer None
impressions integer None
lat_off_installs integer None
lat_on_installs integer None
local_spend_amount double precision None
local_spend_currency text None
new_downloads integer None
redownloads integer None
tap_through_rate double precision None
taps integer None
Column Lineage
%3 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp date 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report date_day 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp:f0->66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report:f0 49. model.apple_search_ads.apple_search_ads__keyword_report 49. model.apple_search_ads.apple_search_ads__keyword_report date_day 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report:f0->49. model.apple_search_ads.apple_search_ads__keyword_report:f0
66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report
  • Input Column: 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp[date]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as DATE type
    • Output Columns:
      • date_day: Directly mapped after casting
49. model.apple_search_ads.apple_search_ads__keyword_report
  • Input Column: 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp id 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report keyword_id 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp:f0->66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report:f0 49. model.apple_search_ads.apple_search_ads__keyword_report 49. model.apple_search_ads.apple_search_ads__keyword_report keyword_id 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report:f0->49. model.apple_search_ads.apple_search_ads__keyword_report:f0
66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report
  • Input Column: 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp[id]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as INT type
    • Output Columns:
      • keyword_id: Directly mapped after casting
49. model.apple_search_ads.apple_search_ads__keyword_report
  • Input Column: 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report[keyword_id]
    • Integration Used as the key to join with the keyword history table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • keyword_id: Indirectly mapped, as it's used to join with keyword history table
Column Lineage
%3 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp impressions 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report impressions 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp:f0->66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report:f0 49. model.apple_search_ads.apple_search_ads__keyword_report 49. model.apple_search_ads.apple_search_ads__keyword_report impressions 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report:f0->49. model.apple_search_ads.apple_search_ads__keyword_report:f0
66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report
  • Input Column: 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp[impressions]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as INT type
    • Output Columns:
      • impressions: Directly mapped after casting
49. model.apple_search_ads.apple_search_ads__keyword_report
  • Input Column: 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report[impressions]
    • Aggregation The column is summed up in the SELECT statement
    • Output Columns:
      • impressions: Aggregated sum in the output
Column Lineage
%3 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp local_spend_amount 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report spend 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp:f0->66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report:f0 49. model.apple_search_ads.apple_search_ads__keyword_report 49. model.apple_search_ads.apple_search_ads__keyword_report spend 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report:f0->49. model.apple_search_ads.apple_search_ads__keyword_report:f0
66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report
  • Input Column: 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp[local_spend_amount]
    • Cleaning The column is cast as DECIMAL(28, 6) in the fields CTE
    • Direct The column is directly copied to the final output
    • Output Columns:
      • spend: Directly mapped after renaming
49. model.apple_search_ads.apple_search_ads__keyword_report
  • Input Column: 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report[spend]
    • Aggregation The column is summed up in the SELECT statement
    • Output Columns:
      • spend: Aggregated sum in the output
Column Lineage
%3 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp local_spend_currency 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report currency 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp:f0->66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report:f0 49. model.apple_search_ads.apple_search_ads__keyword_report 49. model.apple_search_ads.apple_search_ads__keyword_report currency 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report:f0->49. model.apple_search_ads.apple_search_ads__keyword_report:f0
66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report
  • Input Column: 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp[local_spend_currency]
    • Cleaning The column is cast as TEXT in the fields CTE
    • Direct The column is directly copied to the final output
    • Output Columns:
      • currency: Directly mapped after renaming
49. model.apple_search_ads.apple_search_ads__keyword_report
  • Input Column: 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report[currency]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • currency: Directly copied to the output
Column Lineage
%3 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp new_downloads 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report new_downloads 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp:f0->66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report:f0 49. model.apple_search_ads.apple_search_ads__keyword_report 49. model.apple_search_ads.apple_search_ads__keyword_report new_downloads total_downloads 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report:f0->49. model.apple_search_ads.apple_search_ads__keyword_report:f0 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report:f0->49. model.apple_search_ads.apple_search_ads__keyword_report:f1
66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report
  • Input Column: 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp[new_downloads]
    • Cleaning The column is cast as INT in the fields CTE
    • Direct The column is directly copied to the final output
    • Output Columns:
      • new_downloads: Directly mapped without renaming
49. model.apple_search_ads.apple_search_ads__keyword_report
  • Input Column: 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report[new_downloads]
    • Aggregation The column is summed up in the SELECT statement
    • Featurization Used to calculate total_downloads
    • Output Columns:
      • new_downloads: Aggregated sum in the output
      • total_downloads: Part of the sum for this derived column
Column Lineage
%3 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp redownloads 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report redownloads 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp:f0->66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report:f0 49. model.apple_search_ads.apple_search_ads__keyword_report 49. model.apple_search_ads.apple_search_ads__keyword_report redownloads total_downloads 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report:f0->49. model.apple_search_ads.apple_search_ads__keyword_report:f0 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report:f0->49. model.apple_search_ads.apple_search_ads__keyword_report:f1
66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report
  • Input Column: 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp[redownloads]
    • Cleaning The column is cast as INT in the fields CTE
    • Direct The column is directly copied to the final output
    • Output Columns:
      • redownloads: Directly mapped without renaming
49. model.apple_search_ads.apple_search_ads__keyword_report
  • Input Column: 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report[redownloads]
    • Aggregation The column is summed up in the SELECT statement
    • Featurization Used to calculate total_downloads
    • Output Columns:
      • redownloads: Aggregated sum in the output
      • total_downloads: Part of the sum for this derived column
Column Lineage
%3 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp taps 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report taps 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp:f0->66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report:f0 49. model.apple_search_ads.apple_search_ads__keyword_report 49. model.apple_search_ads.apple_search_ads__keyword_report taps 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report:f0->49. model.apple_search_ads.apple_search_ads__keyword_report:f0
66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report
  • Input Column: 67. model.apple_search_ads_source.stg_apple_search_ads__keyword_report_tmp[taps]
    • Cleaning The column is cast as INT in the fields CTE
    • Direct The column is directly copied to the final output
    • Output Columns:
      • taps: Directly mapped without renaming
49. model.apple_search_ads.apple_search_ads__keyword_report
  • Input Column: 66. model.apple_search_ads_source.stg_apple_search_ads__keyword_report[taps]
    • Aggregation The column is summed up in the SELECT statement
    • Output Columns:
      • taps: Aggregated sum in the output
68. model.apple_search_ads_source.stg_apple_search_ads__organization

This SQL query creates a staging table for Apple Search Ads organization data. It starts with a base table, then creates a fields CTE with null or empty values for specific columns. The final CTE renames and reorganizes these columns. The query doesn't perform any data manipulation or transformation on actual values; it's setting up a structure for the staging table with placeholder values.

CleaningOther
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_apple_search_ads_source.stg_apple_search_ads__organization_tmp
), fields AS (
  SELECT
    CAST(NULL AS TEXT) AS currency,
    CAST(NULL AS INT) AS id,
    CAST(NULL AS TEXT) AS name,
    CAST(NULL AS TEXT) AS payment_model,
    CAST(NULL AS TEXT) AS time_zone,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    id AS organization_id,
    currency,
    payment_model,
    name AS organization_name,
    time_zone
  FROM fields
)
SELECT
  *
FROM final
%3 68. model.apple_search_ads_source.stg_apple_search_ads__organization 68. model.apple_search_ads_source.stg_apple_search_ads__organization source_relation organization_id currency payment_model organization_name time_zone 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp id currency name payment_model time_zone 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp:f0->68. model.apple_search_ads_source.stg_apple_search_ads__organization:f1 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp:f1->68. model.apple_search_ads_source.stg_apple_search_ads__organization:f2 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp:f2->68. model.apple_search_ads_source.stg_apple_search_ads__organization:f4 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp:f3->68. model.apple_search_ads_source.stg_apple_search_ads__organization:f3 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp:f4->68. model.apple_search_ads_source.stg_apple_search_ads__organization:f5
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
organization_id integer Organization ID associated with the record.
currency text Specified currency for respective organization.
payment_model text Values include 'LOC', 'PAYG' or (payment method hasn't been set).
organization_name text Name of organization.
time_zone text Organization default timezone; values can be ORTZ or UTC.
Column Lineage
%3 68. model.apple_search_ads_source.stg_apple_search_ads__organization 68. model.apple_search_ads_source.stg_apple_search_ads__organization source_relation 50. model.apple_search_ads.apple_search_ads__organization_report 50. model.apple_search_ads.apple_search_ads__organization_report source_relation 68. model.apple_search_ads_source.stg_apple_search_ads__organization:f0->50. model.apple_search_ads.apple_search_ads__organization_report:f0 47. model.apple_search_ads.apple_search_ads__ad_report 47. model.apple_search_ads.apple_search_ads__ad_report source_relation 68. model.apple_search_ads_source.stg_apple_search_ads__organization:f0->47. model.apple_search_ads.apple_search_ads__ad_report:f0 51. model.apple_search_ads.apple_search_ads__search_term_report 51. model.apple_search_ads.apple_search_ads__search_term_report source_relation 68. model.apple_search_ads_source.stg_apple_search_ads__organization:f0->51. model.apple_search_ads.apple_search_ads__search_term_report:f0 46. model.apple_search_ads.apple_search_ads__ad_group_report 46. model.apple_search_ads.apple_search_ads__ad_group_report source_relation 68. model.apple_search_ads_source.stg_apple_search_ads__organization:f0->46. model.apple_search_ads.apple_search_ads__ad_group_report:f0 49. model.apple_search_ads.apple_search_ads__keyword_report 49. model.apple_search_ads.apple_search_ads__keyword_report source_relation 68. model.apple_search_ads_source.stg_apple_search_ads__organization:f0->49. model.apple_search_ads.apple_search_ads__keyword_report:f0 48. model.apple_search_ads.apple_search_ads__campaign_report 48. model.apple_search_ads.apple_search_ads__campaign_report source_relation 68. model.apple_search_ads_source.stg_apple_search_ads__organization:f0->48. model.apple_search_ads.apple_search_ads__campaign_report:f0
46. model.apple_search_ads.apple_search_ads__ad_group_report
  • Input Column: 68. model.apple_search_ads_source.stg_apple_search_ads__organization[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
47. model.apple_search_ads.apple_search_ads__ad_report
  • Input Column: 68. model.apple_search_ads_source.stg_apple_search_ads__organization[source_relation]
    • Integration used as a key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
48. model.apple_search_ads.apple_search_ads__campaign_report
  • Input Column: 68. model.apple_search_ads_source.stg_apple_search_ads__organization[source_relation]
    • Integration used as part of the join condition with campaign table
    • Output Columns:
      • source_relation: directly copied to output
49. model.apple_search_ads.apple_search_ads__keyword_report
  • Input Column: 68. model.apple_search_ads_source.stg_apple_search_ads__organization[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
50. model.apple_search_ads.apple_search_ads__organization_report
  • Input Column: 68. model.apple_search_ads_source.stg_apple_search_ads__organization[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as a key to join tables
    • Output Columns:
      • source_relation: Directly copied to the output
51. model.apple_search_ads.apple_search_ads__search_term_report
  • Input Column: 68. model.apple_search_ads_source.stg_apple_search_ads__organization[source_relation]
    • Integration Used as a join condition to link organization data with campaign data
    • Direct Directly selected in the final output
    • Output Columns:
      • source_relation: Directly copied to the output
Column Lineage
%3 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp id 68. model.apple_search_ads_source.stg_apple_search_ads__organization 68. model.apple_search_ads_source.stg_apple_search_ads__organization organization_id 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp:f0->68. model.apple_search_ads_source.stg_apple_search_ads__organization:f0 50. model.apple_search_ads.apple_search_ads__organization_report 50. model.apple_search_ads.apple_search_ads__organization_report organization_id 68. model.apple_search_ads_source.stg_apple_search_ads__organization:f0->50. model.apple_search_ads.apple_search_ads__organization_report:f0 47. model.apple_search_ads.apple_search_ads__ad_report 47. model.apple_search_ads.apple_search_ads__ad_report organization_id 68. model.apple_search_ads_source.stg_apple_search_ads__organization:f0->47. model.apple_search_ads.apple_search_ads__ad_report:f0 51. model.apple_search_ads.apple_search_ads__search_term_report 51. model.apple_search_ads.apple_search_ads__search_term_report organization_id 68. model.apple_search_ads_source.stg_apple_search_ads__organization:f0->51. model.apple_search_ads.apple_search_ads__search_term_report:f0 46. model.apple_search_ads.apple_search_ads__ad_group_report 46. model.apple_search_ads.apple_search_ads__ad_group_report organization_id 68. model.apple_search_ads_source.stg_apple_search_ads__organization:f0->46. model.apple_search_ads.apple_search_ads__ad_group_report:f0 49. model.apple_search_ads.apple_search_ads__keyword_report 49. model.apple_search_ads.apple_search_ads__keyword_report organization_id 68. model.apple_search_ads_source.stg_apple_search_ads__organization:f0->49. model.apple_search_ads.apple_search_ads__keyword_report:f0 48. model.apple_search_ads.apple_search_ads__campaign_report 48. model.apple_search_ads.apple_search_ads__campaign_report organization_id 68. model.apple_search_ads_source.stg_apple_search_ads__organization:f0->48. model.apple_search_ads.apple_search_ads__campaign_report:f0
68. model.apple_search_ads_source.stg_apple_search_ads__organization
  • Input Column: 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp[id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT in the fields CTE
    • Output Columns:
      • organization_id: Directly mapped and renamed
46. model.apple_search_ads.apple_search_ads__ad_group_report
  • Input Column: 68. model.apple_search_ads_source.stg_apple_search_ads__organization[organization_id]
    • Integration used as the key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • organization_id: directly copied
47. model.apple_search_ads.apple_search_ads__ad_report
  • Input Column: 68. model.apple_search_ads_source.stg_apple_search_ads__organization[organization_id]
    • Integration used as a key to join with the ad table
    • Direct directly copied to the output
    • Output Columns:
      • organization_id: directly copied
48. model.apple_search_ads.apple_search_ads__campaign_report
  • Input Column: 68. model.apple_search_ads_source.stg_apple_search_ads__organization[organization_id]
    • Integration used as part of the join condition with campaign table
    • Output Columns:
      • organization_id: directly copied to output
49. model.apple_search_ads.apple_search_ads__keyword_report
  • Input Column: 68. model.apple_search_ads_source.stg_apple_search_ads__organization[organization_id]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • organization_id: directly copied
50. model.apple_search_ads.apple_search_ads__organization_report
  • Input Column: 68. model.apple_search_ads_source.stg_apple_search_ads__organization[organization_id]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as a key to join tables
    • Aggregation The column is grouped by in the final SELECT
    • Output Columns:
      • organization_id: Directly copied to the output
51. model.apple_search_ads.apple_search_ads__search_term_report
  • Input Column: 68. model.apple_search_ads_source.stg_apple_search_ads__organization[organization_id]
    • Integration Used as a join condition to link organization data with campaign data
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • organization_id: Directly copied to the output
Column Lineage
%3 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp currency 68. model.apple_search_ads_source.stg_apple_search_ads__organization 68. model.apple_search_ads_source.stg_apple_search_ads__organization currency 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp:f0->68. model.apple_search_ads_source.stg_apple_search_ads__organization:f0 50. model.apple_search_ads.apple_search_ads__organization_report 50. model.apple_search_ads.apple_search_ads__organization_report currency 68. model.apple_search_ads_source.stg_apple_search_ads__organization:f0->50. model.apple_search_ads.apple_search_ads__organization_report:f0
68. model.apple_search_ads_source.stg_apple_search_ads__organization
  • Input Column: 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp[currency]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • currency: Directly mapped
50. model.apple_search_ads.apple_search_ads__organization_report
  • Input Column: 68. model.apple_search_ads_source.stg_apple_search_ads__organization[currency]
    • Direct The column is directly copied without any transformation
    • Aggregation The column is grouped by in the final SELECT
    • Output Columns:
      • currency: Directly copied to the output
Column Lineage
%3 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp payment_model 68. model.apple_search_ads_source.stg_apple_search_ads__organization 68. model.apple_search_ads_source.stg_apple_search_ads__organization payment_model 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp:f0->68. model.apple_search_ads_source.stg_apple_search_ads__organization:f0
68. model.apple_search_ads_source.stg_apple_search_ads__organization
  • Input Column: 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp[payment_model]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • payment_model: Directly mapped
Column Lineage
%3 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp name 68. model.apple_search_ads_source.stg_apple_search_ads__organization 68. model.apple_search_ads_source.stg_apple_search_ads__organization organization_name 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp:f0->68. model.apple_search_ads_source.stg_apple_search_ads__organization:f0 50. model.apple_search_ads.apple_search_ads__organization_report 50. model.apple_search_ads.apple_search_ads__organization_report organization_name 68. model.apple_search_ads_source.stg_apple_search_ads__organization:f0->50. model.apple_search_ads.apple_search_ads__organization_report:f0 47. model.apple_search_ads.apple_search_ads__ad_report 47. model.apple_search_ads.apple_search_ads__ad_report organization_name 68. model.apple_search_ads_source.stg_apple_search_ads__organization:f0->47. model.apple_search_ads.apple_search_ads__ad_report:f0 51. model.apple_search_ads.apple_search_ads__search_term_report 51. model.apple_search_ads.apple_search_ads__search_term_report organization_name 68. model.apple_search_ads_source.stg_apple_search_ads__organization:f0->51. model.apple_search_ads.apple_search_ads__search_term_report:f0 46. model.apple_search_ads.apple_search_ads__ad_group_report 46. model.apple_search_ads.apple_search_ads__ad_group_report organization_name 68. model.apple_search_ads_source.stg_apple_search_ads__organization:f0->46. model.apple_search_ads.apple_search_ads__ad_group_report:f0 49. model.apple_search_ads.apple_search_ads__keyword_report 49. model.apple_search_ads.apple_search_ads__keyword_report organization_name 68. model.apple_search_ads_source.stg_apple_search_ads__organization:f0->49. model.apple_search_ads.apple_search_ads__keyword_report:f0 48. model.apple_search_ads.apple_search_ads__campaign_report 48. model.apple_search_ads.apple_search_ads__campaign_report organization_name 68. model.apple_search_ads_source.stg_apple_search_ads__organization:f0->48. model.apple_search_ads.apple_search_ads__campaign_report:f0
68. model.apple_search_ads_source.stg_apple_search_ads__organization
  • Input Column: 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp[name]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • organization_name: Directly mapped and renamed
46. model.apple_search_ads.apple_search_ads__ad_group_report
  • Input Column: 68. model.apple_search_ads_source.stg_apple_search_ads__organization[organization_name]
    • Direct directly copied to the output
    • Output Columns:
      • organization_name: directly copied
47. model.apple_search_ads.apple_search_ads__ad_report
  • Input Column: 68. model.apple_search_ads_source.stg_apple_search_ads__organization[organization_name]
    • Direct directly copied to the output
    • Output Columns:
      • organization_name: directly copied
48. model.apple_search_ads.apple_search_ads__campaign_report
  • Input Column: 68. model.apple_search_ads_source.stg_apple_search_ads__organization[organization_name]
    • Direct directly selected in the final output
    • Output Columns:
      • organization_name: directly copied to output
49. model.apple_search_ads.apple_search_ads__keyword_report
  • Input Column: 68. model.apple_search_ads_source.stg_apple_search_ads__organization[organization_name]
    • Direct directly copied to the output
    • Output Columns:
      • organization_name: directly copied
50. model.apple_search_ads.apple_search_ads__organization_report
  • Input Column: 68. model.apple_search_ads_source.stg_apple_search_ads__organization[organization_name]
    • Direct The column is directly copied without any transformation
    • Aggregation The column is grouped by in the final SELECT
    • Output Columns:
      • organization_name: Directly copied to the output
51. model.apple_search_ads.apple_search_ads__search_term_report
  • Input Column: 68. model.apple_search_ads_source.stg_apple_search_ads__organization[organization_name]
    • Direct Directly selected in the final output
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • organization_name: Directly copied to the output
Column Lineage
%3 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp time_zone 68. model.apple_search_ads_source.stg_apple_search_ads__organization 68. model.apple_search_ads_source.stg_apple_search_ads__organization time_zone 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp:f0->68. model.apple_search_ads_source.stg_apple_search_ads__organization:f0
68. model.apple_search_ads_source.stg_apple_search_ads__organization
  • Input Column: 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp[time_zone]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • time_zone: Directly mapped
69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of type TEXT. It's likely used as a placeholder or template for further operations in a dbt (data build tool) model.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp id currency name payment_model role_names time_zone 298. source.apple_search_ads_source.apple_search_ads.organization 298. source.apple_search_ads_source.apple_search_ads.organization
Name Type Comment
id integer None
currency text None
name text None
payment_model text None
role_names text None
time_zone text None
Column Lineage
%3 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp id 68. model.apple_search_ads_source.stg_apple_search_ads__organization 68. model.apple_search_ads_source.stg_apple_search_ads__organization organization_id 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp:f0->68. model.apple_search_ads_source.stg_apple_search_ads__organization:f0 50. model.apple_search_ads.apple_search_ads__organization_report 50. model.apple_search_ads.apple_search_ads__organization_report organization_id 68. model.apple_search_ads_source.stg_apple_search_ads__organization:f0->50. model.apple_search_ads.apple_search_ads__organization_report:f0 47. model.apple_search_ads.apple_search_ads__ad_report 47. model.apple_search_ads.apple_search_ads__ad_report organization_id 68. model.apple_search_ads_source.stg_apple_search_ads__organization:f0->47. model.apple_search_ads.apple_search_ads__ad_report:f0 51. model.apple_search_ads.apple_search_ads__search_term_report 51. model.apple_search_ads.apple_search_ads__search_term_report organization_id 68. model.apple_search_ads_source.stg_apple_search_ads__organization:f0->51. model.apple_search_ads.apple_search_ads__search_term_report:f0 46. model.apple_search_ads.apple_search_ads__ad_group_report 46. model.apple_search_ads.apple_search_ads__ad_group_report organization_id 68. model.apple_search_ads_source.stg_apple_search_ads__organization:f0->46. model.apple_search_ads.apple_search_ads__ad_group_report:f0 49. model.apple_search_ads.apple_search_ads__keyword_report 49. model.apple_search_ads.apple_search_ads__keyword_report organization_id 68. model.apple_search_ads_source.stg_apple_search_ads__organization:f0->49. model.apple_search_ads.apple_search_ads__keyword_report:f0 48. model.apple_search_ads.apple_search_ads__campaign_report 48. model.apple_search_ads.apple_search_ads__campaign_report organization_id 68. model.apple_search_ads_source.stg_apple_search_ads__organization:f0->48. model.apple_search_ads.apple_search_ads__campaign_report:f0
68. model.apple_search_ads_source.stg_apple_search_ads__organization
  • Input Column: 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp[id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT in the fields CTE
    • Output Columns:
      • organization_id: Directly mapped and renamed
46. model.apple_search_ads.apple_search_ads__ad_group_report
  • Input Column: 68. model.apple_search_ads_source.stg_apple_search_ads__organization[organization_id]
    • Integration used as the key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • organization_id: directly copied
47. model.apple_search_ads.apple_search_ads__ad_report
  • Input Column: 68. model.apple_search_ads_source.stg_apple_search_ads__organization[organization_id]
    • Integration used as a key to join with the ad table
    • Direct directly copied to the output
    • Output Columns:
      • organization_id: directly copied
48. model.apple_search_ads.apple_search_ads__campaign_report
  • Input Column: 68. model.apple_search_ads_source.stg_apple_search_ads__organization[organization_id]
    • Integration used as part of the join condition with campaign table
    • Output Columns:
      • organization_id: directly copied to output
49. model.apple_search_ads.apple_search_ads__keyword_report
  • Input Column: 68. model.apple_search_ads_source.stg_apple_search_ads__organization[organization_id]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • organization_id: directly copied
50. model.apple_search_ads.apple_search_ads__organization_report
  • Input Column: 68. model.apple_search_ads_source.stg_apple_search_ads__organization[organization_id]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as a key to join tables
    • Aggregation The column is grouped by in the final SELECT
    • Output Columns:
      • organization_id: Directly copied to the output
51. model.apple_search_ads.apple_search_ads__search_term_report
  • Input Column: 68. model.apple_search_ads_source.stg_apple_search_ads__organization[organization_id]
    • Integration Used as a join condition to link organization data with campaign data
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • organization_id: Directly copied to the output
Column Lineage
%3 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp currency 68. model.apple_search_ads_source.stg_apple_search_ads__organization 68. model.apple_search_ads_source.stg_apple_search_ads__organization currency 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp:f0->68. model.apple_search_ads_source.stg_apple_search_ads__organization:f0 50. model.apple_search_ads.apple_search_ads__organization_report 50. model.apple_search_ads.apple_search_ads__organization_report currency 68. model.apple_search_ads_source.stg_apple_search_ads__organization:f0->50. model.apple_search_ads.apple_search_ads__organization_report:f0
68. model.apple_search_ads_source.stg_apple_search_ads__organization
  • Input Column: 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp[currency]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • currency: Directly mapped
50. model.apple_search_ads.apple_search_ads__organization_report
  • Input Column: 68. model.apple_search_ads_source.stg_apple_search_ads__organization[currency]
    • Direct The column is directly copied without any transformation
    • Aggregation The column is grouped by in the final SELECT
    • Output Columns:
      • currency: Directly copied to the output
Column Lineage
%3 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp name 68. model.apple_search_ads_source.stg_apple_search_ads__organization 68. model.apple_search_ads_source.stg_apple_search_ads__organization organization_name 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp:f0->68. model.apple_search_ads_source.stg_apple_search_ads__organization:f0 50. model.apple_search_ads.apple_search_ads__organization_report 50. model.apple_search_ads.apple_search_ads__organization_report organization_name 68. model.apple_search_ads_source.stg_apple_search_ads__organization:f0->50. model.apple_search_ads.apple_search_ads__organization_report:f0 47. model.apple_search_ads.apple_search_ads__ad_report 47. model.apple_search_ads.apple_search_ads__ad_report organization_name 68. model.apple_search_ads_source.stg_apple_search_ads__organization:f0->47. model.apple_search_ads.apple_search_ads__ad_report:f0 51. model.apple_search_ads.apple_search_ads__search_term_report 51. model.apple_search_ads.apple_search_ads__search_term_report organization_name 68. model.apple_search_ads_source.stg_apple_search_ads__organization:f0->51. model.apple_search_ads.apple_search_ads__search_term_report:f0 46. model.apple_search_ads.apple_search_ads__ad_group_report 46. model.apple_search_ads.apple_search_ads__ad_group_report organization_name 68. model.apple_search_ads_source.stg_apple_search_ads__organization:f0->46. model.apple_search_ads.apple_search_ads__ad_group_report:f0 49. model.apple_search_ads.apple_search_ads__keyword_report 49. model.apple_search_ads.apple_search_ads__keyword_report organization_name 68. model.apple_search_ads_source.stg_apple_search_ads__organization:f0->49. model.apple_search_ads.apple_search_ads__keyword_report:f0 48. model.apple_search_ads.apple_search_ads__campaign_report 48. model.apple_search_ads.apple_search_ads__campaign_report organization_name 68. model.apple_search_ads_source.stg_apple_search_ads__organization:f0->48. model.apple_search_ads.apple_search_ads__campaign_report:f0
68. model.apple_search_ads_source.stg_apple_search_ads__organization
  • Input Column: 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp[name]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • organization_name: Directly mapped and renamed
46. model.apple_search_ads.apple_search_ads__ad_group_report
  • Input Column: 68. model.apple_search_ads_source.stg_apple_search_ads__organization[organization_name]
    • Direct directly copied to the output
    • Output Columns:
      • organization_name: directly copied
47. model.apple_search_ads.apple_search_ads__ad_report
  • Input Column: 68. model.apple_search_ads_source.stg_apple_search_ads__organization[organization_name]
    • Direct directly copied to the output
    • Output Columns:
      • organization_name: directly copied
48. model.apple_search_ads.apple_search_ads__campaign_report
  • Input Column: 68. model.apple_search_ads_source.stg_apple_search_ads__organization[organization_name]
    • Direct directly selected in the final output
    • Output Columns:
      • organization_name: directly copied to output
49. model.apple_search_ads.apple_search_ads__keyword_report
  • Input Column: 68. model.apple_search_ads_source.stg_apple_search_ads__organization[organization_name]
    • Direct directly copied to the output
    • Output Columns:
      • organization_name: directly copied
50. model.apple_search_ads.apple_search_ads__organization_report
  • Input Column: 68. model.apple_search_ads_source.stg_apple_search_ads__organization[organization_name]
    • Direct The column is directly copied without any transformation
    • Aggregation The column is grouped by in the final SELECT
    • Output Columns:
      • organization_name: Directly copied to the output
51. model.apple_search_ads.apple_search_ads__search_term_report
  • Input Column: 68. model.apple_search_ads_source.stg_apple_search_ads__organization[organization_name]
    • Direct Directly selected in the final output
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • organization_name: Directly copied to the output
Column Lineage
%3 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp payment_model 68. model.apple_search_ads_source.stg_apple_search_ads__organization 68. model.apple_search_ads_source.stg_apple_search_ads__organization payment_model 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp:f0->68. model.apple_search_ads_source.stg_apple_search_ads__organization:f0
68. model.apple_search_ads_source.stg_apple_search_ads__organization
  • Input Column: 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp[payment_model]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • payment_model: Directly mapped
Column Lineage
%3 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp time_zone 68. model.apple_search_ads_source.stg_apple_search_ads__organization 68. model.apple_search_ads_source.stg_apple_search_ads__organization time_zone 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp:f0->68. model.apple_search_ads_source.stg_apple_search_ads__organization:f0
68. model.apple_search_ads_source.stg_apple_search_ads__organization
  • Input Column: 69. model.apple_search_ads_source.stg_apple_search_ads__organization_tmp[time_zone]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • time_zone: Directly mapped
70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report

This SQL query stages data from an Apple Search Ads source table. It casts various fields to specific data types, renames some columns, and selects a subset of columns for the final output. The query doesn't perform any filtering, deduplication, or aggregation, but focuses on cleaning and restructuring the data for further use.

CleaningOther
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp
), fields AS (
  SELECT
    CAST(NULL AS TEXT) AS _fivetran_id,
    CAST(NULL AS BOOLEAN) AS ad_group_deleted,
    CAST(NULL AS INT) AS ad_group_id,
    CAST(NULL AS TEXT) AS ad_group_name,
    CAST(NULL AS DECIMAL(28, 6)) AS bid_amount_amount,
    CAST(NULL AS TEXT) AS bid_amount_currency,
    CAST(NULL AS INT) AS campaign_id,
    CAST(NULL AS DATE) AS date,
    CAST(NULL AS BOOLEAN) AS deleted,
    CAST(NULL AS INT) AS impressions,
    CAST(NULL AS TEXT) AS keyword,
    CAST(NULL AS TEXT) AS keyword_display_status,
    CAST(NULL AS INT) AS keyword_id,
    CAST(NULL AS DECIMAL(28, 6)) AS local_spend_amount,
    CAST(NULL AS TEXT) AS local_spend_currency,
    CAST(NULL AS TEXT) AS match_type,
    CAST(NULL AS INT) AS new_downloads,
    CAST(NULL AS INT) AS redownloads,
    CAST(NULL AS TEXT) AS search_term_source,
    CAST(NULL AS TEXT) AS search_term_text,
    CAST(NULL AS INT) AS taps,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    date AS date_day,
    _fivetran_id,
    campaign_id,
    ad_group_id,
    ad_group_name,
    bid_amount_amount AS bid_amount,
    bid_amount_currency AS bid_currency,
    keyword AS keyword_text,
    keyword_display_status,
    keyword_id,
    local_spend_amount AS spend,
    local_spend_currency AS currency,
    match_type,
    search_term_source,
    search_term_text,
    impressions,
    taps,
    new_downloads,
    redownloads
  FROM fields
)
SELECT
  *
FROM final
%3 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report source_relation _fivetran_id ad_group_id ad_format campaign_id date_day ad_group_name bid_amount bid_currency keyword_text keyword_display_status keyword_id spend currency match_type search_term_source search_term_text impressions taps new_downloads redownloads 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp _fivetran_id ad_group_id campaign_id date ad_group_name bid_amount_amount bid_amount_currency impressions keyword keyword_display_status keyword_id local_spend_amount local_spend_currency match_type new_downloads redownloads search_term_source search_term_text taps 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp:f0->70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f1 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp:f1->70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f2 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp:f2->70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f4 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp:f3->70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f5 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp:f4->70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f6 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp:f5->70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f7 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp:f6->70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f8 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp:f7->70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f17 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp:f8->70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f9 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp:f9->70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f10 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp:f10->70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f11 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp:f11->70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f12 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp:f12->70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f13 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp:f13->70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f14 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp:f14->70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f19 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp:f15->70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f20 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp:f16->70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f15 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp:f17->70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f16 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp:f18->70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f18
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
_fivetran_id text A Fivetran internal unique id that helps us avoid duplicate rows in primary keyless tables.
ad_group_id integer Ad group ID associated with the record.
ad_format None Format of creative set.
campaign_id integer Campaign ID associated with the record.
date_day date Date for daily report aggregation.
ad_group_name text Ad group name.
bid_amount double precision The bid amount to display your ad for the matching text value.
bid_currency text This currency value should match the respective organization's currency value.
keyword_text text The word or phrase to match in user searches, to show respective ad.
keyword_display_status text The keyword display status can either be ACTIVE or PAUSED.
keyword_id integer Keyword ID associated with the record.
spend double precision The sum of costs associated with the number of impressions served; Spend is measured in the currency used in the campaign.
currency text This currency value should match the respective organization's currency value.
match_type text Controls how ads are matched to user searches; values include EXACT, BROAD or AUTO.
search_term_source text The search term source can either be TARGETED or AUTO; if this value is AUTO so will match_type.
search_term_text text The word or phrase to match of user searches.
impressions integer Number of times your ad appeared in App Store search results.
taps integer The number of times ad was tapped by users within the reporting time period.
new_downloads integer App downloads from new users who have never before installed the respective app.
redownloads integer Occurs when a user downloads respective app, deletes it, and downloads the same app again following a tap on an ad on the App Store, or downloads the same app to an additional device.
Column Lineage
%3 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report source_relation 51. model.apple_search_ads.apple_search_ads__search_term_report 51. model.apple_search_ads.apple_search_ads__search_term_report source_relation 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0->51. model.apple_search_ads.apple_search_ads__search_term_report:f0
51. model.apple_search_ads.apple_search_ads__search_term_report
  • Input Column: 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with other tables
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to output
Column Lineage
%3 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp _fivetran_id 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report _fivetran_id 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp:f0->70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0
70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report
  • Input Column: 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp[_fivetran_id]
    • Cleaning The column is cast to TEXT data type
    • Direct The column is directly copied to the output
    • Output Columns:
      • _fivetran_id: Directly copied after casting
Column Lineage
%3 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp ad_group_id 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report ad_group_id 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp:f0->70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0 51. model.apple_search_ads.apple_search_ads__search_term_report 51. model.apple_search_ads.apple_search_ads__search_term_report ad_group_id 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0->51. model.apple_search_ads.apple_search_ads__search_term_report:f0
70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report
  • Input Column: 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp[ad_group_id]
    • Cleaning The column is cast to INT data type
    • Direct The column is directly copied to the output
    • Output Columns:
      • ad_group_id: Directly copied after casting
51. model.apple_search_ads.apple_search_ads__search_term_report
  • Input Column: 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report[ad_group_id]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • ad_group_id: Directly copied to output
Column Lineage
%3 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp campaign_id 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report campaign_id 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp:f0->70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0
70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report
  • Input Column: 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp[campaign_id]
    • Cleaning The column is cast to INT data type
    • Direct The column is directly copied to the output
    • Output Columns:
      • campaign_id: Directly copied after casting
Column Lineage
%3 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp date 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report date_day 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp:f0->70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0 51. model.apple_search_ads.apple_search_ads__search_term_report 51. model.apple_search_ads.apple_search_ads__search_term_report date_day 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0->51. model.apple_search_ads.apple_search_ads__search_term_report:f0
70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report
  • Input Column: 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp[date]
    • Cleaning The column is cast to DATE data type
    • Direct The column is directly copied to the output
    • Output Columns:
      • date_day: Directly copied after casting and renamed
51. model.apple_search_ads.apple_search_ads__search_term_report
  • Input Column: 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to output
Column Lineage
%3 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp ad_group_name 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report ad_group_name 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp:f0->70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0 51. model.apple_search_ads.apple_search_ads__search_term_report 51. model.apple_search_ads.apple_search_ads__search_term_report ad_group_name 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0->51. model.apple_search_ads.apple_search_ads__search_term_report:f0
70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report
  • Input Column: 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp[ad_group_name]
    • Cleaning The column is cast to TEXT data type
    • Direct The column is directly copied to the output
    • Output Columns:
      • ad_group_name: Directly copied after casting
51. model.apple_search_ads.apple_search_ads__search_term_report
  • Input Column: 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report[ad_group_name]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • ad_group_name: Directly copied to output
Column Lineage
%3 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp bid_amount_amount 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report bid_amount 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp:f0->70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0
70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report
  • Input Column: 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp[bid_amount_amount]
    • Cleaning The column is cast to DECIMAL(28, 6) and renamed
    • Output Columns:
      • bid_amount: Directly mapped after casting
Column Lineage
%3 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp bid_amount_currency 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report bid_currency 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp:f0->70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0
70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report
  • Input Column: 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp[bid_amount_currency]
    • Cleaning The column is cast to TEXT and renamed
    • Output Columns:
      • bid_currency: Directly mapped after casting
Column Lineage
%3 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp keyword 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report keyword_text 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp:f0->70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0 51. model.apple_search_ads.apple_search_ads__search_term_report 51. model.apple_search_ads.apple_search_ads__search_term_report keyword_text 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0->51. model.apple_search_ads.apple_search_ads__search_term_report:f0
70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report
  • Input Column: 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp[keyword]
    • Cleaning The column is cast to TEXT and renamed
    • Output Columns:
      • keyword_text: Directly mapped after casting
51. model.apple_search_ads.apple_search_ads__search_term_report
  • Input Column: 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report[keyword_text]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • keyword_text: Directly copied to output
Column Lineage
%3 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp keyword_display_status 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report keyword_display_status 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp:f0->70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0
70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report
  • Input Column: 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp[keyword_display_status]
    • Cleaning The column is cast to TEXT
    • Direct The column is directly copied to the output
    • Output Columns:
      • keyword_display_status: Directly mapped after casting
Column Lineage
%3 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp keyword_id 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report keyword_id 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp:f0->70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0 51. model.apple_search_ads.apple_search_ads__search_term_report 51. model.apple_search_ads.apple_search_ads__search_term_report keyword_id 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0->51. model.apple_search_ads.apple_search_ads__search_term_report:f0
70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report
  • Input Column: 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp[keyword_id]
    • Cleaning The column is cast to INT
    • Direct The column is directly copied to the output
    • Output Columns:
      • keyword_id: Directly mapped after casting
51. model.apple_search_ads.apple_search_ads__search_term_report
  • Input Column: 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report[keyword_id]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the grouping in the final SELECT statement
    • Output Columns:
      • keyword_id: Directly mapped
Column Lineage
%3 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp local_spend_amount 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report spend 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp:f0->70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0 51. model.apple_search_ads.apple_search_ads__search_term_report 51. model.apple_search_ads.apple_search_ads__search_term_report spend 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0->51. model.apple_search_ads.apple_search_ads__search_term_report:f0
70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report
  • Input Column: 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp[local_spend_amount]
    • Cleaning The column is cast as DECIMAL(28, 6) and renamed
    • Output Columns:
      • spend: Directly mapped after casting and renaming
51. model.apple_search_ads.apple_search_ads__search_term_report
  • Input Column: 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report[spend]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • spend: Aggregated sum of spend
Column Lineage
%3 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp local_spend_currency 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report currency 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp:f0->70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0 51. model.apple_search_ads.apple_search_ads__search_term_report 51. model.apple_search_ads.apple_search_ads__search_term_report currency 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0->51. model.apple_search_ads.apple_search_ads__search_term_report:f0
70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report
  • Input Column: 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp[local_spend_currency]
    • Cleaning The column is cast as TEXT and renamed
    • Output Columns:
      • currency: Directly mapped after casting and renaming
51. model.apple_search_ads.apple_search_ads__search_term_report
  • Input Column: 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report[currency]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the grouping in the final SELECT statement
    • Output Columns:
      • currency: Directly mapped
Column Lineage
%3 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp match_type 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report match_type 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp:f0->70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0 51. model.apple_search_ads.apple_search_ads__search_term_report 51. model.apple_search_ads.apple_search_ads__search_term_report match_type 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0->51. model.apple_search_ads.apple_search_ads__search_term_report:f0
70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report
  • Input Column: 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp[match_type]
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • match_type: Directly mapped after casting
51. model.apple_search_ads.apple_search_ads__search_term_report
  • Input Column: 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report[match_type]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the grouping in the final SELECT statement
    • Output Columns:
      • match_type: Directly mapped
Column Lineage
%3 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp search_term_source 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report search_term_source 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp:f0->70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0
70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report
  • Input Column: 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp[search_term_source]
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • search_term_source: Directly mapped after casting
Column Lineage
%3 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp search_term_text 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report search_term_text 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp:f0->70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0 51. model.apple_search_ads.apple_search_ads__search_term_report 51. model.apple_search_ads.apple_search_ads__search_term_report search_term_text 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0->51. model.apple_search_ads.apple_search_ads__search_term_report:f0
70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report
  • Input Column: 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp[search_term_text]
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • search_term_text: Directly mapped after casting
51. model.apple_search_ads.apple_search_ads__search_term_report
  • Input Column: 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report[search_term_text]
    • Direct The column is directly copied without any transformation
    • Filtering The column is filtered to exclude NULL values
    • Integration The column is used as part of the grouping in the final SELECT statement
    • Output Columns:
      • search_term_text: Directly mapped
Column Lineage
%3 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp impressions 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report impressions 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp:f0->70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0 51. model.apple_search_ads.apple_search_ads__search_term_report 51. model.apple_search_ads.apple_search_ads__search_term_report impressions 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0->51. model.apple_search_ads.apple_search_ads__search_term_report:f0
70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report
  • Input Column: 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp[impressions]
    • Cleaning The column is cast to INT
    • Direct The column is directly copied to the output
    • Output Columns:
      • impressions: Directly mapped after casting
51. model.apple_search_ads.apple_search_ads__search_term_report
  • Input Column: 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report[impressions]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • impressions: Aggregated sum of impressions
Column Lineage
%3 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp taps 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report taps 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp:f0->70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0 51. model.apple_search_ads.apple_search_ads__search_term_report 51. model.apple_search_ads.apple_search_ads__search_term_report taps 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0->51. model.apple_search_ads.apple_search_ads__search_term_report:f0
70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report
  • Input Column: 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp[taps]
    • Cleaning The column is cast as INT
    • Output Columns:
      • taps: Directly mapped after casting
51. model.apple_search_ads.apple_search_ads__search_term_report
  • Input Column: 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report[taps]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • taps: Aggregated sum of taps
Column Lineage
%3 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp new_downloads 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report new_downloads 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp:f0->70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0 51. model.apple_search_ads.apple_search_ads__search_term_report 51. model.apple_search_ads.apple_search_ads__search_term_report new_downloads total_downloads 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0->51. model.apple_search_ads.apple_search_ads__search_term_report:f0 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0->51. model.apple_search_ads.apple_search_ads__search_term_report:f1
70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report
  • Input Column: 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp[new_downloads]
    • Cleaning The column is cast as INT
    • Output Columns:
      • new_downloads: Directly mapped after casting
51. model.apple_search_ads.apple_search_ads__search_term_report
  • Input Column: 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report[new_downloads]
    • Aggregation The column is summed up in the final SELECT statement
    • Other It's also used in combination with redownloads to calculate total_downloads
    • Output Columns:
      • new_downloads: Aggregated sum of new_downloads
      • total_downloads: Part of the calculation for total_downloads
Column Lineage
%3 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp redownloads 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report redownloads 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp:f0->70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0 51. model.apple_search_ads.apple_search_ads__search_term_report 51. model.apple_search_ads.apple_search_ads__search_term_report redownloads total_downloads 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0->51. model.apple_search_ads.apple_search_ads__search_term_report:f0 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0->51. model.apple_search_ads.apple_search_ads__search_term_report:f1
70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report
  • Input Column: 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp[redownloads]
    • Cleaning The column is cast as INT
    • Output Columns:
      • redownloads: Directly mapped after casting
51. model.apple_search_ads.apple_search_ads__search_term_report
  • Input Column: 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report[redownloads]
    • Aggregation The column is summed up in the GROUP BY clause
    • Other It's also used in a calculation to derive total_downloads
    • Output Columns:
      • redownloads: It is directly mapped to the output 'redownloads' column after aggregation
      • total_downloads: It contributes to the calculation of total_downloads (new_downloads + redownloads)
71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of type TEXT, which is set to NULL. The query is limited to 0 rows, effectively creating a template or schema for the '_dbt_source_relation' column without actually returning any data.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp _fivetran_id ad_group_id campaign_id date ad_group_deleted ad_group_name avg_cpa_amount avg_cpa_currency avg_cpt_amount avg_cpt_currency bid_amount_amount bid_amount_currency conversion_rate conversions deleted impressions keyword keyword_display_status keyword_id lat_off_installs lat_on_installs local_spend_amount local_spend_currency match_type new_downloads redownloads search_term_source search_term_text tap_through_rate taps 299. source.apple_search_ads_source.apple_search_ads.search_term_report 299. source.apple_search_ads_source.apple_search_ads.search_term_report
Name Type Comment
_fivetran_id text None
ad_group_id integer None
campaign_id integer None
date date None
ad_group_deleted boolean None
ad_group_name text None
avg_cpa_amount double precision None
avg_cpa_currency text None
avg_cpt_amount double precision None
avg_cpt_currency text None
bid_amount_amount double precision None
bid_amount_currency text None
conversion_rate double precision None
conversions integer None
deleted boolean None
impressions integer None
keyword text None
keyword_display_status text None
keyword_id integer None
lat_off_installs integer None
lat_on_installs integer None
local_spend_amount double precision None
local_spend_currency text None
match_type text None
new_downloads integer None
redownloads integer None
search_term_source text None
search_term_text text None
tap_through_rate double precision None
taps integer None
Column Lineage
%3 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp _fivetran_id 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report _fivetran_id 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp:f0->70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0
70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report
  • Input Column: 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp[_fivetran_id]
    • Cleaning The column is cast to TEXT data type
    • Direct The column is directly copied to the output
    • Output Columns:
      • _fivetran_id: Directly copied after casting
Column Lineage
%3 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp ad_group_id 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report ad_group_id 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp:f0->70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0 51. model.apple_search_ads.apple_search_ads__search_term_report 51. model.apple_search_ads.apple_search_ads__search_term_report ad_group_id 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0->51. model.apple_search_ads.apple_search_ads__search_term_report:f0
70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report
  • Input Column: 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp[ad_group_id]
    • Cleaning The column is cast to INT data type
    • Direct The column is directly copied to the output
    • Output Columns:
      • ad_group_id: Directly copied after casting
51. model.apple_search_ads.apple_search_ads__search_term_report
  • Input Column: 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report[ad_group_id]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • ad_group_id: Directly copied to output
Column Lineage
%3 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp campaign_id 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report campaign_id 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp:f0->70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0
70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report
  • Input Column: 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp[campaign_id]
    • Cleaning The column is cast to INT data type
    • Direct The column is directly copied to the output
    • Output Columns:
      • campaign_id: Directly copied after casting
Column Lineage
%3 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp date 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report date_day 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp:f0->70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0 51. model.apple_search_ads.apple_search_ads__search_term_report 51. model.apple_search_ads.apple_search_ads__search_term_report date_day 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0->51. model.apple_search_ads.apple_search_ads__search_term_report:f0
70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report
  • Input Column: 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp[date]
    • Cleaning The column is cast to DATE data type
    • Direct The column is directly copied to the output
    • Output Columns:
      • date_day: Directly copied after casting and renamed
51. model.apple_search_ads.apple_search_ads__search_term_report
  • Input Column: 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to output
Column Lineage
%3 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp ad_group_name 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report ad_group_name 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp:f0->70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0 51. model.apple_search_ads.apple_search_ads__search_term_report 51. model.apple_search_ads.apple_search_ads__search_term_report ad_group_name 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0->51. model.apple_search_ads.apple_search_ads__search_term_report:f0
70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report
  • Input Column: 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp[ad_group_name]
    • Cleaning The column is cast to TEXT data type
    • Direct The column is directly copied to the output
    • Output Columns:
      • ad_group_name: Directly copied after casting
51. model.apple_search_ads.apple_search_ads__search_term_report
  • Input Column: 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report[ad_group_name]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • ad_group_name: Directly copied to output
Column Lineage
%3 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp bid_amount_amount 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report bid_amount 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp:f0->70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0
70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report
  • Input Column: 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp[bid_amount_amount]
    • Cleaning The column is cast to DECIMAL(28, 6) and renamed
    • Output Columns:
      • bid_amount: Directly mapped after casting
Column Lineage
%3 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp bid_amount_currency 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report bid_currency 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp:f0->70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0
70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report
  • Input Column: 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp[bid_amount_currency]
    • Cleaning The column is cast to TEXT and renamed
    • Output Columns:
      • bid_currency: Directly mapped after casting
Column Lineage
%3 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp impressions 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report impressions 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp:f0->70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0 51. model.apple_search_ads.apple_search_ads__search_term_report 51. model.apple_search_ads.apple_search_ads__search_term_report impressions 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0->51. model.apple_search_ads.apple_search_ads__search_term_report:f0
70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report
  • Input Column: 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp[impressions]
    • Cleaning The column is cast to INT
    • Direct The column is directly copied to the output
    • Output Columns:
      • impressions: Directly mapped after casting
51. model.apple_search_ads.apple_search_ads__search_term_report
  • Input Column: 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report[impressions]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • impressions: Aggregated sum of impressions
Column Lineage
%3 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp keyword 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report keyword_text 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp:f0->70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0 51. model.apple_search_ads.apple_search_ads__search_term_report 51. model.apple_search_ads.apple_search_ads__search_term_report keyword_text 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0->51. model.apple_search_ads.apple_search_ads__search_term_report:f0
70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report
  • Input Column: 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp[keyword]
    • Cleaning The column is cast to TEXT and renamed
    • Output Columns:
      • keyword_text: Directly mapped after casting
51. model.apple_search_ads.apple_search_ads__search_term_report
  • Input Column: 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report[keyword_text]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • keyword_text: Directly copied to output
Column Lineage
%3 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp keyword_display_status 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report keyword_display_status 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp:f0->70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0
70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report
  • Input Column: 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp[keyword_display_status]
    • Cleaning The column is cast to TEXT
    • Direct The column is directly copied to the output
    • Output Columns:
      • keyword_display_status: Directly mapped after casting
Column Lineage
%3 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp keyword_id 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report keyword_id 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp:f0->70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0 51. model.apple_search_ads.apple_search_ads__search_term_report 51. model.apple_search_ads.apple_search_ads__search_term_report keyword_id 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0->51. model.apple_search_ads.apple_search_ads__search_term_report:f0
70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report
  • Input Column: 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp[keyword_id]
    • Cleaning The column is cast to INT
    • Direct The column is directly copied to the output
    • Output Columns:
      • keyword_id: Directly mapped after casting
51. model.apple_search_ads.apple_search_ads__search_term_report
  • Input Column: 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report[keyword_id]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the grouping in the final SELECT statement
    • Output Columns:
      • keyword_id: Directly mapped
Column Lineage
%3 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp local_spend_amount 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report spend 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp:f0->70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0 51. model.apple_search_ads.apple_search_ads__search_term_report 51. model.apple_search_ads.apple_search_ads__search_term_report spend 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0->51. model.apple_search_ads.apple_search_ads__search_term_report:f0
70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report
  • Input Column: 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp[local_spend_amount]
    • Cleaning The column is cast as DECIMAL(28, 6) and renamed
    • Output Columns:
      • spend: Directly mapped after casting and renaming
51. model.apple_search_ads.apple_search_ads__search_term_report
  • Input Column: 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report[spend]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • spend: Aggregated sum of spend
Column Lineage
%3 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp local_spend_currency 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report currency 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp:f0->70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0 51. model.apple_search_ads.apple_search_ads__search_term_report 51. model.apple_search_ads.apple_search_ads__search_term_report currency 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0->51. model.apple_search_ads.apple_search_ads__search_term_report:f0
70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report
  • Input Column: 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp[local_spend_currency]
    • Cleaning The column is cast as TEXT and renamed
    • Output Columns:
      • currency: Directly mapped after casting and renaming
51. model.apple_search_ads.apple_search_ads__search_term_report
  • Input Column: 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report[currency]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the grouping in the final SELECT statement
    • Output Columns:
      • currency: Directly mapped
Column Lineage
%3 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp match_type 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report match_type 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp:f0->70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0 51. model.apple_search_ads.apple_search_ads__search_term_report 51. model.apple_search_ads.apple_search_ads__search_term_report match_type 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0->51. model.apple_search_ads.apple_search_ads__search_term_report:f0
70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report
  • Input Column: 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp[match_type]
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • match_type: Directly mapped after casting
51. model.apple_search_ads.apple_search_ads__search_term_report
  • Input Column: 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report[match_type]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the grouping in the final SELECT statement
    • Output Columns:
      • match_type: Directly mapped
Column Lineage
%3 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp new_downloads 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report new_downloads 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp:f0->70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0 51. model.apple_search_ads.apple_search_ads__search_term_report 51. model.apple_search_ads.apple_search_ads__search_term_report new_downloads total_downloads 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0->51. model.apple_search_ads.apple_search_ads__search_term_report:f0 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0->51. model.apple_search_ads.apple_search_ads__search_term_report:f1
70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report
  • Input Column: 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp[new_downloads]
    • Cleaning The column is cast as INT
    • Output Columns:
      • new_downloads: Directly mapped after casting
51. model.apple_search_ads.apple_search_ads__search_term_report
  • Input Column: 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report[new_downloads]
    • Aggregation The column is summed up in the final SELECT statement
    • Other It's also used in combination with redownloads to calculate total_downloads
    • Output Columns:
      • new_downloads: Aggregated sum of new_downloads
      • total_downloads: Part of the calculation for total_downloads
Column Lineage
%3 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp redownloads 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report redownloads 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp:f0->70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0 51. model.apple_search_ads.apple_search_ads__search_term_report 51. model.apple_search_ads.apple_search_ads__search_term_report redownloads total_downloads 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0->51. model.apple_search_ads.apple_search_ads__search_term_report:f0 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0->51. model.apple_search_ads.apple_search_ads__search_term_report:f1
70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report
  • Input Column: 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp[redownloads]
    • Cleaning The column is cast as INT
    • Output Columns:
      • redownloads: Directly mapped after casting
51. model.apple_search_ads.apple_search_ads__search_term_report
  • Input Column: 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report[redownloads]
    • Aggregation The column is summed up in the GROUP BY clause
    • Other It's also used in a calculation to derive total_downloads
    • Output Columns:
      • redownloads: It is directly mapped to the output 'redownloads' column after aggregation
      • total_downloads: It contributes to the calculation of total_downloads (new_downloads + redownloads)
Column Lineage
%3 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp search_term_source 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report search_term_source 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp:f0->70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0
70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report
  • Input Column: 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp[search_term_source]
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • search_term_source: Directly mapped after casting
Column Lineage
%3 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp search_term_text 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report search_term_text 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp:f0->70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0 51. model.apple_search_ads.apple_search_ads__search_term_report 51. model.apple_search_ads.apple_search_ads__search_term_report search_term_text 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0->51. model.apple_search_ads.apple_search_ads__search_term_report:f0
70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report
  • Input Column: 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp[search_term_text]
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • search_term_text: Directly mapped after casting
51. model.apple_search_ads.apple_search_ads__search_term_report
  • Input Column: 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report[search_term_text]
    • Direct The column is directly copied without any transformation
    • Filtering The column is filtered to exclude NULL values
    • Integration The column is used as part of the grouping in the final SELECT statement
    • Output Columns:
      • search_term_text: Directly mapped
Column Lineage
%3 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp taps 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report taps 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp:f0->70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0 51. model.apple_search_ads.apple_search_ads__search_term_report 51. model.apple_search_ads.apple_search_ads__search_term_report taps 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report:f0->51. model.apple_search_ads.apple_search_ads__search_term_report:f0
70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report
  • Input Column: 71. model.apple_search_ads_source.stg_apple_search_ads__search_term_report_tmp[taps]
    • Cleaning The column is cast as INT
    • Output Columns:
      • taps: Directly mapped after casting
51. model.apple_search_ads.apple_search_ads__search_term_report
  • Input Column: 70. model.apple_search_ads_source.stg_apple_search_ads__search_term_report[taps]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • taps: Aggregated sum of taps
72. model.facebook_ads.facebook_ads__account_report

This SQL query combines data from two staging tables: basic ad report and account history. It joins these tables on account ID and source relation, filtering for the most recent account records. The query then aggregates ad performance metrics (clicks, impressions, spend) at the account and date level, while including various account details. The result is a comprehensive daily account-level report of Facebook ad performance with associated account information.

FilteringIntegrationAggregation
SQL Query
WITH report AS (
  SELECT
    *
  FROM TEST.PUBLIC_facebook_ads_source.stg_facebook_ads__basic_ad
), accounts AS (
  SELECT
    *
  FROM TEST.PUBLIC_facebook_ads_source.stg_facebook_ads__account_history
  WHERE
    is_most_recent_record = TRUE
), joined AS (
  SELECT
    report.source_relation,
    report.date_day,
    accounts.account_id,
    accounts.account_name,
    accounts.account_status,
    accounts.business_country_code,
    accounts.created_at,
    accounts.currency,
    accounts.timezone_name,
    SUM(report.clicks) AS clicks,
    SUM(report.impressions) AS impressions,
    SUM(report.spend) AS spend
  FROM report
  LEFT JOIN accounts
    ON report.account_id = accounts.account_id
    AND report.source_relation = accounts.source_relation
  GROUP BY
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9
)
SELECT
  *
FROM joined
%3 72. model.facebook_ads.facebook_ads__account_report 72. model.facebook_ads.facebook_ads__account_report source_relation date_day account_id account_name clicks impressions spend account_status business_country_code created_at currency timezone_name 79. model.facebook_ads_source.stg_facebook_ads__account_history 79. model.facebook_ads_source.stg_facebook_ads__account_history source_relation account_id account_name account_status business_country_code created_at currency timezone_name 79. model.facebook_ads_source.stg_facebook_ads__account_history:f0->72. model.facebook_ads.facebook_ads__account_report:f0 79. model.facebook_ads_source.stg_facebook_ads__account_history:f1->72. model.facebook_ads.facebook_ads__account_report:f2 79. model.facebook_ads_source.stg_facebook_ads__account_history:f2->72. model.facebook_ads.facebook_ads__account_report:f3 79. model.facebook_ads_source.stg_facebook_ads__account_history:f3->72. model.facebook_ads.facebook_ads__account_report:f7 79. model.facebook_ads_source.stg_facebook_ads__account_history:f4->72. model.facebook_ads.facebook_ads__account_report:f8 79. model.facebook_ads_source.stg_facebook_ads__account_history:f5->72. model.facebook_ads.facebook_ads__account_report:f9 79. model.facebook_ads_source.stg_facebook_ads__account_history:f6->72. model.facebook_ads.facebook_ads__account_report:f10 79. model.facebook_ads_source.stg_facebook_ads__account_history:f7->72. model.facebook_ads.facebook_ads__account_report:f11 85. model.facebook_ads_source.stg_facebook_ads__basic_ad 85. model.facebook_ads_source.stg_facebook_ads__basic_ad source_relation date_day account_id impressions clicks spend 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->72. model.facebook_ads.facebook_ads__account_report:f0 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f1->72. model.facebook_ads.facebook_ads__account_report:f1 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f2->72. model.facebook_ads.facebook_ads__account_report:f2 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f3->72. model.facebook_ads.facebook_ads__account_report:f5 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f4->72. model.facebook_ads.facebook_ads__account_report:f4 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f5->72. model.facebook_ads.facebook_ads__account_report:f6
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
date_day date The date of the performance.
account_id bigint The ID of the related account.
account_name character varying The name of the related account.
clicks bigint The number of clicks the ad had on the given day.
impressions bigint The number of impressions the ad had on the given day.
spend double precision The spend on the ad in the given day.
account_status text None
business_country_code text None
created_at timestamp without time zone None
currency text None
timezone_name text None
Column Lineage
%3 79. model.facebook_ads_source.stg_facebook_ads__account_history 79. model.facebook_ads_source.stg_facebook_ads__account_history source_relation 72. model.facebook_ads.facebook_ads__account_report 72. model.facebook_ads.facebook_ads__account_report source_relation 79. model.facebook_ads_source.stg_facebook_ads__account_history:f0->72. model.facebook_ads.facebook_ads__account_report:f0 85. model.facebook_ads_source.stg_facebook_ads__basic_ad 85. model.facebook_ads_source.stg_facebook_ads__basic_ad source_relation 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->72. model.facebook_ads.facebook_ads__account_report:f0
72. model.facebook_ads.facebook_ads__account_report
  • Input Column: 79. model.facebook_ads_source.stg_facebook_ads__account_history[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as a key to join with the report table
    • Aggregation The column is part of the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to output
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with the accounts table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
Column Lineage
%3 85. model.facebook_ads_source.stg_facebook_ads__basic_ad 85. model.facebook_ads_source.stg_facebook_ads__basic_ad date_day 72. model.facebook_ads.facebook_ads__account_report 72. model.facebook_ads.facebook_ads__account_report date_day 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->72. model.facebook_ads.facebook_ads__account_report:f0 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp date 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp:f0->85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0
85. model.facebook_ads_source.stg_facebook_ads__basic_ad
  • Input Column: 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp[date]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • date_day: Directly mapped and renamed
72. model.facebook_ads.facebook_ads__account_report
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 79. model.facebook_ads_source.stg_facebook_ads__account_history 79. model.facebook_ads_source.stg_facebook_ads__account_history account_id 72. model.facebook_ads.facebook_ads__account_report 72. model.facebook_ads.facebook_ads__account_report account_id 79. model.facebook_ads_source.stg_facebook_ads__account_history:f0->72. model.facebook_ads.facebook_ads__account_report:f0 85. model.facebook_ads_source.stg_facebook_ads__basic_ad 85. model.facebook_ads_source.stg_facebook_ads__basic_ad account_id 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->72. model.facebook_ads.facebook_ads__account_report:f0 80. model.facebook_ads_source.stg_facebook_ads__account_history_tmp 80. model.facebook_ads_source.stg_facebook_ads__account_history_tmp id 80. model.facebook_ads_source.stg_facebook_ads__account_history_tmp:f0->79. model.facebook_ads_source.stg_facebook_ads__account_history:f0 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp account_id 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp:f0->85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0
79. model.facebook_ads_source.stg_facebook_ads__account_history
  • Input Column: 80. model.facebook_ads_source.stg_facebook_ads__account_history_tmp[id]
    • Cleaning The column is cast to BIGINT
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • account_id: Directly mapped after casting to BIGINT
85. model.facebook_ads_source.stg_facebook_ads__basic_ad
  • Input Column: 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp[account_id]
    • Cleaning The column is cast to BIGINT data type
    • Output Columns:
      • account_id: Directly mapped after casting
72. model.facebook_ads.facebook_ads__account_report
  • Input Column: 79. model.facebook_ads_source.stg_facebook_ads__account_history[account_id]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as a key to join with the report table
    • Aggregation The column is part of the GROUP BY clause
    • Output Columns:
      • account_id: Directly copied to output
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[account_id]
    • Integration Used as the key to join with the accounts table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • account_id: Directly copied to the output
Column Lineage
%3 79. model.facebook_ads_source.stg_facebook_ads__account_history 79. model.facebook_ads_source.stg_facebook_ads__account_history account_name 72. model.facebook_ads.facebook_ads__account_report 72. model.facebook_ads.facebook_ads__account_report account_name 79. model.facebook_ads_source.stg_facebook_ads__account_history:f0->72. model.facebook_ads.facebook_ads__account_report:f0 80. model.facebook_ads_source.stg_facebook_ads__account_history_tmp 80. model.facebook_ads_source.stg_facebook_ads__account_history_tmp name 80. model.facebook_ads_source.stg_facebook_ads__account_history_tmp:f0->79. model.facebook_ads_source.stg_facebook_ads__account_history:f0
79. model.facebook_ads_source.stg_facebook_ads__account_history
  • Input Column: 80. model.facebook_ads_source.stg_facebook_ads__account_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • account_name: Directly mapped
72. model.facebook_ads.facebook_ads__account_report
  • Input Column: 79. model.facebook_ads_source.stg_facebook_ads__account_history[account_name]
    • Direct The column is directly copied without any transformation
    • Aggregation The column is part of the GROUP BY clause
    • Output Columns:
      • account_name: Directly copied to output
Column Lineage
%3 85. model.facebook_ads_source.stg_facebook_ads__basic_ad 85. model.facebook_ads_source.stg_facebook_ads__basic_ad clicks 72. model.facebook_ads.facebook_ads__account_report 72. model.facebook_ads.facebook_ads__account_report clicks 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->72. model.facebook_ads.facebook_ads__account_report:f0 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp inline_link_clicks 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp:f0->85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0
85. model.facebook_ads_source.stg_facebook_ads__basic_ad
  • Input Column: 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp[inline_link_clicks]
    • Cleaning The column is cleaned by applying COALESCE to handle potential NULL values
    • Output Columns:
      • clicks: Mapped after applying COALESCE and renamed
72. model.facebook_ads.facebook_ads__account_report
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[clicks]
    • Aggregation Summed up in the SELECT clause
    • Output Columns:
      • clicks: Aggregated into the output column
Column Lineage
%3 85. model.facebook_ads_source.stg_facebook_ads__basic_ad 85. model.facebook_ads_source.stg_facebook_ads__basic_ad impressions 72. model.facebook_ads.facebook_ads__account_report 72. model.facebook_ads.facebook_ads__account_report impressions 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->72. model.facebook_ads.facebook_ads__account_report:f0 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp impressions 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp:f0->85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0
85. model.facebook_ads_source.stg_facebook_ads__basic_ad
  • Input Column: 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp[impressions]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • impressions: Directly mapped
72. model.facebook_ads.facebook_ads__account_report
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[impressions]
    • Aggregation Summed up in the SELECT clause
    • Output Columns:
      • impressions: Aggregated into the output column
Column Lineage
%3 85. model.facebook_ads_source.stg_facebook_ads__basic_ad 85. model.facebook_ads_source.stg_facebook_ads__basic_ad spend 72. model.facebook_ads.facebook_ads__account_report 72. model.facebook_ads.facebook_ads__account_report spend 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->72. model.facebook_ads.facebook_ads__account_report:f0 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp spend 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp:f0->85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0
85. model.facebook_ads_source.stg_facebook_ads__basic_ad
  • Input Column: 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp[spend]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • spend: Directly mapped
72. model.facebook_ads.facebook_ads__account_report
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[spend]
    • Aggregation Summed up in the SELECT clause
    • Output Columns:
      • spend: Aggregated into the output column
Column Lineage
%3 79. model.facebook_ads_source.stg_facebook_ads__account_history 79. model.facebook_ads_source.stg_facebook_ads__account_history account_status 72. model.facebook_ads.facebook_ads__account_report 72. model.facebook_ads.facebook_ads__account_report account_status 79. model.facebook_ads_source.stg_facebook_ads__account_history:f0->72. model.facebook_ads.facebook_ads__account_report:f0
72. model.facebook_ads.facebook_ads__account_report
  • Input Column: 79. model.facebook_ads_source.stg_facebook_ads__account_history[account_status]
    • Direct The column is directly copied without any transformation
    • Aggregation The column is part of the GROUP BY clause
    • Output Columns:
      • account_status: Directly copied to output
Column Lineage
%3 79. model.facebook_ads_source.stg_facebook_ads__account_history 79. model.facebook_ads_source.stg_facebook_ads__account_history business_country_code 72. model.facebook_ads.facebook_ads__account_report 72. model.facebook_ads.facebook_ads__account_report business_country_code 79. model.facebook_ads_source.stg_facebook_ads__account_history:f0->72. model.facebook_ads.facebook_ads__account_report:f0
72. model.facebook_ads.facebook_ads__account_report
  • Input Column: 79. model.facebook_ads_source.stg_facebook_ads__account_history[business_country_code]
    • Direct The column is directly copied without any transformation
    • Aggregation The column is part of the GROUP BY clause
    • Output Columns:
      • business_country_code: Directly copied to output
Column Lineage
%3 79. model.facebook_ads_source.stg_facebook_ads__account_history 79. model.facebook_ads_source.stg_facebook_ads__account_history created_at 72. model.facebook_ads.facebook_ads__account_report 72. model.facebook_ads.facebook_ads__account_report created_at 79. model.facebook_ads_source.stg_facebook_ads__account_history:f0->72. model.facebook_ads.facebook_ads__account_report:f0
72. model.facebook_ads.facebook_ads__account_report
  • Input Column: 79. model.facebook_ads_source.stg_facebook_ads__account_history[created_at]
    • Direct The column is directly copied without any transformation
    • Aggregation The column is part of the GROUP BY clause
    • Output Columns:
      • created_at: Directly copied to output
Column Lineage
%3 79. model.facebook_ads_source.stg_facebook_ads__account_history 79. model.facebook_ads_source.stg_facebook_ads__account_history currency 72. model.facebook_ads.facebook_ads__account_report 72. model.facebook_ads.facebook_ads__account_report currency 79. model.facebook_ads_source.stg_facebook_ads__account_history:f0->72. model.facebook_ads.facebook_ads__account_report:f0
72. model.facebook_ads.facebook_ads__account_report
  • Input Column: 79. model.facebook_ads_source.stg_facebook_ads__account_history[currency]
    • Direct The column is directly copied without any transformation
    • Aggregation The column is part of the GROUP BY clause
    • Output Columns:
      • currency: Directly copied to output
Column Lineage
%3 79. model.facebook_ads_source.stg_facebook_ads__account_history 79. model.facebook_ads_source.stg_facebook_ads__account_history timezone_name 72. model.facebook_ads.facebook_ads__account_report 72. model.facebook_ads.facebook_ads__account_report timezone_name 79. model.facebook_ads_source.stg_facebook_ads__account_history:f0->72. model.facebook_ads.facebook_ads__account_report:f0
72. model.facebook_ads.facebook_ads__account_report
  • Input Column: 79. model.facebook_ads_source.stg_facebook_ads__account_history[timezone_name]
    • Direct The column is directly copied without any transformation
    • Aggregation The column is part of the GROUP BY clause
    • Output Columns:
      • timezone_name: Directly copied to output
73. model.facebook_ads.facebook_ads__ad_report

This SQL query integrates data from multiple Facebook Ads-related tables (ad reports, accounts, campaigns, ad sets, and ads) to create a comprehensive ad performance report. It joins these tables based on various IDs and the source relation, filters for the most recent records in history tables, and aggregates metrics such as clicks, impressions, and spend. The result is a detailed view of ad performance across different levels of the ad hierarchy (account, campaign, ad set, and ad).

FilteringIntegrationAggregation
SQL Query
WITH report AS (
  SELECT
    *
  FROM TEST.PUBLIC_facebook_ads_source.stg_facebook_ads__basic_ad
), accounts AS (
  SELECT
    *
  FROM TEST.PUBLIC_facebook_ads_source.stg_facebook_ads__account_history
  WHERE
    is_most_recent_record = TRUE
), campaigns AS (
  SELECT
    *
  FROM TEST.PUBLIC_facebook_ads_source.stg_facebook_ads__campaign_history
  WHERE
    is_most_recent_record = TRUE
), ad_sets AS (
  SELECT
    *
  FROM TEST.PUBLIC_facebook_ads_source.stg_facebook_ads__ad_set_history
  WHERE
    is_most_recent_record = TRUE
), ads AS (
  SELECT
    *
  FROM TEST.PUBLIC_facebook_ads_source.stg_facebook_ads__ad_history
  WHERE
    is_most_recent_record = TRUE
), joined AS (
  SELECT
    report.source_relation,
    report.date_day,
    accounts.account_id,
    accounts.account_name,
    campaigns.campaign_id,
    campaigns.campaign_name,
    ad_sets.ad_set_id,
    ad_sets.ad_set_name,
    ads.ad_id,
    ads.ad_name,
    SUM(report.clicks) AS clicks,
    SUM(report.impressions) AS impressions,
    SUM(report.spend) AS spend
  FROM report
  LEFT JOIN accounts
    ON report.account_id = accounts.account_id
    AND report.source_relation = accounts.source_relation
  LEFT JOIN ads
    ON report.ad_id = ads.ad_id AND report.source_relation = ads.source_relation
  LEFT JOIN campaigns
    ON ads.campaign_id = campaigns.campaign_id
    AND ads.source_relation = campaigns.source_relation
  LEFT JOIN ad_sets
    ON ads.ad_set_id = ad_sets.ad_set_id
    AND ads.source_relation = ad_sets.source_relation
  GROUP BY
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10
)
SELECT
  *
FROM joined
%3 73. model.facebook_ads.facebook_ads__ad_report 73. model.facebook_ads.facebook_ads__ad_report source_relation date_day account_id account_name campaign_id campaign_name ad_set_id ad_set_name ad_id ad_name clicks impressions spend 79. model.facebook_ads_source.stg_facebook_ads__account_history 79. model.facebook_ads_source.stg_facebook_ads__account_history source_relation account_id account_name 79. model.facebook_ads_source.stg_facebook_ads__account_history:f0->73. model.facebook_ads.facebook_ads__ad_report:f0 79. model.facebook_ads_source.stg_facebook_ads__account_history:f1->73. model.facebook_ads.facebook_ads__ad_report:f2 79. model.facebook_ads_source.stg_facebook_ads__account_history:f2->73. model.facebook_ads.facebook_ads__ad_report:f3 81. model.facebook_ads_source.stg_facebook_ads__ad_history 81. model.facebook_ads_source.stg_facebook_ads__ad_history source_relation ad_id ad_name 81. model.facebook_ads_source.stg_facebook_ads__ad_history:f0->73. model.facebook_ads.facebook_ads__ad_report:f0 81. model.facebook_ads_source.stg_facebook_ads__ad_history:f1->73. model.facebook_ads.facebook_ads__ad_report:f8 81. model.facebook_ads_source.stg_facebook_ads__ad_history:f2->73. model.facebook_ads.facebook_ads__ad_report:f9 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history source_relation ad_set_id ad_set_name 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history:f0->73. model.facebook_ads.facebook_ads__ad_report:f0 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history:f1->73. model.facebook_ads.facebook_ads__ad_report:f6 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history:f2->73. model.facebook_ads.facebook_ads__ad_report:f7 85. model.facebook_ads_source.stg_facebook_ads__basic_ad 85. model.facebook_ads_source.stg_facebook_ads__basic_ad source_relation ad_id date_day account_id impressions clicks spend 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->73. model.facebook_ads.facebook_ads__ad_report:f0 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f1->73. model.facebook_ads.facebook_ads__ad_report:f8 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f2->73. model.facebook_ads.facebook_ads__ad_report:f1 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f3->73. model.facebook_ads.facebook_ads__ad_report:f2 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f4->73. model.facebook_ads.facebook_ads__ad_report:f11 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f5->73. model.facebook_ads.facebook_ads__ad_report:f10 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f6->73. model.facebook_ads.facebook_ads__ad_report:f12 87. model.facebook_ads_source.stg_facebook_ads__campaign_history 87. model.facebook_ads_source.stg_facebook_ads__campaign_history source_relation campaign_id campaign_name 87. model.facebook_ads_source.stg_facebook_ads__campaign_history:f0->73. model.facebook_ads.facebook_ads__ad_report:f0 87. model.facebook_ads_source.stg_facebook_ads__campaign_history:f1->73. model.facebook_ads.facebook_ads__ad_report:f4 87. model.facebook_ads_source.stg_facebook_ads__campaign_history:f2->73. model.facebook_ads.facebook_ads__ad_report:f5
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
date_day date The date of the performance.
account_id bigint The ID of the related account.
account_name character varying The name of the related account.
campaign_id bigint The ID of the related campaign.
campaign_name text The name of the related campaign.
ad_set_id bigint The ID of the related ad set.
ad_set_name text The name of the related ad set.
ad_id bigint The ID of the related ad.
ad_name text The name of the related ad.
clicks bigint The number of clicks the ad had on the given day.
impressions bigint The number of impressions the ad had on the given day.
spend double precision The spend on the ad in the given day.
Column Lineage
%3 79. model.facebook_ads_source.stg_facebook_ads__account_history 79. model.facebook_ads_source.stg_facebook_ads__account_history source_relation 73. model.facebook_ads.facebook_ads__ad_report 73. model.facebook_ads.facebook_ads__ad_report source_relation 79. model.facebook_ads_source.stg_facebook_ads__account_history:f0->73. model.facebook_ads.facebook_ads__ad_report:f0 81. model.facebook_ads_source.stg_facebook_ads__ad_history 81. model.facebook_ads_source.stg_facebook_ads__ad_history source_relation 81. model.facebook_ads_source.stg_facebook_ads__ad_history:f0->73. model.facebook_ads.facebook_ads__ad_report:f0 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history source_relation 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history:f0->73. model.facebook_ads.facebook_ads__ad_report:f0 85. model.facebook_ads_source.stg_facebook_ads__basic_ad 85. model.facebook_ads_source.stg_facebook_ads__basic_ad source_relation 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->73. model.facebook_ads.facebook_ads__ad_report:f0 87. model.facebook_ads_source.stg_facebook_ads__campaign_history 87. model.facebook_ads_source.stg_facebook_ads__campaign_history source_relation 87. model.facebook_ads_source.stg_facebook_ads__campaign_history:f0->73. model.facebook_ads.facebook_ads__ad_report:f0
73. model.facebook_ads.facebook_ads__ad_report
  • Input Column: 79. model.facebook_ads_source.stg_facebook_ads__account_history[source_relation]
    • Integration used as part of the join condition with the report table
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 81. model.facebook_ads_source.stg_facebook_ads__ad_history[source_relation]
    • Integration used as a key to join with other tables
    • Direct copied directly to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with other tables
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
  • Input Column: 87. model.facebook_ads_source.stg_facebook_ads__campaign_history[source_relation]
    • Integration used to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
Column Lineage
%3 85. model.facebook_ads_source.stg_facebook_ads__basic_ad 85. model.facebook_ads_source.stg_facebook_ads__basic_ad date_day 73. model.facebook_ads.facebook_ads__ad_report 73. model.facebook_ads.facebook_ads__ad_report date_day 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->73. model.facebook_ads.facebook_ads__ad_report:f0 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp date 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp:f0->85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0
85. model.facebook_ads_source.stg_facebook_ads__basic_ad
  • Input Column: 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp[date]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • date_day: Directly mapped and renamed
73. model.facebook_ads.facebook_ads__ad_report
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 79. model.facebook_ads_source.stg_facebook_ads__account_history 79. model.facebook_ads_source.stg_facebook_ads__account_history account_id 73. model.facebook_ads.facebook_ads__ad_report 73. model.facebook_ads.facebook_ads__ad_report account_id 79. model.facebook_ads_source.stg_facebook_ads__account_history:f0->73. model.facebook_ads.facebook_ads__ad_report:f0 85. model.facebook_ads_source.stg_facebook_ads__basic_ad 85. model.facebook_ads_source.stg_facebook_ads__basic_ad account_id 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->73. model.facebook_ads.facebook_ads__ad_report:f0 80. model.facebook_ads_source.stg_facebook_ads__account_history_tmp 80. model.facebook_ads_source.stg_facebook_ads__account_history_tmp id 80. model.facebook_ads_source.stg_facebook_ads__account_history_tmp:f0->79. model.facebook_ads_source.stg_facebook_ads__account_history:f0 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp account_id 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp:f0->85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0
79. model.facebook_ads_source.stg_facebook_ads__account_history
  • Input Column: 80. model.facebook_ads_source.stg_facebook_ads__account_history_tmp[id]
    • Cleaning The column is cast to BIGINT
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • account_id: Directly mapped after casting to BIGINT
85. model.facebook_ads_source.stg_facebook_ads__basic_ad
  • Input Column: 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp[account_id]
    • Cleaning The column is cast to BIGINT data type
    • Output Columns:
      • account_id: Directly mapped after casting
73. model.facebook_ads.facebook_ads__ad_report
  • Input Column: 79. model.facebook_ads_source.stg_facebook_ads__account_history[account_id]
    • Integration used as the join key with the report table
    • Direct directly copied to the output
    • Output Columns:
      • account_id: directly copied
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[account_id]
    • Integration Used as a join key to connect with the accounts table
    • Output Columns:
      • account_id: Directly copied to the output from the joined accounts table
Column Lineage
%3 79. model.facebook_ads_source.stg_facebook_ads__account_history 79. model.facebook_ads_source.stg_facebook_ads__account_history account_name 73. model.facebook_ads.facebook_ads__ad_report 73. model.facebook_ads.facebook_ads__ad_report account_name 79. model.facebook_ads_source.stg_facebook_ads__account_history:f0->73. model.facebook_ads.facebook_ads__ad_report:f0 80. model.facebook_ads_source.stg_facebook_ads__account_history_tmp 80. model.facebook_ads_source.stg_facebook_ads__account_history_tmp name 80. model.facebook_ads_source.stg_facebook_ads__account_history_tmp:f0->79. model.facebook_ads_source.stg_facebook_ads__account_history:f0
79. model.facebook_ads_source.stg_facebook_ads__account_history
  • Input Column: 80. model.facebook_ads_source.stg_facebook_ads__account_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • account_name: Directly mapped
73. model.facebook_ads.facebook_ads__ad_report
  • Input Column: 79. model.facebook_ads_source.stg_facebook_ads__account_history[account_name]
    • Direct directly copied to the output
    • Output Columns:
      • account_name: directly copied
Column Lineage
%3 87. model.facebook_ads_source.stg_facebook_ads__campaign_history 87. model.facebook_ads_source.stg_facebook_ads__campaign_history campaign_id 73. model.facebook_ads.facebook_ads__ad_report 73. model.facebook_ads.facebook_ads__ad_report campaign_id 87. model.facebook_ads_source.stg_facebook_ads__campaign_history:f0->73. model.facebook_ads.facebook_ads__ad_report:f0 88. model.facebook_ads_source.stg_facebook_ads__campaign_history_tmp 88. model.facebook_ads_source.stg_facebook_ads__campaign_history_tmp id 88. model.facebook_ads_source.stg_facebook_ads__campaign_history_tmp:f0->87. model.facebook_ads_source.stg_facebook_ads__campaign_history:f0
87. model.facebook_ads_source.stg_facebook_ads__campaign_history
  • Input Column: 88. model.facebook_ads_source.stg_facebook_ads__campaign_history_tmp[id]
    • Cleaning Cast to BIGINT data type
    • Deduplication Used in the ROW_NUMBER() window function to identify the most recent record
    • Output Columns:
      • campaign_id: Directly mapped after casting to BIGINT
73. model.facebook_ads.facebook_ads__ad_report
  • Input Column: 87. model.facebook_ads_source.stg_facebook_ads__campaign_history[campaign_id]
    • Integration used to join with the ads table
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
Column Lineage
%3 87. model.facebook_ads_source.stg_facebook_ads__campaign_history 87. model.facebook_ads_source.stg_facebook_ads__campaign_history campaign_name 73. model.facebook_ads.facebook_ads__ad_report 73. model.facebook_ads.facebook_ads__ad_report campaign_name 87. model.facebook_ads_source.stg_facebook_ads__campaign_history:f0->73. model.facebook_ads.facebook_ads__ad_report:f0 88. model.facebook_ads_source.stg_facebook_ads__campaign_history_tmp 88. model.facebook_ads_source.stg_facebook_ads__campaign_history_tmp name 88. model.facebook_ads_source.stg_facebook_ads__campaign_history_tmp:f0->87. model.facebook_ads_source.stg_facebook_ads__campaign_history:f0
87. model.facebook_ads_source.stg_facebook_ads__campaign_history
  • Input Column: 88. model.facebook_ads_source.stg_facebook_ads__campaign_history_tmp[name]
    • Direct Copied without transformation
    • Output Columns:
      • campaign_name: Directly mapped
73. model.facebook_ads.facebook_ads__ad_report
  • Input Column: 87. model.facebook_ads_source.stg_facebook_ads__campaign_history[campaign_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_name: directly copied
Column Lineage
%3 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history ad_set_id 73. model.facebook_ads.facebook_ads__ad_report 73. model.facebook_ads.facebook_ads__ad_report ad_set_id 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history:f0->73. model.facebook_ads.facebook_ads__ad_report:f0 84. model.facebook_ads_source.stg_facebook_ads__ad_set_history_tmp 84. model.facebook_ads_source.stg_facebook_ads__ad_set_history_tmp id 84. model.facebook_ads_source.stg_facebook_ads__ad_set_history_tmp:f0->83. model.facebook_ads_source.stg_facebook_ads__ad_set_history:f0
83. model.facebook_ads_source.stg_facebook_ads__ad_set_history
  • Input Column: 84. model.facebook_ads_source.stg_facebook_ads__ad_set_history_tmp[id]
    • Cleaning The column is cast to BIGINT
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • ad_set_id: Directly mapped after casting to BIGINT
73. model.facebook_ads.facebook_ads__ad_report
  • Input Column: 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history[ad_set_id]
    • Integration used as part of the join condition with the ads table
    • Direct directly copied to the output
    • Output Columns:
      • ad_set_id: directly copied
Column Lineage
%3 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history ad_set_name 73. model.facebook_ads.facebook_ads__ad_report 73. model.facebook_ads.facebook_ads__ad_report ad_set_name 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history:f0->73. model.facebook_ads.facebook_ads__ad_report:f0 84. model.facebook_ads_source.stg_facebook_ads__ad_set_history_tmp 84. model.facebook_ads_source.stg_facebook_ads__ad_set_history_tmp name 84. model.facebook_ads_source.stg_facebook_ads__ad_set_history_tmp:f0->83. model.facebook_ads_source.stg_facebook_ads__ad_set_history:f0
83. model.facebook_ads_source.stg_facebook_ads__ad_set_history
  • Input Column: 84. model.facebook_ads_source.stg_facebook_ads__ad_set_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • ad_set_name: Directly mapped
73. model.facebook_ads.facebook_ads__ad_report
  • Input Column: 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history[ad_set_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_set_name: directly copied
Column Lineage
%3 81. model.facebook_ads_source.stg_facebook_ads__ad_history 81. model.facebook_ads_source.stg_facebook_ads__ad_history ad_id 73. model.facebook_ads.facebook_ads__ad_report 73. model.facebook_ads.facebook_ads__ad_report ad_id 81. model.facebook_ads_source.stg_facebook_ads__ad_history:f0->73. model.facebook_ads.facebook_ads__ad_report:f0 85. model.facebook_ads_source.stg_facebook_ads__basic_ad 85. model.facebook_ads_source.stg_facebook_ads__basic_ad ad_id 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->73. model.facebook_ads.facebook_ads__ad_report:f0 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp id 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp:f0->81. model.facebook_ads_source.stg_facebook_ads__ad_history:f0 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp ad_id 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp:f0->85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0
81. model.facebook_ads_source.stg_facebook_ads__ad_history
  • Input Column: 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp[id]
    • Cleaning The column is cast to BIGINT
    • Deduplication Used in ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • ad_id: Directly mapped after casting to BIGINT
85. model.facebook_ads_source.stg_facebook_ads__basic_ad
  • Input Column: 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp[ad_id]
    • Cleaning The column is cast to BIGINT data type
    • Output Columns:
      • ad_id: Directly mapped after casting
73. model.facebook_ads.facebook_ads__ad_report
  • Input Column: 81. model.facebook_ads_source.stg_facebook_ads__ad_history[ad_id]
    • Integration used as a key to join with the report table
    • Direct copied directly to the output
    • Output Columns:
      • ad_id: directly copied
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[ad_id]
    • Integration Used as a join key to connect with the ads table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • ad_id: Directly copied to the output from the joined ads table
Column Lineage
%3 81. model.facebook_ads_source.stg_facebook_ads__ad_history 81. model.facebook_ads_source.stg_facebook_ads__ad_history ad_name 73. model.facebook_ads.facebook_ads__ad_report 73. model.facebook_ads.facebook_ads__ad_report ad_name 81. model.facebook_ads_source.stg_facebook_ads__ad_history:f0->73. model.facebook_ads.facebook_ads__ad_report:f0 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp name 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp:f0->81. model.facebook_ads_source.stg_facebook_ads__ad_history:f0
81. model.facebook_ads_source.stg_facebook_ads__ad_history
  • Input Column: 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • ad_name: Directly mapped
73. model.facebook_ads.facebook_ads__ad_report
  • Input Column: 81. model.facebook_ads_source.stg_facebook_ads__ad_history[ad_name]
    • Direct copied directly to the output
    • Output Columns:
      • ad_name: directly copied
Column Lineage
%3 85. model.facebook_ads_source.stg_facebook_ads__basic_ad 85. model.facebook_ads_source.stg_facebook_ads__basic_ad clicks 73. model.facebook_ads.facebook_ads__ad_report 73. model.facebook_ads.facebook_ads__ad_report clicks 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->73. model.facebook_ads.facebook_ads__ad_report:f0 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp inline_link_clicks 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp:f0->85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0
85. model.facebook_ads_source.stg_facebook_ads__basic_ad
  • Input Column: 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp[inline_link_clicks]
    • Cleaning The column is cleaned by applying COALESCE to handle potential NULL values
    • Output Columns:
      • clicks: Mapped after applying COALESCE and renamed
73. model.facebook_ads.facebook_ads__ad_report
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[clicks]
    • Aggregation The column is summed up in the SELECT statement
    • Output Columns:
      • clicks: Aggregated sum in the output
Column Lineage
%3 85. model.facebook_ads_source.stg_facebook_ads__basic_ad 85. model.facebook_ads_source.stg_facebook_ads__basic_ad impressions 73. model.facebook_ads.facebook_ads__ad_report 73. model.facebook_ads.facebook_ads__ad_report impressions 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->73. model.facebook_ads.facebook_ads__ad_report:f0 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp impressions 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp:f0->85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0
85. model.facebook_ads_source.stg_facebook_ads__basic_ad
  • Input Column: 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp[impressions]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • impressions: Directly mapped
73. model.facebook_ads.facebook_ads__ad_report
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[impressions]
    • Aggregation The column is summed up in the SELECT statement
    • Output Columns:
      • impressions: Aggregated sum in the output
Column Lineage
%3 85. model.facebook_ads_source.stg_facebook_ads__basic_ad 85. model.facebook_ads_source.stg_facebook_ads__basic_ad spend 73. model.facebook_ads.facebook_ads__ad_report 73. model.facebook_ads.facebook_ads__ad_report spend 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->73. model.facebook_ads.facebook_ads__ad_report:f0 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp spend 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp:f0->85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0
85. model.facebook_ads_source.stg_facebook_ads__basic_ad
  • Input Column: 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp[spend]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • spend: Directly mapped
73. model.facebook_ads.facebook_ads__ad_report
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[spend]
    • Aggregation The column is summed up in the SELECT statement
    • Output Columns:
      • spend: Aggregated sum in the output
74. model.facebook_ads.facebook_ads__ad_set_report

This SQL query integrates data from multiple Facebook Ads related tables (basic ad reports, account history, campaign history, ad set history, and ad history) to create a comprehensive ad set report. It filters for the most recent records in the history tables, joins these tables based on various ID fields and source relations, and then aggregates metrics like clicks, impressions, and spend at the ad set level. The result is a detailed report that includes account, campaign, and ad set information along with performance metrics.

FilteringIntegrationAggregation
SQL Query
WITH report AS (
  SELECT
    *
  FROM TEST.PUBLIC_facebook_ads_source.stg_facebook_ads__basic_ad
), accounts AS (
  SELECT
    *
  FROM TEST.PUBLIC_facebook_ads_source.stg_facebook_ads__account_history
  WHERE
    is_most_recent_record = TRUE
), campaigns AS (
  SELECT
    *
  FROM TEST.PUBLIC_facebook_ads_source.stg_facebook_ads__campaign_history
  WHERE
    is_most_recent_record = TRUE
), ad_sets AS (
  SELECT
    *
  FROM TEST.PUBLIC_facebook_ads_source.stg_facebook_ads__ad_set_history
  WHERE
    is_most_recent_record = TRUE
), ads AS (
  SELECT
    *
  FROM TEST.PUBLIC_facebook_ads_source.stg_facebook_ads__ad_history
  WHERE
    is_most_recent_record = TRUE
), joined AS (
  SELECT
    report.source_relation,
    report.date_day,
    accounts.account_id,
    accounts.account_name,
    campaigns.campaign_id,
    campaigns.campaign_name,
    ad_sets.ad_set_id,
    ad_sets.ad_set_name,
    ad_sets.start_at,
    ad_sets.end_at,
    ad_sets.bid_strategy,
    ad_sets.daily_budget,
    ad_sets.budget_remaining,
    SUM(report.clicks) AS clicks,
    SUM(report.impressions) AS impressions,
    SUM(report.spend) AS spend
  FROM report
  LEFT JOIN accounts
    ON report.account_id = accounts.account_id
    AND report.source_relation = accounts.source_relation
  LEFT JOIN ads
    ON report.ad_id = ads.ad_id AND report.source_relation = ads.source_relation
  LEFT JOIN campaigns
    ON ads.campaign_id = campaigns.campaign_id
    AND ads.source_relation = campaigns.source_relation
  LEFT JOIN ad_sets
    ON ads.ad_set_id = ad_sets.ad_set_id
    AND ads.source_relation = ad_sets.source_relation
  GROUP BY
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10,
    11,
    12,
    13
)
SELECT
  *
FROM joined
%3 74. model.facebook_ads.facebook_ads__ad_set_report 74. model.facebook_ads.facebook_ads__ad_set_report source_relation date_day account_id account_name campaign_id campaign_name ad_set_id ad_set_name clicks impressions spend start_at end_at bid_strategy daily_budget budget_remaining 79. model.facebook_ads_source.stg_facebook_ads__account_history 79. model.facebook_ads_source.stg_facebook_ads__account_history source_relation account_id account_name 79. model.facebook_ads_source.stg_facebook_ads__account_history:f0->74. model.facebook_ads.facebook_ads__ad_set_report:f0 79. model.facebook_ads_source.stg_facebook_ads__account_history:f1->74. model.facebook_ads.facebook_ads__ad_set_report:f2 79. model.facebook_ads_source.stg_facebook_ads__account_history:f2->74. model.facebook_ads.facebook_ads__ad_set_report:f3 81. model.facebook_ads_source.stg_facebook_ads__ad_history 81. model.facebook_ads_source.stg_facebook_ads__ad_history source_relation 81. model.facebook_ads_source.stg_facebook_ads__ad_history:f0->74. model.facebook_ads.facebook_ads__ad_set_report:f0 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history source_relation ad_set_id ad_set_name start_at end_at bid_strategy daily_budget budget_remaining 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history:f0->74. model.facebook_ads.facebook_ads__ad_set_report:f0 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history:f1->74. model.facebook_ads.facebook_ads__ad_set_report:f6 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history:f2->74. model.facebook_ads.facebook_ads__ad_set_report:f7 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history:f3->74. model.facebook_ads.facebook_ads__ad_set_report:f11 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history:f4->74. model.facebook_ads.facebook_ads__ad_set_report:f12 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history:f5->74. model.facebook_ads.facebook_ads__ad_set_report:f13 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history:f6->74. model.facebook_ads.facebook_ads__ad_set_report:f14 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history:f7->74. model.facebook_ads.facebook_ads__ad_set_report:f15 85. model.facebook_ads_source.stg_facebook_ads__basic_ad 85. model.facebook_ads_source.stg_facebook_ads__basic_ad source_relation date_day impressions clicks spend 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->74. model.facebook_ads.facebook_ads__ad_set_report:f0 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f1->74. model.facebook_ads.facebook_ads__ad_set_report:f1 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f2->74. model.facebook_ads.facebook_ads__ad_set_report:f9 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f3->74. model.facebook_ads.facebook_ads__ad_set_report:f8 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f4->74. model.facebook_ads.facebook_ads__ad_set_report:f10 87. model.facebook_ads_source.stg_facebook_ads__campaign_history 87. model.facebook_ads_source.stg_facebook_ads__campaign_history campaign_id campaign_name 87. model.facebook_ads_source.stg_facebook_ads__campaign_history:f0->74. model.facebook_ads.facebook_ads__ad_set_report:f4 87. model.facebook_ads_source.stg_facebook_ads__campaign_history:f1->74. model.facebook_ads.facebook_ads__ad_set_report:f5
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
date_day date The date of the performance.
account_id bigint The ID of the related account.
account_name character varying The name of the related account.
campaign_id bigint The ID of the related campaign.
campaign_name text The name of the related campaign.
ad_set_id bigint The ID of the related ad set.
ad_set_name text The name of the related ad set.
clicks bigint The number of clicks the ad had on the given day.
impressions bigint The number of impressions the ad had on the given day.
spend double precision The spend on the ad in the given day.
start_at timestamp without time zone None
end_at timestamp without time zone None
bid_strategy text None
daily_budget integer None
budget_remaining integer None
Column Lineage
%3 79. model.facebook_ads_source.stg_facebook_ads__account_history 79. model.facebook_ads_source.stg_facebook_ads__account_history source_relation 74. model.facebook_ads.facebook_ads__ad_set_report 74. model.facebook_ads.facebook_ads__ad_set_report source_relation 79. model.facebook_ads_source.stg_facebook_ads__account_history:f0->74. model.facebook_ads.facebook_ads__ad_set_report:f0 81. model.facebook_ads_source.stg_facebook_ads__ad_history 81. model.facebook_ads_source.stg_facebook_ads__ad_history source_relation 81. model.facebook_ads_source.stg_facebook_ads__ad_history:f0->74. model.facebook_ads.facebook_ads__ad_set_report:f0 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history source_relation 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history:f0->74. model.facebook_ads.facebook_ads__ad_set_report:f0 85. model.facebook_ads_source.stg_facebook_ads__basic_ad 85. model.facebook_ads_source.stg_facebook_ads__basic_ad source_relation 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->74. model.facebook_ads.facebook_ads__ad_set_report:f0
74. model.facebook_ads.facebook_ads__ad_set_report
  • Input Column: 79. model.facebook_ads_source.stg_facebook_ads__account_history[source_relation]
    • Integration used as part of the join condition with the report table
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 81. model.facebook_ads_source.stg_facebook_ads__ad_history[source_relation]
    • Integration used as a key to join with other tables
    • Output Columns:
      • source_relation: directly copied to output
  • Input Column: 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with other tables
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
Column Lineage
%3 85. model.facebook_ads_source.stg_facebook_ads__basic_ad 85. model.facebook_ads_source.stg_facebook_ads__basic_ad date_day 74. model.facebook_ads.facebook_ads__ad_set_report 74. model.facebook_ads.facebook_ads__ad_set_report date_day 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->74. model.facebook_ads.facebook_ads__ad_set_report:f0 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp date 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp:f0->85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0
85. model.facebook_ads_source.stg_facebook_ads__basic_ad
  • Input Column: 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp[date]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • date_day: Directly mapped and renamed
74. model.facebook_ads.facebook_ads__ad_set_report
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 79. model.facebook_ads_source.stg_facebook_ads__account_history 79. model.facebook_ads_source.stg_facebook_ads__account_history account_id 74. model.facebook_ads.facebook_ads__ad_set_report 74. model.facebook_ads.facebook_ads__ad_set_report account_id 79. model.facebook_ads_source.stg_facebook_ads__account_history:f0->74. model.facebook_ads.facebook_ads__ad_set_report:f0 80. model.facebook_ads_source.stg_facebook_ads__account_history_tmp 80. model.facebook_ads_source.stg_facebook_ads__account_history_tmp id 80. model.facebook_ads_source.stg_facebook_ads__account_history_tmp:f0->79. model.facebook_ads_source.stg_facebook_ads__account_history:f0
79. model.facebook_ads_source.stg_facebook_ads__account_history
  • Input Column: 80. model.facebook_ads_source.stg_facebook_ads__account_history_tmp[id]
    • Cleaning The column is cast to BIGINT
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • account_id: Directly mapped after casting to BIGINT
74. model.facebook_ads.facebook_ads__ad_set_report
  • Input Column: 79. model.facebook_ads_source.stg_facebook_ads__account_history[account_id]
    • Integration used as the key to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • account_id: directly copied
Column Lineage
%3 79. model.facebook_ads_source.stg_facebook_ads__account_history 79. model.facebook_ads_source.stg_facebook_ads__account_history account_name 74. model.facebook_ads.facebook_ads__ad_set_report 74. model.facebook_ads.facebook_ads__ad_set_report account_name 79. model.facebook_ads_source.stg_facebook_ads__account_history:f0->74. model.facebook_ads.facebook_ads__ad_set_report:f0 80. model.facebook_ads_source.stg_facebook_ads__account_history_tmp 80. model.facebook_ads_source.stg_facebook_ads__account_history_tmp name 80. model.facebook_ads_source.stg_facebook_ads__account_history_tmp:f0->79. model.facebook_ads_source.stg_facebook_ads__account_history:f0
79. model.facebook_ads_source.stg_facebook_ads__account_history
  • Input Column: 80. model.facebook_ads_source.stg_facebook_ads__account_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • account_name: Directly mapped
74. model.facebook_ads.facebook_ads__ad_set_report
  • Input Column: 79. model.facebook_ads_source.stg_facebook_ads__account_history[account_name]
    • Direct directly copied to the output
    • Output Columns:
      • account_name: directly copied
Column Lineage
%3 87. model.facebook_ads_source.stg_facebook_ads__campaign_history 87. model.facebook_ads_source.stg_facebook_ads__campaign_history campaign_id 74. model.facebook_ads.facebook_ads__ad_set_report 74. model.facebook_ads.facebook_ads__ad_set_report campaign_id 87. model.facebook_ads_source.stg_facebook_ads__campaign_history:f0->74. model.facebook_ads.facebook_ads__ad_set_report:f0 88. model.facebook_ads_source.stg_facebook_ads__campaign_history_tmp 88. model.facebook_ads_source.stg_facebook_ads__campaign_history_tmp id 88. model.facebook_ads_source.stg_facebook_ads__campaign_history_tmp:f0->87. model.facebook_ads_source.stg_facebook_ads__campaign_history:f0
87. model.facebook_ads_source.stg_facebook_ads__campaign_history
  • Input Column: 88. model.facebook_ads_source.stg_facebook_ads__campaign_history_tmp[id]
    • Cleaning Cast to BIGINT data type
    • Deduplication Used in the ROW_NUMBER() window function to identify the most recent record
    • Output Columns:
      • campaign_id: Directly mapped after casting to BIGINT
74. model.facebook_ads.facebook_ads__ad_set_report
  • Input Column: 87. model.facebook_ads_source.stg_facebook_ads__campaign_history[campaign_id]
    • Integration used as the key to join with the ads table
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
Column Lineage
%3 87. model.facebook_ads_source.stg_facebook_ads__campaign_history 87. model.facebook_ads_source.stg_facebook_ads__campaign_history campaign_name 74. model.facebook_ads.facebook_ads__ad_set_report 74. model.facebook_ads.facebook_ads__ad_set_report campaign_name 87. model.facebook_ads_source.stg_facebook_ads__campaign_history:f0->74. model.facebook_ads.facebook_ads__ad_set_report:f0 88. model.facebook_ads_source.stg_facebook_ads__campaign_history_tmp 88. model.facebook_ads_source.stg_facebook_ads__campaign_history_tmp name 88. model.facebook_ads_source.stg_facebook_ads__campaign_history_tmp:f0->87. model.facebook_ads_source.stg_facebook_ads__campaign_history:f0
87. model.facebook_ads_source.stg_facebook_ads__campaign_history
  • Input Column: 88. model.facebook_ads_source.stg_facebook_ads__campaign_history_tmp[name]
    • Direct Copied without transformation
    • Output Columns:
      • campaign_name: Directly mapped
74. model.facebook_ads.facebook_ads__ad_set_report
  • Input Column: 87. model.facebook_ads_source.stg_facebook_ads__campaign_history[campaign_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_name: directly copied
Column Lineage
%3 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history ad_set_id 74. model.facebook_ads.facebook_ads__ad_set_report 74. model.facebook_ads.facebook_ads__ad_set_report ad_set_id 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history:f0->74. model.facebook_ads.facebook_ads__ad_set_report:f0 84. model.facebook_ads_source.stg_facebook_ads__ad_set_history_tmp 84. model.facebook_ads_source.stg_facebook_ads__ad_set_history_tmp id 84. model.facebook_ads_source.stg_facebook_ads__ad_set_history_tmp:f0->83. model.facebook_ads_source.stg_facebook_ads__ad_set_history:f0
83. model.facebook_ads_source.stg_facebook_ads__ad_set_history
  • Input Column: 84. model.facebook_ads_source.stg_facebook_ads__ad_set_history_tmp[id]
    • Cleaning The column is cast to BIGINT
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • ad_set_id: Directly mapped after casting to BIGINT
74. model.facebook_ads.facebook_ads__ad_set_report
  • Input Column: 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history[ad_set_id]
    • Integration used as the key to join with the ads table
    • Direct directly copied to the output
    • Output Columns:
      • ad_set_id: directly copied
Column Lineage
%3 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history ad_set_name 74. model.facebook_ads.facebook_ads__ad_set_report 74. model.facebook_ads.facebook_ads__ad_set_report ad_set_name 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history:f0->74. model.facebook_ads.facebook_ads__ad_set_report:f0 84. model.facebook_ads_source.stg_facebook_ads__ad_set_history_tmp 84. model.facebook_ads_source.stg_facebook_ads__ad_set_history_tmp name 84. model.facebook_ads_source.stg_facebook_ads__ad_set_history_tmp:f0->83. model.facebook_ads_source.stg_facebook_ads__ad_set_history:f0
83. model.facebook_ads_source.stg_facebook_ads__ad_set_history
  • Input Column: 84. model.facebook_ads_source.stg_facebook_ads__ad_set_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • ad_set_name: Directly mapped
74. model.facebook_ads.facebook_ads__ad_set_report
  • Input Column: 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history[ad_set_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_set_name: directly copied
Column Lineage
%3 85. model.facebook_ads_source.stg_facebook_ads__basic_ad 85. model.facebook_ads_source.stg_facebook_ads__basic_ad clicks 74. model.facebook_ads.facebook_ads__ad_set_report 74. model.facebook_ads.facebook_ads__ad_set_report clicks 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->74. model.facebook_ads.facebook_ads__ad_set_report:f0 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp inline_link_clicks 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp:f0->85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0
85. model.facebook_ads_source.stg_facebook_ads__basic_ad
  • Input Column: 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp[inline_link_clicks]
    • Cleaning The column is cleaned by applying COALESCE to handle potential NULL values
    • Output Columns:
      • clicks: Mapped after applying COALESCE and renamed
74. model.facebook_ads.facebook_ads__ad_set_report
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[clicks]
    • Aggregation The column is summed up in the SELECT statement
    • Output Columns:
      • clicks: Aggregated sum in the output
Column Lineage
%3 85. model.facebook_ads_source.stg_facebook_ads__basic_ad 85. model.facebook_ads_source.stg_facebook_ads__basic_ad impressions 74. model.facebook_ads.facebook_ads__ad_set_report 74. model.facebook_ads.facebook_ads__ad_set_report impressions 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->74. model.facebook_ads.facebook_ads__ad_set_report:f0 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp impressions 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp:f0->85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0
85. model.facebook_ads_source.stg_facebook_ads__basic_ad
  • Input Column: 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp[impressions]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • impressions: Directly mapped
74. model.facebook_ads.facebook_ads__ad_set_report
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[impressions]
    • Aggregation The column is summed up in the SELECT statement
    • Output Columns:
      • impressions: Aggregated sum in the output
Column Lineage
%3 85. model.facebook_ads_source.stg_facebook_ads__basic_ad 85. model.facebook_ads_source.stg_facebook_ads__basic_ad spend 74. model.facebook_ads.facebook_ads__ad_set_report 74. model.facebook_ads.facebook_ads__ad_set_report spend 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->74. model.facebook_ads.facebook_ads__ad_set_report:f0 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp spend 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp:f0->85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0
85. model.facebook_ads_source.stg_facebook_ads__basic_ad
  • Input Column: 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp[spend]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • spend: Directly mapped
74. model.facebook_ads.facebook_ads__ad_set_report
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[spend]
    • Aggregation The column is summed up in the SELECT statement
    • Output Columns:
      • spend: Aggregated sum in the output
Column Lineage
%3 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history start_at 74. model.facebook_ads.facebook_ads__ad_set_report 74. model.facebook_ads.facebook_ads__ad_set_report start_at 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history:f0->74. model.facebook_ads.facebook_ads__ad_set_report:f0
74. model.facebook_ads.facebook_ads__ad_set_report
  • Input Column: 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history[start_at]
    • Direct directly copied to the output
    • Output Columns:
      • start_at: directly copied
Column Lineage
%3 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history end_at 74. model.facebook_ads.facebook_ads__ad_set_report 74. model.facebook_ads.facebook_ads__ad_set_report end_at 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history:f0->74. model.facebook_ads.facebook_ads__ad_set_report:f0
74. model.facebook_ads.facebook_ads__ad_set_report
  • Input Column: 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history[end_at]
    • Direct directly copied to the output
    • Output Columns:
      • end_at: directly copied
Column Lineage
%3 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history bid_strategy 74. model.facebook_ads.facebook_ads__ad_set_report 74. model.facebook_ads.facebook_ads__ad_set_report bid_strategy 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history:f0->74. model.facebook_ads.facebook_ads__ad_set_report:f0
74. model.facebook_ads.facebook_ads__ad_set_report
  • Input Column: 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history[bid_strategy]
    • Direct directly copied to the output
    • Output Columns:
      • bid_strategy: directly copied
Column Lineage
%3 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history daily_budget 74. model.facebook_ads.facebook_ads__ad_set_report 74. model.facebook_ads.facebook_ads__ad_set_report daily_budget 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history:f0->74. model.facebook_ads.facebook_ads__ad_set_report:f0
74. model.facebook_ads.facebook_ads__ad_set_report
  • Input Column: 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history[daily_budget]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • daily_budget: Directly copied to the output
Column Lineage
%3 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history budget_remaining 74. model.facebook_ads.facebook_ads__ad_set_report 74. model.facebook_ads.facebook_ads__ad_set_report budget_remaining 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history:f0->74. model.facebook_ads.facebook_ads__ad_set_report:f0
74. model.facebook_ads.facebook_ads__ad_set_report
  • Input Column: 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history[budget_remaining]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • budget_remaining: Directly copied to the output
75. model.facebook_ads.facebook_ads__campaign_report

This SQL query combines data from multiple Facebook Ads-related tables to create a comprehensive campaign report. It joins account, campaign, and ad data with the basic ad report, filtering for the most recent records in history tables. The query then aggregates clicks, impressions, and spend data at the campaign level, providing a detailed view of campaign performance along with account and campaign details.

FilteringIntegrationAggregation
SQL Query
WITH report AS (
  SELECT
    *
  FROM TEST.PUBLIC_facebook_ads_source.stg_facebook_ads__basic_ad
), accounts AS (
  SELECT
    *
  FROM TEST.PUBLIC_facebook_ads_source.stg_facebook_ads__account_history
  WHERE
    is_most_recent_record = TRUE
), campaigns AS (
  SELECT
    *
  FROM TEST.PUBLIC_facebook_ads_source.stg_facebook_ads__campaign_history
  WHERE
    is_most_recent_record = TRUE
), ads AS (
  SELECT
    *
  FROM TEST.PUBLIC_facebook_ads_source.stg_facebook_ads__ad_history
  WHERE
    is_most_recent_record = TRUE
), joined AS (
  SELECT
    report.source_relation,
    report.date_day,
    accounts.account_id,
    accounts.account_name,
    campaigns.campaign_id,
    campaigns.campaign_name,
    campaigns.start_at,
    campaigns.end_at,
    campaigns.status,
    campaigns.daily_budget,
    campaigns.lifetime_budget,
    campaigns.budget_remaining,
    SUM(report.clicks) AS clicks,
    SUM(report.impressions) AS impressions,
    SUM(report.spend) AS spend
  FROM report
  LEFT JOIN accounts
    ON report.account_id = accounts.account_id
    AND report.source_relation = accounts.source_relation
  LEFT JOIN ads
    ON report.ad_id = ads.ad_id AND report.source_relation = ads.source_relation
  LEFT JOIN campaigns
    ON ads.campaign_id = campaigns.campaign_id
    AND ads.source_relation = campaigns.source_relation
  GROUP BY
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10,
    11,
    12
)
SELECT
  *
FROM joined
%3 75. model.facebook_ads.facebook_ads__campaign_report 75. model.facebook_ads.facebook_ads__campaign_report source_relation date_day account_id account_name campaign_id campaign_name clicks impressions spend start_at end_at status daily_budget lifetime_budget budget_remaining 79. model.facebook_ads_source.stg_facebook_ads__account_history 79. model.facebook_ads_source.stg_facebook_ads__account_history source_relation account_id account_name 79. model.facebook_ads_source.stg_facebook_ads__account_history:f0->75. model.facebook_ads.facebook_ads__campaign_report:f0 79. model.facebook_ads_source.stg_facebook_ads__account_history:f1->75. model.facebook_ads.facebook_ads__campaign_report:f2 79. model.facebook_ads_source.stg_facebook_ads__account_history:f2->75. model.facebook_ads.facebook_ads__campaign_report:f3 81. model.facebook_ads_source.stg_facebook_ads__ad_history 81. model.facebook_ads_source.stg_facebook_ads__ad_history source_relation 81. model.facebook_ads_source.stg_facebook_ads__ad_history:f0->75. model.facebook_ads.facebook_ads__campaign_report:f0 85. model.facebook_ads_source.stg_facebook_ads__basic_ad 85. model.facebook_ads_source.stg_facebook_ads__basic_ad source_relation date_day account_id impressions clicks spend 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->75. model.facebook_ads.facebook_ads__campaign_report:f0 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f1->75. model.facebook_ads.facebook_ads__campaign_report:f1 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f2->75. model.facebook_ads.facebook_ads__campaign_report:f2 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f3->75. model.facebook_ads.facebook_ads__campaign_report:f7 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f4->75. model.facebook_ads.facebook_ads__campaign_report:f6 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f5->75. model.facebook_ads.facebook_ads__campaign_report:f8 87. model.facebook_ads_source.stg_facebook_ads__campaign_history 87. model.facebook_ads_source.stg_facebook_ads__campaign_history source_relation campaign_id campaign_name start_at end_at daily_budget budget_remaining lifetime_budget status 87. model.facebook_ads_source.stg_facebook_ads__campaign_history:f0->75. model.facebook_ads.facebook_ads__campaign_report:f0 87. model.facebook_ads_source.stg_facebook_ads__campaign_history:f1->75. model.facebook_ads.facebook_ads__campaign_report:f4 87. model.facebook_ads_source.stg_facebook_ads__campaign_history:f2->75. model.facebook_ads.facebook_ads__campaign_report:f5 87. model.facebook_ads_source.stg_facebook_ads__campaign_history:f3->75. model.facebook_ads.facebook_ads__campaign_report:f9 87. model.facebook_ads_source.stg_facebook_ads__campaign_history:f4->75. model.facebook_ads.facebook_ads__campaign_report:f10 87. model.facebook_ads_source.stg_facebook_ads__campaign_history:f5->75. model.facebook_ads.facebook_ads__campaign_report:f12 87. model.facebook_ads_source.stg_facebook_ads__campaign_history:f6->75. model.facebook_ads.facebook_ads__campaign_report:f14 87. model.facebook_ads_source.stg_facebook_ads__campaign_history:f7->75. model.facebook_ads.facebook_ads__campaign_report:f13 87. model.facebook_ads_source.stg_facebook_ads__campaign_history:f8->75. model.facebook_ads.facebook_ads__campaign_report:f11
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
date_day date The date of the performance.
account_id bigint The ID of the related account.
account_name character varying The name of the related account.
campaign_id bigint The ID of the related campaign.
campaign_name text The name of the related campaign.
clicks bigint The number of clicks the ad had on the given day.
impressions bigint The number of impressions the ad had on the given day.
spend double precision The spend on the ad in the given day.
start_at timestamp without time zone None
end_at timestamp without time zone None
status text None
daily_budget integer None
lifetime_budget integer None
budget_remaining double precision None
Column Lineage
%3 79. model.facebook_ads_source.stg_facebook_ads__account_history 79. model.facebook_ads_source.stg_facebook_ads__account_history source_relation 75. model.facebook_ads.facebook_ads__campaign_report 75. model.facebook_ads.facebook_ads__campaign_report source_relation 79. model.facebook_ads_source.stg_facebook_ads__account_history:f0->75. model.facebook_ads.facebook_ads__campaign_report:f0 81. model.facebook_ads_source.stg_facebook_ads__ad_history 81. model.facebook_ads_source.stg_facebook_ads__ad_history source_relation 81. model.facebook_ads_source.stg_facebook_ads__ad_history:f0->75. model.facebook_ads.facebook_ads__campaign_report:f0 85. model.facebook_ads_source.stg_facebook_ads__basic_ad 85. model.facebook_ads_source.stg_facebook_ads__basic_ad source_relation 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->75. model.facebook_ads.facebook_ads__campaign_report:f0 87. model.facebook_ads_source.stg_facebook_ads__campaign_history 87. model.facebook_ads_source.stg_facebook_ads__campaign_history source_relation 87. model.facebook_ads_source.stg_facebook_ads__campaign_history:f0->75. model.facebook_ads.facebook_ads__campaign_report:f0
75. model.facebook_ads.facebook_ads__campaign_report
  • Input Column: 79. model.facebook_ads_source.stg_facebook_ads__account_history[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as a key to join tables
    • Output Columns:
      • source_relation: Directly copied
  • Input Column: 81. model.facebook_ads_source.stg_facebook_ads__ad_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct copied directly to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with other tables
    • Aggregation Part of the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
  • Input Column: 87. model.facebook_ads_source.stg_facebook_ads__campaign_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
Column Lineage
%3 85. model.facebook_ads_source.stg_facebook_ads__basic_ad 85. model.facebook_ads_source.stg_facebook_ads__basic_ad date_day 75. model.facebook_ads.facebook_ads__campaign_report 75. model.facebook_ads.facebook_ads__campaign_report date_day 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->75. model.facebook_ads.facebook_ads__campaign_report:f0 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp date 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp:f0->85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0
85. model.facebook_ads_source.stg_facebook_ads__basic_ad
  • Input Column: 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp[date]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • date_day: Directly mapped and renamed
75. model.facebook_ads.facebook_ads__campaign_report
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Part of the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 79. model.facebook_ads_source.stg_facebook_ads__account_history 79. model.facebook_ads_source.stg_facebook_ads__account_history account_id 75. model.facebook_ads.facebook_ads__campaign_report 75. model.facebook_ads.facebook_ads__campaign_report account_id 79. model.facebook_ads_source.stg_facebook_ads__account_history:f0->75. model.facebook_ads.facebook_ads__campaign_report:f0 85. model.facebook_ads_source.stg_facebook_ads__basic_ad 85. model.facebook_ads_source.stg_facebook_ads__basic_ad account_id 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->75. model.facebook_ads.facebook_ads__campaign_report:f0 80. model.facebook_ads_source.stg_facebook_ads__account_history_tmp 80. model.facebook_ads_source.stg_facebook_ads__account_history_tmp id 80. model.facebook_ads_source.stg_facebook_ads__account_history_tmp:f0->79. model.facebook_ads_source.stg_facebook_ads__account_history:f0 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp account_id 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp:f0->85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0
79. model.facebook_ads_source.stg_facebook_ads__account_history
  • Input Column: 80. model.facebook_ads_source.stg_facebook_ads__account_history_tmp[id]
    • Cleaning The column is cast to BIGINT
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • account_id: Directly mapped after casting to BIGINT
85. model.facebook_ads_source.stg_facebook_ads__basic_ad
  • Input Column: 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp[account_id]
    • Cleaning The column is cast to BIGINT data type
    • Output Columns:
      • account_id: Directly mapped after casting
75. model.facebook_ads.facebook_ads__campaign_report
  • Input Column: 79. model.facebook_ads_source.stg_facebook_ads__account_history[account_id]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as a key to join tables
    • Output Columns:
      • account_id: Directly copied
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[account_id]
    • Integration Used as a key to join with the accounts table
    • Output Columns:
      • account_id: Indirectly mapped through the join with accounts table
Column Lineage
%3 79. model.facebook_ads_source.stg_facebook_ads__account_history 79. model.facebook_ads_source.stg_facebook_ads__account_history account_name 75. model.facebook_ads.facebook_ads__campaign_report 75. model.facebook_ads.facebook_ads__campaign_report account_name 79. model.facebook_ads_source.stg_facebook_ads__account_history:f0->75. model.facebook_ads.facebook_ads__campaign_report:f0 80. model.facebook_ads_source.stg_facebook_ads__account_history_tmp 80. model.facebook_ads_source.stg_facebook_ads__account_history_tmp name 80. model.facebook_ads_source.stg_facebook_ads__account_history_tmp:f0->79. model.facebook_ads_source.stg_facebook_ads__account_history:f0
79. model.facebook_ads_source.stg_facebook_ads__account_history
  • Input Column: 80. model.facebook_ads_source.stg_facebook_ads__account_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • account_name: Directly mapped
75. model.facebook_ads.facebook_ads__campaign_report
  • Input Column: 79. model.facebook_ads_source.stg_facebook_ads__account_history[account_name]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • account_name: Directly copied
Column Lineage
%3 87. model.facebook_ads_source.stg_facebook_ads__campaign_history 87. model.facebook_ads_source.stg_facebook_ads__campaign_history campaign_id 75. model.facebook_ads.facebook_ads__campaign_report 75. model.facebook_ads.facebook_ads__campaign_report campaign_id 87. model.facebook_ads_source.stg_facebook_ads__campaign_history:f0->75. model.facebook_ads.facebook_ads__campaign_report:f0 88. model.facebook_ads_source.stg_facebook_ads__campaign_history_tmp 88. model.facebook_ads_source.stg_facebook_ads__campaign_history_tmp id 88. model.facebook_ads_source.stg_facebook_ads__campaign_history_tmp:f0->87. model.facebook_ads_source.stg_facebook_ads__campaign_history:f0
87. model.facebook_ads_source.stg_facebook_ads__campaign_history
  • Input Column: 88. model.facebook_ads_source.stg_facebook_ads__campaign_history_tmp[id]
    • Cleaning Cast to BIGINT data type
    • Deduplication Used in the ROW_NUMBER() window function to identify the most recent record
    • Output Columns:
      • campaign_id: Directly mapped after casting to BIGINT
75. model.facebook_ads.facebook_ads__campaign_report
  • Input Column: 87. model.facebook_ads_source.stg_facebook_ads__campaign_history[campaign_id]
    • Integration used as the key to join with the ads table
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
Column Lineage
%3 87. model.facebook_ads_source.stg_facebook_ads__campaign_history 87. model.facebook_ads_source.stg_facebook_ads__campaign_history campaign_name 75. model.facebook_ads.facebook_ads__campaign_report 75. model.facebook_ads.facebook_ads__campaign_report campaign_name 87. model.facebook_ads_source.stg_facebook_ads__campaign_history:f0->75. model.facebook_ads.facebook_ads__campaign_report:f0 88. model.facebook_ads_source.stg_facebook_ads__campaign_history_tmp 88. model.facebook_ads_source.stg_facebook_ads__campaign_history_tmp name 88. model.facebook_ads_source.stg_facebook_ads__campaign_history_tmp:f0->87. model.facebook_ads_source.stg_facebook_ads__campaign_history:f0
87. model.facebook_ads_source.stg_facebook_ads__campaign_history
  • Input Column: 88. model.facebook_ads_source.stg_facebook_ads__campaign_history_tmp[name]
    • Direct Copied without transformation
    • Output Columns:
      • campaign_name: Directly mapped
75. model.facebook_ads.facebook_ads__campaign_report
  • Input Column: 87. model.facebook_ads_source.stg_facebook_ads__campaign_history[campaign_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_name: directly copied
Column Lineage
%3 85. model.facebook_ads_source.stg_facebook_ads__basic_ad 85. model.facebook_ads_source.stg_facebook_ads__basic_ad clicks 75. model.facebook_ads.facebook_ads__campaign_report 75. model.facebook_ads.facebook_ads__campaign_report clicks 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->75. model.facebook_ads.facebook_ads__campaign_report:f0 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp inline_link_clicks 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp:f0->85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0
85. model.facebook_ads_source.stg_facebook_ads__basic_ad
  • Input Column: 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp[inline_link_clicks]
    • Cleaning The column is cleaned by applying COALESCE to handle potential NULL values
    • Output Columns:
      • clicks: Mapped after applying COALESCE and renamed
75. model.facebook_ads.facebook_ads__campaign_report
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[clicks]
    • Aggregation The column is aggregated using SUM function
    • Output Columns:
      • clicks: Aggregated sum in the output
Column Lineage
%3 85. model.facebook_ads_source.stg_facebook_ads__basic_ad 85. model.facebook_ads_source.stg_facebook_ads__basic_ad impressions 75. model.facebook_ads.facebook_ads__campaign_report 75. model.facebook_ads.facebook_ads__campaign_report impressions 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->75. model.facebook_ads.facebook_ads__campaign_report:f0 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp impressions 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp:f0->85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0
85. model.facebook_ads_source.stg_facebook_ads__basic_ad
  • Input Column: 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp[impressions]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • impressions: Directly mapped
75. model.facebook_ads.facebook_ads__campaign_report
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[impressions]
    • Aggregation The column is aggregated using SUM function
    • Output Columns:
      • impressions: Aggregated sum in the output
Column Lineage
%3 85. model.facebook_ads_source.stg_facebook_ads__basic_ad 85. model.facebook_ads_source.stg_facebook_ads__basic_ad spend 75. model.facebook_ads.facebook_ads__campaign_report 75. model.facebook_ads.facebook_ads__campaign_report spend 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->75. model.facebook_ads.facebook_ads__campaign_report:f0 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp spend 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp:f0->85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0
85. model.facebook_ads_source.stg_facebook_ads__basic_ad
  • Input Column: 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp[spend]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • spend: Directly mapped
75. model.facebook_ads.facebook_ads__campaign_report
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[spend]
    • Aggregation The column is aggregated using SUM function
    • Output Columns:
      • spend: Aggregated sum in the output
Column Lineage
%3 87. model.facebook_ads_source.stg_facebook_ads__campaign_history 87. model.facebook_ads_source.stg_facebook_ads__campaign_history start_at 75. model.facebook_ads.facebook_ads__campaign_report 75. model.facebook_ads.facebook_ads__campaign_report start_at 87. model.facebook_ads_source.stg_facebook_ads__campaign_history:f0->75. model.facebook_ads.facebook_ads__campaign_report:f0
75. model.facebook_ads.facebook_ads__campaign_report
  • Input Column: 87. model.facebook_ads_source.stg_facebook_ads__campaign_history[start_at]
    • Direct directly copied to the output
    • Output Columns:
      • start_at: directly copied
Column Lineage
%3 87. model.facebook_ads_source.stg_facebook_ads__campaign_history 87. model.facebook_ads_source.stg_facebook_ads__campaign_history end_at 75. model.facebook_ads.facebook_ads__campaign_report 75. model.facebook_ads.facebook_ads__campaign_report end_at 87. model.facebook_ads_source.stg_facebook_ads__campaign_history:f0->75. model.facebook_ads.facebook_ads__campaign_report:f0
75. model.facebook_ads.facebook_ads__campaign_report
  • Input Column: 87. model.facebook_ads_source.stg_facebook_ads__campaign_history[end_at]
    • Direct directly copied to the output
    • Output Columns:
      • end_at: directly copied
Column Lineage
%3 87. model.facebook_ads_source.stg_facebook_ads__campaign_history 87. model.facebook_ads_source.stg_facebook_ads__campaign_history status 75. model.facebook_ads.facebook_ads__campaign_report 75. model.facebook_ads.facebook_ads__campaign_report status 87. model.facebook_ads_source.stg_facebook_ads__campaign_history:f0->75. model.facebook_ads.facebook_ads__campaign_report:f0
75. model.facebook_ads.facebook_ads__campaign_report
  • Input Column: 87. model.facebook_ads_source.stg_facebook_ads__campaign_history[status]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the ads table
    • Output Columns:
      • status: Directly copied to the output
Column Lineage
%3 87. model.facebook_ads_source.stg_facebook_ads__campaign_history 87. model.facebook_ads_source.stg_facebook_ads__campaign_history daily_budget 75. model.facebook_ads.facebook_ads__campaign_report 75. model.facebook_ads.facebook_ads__campaign_report daily_budget 87. model.facebook_ads_source.stg_facebook_ads__campaign_history:f0->75. model.facebook_ads.facebook_ads__campaign_report:f0
75. model.facebook_ads.facebook_ads__campaign_report
  • Input Column: 87. model.facebook_ads_source.stg_facebook_ads__campaign_history[daily_budget]
    • Direct directly copied to the output
    • Output Columns:
      • daily_budget: directly copied
Column Lineage
%3 87. model.facebook_ads_source.stg_facebook_ads__campaign_history 87. model.facebook_ads_source.stg_facebook_ads__campaign_history lifetime_budget 75. model.facebook_ads.facebook_ads__campaign_report 75. model.facebook_ads.facebook_ads__campaign_report lifetime_budget 87. model.facebook_ads_source.stg_facebook_ads__campaign_history:f0->75. model.facebook_ads.facebook_ads__campaign_report:f0
75. model.facebook_ads.facebook_ads__campaign_report
  • Input Column: 87. model.facebook_ads_source.stg_facebook_ads__campaign_history[lifetime_budget]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the ads table
    • Output Columns:
      • lifetime_budget: Directly copied to the output
Column Lineage
%3 87. model.facebook_ads_source.stg_facebook_ads__campaign_history 87. model.facebook_ads_source.stg_facebook_ads__campaign_history budget_remaining 75. model.facebook_ads.facebook_ads__campaign_report 75. model.facebook_ads.facebook_ads__campaign_report budget_remaining 87. model.facebook_ads_source.stg_facebook_ads__campaign_history:f0->75. model.facebook_ads.facebook_ads__campaign_report:f0
75. model.facebook_ads.facebook_ads__campaign_report
  • Input Column: 87. model.facebook_ads_source.stg_facebook_ads__campaign_history[budget_remaining]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the ads table
    • Output Columns:
      • budget_remaining: Directly copied to the output
76. model.facebook_ads.facebook_ads__url_report

This SQL query integrates data from various Facebook Ads-related tables to create a comprehensive URL report. It joins information from ad accounts, campaigns, ad sets, ads, and creatives, focusing on URLs associated with the ads. The query filters out records where the URL is null, aggregates metrics like clicks, impressions, and spend, and groups the results by various dimensions including date, account, campaign, ad set, ad, and URL-related fields.

IntegrationFilteringAggregation
SQL Query
WITH report AS (
  SELECT
    *
  FROM TEST.PUBLIC_facebook_ads_source.stg_facebook_ads__basic_ad
), creatives AS (
  SELECT
    *
  FROM TEST.PUBLIC_facebook_ads.int_facebook_ads__creative_history
), accounts AS (
  SELECT
    *
  FROM TEST.PUBLIC_facebook_ads_source.stg_facebook_ads__account_history
  WHERE
    is_most_recent_record = TRUE
), ads AS (
  SELECT
    *
  FROM TEST.PUBLIC_facebook_ads_source.stg_facebook_ads__ad_history
  WHERE
    is_most_recent_record = TRUE
), ad_sets AS (
  SELECT
    *
  FROM TEST.PUBLIC_facebook_ads_source.stg_facebook_ads__ad_set_history
  WHERE
    is_most_recent_record = TRUE
), campaigns AS (
  SELECT
    *
  FROM TEST.PUBLIC_facebook_ads_source.stg_facebook_ads__campaign_history
  WHERE
    is_most_recent_record = TRUE
), joined AS (
  SELECT
    report.source_relation,
    report.date_day,
    accounts.account_id,
    accounts.account_name,
    campaigns.campaign_id,
    campaigns.campaign_name,
    ad_sets.ad_set_id,
    ad_sets.ad_set_name,
    ads.ad_id,
    ads.ad_name,
    creatives.creative_id,
    creatives.creative_name,
    creatives.base_url,
    creatives.url_host,
    creatives.url_path,
    creatives.utm_source,
    creatives.utm_medium,
    creatives.utm_campaign,
    creatives.utm_content,
    creatives.utm_term,
    SUM(report.clicks) AS clicks,
    SUM(report.impressions) AS impressions,
    SUM(report.spend) AS spend
  FROM report
  LEFT JOIN ads
    ON report.ad_id = ads.ad_id AND report.source_relation = ads.source_relation
  LEFT JOIN creatives
    ON ads.creative_id = creatives.creative_id
    AND ads.source_relation = creatives.source_relation
  LEFT JOIN ad_sets
    ON ads.ad_set_id = ad_sets.ad_set_id
    AND ads.source_relation = ad_sets.source_relation
  LEFT JOIN campaigns
    ON ads.campaign_id = campaigns.campaign_id
    AND ads.source_relation = campaigns.source_relation
  LEFT JOIN accounts
    ON report.account_id = accounts.account_id
    AND report.source_relation = accounts.source_relation
  WHERE
    NOT creatives.url IS NULL
  GROUP BY
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10,
    11,
    12,
    13,
    14,
    15,
    16,
    17,
    18,
    19,
    20
)
SELECT
  *
FROM joined
%3 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report source_relation date_day account_id account_name campaign_id campaign_name ad_set_id ad_set_name ad_id ad_name creative_id creative_name base_url url_host url_path utm_source utm_medium utm_campaign utm_content utm_term clicks impressions spend 78. model.facebook_ads.int_facebook_ads__creative_history 78. model.facebook_ads.int_facebook_ads__creative_history source_relation creative_id creative_name base_url url_host url_path utm_source utm_medium utm_campaign utm_content utm_term 78. model.facebook_ads.int_facebook_ads__creative_history:f0->76. model.facebook_ads.facebook_ads__url_report:f0 78. model.facebook_ads.int_facebook_ads__creative_history:f1->76. model.facebook_ads.facebook_ads__url_report:f10 78. model.facebook_ads.int_facebook_ads__creative_history:f2->76. model.facebook_ads.facebook_ads__url_report:f11 78. model.facebook_ads.int_facebook_ads__creative_history:f3->76. model.facebook_ads.facebook_ads__url_report:f12 78. model.facebook_ads.int_facebook_ads__creative_history:f4->76. model.facebook_ads.facebook_ads__url_report:f13 78. model.facebook_ads.int_facebook_ads__creative_history:f5->76. model.facebook_ads.facebook_ads__url_report:f14 78. model.facebook_ads.int_facebook_ads__creative_history:f6->76. model.facebook_ads.facebook_ads__url_report:f15 78. model.facebook_ads.int_facebook_ads__creative_history:f7->76. model.facebook_ads.facebook_ads__url_report:f16 78. model.facebook_ads.int_facebook_ads__creative_history:f8->76. model.facebook_ads.facebook_ads__url_report:f17 78. model.facebook_ads.int_facebook_ads__creative_history:f9->76. model.facebook_ads.facebook_ads__url_report:f18 78. model.facebook_ads.int_facebook_ads__creative_history:f10->76. model.facebook_ads.facebook_ads__url_report:f19 79. model.facebook_ads_source.stg_facebook_ads__account_history 79. model.facebook_ads_source.stg_facebook_ads__account_history source_relation account_id account_name 79. model.facebook_ads_source.stg_facebook_ads__account_history:f0->76. model.facebook_ads.facebook_ads__url_report:f0 79. model.facebook_ads_source.stg_facebook_ads__account_history:f1->76. model.facebook_ads.facebook_ads__url_report:f2 79. model.facebook_ads_source.stg_facebook_ads__account_history:f2->76. model.facebook_ads.facebook_ads__url_report:f3 81. model.facebook_ads_source.stg_facebook_ads__ad_history 81. model.facebook_ads_source.stg_facebook_ads__ad_history source_relation ad_id ad_name 81. model.facebook_ads_source.stg_facebook_ads__ad_history:f0->76. model.facebook_ads.facebook_ads__url_report:f0 81. model.facebook_ads_source.stg_facebook_ads__ad_history:f1->76. model.facebook_ads.facebook_ads__url_report:f8 81. model.facebook_ads_source.stg_facebook_ads__ad_history:f2->76. model.facebook_ads.facebook_ads__url_report:f9 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history source_relation ad_set_id ad_set_name 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history:f0->76. model.facebook_ads.facebook_ads__url_report:f0 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history:f1->76. model.facebook_ads.facebook_ads__url_report:f6 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history:f2->76. model.facebook_ads.facebook_ads__url_report:f7 85. model.facebook_ads_source.stg_facebook_ads__basic_ad 85. model.facebook_ads_source.stg_facebook_ads__basic_ad source_relation ad_id date_day account_id impressions clicks spend 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->76. model.facebook_ads.facebook_ads__url_report:f0 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f1->76. model.facebook_ads.facebook_ads__url_report:f8 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f2->76. model.facebook_ads.facebook_ads__url_report:f1 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f3->76. model.facebook_ads.facebook_ads__url_report:f2 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f4->76. model.facebook_ads.facebook_ads__url_report:f21 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f5->76. model.facebook_ads.facebook_ads__url_report:f20 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f6->76. model.facebook_ads.facebook_ads__url_report:f22 87. model.facebook_ads_source.stg_facebook_ads__campaign_history 87. model.facebook_ads_source.stg_facebook_ads__campaign_history source_relation campaign_id campaign_name 87. model.facebook_ads_source.stg_facebook_ads__campaign_history:f0->76. model.facebook_ads.facebook_ads__url_report:f0 87. model.facebook_ads_source.stg_facebook_ads__campaign_history:f1->76. model.facebook_ads.facebook_ads__url_report:f4 87. model.facebook_ads_source.stg_facebook_ads__campaign_history:f2->76. model.facebook_ads.facebook_ads__url_report:f5
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
date_day date The date of the performance.
account_id bigint The ID of the related account.
account_name character varying The name of the related account.
campaign_id bigint The ID of the related campaign.
campaign_name text The name of the related campaign.
ad_set_id bigint The ID of the related ad set.
ad_set_name text The name of the related ad set.
ad_id bigint The ID of the related ad.
ad_name text The name of the related ad.
creative_id bigint The ID of the related creative.
creative_name text The name of the related creative.
base_url text The base URL of the ad, extracted from the page_link and template_page_link.
url_host text The URL host of the ad, extracted from the page_link and template_page_link.
url_path text The URL path of the ad, extracted from the page_link and template_page_link.
utm_source text The utm_source parameter of the ad, extracted from the page_link and template_page_link.
utm_medium text The utm_medium parameter of the ad, extracted from the page_link and template_page_link.
utm_campaign text The utm_campaign parameter of the ad, extracted from the page_link and template_page_link.
utm_content text The utm_content parameter of the ad, extracted from the page_link and template_page_link.
utm_term text The utm_term parameter of the ad, extracted from the page_link and template_page_link.
clicks bigint The number of clicks the ad had on the given day.
impressions bigint The number of impressions the ad had on the given day.
spend double precision The spend on the ad in the given day.
Column Lineage
%3 78. model.facebook_ads.int_facebook_ads__creative_history 78. model.facebook_ads.int_facebook_ads__creative_history source_relation 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report source_relation 78. model.facebook_ads.int_facebook_ads__creative_history:f0->76. model.facebook_ads.facebook_ads__url_report:f0 79. model.facebook_ads_source.stg_facebook_ads__account_history 79. model.facebook_ads_source.stg_facebook_ads__account_history source_relation 79. model.facebook_ads_source.stg_facebook_ads__account_history:f0->76. model.facebook_ads.facebook_ads__url_report:f0 81. model.facebook_ads_source.stg_facebook_ads__ad_history 81. model.facebook_ads_source.stg_facebook_ads__ad_history source_relation 81. model.facebook_ads_source.stg_facebook_ads__ad_history:f0->76. model.facebook_ads.facebook_ads__url_report:f0 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history source_relation 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history:f0->76. model.facebook_ads.facebook_ads__url_report:f0 85. model.facebook_ads_source.stg_facebook_ads__basic_ad 85. model.facebook_ads_source.stg_facebook_ads__basic_ad source_relation 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->76. model.facebook_ads.facebook_ads__url_report:f0 87. model.facebook_ads_source.stg_facebook_ads__campaign_history 87. model.facebook_ads_source.stg_facebook_ads__campaign_history source_relation 87. model.facebook_ads_source.stg_facebook_ads__campaign_history:f0->76. model.facebook_ads.facebook_ads__url_report:f0 77. model.facebook_ads.facebook_ads__url_tags 77. model.facebook_ads.facebook_ads__url_tags source_relation 77. model.facebook_ads.facebook_ads__url_tags:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history 89. model.facebook_ads_source.stg_facebook_ads__creative_history source_relation 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->77. model.facebook_ads.facebook_ads__url_tags:f0
77. model.facebook_ads.facebook_ads__url_tags
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[source_relation]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • source_relation: Directly copied
78. model.facebook_ads.int_facebook_ads__creative_history
  • Input Column: 77. model.facebook_ads.facebook_ads__url_tags[source_relation]
    • Integration Used to join with the base table
    • Direct Directly selected in the final output
    • Output Columns:
      • source_relation: Directly copied to the output
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with url_tags_pivoted
    • Output Columns:
      • source_relation: Directly copied
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[source_relation]
    • Direct The column is directly copied without transformation
    • Integration Used as part of the join condition with other tables
    • Output Columns:
      • source_relation: Directly copied to the output
  • Input Column: 79. model.facebook_ads_source.stg_facebook_ads__account_history[source_relation]
    • Integration Used as part of the join condition with the report table
    • Direct Directly copied to the output
    • Output Columns:
      • source_relation: Directly copied
  • Input Column: 81. model.facebook_ads_source.stg_facebook_ads__ad_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct copied directly to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join conditions with other tables
    • Output Columns:
      • source_relation: Directly copied to the output
  • Input Column: 87. model.facebook_ads_source.stg_facebook_ads__campaign_history[source_relation]
    • Integration used to join with other tables
    • Filtering used in the WHERE clause to ensure consistency across joins
    • Output Columns:
      • source_relation: directly copied to output
Column Lineage
%3 85. model.facebook_ads_source.stg_facebook_ads__basic_ad 85. model.facebook_ads_source.stg_facebook_ads__basic_ad date_day 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report date_day 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->76. model.facebook_ads.facebook_ads__url_report:f0 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp date 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp:f0->85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0
85. model.facebook_ads_source.stg_facebook_ads__basic_ad
  • Input Column: 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp[date]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • date_day: Directly mapped and renamed
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 79. model.facebook_ads_source.stg_facebook_ads__account_history 79. model.facebook_ads_source.stg_facebook_ads__account_history account_id 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report account_id 79. model.facebook_ads_source.stg_facebook_ads__account_history:f0->76. model.facebook_ads.facebook_ads__url_report:f0 85. model.facebook_ads_source.stg_facebook_ads__basic_ad 85. model.facebook_ads_source.stg_facebook_ads__basic_ad account_id 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->76. model.facebook_ads.facebook_ads__url_report:f0 80. model.facebook_ads_source.stg_facebook_ads__account_history_tmp 80. model.facebook_ads_source.stg_facebook_ads__account_history_tmp id 80. model.facebook_ads_source.stg_facebook_ads__account_history_tmp:f0->79. model.facebook_ads_source.stg_facebook_ads__account_history:f0 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp account_id 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp:f0->85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0
79. model.facebook_ads_source.stg_facebook_ads__account_history
  • Input Column: 80. model.facebook_ads_source.stg_facebook_ads__account_history_tmp[id]
    • Cleaning The column is cast to BIGINT
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • account_id: Directly mapped after casting to BIGINT
85. model.facebook_ads_source.stg_facebook_ads__basic_ad
  • Input Column: 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp[account_id]
    • Cleaning The column is cast to BIGINT data type
    • Output Columns:
      • account_id: Directly mapped after casting
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 79. model.facebook_ads_source.stg_facebook_ads__account_history[account_id]
    • Integration Used as part of the join condition with the report table
    • Direct Directly copied to the output
    • Output Columns:
      • account_id: Directly copied
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[account_id]
    • Integration Used as a key to join with the accounts table
    • Output Columns:
      • account_id: Indirectly mapped through the join with accounts table
Column Lineage
%3 79. model.facebook_ads_source.stg_facebook_ads__account_history 79. model.facebook_ads_source.stg_facebook_ads__account_history account_name 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report account_name 79. model.facebook_ads_source.stg_facebook_ads__account_history:f0->76. model.facebook_ads.facebook_ads__url_report:f0 80. model.facebook_ads_source.stg_facebook_ads__account_history_tmp 80. model.facebook_ads_source.stg_facebook_ads__account_history_tmp name 80. model.facebook_ads_source.stg_facebook_ads__account_history_tmp:f0->79. model.facebook_ads_source.stg_facebook_ads__account_history:f0
79. model.facebook_ads_source.stg_facebook_ads__account_history
  • Input Column: 80. model.facebook_ads_source.stg_facebook_ads__account_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • account_name: Directly mapped
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 79. model.facebook_ads_source.stg_facebook_ads__account_history[account_name]
    • Direct Directly copied to the output
    • Output Columns:
      • account_name: Directly copied
Column Lineage
%3 87. model.facebook_ads_source.stg_facebook_ads__campaign_history 87. model.facebook_ads_source.stg_facebook_ads__campaign_history campaign_id 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report campaign_id 87. model.facebook_ads_source.stg_facebook_ads__campaign_history:f0->76. model.facebook_ads.facebook_ads__url_report:f0 88. model.facebook_ads_source.stg_facebook_ads__campaign_history_tmp 88. model.facebook_ads_source.stg_facebook_ads__campaign_history_tmp id 88. model.facebook_ads_source.stg_facebook_ads__campaign_history_tmp:f0->87. model.facebook_ads_source.stg_facebook_ads__campaign_history:f0
87. model.facebook_ads_source.stg_facebook_ads__campaign_history
  • Input Column: 88. model.facebook_ads_source.stg_facebook_ads__campaign_history_tmp[id]
    • Cleaning Cast to BIGINT data type
    • Deduplication Used in the ROW_NUMBER() window function to identify the most recent record
    • Output Columns:
      • campaign_id: Directly mapped after casting to BIGINT
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 87. model.facebook_ads_source.stg_facebook_ads__campaign_history[campaign_id]
    • Integration used to join with the ads table
    • Filtering used in the WHERE clause to ensure consistency across joins
    • Output Columns:
      • campaign_id: directly copied to output
Column Lineage
%3 87. model.facebook_ads_source.stg_facebook_ads__campaign_history 87. model.facebook_ads_source.stg_facebook_ads__campaign_history campaign_name 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report campaign_name 87. model.facebook_ads_source.stg_facebook_ads__campaign_history:f0->76. model.facebook_ads.facebook_ads__url_report:f0 88. model.facebook_ads_source.stg_facebook_ads__campaign_history_tmp 88. model.facebook_ads_source.stg_facebook_ads__campaign_history_tmp name 88. model.facebook_ads_source.stg_facebook_ads__campaign_history_tmp:f0->87. model.facebook_ads_source.stg_facebook_ads__campaign_history:f0
87. model.facebook_ads_source.stg_facebook_ads__campaign_history
  • Input Column: 88. model.facebook_ads_source.stg_facebook_ads__campaign_history_tmp[name]
    • Direct Copied without transformation
    • Output Columns:
      • campaign_name: Directly mapped
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 87. model.facebook_ads_source.stg_facebook_ads__campaign_history[campaign_name]
    • Direct copied without transformation
    • Output Columns:
      • campaign_name: directly copied to output
Column Lineage
%3 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history ad_set_id 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report ad_set_id 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history:f0->76. model.facebook_ads.facebook_ads__url_report:f0 84. model.facebook_ads_source.stg_facebook_ads__ad_set_history_tmp 84. model.facebook_ads_source.stg_facebook_ads__ad_set_history_tmp id 84. model.facebook_ads_source.stg_facebook_ads__ad_set_history_tmp:f0->83. model.facebook_ads_source.stg_facebook_ads__ad_set_history:f0
83. model.facebook_ads_source.stg_facebook_ads__ad_set_history
  • Input Column: 84. model.facebook_ads_source.stg_facebook_ads__ad_set_history_tmp[id]
    • Cleaning The column is cast to BIGINT
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • ad_set_id: Directly mapped after casting to BIGINT
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history[ad_set_id]
    • Integration used as the key to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • ad_set_id: directly copied
Column Lineage
%3 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history ad_set_name 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report ad_set_name 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history:f0->76. model.facebook_ads.facebook_ads__url_report:f0 84. model.facebook_ads_source.stg_facebook_ads__ad_set_history_tmp 84. model.facebook_ads_source.stg_facebook_ads__ad_set_history_tmp name 84. model.facebook_ads_source.stg_facebook_ads__ad_set_history_tmp:f0->83. model.facebook_ads_source.stg_facebook_ads__ad_set_history:f0
83. model.facebook_ads_source.stg_facebook_ads__ad_set_history
  • Input Column: 84. model.facebook_ads_source.stg_facebook_ads__ad_set_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • ad_set_name: Directly mapped
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history[ad_set_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_set_name: directly copied
Column Lineage
%3 81. model.facebook_ads_source.stg_facebook_ads__ad_history 81. model.facebook_ads_source.stg_facebook_ads__ad_history ad_id 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report ad_id 81. model.facebook_ads_source.stg_facebook_ads__ad_history:f0->76. model.facebook_ads.facebook_ads__url_report:f0 85. model.facebook_ads_source.stg_facebook_ads__basic_ad 85. model.facebook_ads_source.stg_facebook_ads__basic_ad ad_id 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->76. model.facebook_ads.facebook_ads__url_report:f0 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp id 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp:f0->81. model.facebook_ads_source.stg_facebook_ads__ad_history:f0 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp ad_id 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp:f0->85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0
81. model.facebook_ads_source.stg_facebook_ads__ad_history
  • Input Column: 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp[id]
    • Cleaning The column is cast to BIGINT
    • Deduplication Used in ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • ad_id: Directly mapped after casting to BIGINT
85. model.facebook_ads_source.stg_facebook_ads__basic_ad
  • Input Column: 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp[ad_id]
    • Cleaning The column is cast to BIGINT data type
    • Output Columns:
      • ad_id: Directly mapped after casting
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 81. model.facebook_ads_source.stg_facebook_ads__ad_history[ad_id]
    • Integration used as the key to join with the report table
    • Direct copied directly to the output
    • Output Columns:
      • ad_id: directly copied
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[ad_id]
    • Integration Used as a key to join with the ads table
    • Output Columns:
      • ad_id: Indirectly mapped through the join with ads table
Column Lineage
%3 81. model.facebook_ads_source.stg_facebook_ads__ad_history 81. model.facebook_ads_source.stg_facebook_ads__ad_history ad_name 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report ad_name 81. model.facebook_ads_source.stg_facebook_ads__ad_history:f0->76. model.facebook_ads.facebook_ads__url_report:f0 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp name 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp:f0->81. model.facebook_ads_source.stg_facebook_ads__ad_history:f0
81. model.facebook_ads_source.stg_facebook_ads__ad_history
  • Input Column: 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • ad_name: Directly mapped
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 81. model.facebook_ads_source.stg_facebook_ads__ad_history[ad_name]
    • Direct copied directly to the output
    • Output Columns:
      • ad_name: directly copied
Column Lineage
%3 78. model.facebook_ads.int_facebook_ads__creative_history 78. model.facebook_ads.int_facebook_ads__creative_history creative_id 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report creative_id 78. model.facebook_ads.int_facebook_ads__creative_history:f0->76. model.facebook_ads.facebook_ads__url_report:f0 77. model.facebook_ads.facebook_ads__url_tags 77. model.facebook_ads.facebook_ads__url_tags creative_id 77. model.facebook_ads.facebook_ads__url_tags:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history 89. model.facebook_ads_source.stg_facebook_ads__creative_history creative_id 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->77. model.facebook_ads.facebook_ads__url_tags:f0 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp id 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f0->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0
77. model.facebook_ads.facebook_ads__url_tags
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[creative_id]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • creative_id: Directly copied
89. model.facebook_ads_source.stg_facebook_ads__creative_history
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[id]
    • Cleaning The column is cast as BIGINT
    • Deduplication Used in the window function to determine the most recent record
    • Output Columns:
      • creative_id: Mapped after casting to BIGINT
78. model.facebook_ads.int_facebook_ads__creative_history
  • Input Column: 77. model.facebook_ads.facebook_ads__url_tags[creative_id]
    • Integration Used to join with the base table
    • Aggregation Used in GROUP BY clause
    • Output Columns:
      • creative_id: Directly copied to the output
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[creative_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with url_tags_pivoted
    • Output Columns:
      • creative_id: Directly copied
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[creative_id]
    • Direct The column is directly copied without transformation
    • Integration Used as the key to join with the ads table
    • Output Columns:
      • creative_id: Directly copied to the output
Column Lineage
%3 78. model.facebook_ads.int_facebook_ads__creative_history 78. model.facebook_ads.int_facebook_ads__creative_history creative_name 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report creative_name 78. model.facebook_ads.int_facebook_ads__creative_history:f0->76. model.facebook_ads.facebook_ads__url_report:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history 89. model.facebook_ads_source.stg_facebook_ads__creative_history creative_name 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f0 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp name 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f0->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0
89. model.facebook_ads_source.stg_facebook_ads__creative_history
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[name]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • creative_name: Renamed and directly mapped
78. model.facebook_ads.int_facebook_ads__creative_history
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[creative_name]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • creative_name: Directly copied
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[creative_name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • creative_name: Directly copied to the output
Column Lineage
%3 78. model.facebook_ads.int_facebook_ads__creative_history 78. model.facebook_ads.int_facebook_ads__creative_history base_url url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report base_url 78. model.facebook_ads.int_facebook_ads__creative_history:f0->76. model.facebook_ads.facebook_ads__url_report:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history 89. model.facebook_ads_source.stg_facebook_ads__creative_history object_story_link_data_link page_link template_page_link 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f1 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f3 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f7 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f6 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f4 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f5 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f8 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f1 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f3 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f7 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f6 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f4 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f5 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f8 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f1 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f3 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f7 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f6 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f4 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f5 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f8 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp object_story_link_data_link page_link template_page_link 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f1->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f2->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f0->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0
89. model.facebook_ads_source.stg_facebook_ads__creative_history
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[page_link]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • page_link: Directly mapped
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[template_page_link]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • template_page_link: Directly mapped
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[object_story_link_data_link]
    • Direct This column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the 'fields' CTE
    • Output Columns:
      • object_story_link_data_link: Directly mapped to this output column
78. model.facebook_ads.int_facebook_ads__creative_history
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[page_link]
    • Cleaning Used in COALESCE with template_page_link
    • Featurization Various URL components and UTM parameters are extracted from this column
    • Output Columns:
      • url: COALESCE(page_link, template_page_link)
      • base_url: Extracted from page_link or template_page_link
      • url_host: Extracted from page_link or template_page_link
      • url_path: Extracted from page_link or template_page_link
      • utm_source: Extracted if not found in url_tags_pivoted
      • utm_medium: Extracted if not found in url_tags_pivoted
      • utm_campaign: Extracted if not found in url_tags_pivoted
      • utm_content: Extracted if not found in url_tags_pivoted
      • utm_term: Extracted if not found in url_tags_pivoted
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[template_page_link]
    • Cleaning Used in COALESCE with page_link
    • Featurization Various URL components and UTM parameters are extracted from this column if page_link is null
    • Output Columns:
      • url: COALESCE(page_link, template_page_link)
      • base_url: Extracted from page_link or template_page_link
      • url_host: Extracted from page_link or template_page_link
      • url_path: Extracted from page_link or template_page_link
      • utm_source: Extracted if not found in url_tags_pivoted and page_link
      • utm_medium: Extracted if not found in url_tags_pivoted and page_link
      • utm_campaign: Extracted if not found in url_tags_pivoted and page_link
      • utm_content: Extracted if not found in url_tags_pivoted and page_link
      • utm_term: Extracted if not found in url_tags_pivoted and page_link
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[object_story_link_data_link]
    • Cleaning This column is likely used in the COALESCE function with template_page_link to create the 'url' column.
    • Featurization Various parts of the URL are extracted from this column to create different features.
    • Output Columns:
      • url: Potentially used in COALESCE(page_link, template_page_link)
      • base_url: Extracted from this column
      • url_host: Extracted and cleaned from this column
      • url_path: Extracted and cleaned from this column
      • utm_source: Potentially extracted from this column if not found in url_tags
      • utm_medium: Potentially extracted from this column if not found in url_tags
      • utm_campaign: Potentially extracted from this column if not found in url_tags
      • utm_content: Potentially extracted from this column if not found in url_tags
      • utm_term: Potentially extracted from this column if not found in url_tags
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[base_url]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • base_url: Directly copied to the output
Column Lineage
%3 78. model.facebook_ads.int_facebook_ads__creative_history 78. model.facebook_ads.int_facebook_ads__creative_history base_url url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report url_host 78. model.facebook_ads.int_facebook_ads__creative_history:f2->76. model.facebook_ads.facebook_ads__url_report:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history 89. model.facebook_ads_source.stg_facebook_ads__creative_history object_story_link_data_link page_link template_page_link 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f1 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f3 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f7 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f6 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f4 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f5 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f8 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f1 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f3 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f7 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f6 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f4 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f5 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f8 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f1 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f3 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f7 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f6 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f4 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f5 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f8 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp object_story_link_data_link page_link template_page_link 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f1->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f2->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f0->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0
89. model.facebook_ads_source.stg_facebook_ads__creative_history
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[page_link]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • page_link: Directly mapped
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[template_page_link]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • template_page_link: Directly mapped
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[object_story_link_data_link]
    • Direct This column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the 'fields' CTE
    • Output Columns:
      • object_story_link_data_link: Directly mapped to this output column
78. model.facebook_ads.int_facebook_ads__creative_history
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[page_link]
    • Cleaning Used in COALESCE with template_page_link
    • Featurization Various URL components and UTM parameters are extracted from this column
    • Output Columns:
      • url: COALESCE(page_link, template_page_link)
      • base_url: Extracted from page_link or template_page_link
      • url_host: Extracted from page_link or template_page_link
      • url_path: Extracted from page_link or template_page_link
      • utm_source: Extracted if not found in url_tags_pivoted
      • utm_medium: Extracted if not found in url_tags_pivoted
      • utm_campaign: Extracted if not found in url_tags_pivoted
      • utm_content: Extracted if not found in url_tags_pivoted
      • utm_term: Extracted if not found in url_tags_pivoted
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[template_page_link]
    • Cleaning Used in COALESCE with page_link
    • Featurization Various URL components and UTM parameters are extracted from this column if page_link is null
    • Output Columns:
      • url: COALESCE(page_link, template_page_link)
      • base_url: Extracted from page_link or template_page_link
      • url_host: Extracted from page_link or template_page_link
      • url_path: Extracted from page_link or template_page_link
      • utm_source: Extracted if not found in url_tags_pivoted and page_link
      • utm_medium: Extracted if not found in url_tags_pivoted and page_link
      • utm_campaign: Extracted if not found in url_tags_pivoted and page_link
      • utm_content: Extracted if not found in url_tags_pivoted and page_link
      • utm_term: Extracted if not found in url_tags_pivoted and page_link
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[object_story_link_data_link]
    • Cleaning This column is likely used in the COALESCE function with template_page_link to create the 'url' column.
    • Featurization Various parts of the URL are extracted from this column to create different features.
    • Output Columns:
      • url: Potentially used in COALESCE(page_link, template_page_link)
      • base_url: Extracted from this column
      • url_host: Extracted and cleaned from this column
      • url_path: Extracted and cleaned from this column
      • utm_source: Potentially extracted from this column if not found in url_tags
      • utm_medium: Potentially extracted from this column if not found in url_tags
      • utm_campaign: Potentially extracted from this column if not found in url_tags
      • utm_content: Potentially extracted from this column if not found in url_tags
      • utm_term: Potentially extracted from this column if not found in url_tags
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[url_host]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • url_host: Directly copied to the output
Column Lineage
%3 78. model.facebook_ads.int_facebook_ads__creative_history 78. model.facebook_ads.int_facebook_ads__creative_history base_url url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report url_path 78. model.facebook_ads.int_facebook_ads__creative_history:f3->76. model.facebook_ads.facebook_ads__url_report:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history 89. model.facebook_ads_source.stg_facebook_ads__creative_history object_story_link_data_link page_link template_page_link 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f1 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f3 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f7 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f6 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f4 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f5 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f8 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f1 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f3 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f7 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f6 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f4 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f5 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f8 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f1 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f3 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f7 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f6 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f4 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f5 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f8 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp object_story_link_data_link page_link template_page_link 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f1->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f2->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f0->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0
89. model.facebook_ads_source.stg_facebook_ads__creative_history
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[page_link]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • page_link: Directly mapped
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[template_page_link]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • template_page_link: Directly mapped
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[object_story_link_data_link]
    • Direct This column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the 'fields' CTE
    • Output Columns:
      • object_story_link_data_link: Directly mapped to this output column
78. model.facebook_ads.int_facebook_ads__creative_history
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[page_link]
    • Cleaning Used in COALESCE with template_page_link
    • Featurization Various URL components and UTM parameters are extracted from this column
    • Output Columns:
      • url: COALESCE(page_link, template_page_link)
      • base_url: Extracted from page_link or template_page_link
      • url_host: Extracted from page_link or template_page_link
      • url_path: Extracted from page_link or template_page_link
      • utm_source: Extracted if not found in url_tags_pivoted
      • utm_medium: Extracted if not found in url_tags_pivoted
      • utm_campaign: Extracted if not found in url_tags_pivoted
      • utm_content: Extracted if not found in url_tags_pivoted
      • utm_term: Extracted if not found in url_tags_pivoted
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[template_page_link]
    • Cleaning Used in COALESCE with page_link
    • Featurization Various URL components and UTM parameters are extracted from this column if page_link is null
    • Output Columns:
      • url: COALESCE(page_link, template_page_link)
      • base_url: Extracted from page_link or template_page_link
      • url_host: Extracted from page_link or template_page_link
      • url_path: Extracted from page_link or template_page_link
      • utm_source: Extracted if not found in url_tags_pivoted and page_link
      • utm_medium: Extracted if not found in url_tags_pivoted and page_link
      • utm_campaign: Extracted if not found in url_tags_pivoted and page_link
      • utm_content: Extracted if not found in url_tags_pivoted and page_link
      • utm_term: Extracted if not found in url_tags_pivoted and page_link
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[object_story_link_data_link]
    • Cleaning This column is likely used in the COALESCE function with template_page_link to create the 'url' column.
    • Featurization Various parts of the URL are extracted from this column to create different features.
    • Output Columns:
      • url: Potentially used in COALESCE(page_link, template_page_link)
      • base_url: Extracted from this column
      • url_host: Extracted and cleaned from this column
      • url_path: Extracted and cleaned from this column
      • utm_source: Potentially extracted from this column if not found in url_tags
      • utm_medium: Potentially extracted from this column if not found in url_tags
      • utm_campaign: Potentially extracted from this column if not found in url_tags
      • utm_content: Potentially extracted from this column if not found in url_tags
      • utm_term: Potentially extracted from this column if not found in url_tags
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[url_path]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • url_path: Directly copied to the output
Column Lineage
%3 78. model.facebook_ads.int_facebook_ads__creative_history 78. model.facebook_ads.int_facebook_ads__creative_history base_url url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report utm_source 78. model.facebook_ads.int_facebook_ads__creative_history:f7->76. model.facebook_ads.facebook_ads__url_report:f0 77. model.facebook_ads.facebook_ads__url_tags 77. model.facebook_ads.facebook_ads__url_tags key type value 77. model.facebook_ads.facebook_ads__url_tags:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f7 77. model.facebook_ads.facebook_ads__url_tags:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f6 77. model.facebook_ads.facebook_ads__url_tags:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f4 77. model.facebook_ads.facebook_ads__url_tags:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f5 77. model.facebook_ads.facebook_ads__url_tags:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f8 77. model.facebook_ads.facebook_ads__url_tags:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f7 77. model.facebook_ads.facebook_ads__url_tags:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f6 77. model.facebook_ads.facebook_ads__url_tags:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f4 77. model.facebook_ads.facebook_ads__url_tags:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f5 77. model.facebook_ads.facebook_ads__url_tags:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f8 89. model.facebook_ads_source.stg_facebook_ads__creative_history 89. model.facebook_ads_source.stg_facebook_ads__creative_history object_story_link_data_link page_link template_page_link url_tags 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f1 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f3 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f7 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f6 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f4 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f5 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f8 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f1 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f3 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f7 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f6 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f4 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f5 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f8 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f1 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f3 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f7 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f6 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f4 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f5 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f8 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f3->77. model.facebook_ads.facebook_ads__url_tags:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f3->77. model.facebook_ads.facebook_ads__url_tags:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f3->77. model.facebook_ads.facebook_ads__url_tags:f1 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f3->77. model.facebook_ads.facebook_ads__url_tags:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f3->77. model.facebook_ads.facebook_ads__url_tags:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f3->77. model.facebook_ads.facebook_ads__url_tags:f1 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp object_story_link_data_link page_link template_page_link url_tags 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f1->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f2->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f0->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f3->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f3
89. model.facebook_ads_source.stg_facebook_ads__creative_history
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[page_link]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • page_link: Directly mapped
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[template_page_link]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • template_page_link: Directly mapped
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[object_story_link_data_link]
    • Direct This column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the 'fields' CTE
    • Output Columns:
      • object_story_link_data_link: Directly mapped to this output column
77. model.facebook_ads.facebook_ads__url_tags
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[url_tags]
    • Filtering The column is filtered to include only non-null values
    • Cleaning The column is cleaned by parsing JSON
    • Other The column is flattened and its contents are extracted into separate columns
    • Output Columns:
      • key: Extracted from flattened url_tags
      • value: Extracted from flattened url_tags
      • type: Extracted from flattened url_tags
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[url_tags]
    • Filtering The column is filtered to include only non-null values
    • Cleaning The column is cleaned by parsing JSON
    • Other The column is flattened and its contents are extracted into separate columns
    • Output Columns:
      • key: Extracted from flattened url_tags
      • value: Extracted from flattened url_tags
      • type: Extracted from flattened url_tags
78. model.facebook_ads.int_facebook_ads__creative_history
  • Input Column: 77. model.facebook_ads.facebook_ads__url_tags[key]
    • Featurization Used to pivot the data, extracting different UTM parameters
    • Output Columns:
      • utm_source: Mapped when key = 'utm_source'
      • utm_medium: Mapped when key = 'utm_medium'
      • utm_campaign: Mapped when key = 'utm_campaign'
      • utm_content: Mapped when key = 'utm_content'
      • utm_term: Mapped when key = 'utm_term'
  • Input Column: 77. model.facebook_ads.facebook_ads__url_tags[value]
    • Featurization Used as the value for the pivoted UTM parameters
    • Output Columns:
      • utm_source: Mapped when key = 'utm_source'
      • utm_medium: Mapped when key = 'utm_medium'
      • utm_campaign: Mapped when key = 'utm_campaign'
      • utm_content: Mapped when key = 'utm_content'
      • utm_term: Mapped when key = 'utm_term'
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[page_link]
    • Cleaning Used in COALESCE with template_page_link
    • Featurization Various URL components and UTM parameters are extracted from this column
    • Output Columns:
      • url: COALESCE(page_link, template_page_link)
      • base_url: Extracted from page_link or template_page_link
      • url_host: Extracted from page_link or template_page_link
      • url_path: Extracted from page_link or template_page_link
      • utm_source: Extracted if not found in url_tags_pivoted
      • utm_medium: Extracted if not found in url_tags_pivoted
      • utm_campaign: Extracted if not found in url_tags_pivoted
      • utm_content: Extracted if not found in url_tags_pivoted
      • utm_term: Extracted if not found in url_tags_pivoted
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[template_page_link]
    • Cleaning Used in COALESCE with page_link
    • Featurization Various URL components and UTM parameters are extracted from this column if page_link is null
    • Output Columns:
      • url: COALESCE(page_link, template_page_link)
      • base_url: Extracted from page_link or template_page_link
      • url_host: Extracted from page_link or template_page_link
      • url_path: Extracted from page_link or template_page_link
      • utm_source: Extracted if not found in url_tags_pivoted and page_link
      • utm_medium: Extracted if not found in url_tags_pivoted and page_link
      • utm_campaign: Extracted if not found in url_tags_pivoted and page_link
      • utm_content: Extracted if not found in url_tags_pivoted and page_link
      • utm_term: Extracted if not found in url_tags_pivoted and page_link
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[object_story_link_data_link]
    • Cleaning This column is likely used in the COALESCE function with template_page_link to create the 'url' column.
    • Featurization Various parts of the URL are extracted from this column to create different features.
    • Output Columns:
      • url: Potentially used in COALESCE(page_link, template_page_link)
      • base_url: Extracted from this column
      • url_host: Extracted and cleaned from this column
      • url_path: Extracted and cleaned from this column
      • utm_source: Potentially extracted from this column if not found in url_tags
      • utm_medium: Potentially extracted from this column if not found in url_tags
      • utm_campaign: Potentially extracted from this column if not found in url_tags
      • utm_content: Potentially extracted from this column if not found in url_tags
      • utm_term: Potentially extracted from this column if not found in url_tags
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[utm_source]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • utm_source: Directly copied to the output
Column Lineage
%3 78. model.facebook_ads.int_facebook_ads__creative_history 78. model.facebook_ads.int_facebook_ads__creative_history base_url url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report utm_medium 78. model.facebook_ads.int_facebook_ads__creative_history:f6->76. model.facebook_ads.facebook_ads__url_report:f0 77. model.facebook_ads.facebook_ads__url_tags 77. model.facebook_ads.facebook_ads__url_tags key type value 77. model.facebook_ads.facebook_ads__url_tags:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f7 77. model.facebook_ads.facebook_ads__url_tags:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f6 77. model.facebook_ads.facebook_ads__url_tags:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f4 77. model.facebook_ads.facebook_ads__url_tags:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f5 77. model.facebook_ads.facebook_ads__url_tags:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f8 77. model.facebook_ads.facebook_ads__url_tags:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f7 77. model.facebook_ads.facebook_ads__url_tags:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f6 77. model.facebook_ads.facebook_ads__url_tags:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f4 77. model.facebook_ads.facebook_ads__url_tags:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f5 77. model.facebook_ads.facebook_ads__url_tags:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f8 89. model.facebook_ads_source.stg_facebook_ads__creative_history 89. model.facebook_ads_source.stg_facebook_ads__creative_history object_story_link_data_link page_link template_page_link url_tags 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f1 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f3 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f7 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f6 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f4 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f5 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f8 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f1 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f3 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f7 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f6 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f4 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f5 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f8 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f1 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f3 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f7 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f6 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f4 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f5 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f8 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f3->77. model.facebook_ads.facebook_ads__url_tags:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f3->77. model.facebook_ads.facebook_ads__url_tags:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f3->77. model.facebook_ads.facebook_ads__url_tags:f1 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f3->77. model.facebook_ads.facebook_ads__url_tags:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f3->77. model.facebook_ads.facebook_ads__url_tags:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f3->77. model.facebook_ads.facebook_ads__url_tags:f1 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp object_story_link_data_link page_link template_page_link url_tags 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f1->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f2->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f0->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f3->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f3
89. model.facebook_ads_source.stg_facebook_ads__creative_history
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[page_link]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • page_link: Directly mapped
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[template_page_link]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • template_page_link: Directly mapped
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[object_story_link_data_link]
    • Direct This column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the 'fields' CTE
    • Output Columns:
      • object_story_link_data_link: Directly mapped to this output column
77. model.facebook_ads.facebook_ads__url_tags
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[url_tags]
    • Filtering The column is filtered to include only non-null values
    • Cleaning The column is cleaned by parsing JSON
    • Other The column is flattened and its contents are extracted into separate columns
    • Output Columns:
      • key: Extracted from flattened url_tags
      • value: Extracted from flattened url_tags
      • type: Extracted from flattened url_tags
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[url_tags]
    • Filtering The column is filtered to include only non-null values
    • Cleaning The column is cleaned by parsing JSON
    • Other The column is flattened and its contents are extracted into separate columns
    • Output Columns:
      • key: Extracted from flattened url_tags
      • value: Extracted from flattened url_tags
      • type: Extracted from flattened url_tags
78. model.facebook_ads.int_facebook_ads__creative_history
  • Input Column: 77. model.facebook_ads.facebook_ads__url_tags[key]
    • Featurization Used to pivot the data, extracting different UTM parameters
    • Output Columns:
      • utm_source: Mapped when key = 'utm_source'
      • utm_medium: Mapped when key = 'utm_medium'
      • utm_campaign: Mapped when key = 'utm_campaign'
      • utm_content: Mapped when key = 'utm_content'
      • utm_term: Mapped when key = 'utm_term'
  • Input Column: 77. model.facebook_ads.facebook_ads__url_tags[value]
    • Featurization Used as the value for the pivoted UTM parameters
    • Output Columns:
      • utm_source: Mapped when key = 'utm_source'
      • utm_medium: Mapped when key = 'utm_medium'
      • utm_campaign: Mapped when key = 'utm_campaign'
      • utm_content: Mapped when key = 'utm_content'
      • utm_term: Mapped when key = 'utm_term'
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[page_link]
    • Cleaning Used in COALESCE with template_page_link
    • Featurization Various URL components and UTM parameters are extracted from this column
    • Output Columns:
      • url: COALESCE(page_link, template_page_link)
      • base_url: Extracted from page_link or template_page_link
      • url_host: Extracted from page_link or template_page_link
      • url_path: Extracted from page_link or template_page_link
      • utm_source: Extracted if not found in url_tags_pivoted
      • utm_medium: Extracted if not found in url_tags_pivoted
      • utm_campaign: Extracted if not found in url_tags_pivoted
      • utm_content: Extracted if not found in url_tags_pivoted
      • utm_term: Extracted if not found in url_tags_pivoted
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[template_page_link]
    • Cleaning Used in COALESCE with page_link
    • Featurization Various URL components and UTM parameters are extracted from this column if page_link is null
    • Output Columns:
      • url: COALESCE(page_link, template_page_link)
      • base_url: Extracted from page_link or template_page_link
      • url_host: Extracted from page_link or template_page_link
      • url_path: Extracted from page_link or template_page_link
      • utm_source: Extracted if not found in url_tags_pivoted and page_link
      • utm_medium: Extracted if not found in url_tags_pivoted and page_link
      • utm_campaign: Extracted if not found in url_tags_pivoted and page_link
      • utm_content: Extracted if not found in url_tags_pivoted and page_link
      • utm_term: Extracted if not found in url_tags_pivoted and page_link
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[object_story_link_data_link]
    • Cleaning This column is likely used in the COALESCE function with template_page_link to create the 'url' column.
    • Featurization Various parts of the URL are extracted from this column to create different features.
    • Output Columns:
      • url: Potentially used in COALESCE(page_link, template_page_link)
      • base_url: Extracted from this column
      • url_host: Extracted and cleaned from this column
      • url_path: Extracted and cleaned from this column
      • utm_source: Potentially extracted from this column if not found in url_tags
      • utm_medium: Potentially extracted from this column if not found in url_tags
      • utm_campaign: Potentially extracted from this column if not found in url_tags
      • utm_content: Potentially extracted from this column if not found in url_tags
      • utm_term: Potentially extracted from this column if not found in url_tags
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[utm_medium]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the creatives table
    • Output Columns:
      • utm_medium: Directly copied to the output
Column Lineage
%3 78. model.facebook_ads.int_facebook_ads__creative_history 78. model.facebook_ads.int_facebook_ads__creative_history base_url url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report utm_campaign 78. model.facebook_ads.int_facebook_ads__creative_history:f4->76. model.facebook_ads.facebook_ads__url_report:f0 77. model.facebook_ads.facebook_ads__url_tags 77. model.facebook_ads.facebook_ads__url_tags key type value 77. model.facebook_ads.facebook_ads__url_tags:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f7 77. model.facebook_ads.facebook_ads__url_tags:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f6 77. model.facebook_ads.facebook_ads__url_tags:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f4 77. model.facebook_ads.facebook_ads__url_tags:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f5 77. model.facebook_ads.facebook_ads__url_tags:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f8 77. model.facebook_ads.facebook_ads__url_tags:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f7 77. model.facebook_ads.facebook_ads__url_tags:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f6 77. model.facebook_ads.facebook_ads__url_tags:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f4 77. model.facebook_ads.facebook_ads__url_tags:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f5 77. model.facebook_ads.facebook_ads__url_tags:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f8 89. model.facebook_ads_source.stg_facebook_ads__creative_history 89. model.facebook_ads_source.stg_facebook_ads__creative_history object_story_link_data_link page_link template_page_link url_tags 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f1 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f3 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f7 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f6 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f4 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f5 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f8 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f1 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f3 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f7 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f6 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f4 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f5 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f8 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f1 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f3 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f7 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f6 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f4 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f5 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f8 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f3->77. model.facebook_ads.facebook_ads__url_tags:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f3->77. model.facebook_ads.facebook_ads__url_tags:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f3->77. model.facebook_ads.facebook_ads__url_tags:f1 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f3->77. model.facebook_ads.facebook_ads__url_tags:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f3->77. model.facebook_ads.facebook_ads__url_tags:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f3->77. model.facebook_ads.facebook_ads__url_tags:f1 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp object_story_link_data_link page_link template_page_link url_tags 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f1->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f2->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f0->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f3->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f3
89. model.facebook_ads_source.stg_facebook_ads__creative_history
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[page_link]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • page_link: Directly mapped
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[template_page_link]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • template_page_link: Directly mapped
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[object_story_link_data_link]
    • Direct This column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the 'fields' CTE
    • Output Columns:
      • object_story_link_data_link: Directly mapped to this output column
77. model.facebook_ads.facebook_ads__url_tags
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[url_tags]
    • Filtering The column is filtered to include only non-null values
    • Cleaning The column is cleaned by parsing JSON
    • Other The column is flattened and its contents are extracted into separate columns
    • Output Columns:
      • key: Extracted from flattened url_tags
      • value: Extracted from flattened url_tags
      • type: Extracted from flattened url_tags
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[url_tags]
    • Filtering The column is filtered to include only non-null values
    • Cleaning The column is cleaned by parsing JSON
    • Other The column is flattened and its contents are extracted into separate columns
    • Output Columns:
      • key: Extracted from flattened url_tags
      • value: Extracted from flattened url_tags
      • type: Extracted from flattened url_tags
78. model.facebook_ads.int_facebook_ads__creative_history
  • Input Column: 77. model.facebook_ads.facebook_ads__url_tags[key]
    • Featurization Used to pivot the data, extracting different UTM parameters
    • Output Columns:
      • utm_source: Mapped when key = 'utm_source'
      • utm_medium: Mapped when key = 'utm_medium'
      • utm_campaign: Mapped when key = 'utm_campaign'
      • utm_content: Mapped when key = 'utm_content'
      • utm_term: Mapped when key = 'utm_term'
  • Input Column: 77. model.facebook_ads.facebook_ads__url_tags[value]
    • Featurization Used as the value for the pivoted UTM parameters
    • Output Columns:
      • utm_source: Mapped when key = 'utm_source'
      • utm_medium: Mapped when key = 'utm_medium'
      • utm_campaign: Mapped when key = 'utm_campaign'
      • utm_content: Mapped when key = 'utm_content'
      • utm_term: Mapped when key = 'utm_term'
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[page_link]
    • Cleaning Used in COALESCE with template_page_link
    • Featurization Various URL components and UTM parameters are extracted from this column
    • Output Columns:
      • url: COALESCE(page_link, template_page_link)
      • base_url: Extracted from page_link or template_page_link
      • url_host: Extracted from page_link or template_page_link
      • url_path: Extracted from page_link or template_page_link
      • utm_source: Extracted if not found in url_tags_pivoted
      • utm_medium: Extracted if not found in url_tags_pivoted
      • utm_campaign: Extracted if not found in url_tags_pivoted
      • utm_content: Extracted if not found in url_tags_pivoted
      • utm_term: Extracted if not found in url_tags_pivoted
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[template_page_link]
    • Cleaning Used in COALESCE with page_link
    • Featurization Various URL components and UTM parameters are extracted from this column if page_link is null
    • Output Columns:
      • url: COALESCE(page_link, template_page_link)
      • base_url: Extracted from page_link or template_page_link
      • url_host: Extracted from page_link or template_page_link
      • url_path: Extracted from page_link or template_page_link
      • utm_source: Extracted if not found in url_tags_pivoted and page_link
      • utm_medium: Extracted if not found in url_tags_pivoted and page_link
      • utm_campaign: Extracted if not found in url_tags_pivoted and page_link
      • utm_content: Extracted if not found in url_tags_pivoted and page_link
      • utm_term: Extracted if not found in url_tags_pivoted and page_link
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[object_story_link_data_link]
    • Cleaning This column is likely used in the COALESCE function with template_page_link to create the 'url' column.
    • Featurization Various parts of the URL are extracted from this column to create different features.
    • Output Columns:
      • url: Potentially used in COALESCE(page_link, template_page_link)
      • base_url: Extracted from this column
      • url_host: Extracted and cleaned from this column
      • url_path: Extracted and cleaned from this column
      • utm_source: Potentially extracted from this column if not found in url_tags
      • utm_medium: Potentially extracted from this column if not found in url_tags
      • utm_campaign: Potentially extracted from this column if not found in url_tags
      • utm_content: Potentially extracted from this column if not found in url_tags
      • utm_term: Potentially extracted from this column if not found in url_tags
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[utm_campaign]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the creatives table
    • Output Columns:
      • utm_campaign: Directly copied to the output
Column Lineage
%3 78. model.facebook_ads.int_facebook_ads__creative_history 78. model.facebook_ads.int_facebook_ads__creative_history base_url url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report utm_content 78. model.facebook_ads.int_facebook_ads__creative_history:f5->76. model.facebook_ads.facebook_ads__url_report:f0 77. model.facebook_ads.facebook_ads__url_tags 77. model.facebook_ads.facebook_ads__url_tags key type value 77. model.facebook_ads.facebook_ads__url_tags:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f7 77. model.facebook_ads.facebook_ads__url_tags:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f6 77. model.facebook_ads.facebook_ads__url_tags:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f4 77. model.facebook_ads.facebook_ads__url_tags:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f5 77. model.facebook_ads.facebook_ads__url_tags:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f8 77. model.facebook_ads.facebook_ads__url_tags:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f7 77. model.facebook_ads.facebook_ads__url_tags:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f6 77. model.facebook_ads.facebook_ads__url_tags:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f4 77. model.facebook_ads.facebook_ads__url_tags:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f5 77. model.facebook_ads.facebook_ads__url_tags:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f8 89. model.facebook_ads_source.stg_facebook_ads__creative_history 89. model.facebook_ads_source.stg_facebook_ads__creative_history object_story_link_data_link page_link template_page_link url_tags 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f1 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f3 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f7 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f6 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f4 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f5 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f8 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f1 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f3 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f7 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f6 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f4 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f5 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f8 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f1 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f3 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f7 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f6 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f4 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f5 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f8 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f3->77. model.facebook_ads.facebook_ads__url_tags:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f3->77. model.facebook_ads.facebook_ads__url_tags:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f3->77. model.facebook_ads.facebook_ads__url_tags:f1 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f3->77. model.facebook_ads.facebook_ads__url_tags:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f3->77. model.facebook_ads.facebook_ads__url_tags:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f3->77. model.facebook_ads.facebook_ads__url_tags:f1 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp object_story_link_data_link page_link template_page_link url_tags 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f1->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f2->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f0->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f3->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f3
89. model.facebook_ads_source.stg_facebook_ads__creative_history
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[page_link]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • page_link: Directly mapped
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[template_page_link]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • template_page_link: Directly mapped
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[object_story_link_data_link]
    • Direct This column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the 'fields' CTE
    • Output Columns:
      • object_story_link_data_link: Directly mapped to this output column
77. model.facebook_ads.facebook_ads__url_tags
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[url_tags]
    • Filtering The column is filtered to include only non-null values
    • Cleaning The column is cleaned by parsing JSON
    • Other The column is flattened and its contents are extracted into separate columns
    • Output Columns:
      • key: Extracted from flattened url_tags
      • value: Extracted from flattened url_tags
      • type: Extracted from flattened url_tags
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[url_tags]
    • Filtering The column is filtered to include only non-null values
    • Cleaning The column is cleaned by parsing JSON
    • Other The column is flattened and its contents are extracted into separate columns
    • Output Columns:
      • key: Extracted from flattened url_tags
      • value: Extracted from flattened url_tags
      • type: Extracted from flattened url_tags
78. model.facebook_ads.int_facebook_ads__creative_history
  • Input Column: 77. model.facebook_ads.facebook_ads__url_tags[key]
    • Featurization Used to pivot the data, extracting different UTM parameters
    • Output Columns:
      • utm_source: Mapped when key = 'utm_source'
      • utm_medium: Mapped when key = 'utm_medium'
      • utm_campaign: Mapped when key = 'utm_campaign'
      • utm_content: Mapped when key = 'utm_content'
      • utm_term: Mapped when key = 'utm_term'
  • Input Column: 77. model.facebook_ads.facebook_ads__url_tags[value]
    • Featurization Used as the value for the pivoted UTM parameters
    • Output Columns:
      • utm_source: Mapped when key = 'utm_source'
      • utm_medium: Mapped when key = 'utm_medium'
      • utm_campaign: Mapped when key = 'utm_campaign'
      • utm_content: Mapped when key = 'utm_content'
      • utm_term: Mapped when key = 'utm_term'
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[page_link]
    • Cleaning Used in COALESCE with template_page_link
    • Featurization Various URL components and UTM parameters are extracted from this column
    • Output Columns:
      • url: COALESCE(page_link, template_page_link)
      • base_url: Extracted from page_link or template_page_link
      • url_host: Extracted from page_link or template_page_link
      • url_path: Extracted from page_link or template_page_link
      • utm_source: Extracted if not found in url_tags_pivoted
      • utm_medium: Extracted if not found in url_tags_pivoted
      • utm_campaign: Extracted if not found in url_tags_pivoted
      • utm_content: Extracted if not found in url_tags_pivoted
      • utm_term: Extracted if not found in url_tags_pivoted
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[template_page_link]
    • Cleaning Used in COALESCE with page_link
    • Featurization Various URL components and UTM parameters are extracted from this column if page_link is null
    • Output Columns:
      • url: COALESCE(page_link, template_page_link)
      • base_url: Extracted from page_link or template_page_link
      • url_host: Extracted from page_link or template_page_link
      • url_path: Extracted from page_link or template_page_link
      • utm_source: Extracted if not found in url_tags_pivoted and page_link
      • utm_medium: Extracted if not found in url_tags_pivoted and page_link
      • utm_campaign: Extracted if not found in url_tags_pivoted and page_link
      • utm_content: Extracted if not found in url_tags_pivoted and page_link
      • utm_term: Extracted if not found in url_tags_pivoted and page_link
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[object_story_link_data_link]
    • Cleaning This column is likely used in the COALESCE function with template_page_link to create the 'url' column.
    • Featurization Various parts of the URL are extracted from this column to create different features.
    • Output Columns:
      • url: Potentially used in COALESCE(page_link, template_page_link)
      • base_url: Extracted from this column
      • url_host: Extracted and cleaned from this column
      • url_path: Extracted and cleaned from this column
      • utm_source: Potentially extracted from this column if not found in url_tags
      • utm_medium: Potentially extracted from this column if not found in url_tags
      • utm_campaign: Potentially extracted from this column if not found in url_tags
      • utm_content: Potentially extracted from this column if not found in url_tags
      • utm_term: Potentially extracted from this column if not found in url_tags
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[utm_content]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the creatives table
    • Output Columns:
      • utm_content: Directly copied to the output
Column Lineage
%3 78. model.facebook_ads.int_facebook_ads__creative_history 78. model.facebook_ads.int_facebook_ads__creative_history base_url url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report utm_term 78. model.facebook_ads.int_facebook_ads__creative_history:f8->76. model.facebook_ads.facebook_ads__url_report:f0 77. model.facebook_ads.facebook_ads__url_tags 77. model.facebook_ads.facebook_ads__url_tags key type value 77. model.facebook_ads.facebook_ads__url_tags:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f7 77. model.facebook_ads.facebook_ads__url_tags:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f6 77. model.facebook_ads.facebook_ads__url_tags:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f4 77. model.facebook_ads.facebook_ads__url_tags:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f5 77. model.facebook_ads.facebook_ads__url_tags:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f8 77. model.facebook_ads.facebook_ads__url_tags:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f7 77. model.facebook_ads.facebook_ads__url_tags:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f6 77. model.facebook_ads.facebook_ads__url_tags:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f4 77. model.facebook_ads.facebook_ads__url_tags:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f5 77. model.facebook_ads.facebook_ads__url_tags:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f8 89. model.facebook_ads_source.stg_facebook_ads__creative_history 89. model.facebook_ads_source.stg_facebook_ads__creative_history object_story_link_data_link page_link template_page_link url_tags 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f1 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f3 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f7 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f6 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f4 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f5 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f8 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f1 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f3 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f7 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f6 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f4 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f5 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f8 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f1 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f3 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f7 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f6 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f4 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f5 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f8 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f3->77. model.facebook_ads.facebook_ads__url_tags:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f3->77. model.facebook_ads.facebook_ads__url_tags:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f3->77. model.facebook_ads.facebook_ads__url_tags:f1 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f3->77. model.facebook_ads.facebook_ads__url_tags:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f3->77. model.facebook_ads.facebook_ads__url_tags:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f3->77. model.facebook_ads.facebook_ads__url_tags:f1 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp object_story_link_data_link page_link template_page_link url_tags 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f1->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f2->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f0->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f3->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f3
89. model.facebook_ads_source.stg_facebook_ads__creative_history
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[page_link]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • page_link: Directly mapped
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[template_page_link]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • template_page_link: Directly mapped
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[object_story_link_data_link]
    • Direct This column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the 'fields' CTE
    • Output Columns:
      • object_story_link_data_link: Directly mapped to this output column
77. model.facebook_ads.facebook_ads__url_tags
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[url_tags]
    • Filtering The column is filtered to include only non-null values
    • Cleaning The column is cleaned by parsing JSON
    • Other The column is flattened and its contents are extracted into separate columns
    • Output Columns:
      • key: Extracted from flattened url_tags
      • value: Extracted from flattened url_tags
      • type: Extracted from flattened url_tags
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[url_tags]
    • Filtering The column is filtered to include only non-null values
    • Cleaning The column is cleaned by parsing JSON
    • Other The column is flattened and its contents are extracted into separate columns
    • Output Columns:
      • key: Extracted from flattened url_tags
      • value: Extracted from flattened url_tags
      • type: Extracted from flattened url_tags
78. model.facebook_ads.int_facebook_ads__creative_history
  • Input Column: 77. model.facebook_ads.facebook_ads__url_tags[key]
    • Featurization Used to pivot the data, extracting different UTM parameters
    • Output Columns:
      • utm_source: Mapped when key = 'utm_source'
      • utm_medium: Mapped when key = 'utm_medium'
      • utm_campaign: Mapped when key = 'utm_campaign'
      • utm_content: Mapped when key = 'utm_content'
      • utm_term: Mapped when key = 'utm_term'
  • Input Column: 77. model.facebook_ads.facebook_ads__url_tags[value]
    • Featurization Used as the value for the pivoted UTM parameters
    • Output Columns:
      • utm_source: Mapped when key = 'utm_source'
      • utm_medium: Mapped when key = 'utm_medium'
      • utm_campaign: Mapped when key = 'utm_campaign'
      • utm_content: Mapped when key = 'utm_content'
      • utm_term: Mapped when key = 'utm_term'
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[page_link]
    • Cleaning Used in COALESCE with template_page_link
    • Featurization Various URL components and UTM parameters are extracted from this column
    • Output Columns:
      • url: COALESCE(page_link, template_page_link)
      • base_url: Extracted from page_link or template_page_link
      • url_host: Extracted from page_link or template_page_link
      • url_path: Extracted from page_link or template_page_link
      • utm_source: Extracted if not found in url_tags_pivoted
      • utm_medium: Extracted if not found in url_tags_pivoted
      • utm_campaign: Extracted if not found in url_tags_pivoted
      • utm_content: Extracted if not found in url_tags_pivoted
      • utm_term: Extracted if not found in url_tags_pivoted
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[template_page_link]
    • Cleaning Used in COALESCE with page_link
    • Featurization Various URL components and UTM parameters are extracted from this column if page_link is null
    • Output Columns:
      • url: COALESCE(page_link, template_page_link)
      • base_url: Extracted from page_link or template_page_link
      • url_host: Extracted from page_link or template_page_link
      • url_path: Extracted from page_link or template_page_link
      • utm_source: Extracted if not found in url_tags_pivoted and page_link
      • utm_medium: Extracted if not found in url_tags_pivoted and page_link
      • utm_campaign: Extracted if not found in url_tags_pivoted and page_link
      • utm_content: Extracted if not found in url_tags_pivoted and page_link
      • utm_term: Extracted if not found in url_tags_pivoted and page_link
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[object_story_link_data_link]
    • Cleaning This column is likely used in the COALESCE function with template_page_link to create the 'url' column.
    • Featurization Various parts of the URL are extracted from this column to create different features.
    • Output Columns:
      • url: Potentially used in COALESCE(page_link, template_page_link)
      • base_url: Extracted from this column
      • url_host: Extracted and cleaned from this column
      • url_path: Extracted and cleaned from this column
      • utm_source: Potentially extracted from this column if not found in url_tags
      • utm_medium: Potentially extracted from this column if not found in url_tags
      • utm_campaign: Potentially extracted from this column if not found in url_tags
      • utm_content: Potentially extracted from this column if not found in url_tags
      • utm_term: Potentially extracted from this column if not found in url_tags
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[utm_term]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the creatives table
    • Output Columns:
      • utm_term: Directly copied to the output
Column Lineage
%3 85. model.facebook_ads_source.stg_facebook_ads__basic_ad 85. model.facebook_ads_source.stg_facebook_ads__basic_ad clicks 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report clicks 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->76. model.facebook_ads.facebook_ads__url_report:f0 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp inline_link_clicks 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp:f0->85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0
85. model.facebook_ads_source.stg_facebook_ads__basic_ad
  • Input Column: 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp[inline_link_clicks]
    • Cleaning The column is cleaned by applying COALESCE to handle potential NULL values
    • Output Columns:
      • clicks: Mapped after applying COALESCE and renamed
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[clicks]
    • Aggregation Summed up in the SELECT clause
    • Output Columns:
      • clicks: Aggregated sum in the output
Column Lineage
%3 85. model.facebook_ads_source.stg_facebook_ads__basic_ad 85. model.facebook_ads_source.stg_facebook_ads__basic_ad impressions 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report impressions 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->76. model.facebook_ads.facebook_ads__url_report:f0 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp impressions 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp:f0->85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0
85. model.facebook_ads_source.stg_facebook_ads__basic_ad
  • Input Column: 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp[impressions]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • impressions: Directly mapped
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[impressions]
    • Aggregation Summed up in the SELECT clause
    • Output Columns:
      • impressions: Aggregated sum in the output
Column Lineage
%3 85. model.facebook_ads_source.stg_facebook_ads__basic_ad 85. model.facebook_ads_source.stg_facebook_ads__basic_ad spend 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report spend 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->76. model.facebook_ads.facebook_ads__url_report:f0 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp spend 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp:f0->85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0
85. model.facebook_ads_source.stg_facebook_ads__basic_ad
  • Input Column: 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp[spend]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • spend: Directly mapped
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[spend]
    • Aggregation Summed up in the SELECT clause
    • Output Columns:
      • spend: Aggregated sum in the output
77. model.facebook_ads.facebook_ads__url_tags

This SQL query processes Facebook ads creative history data, focusing on URL tags. It starts by selecting the most recent records, then filters for non-null URL tags. The query then parses the JSON-formatted URL tags, flattens the structure, and extracts key-value pairs along with their types from the URL tags.

FilteringCleaningFeaturization
SQL Query
with base as (

    select *
    from TEST.PUBLIC_facebook_ads_source.stg_facebook_ads__creative_history
    where is_most_recent_record = true
), 

required_fields as (

    select
        source_relation,
        _fivetran_id,
        creative_id,
        url_tags
    from base
    where url_tags is not null
), 



  cleaned_fields as (

      select
          source_relation,
          _fivetran_id,
          creative_id,
          parse_json(url_tags) as url_tags
      from required_fields
      where url_tags is not null
  ), 

  fields as (

      select
          source_relation,
          _fivetran_id,
          creative_id,
          url_tags.value:key::string as key,
          url_tags.value:value::string as value,
          url_tags.value:type::string as type
      from cleaned_fields,
      lateral flatten( input => url_tags ) as url_tags
  )

 

select *
from fields
%3 77. model.facebook_ads.facebook_ads__url_tags 77. model.facebook_ads.facebook_ads__url_tags source_relation _fivetran_id creative_id key value type 89. model.facebook_ads_source.stg_facebook_ads__creative_history 89. model.facebook_ads_source.stg_facebook_ads__creative_history source_relation _fivetran_id creative_id url_tags 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->77. model.facebook_ads.facebook_ads__url_tags:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->77. model.facebook_ads.facebook_ads__url_tags:f1 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->77. model.facebook_ads.facebook_ads__url_tags:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f3->77. model.facebook_ads.facebook_ads__url_tags:f3 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f3->77. model.facebook_ads.facebook_ads__url_tags:f4 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f3->77. model.facebook_ads.facebook_ads__url_tags:f5
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
_fivetran_id text The unique fivetran ID for this record.
creative_id bigint The associated creative_id for this record.
key text The url tag object name e.g. utm_source associated with this record.
value text The value assigned to the url tag object associated with this record.
type text The type assigned to the url tag object e.g. 'AD_VIDEO'.
Column Lineage
%3 89. model.facebook_ads_source.stg_facebook_ads__creative_history 89. model.facebook_ads_source.stg_facebook_ads__creative_history source_relation 77. model.facebook_ads.facebook_ads__url_tags 77. model.facebook_ads.facebook_ads__url_tags source_relation 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->77. model.facebook_ads.facebook_ads__url_tags:f0 78. model.facebook_ads.int_facebook_ads__creative_history 78. model.facebook_ads.int_facebook_ads__creative_history source_relation 77. model.facebook_ads.facebook_ads__url_tags:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f0 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report source_relation 78. model.facebook_ads.int_facebook_ads__creative_history:f0->76. model.facebook_ads.facebook_ads__url_report:f0
77. model.facebook_ads.facebook_ads__url_tags
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[source_relation]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • source_relation: Directly copied
78. model.facebook_ads.int_facebook_ads__creative_history
  • Input Column: 77. model.facebook_ads.facebook_ads__url_tags[source_relation]
    • Integration Used to join with the base table
    • Direct Directly selected in the final output
    • Output Columns:
      • source_relation: Directly copied to the output
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[source_relation]
    • Direct The column is directly copied without transformation
    • Integration Used as part of the join condition with other tables
    • Output Columns:
      • source_relation: Directly copied to the output
Column Lineage
%3 89. model.facebook_ads_source.stg_facebook_ads__creative_history 89. model.facebook_ads_source.stg_facebook_ads__creative_history _fivetran_id is_most_recent_record 77. model.facebook_ads.facebook_ads__url_tags 77. model.facebook_ads.facebook_ads__url_tags _fivetran_id 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->77. model.facebook_ads.facebook_ads__url_tags:f0 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp _fivetran_id 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f0->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f0->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1
89. model.facebook_ads_source.stg_facebook_ads__creative_history
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[_fivetran_id]
    • Direct This column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the 'fields' CTE
    • Deduplication This column is used in the window function to determine the most recent record
    • Output Columns:
      • _fivetran_id: Directly mapped to this output column
      • is_most_recent_record: Indirectly used to determine this flag
77. model.facebook_ads.facebook_ads__url_tags
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[_fivetran_id]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • _fivetran_id: Directly copied
Column Lineage
%3 89. model.facebook_ads_source.stg_facebook_ads__creative_history 89. model.facebook_ads_source.stg_facebook_ads__creative_history creative_id 77. model.facebook_ads.facebook_ads__url_tags 77. model.facebook_ads.facebook_ads__url_tags creative_id 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->77. model.facebook_ads.facebook_ads__url_tags:f0 78. model.facebook_ads.int_facebook_ads__creative_history 78. model.facebook_ads.int_facebook_ads__creative_history creative_id 77. model.facebook_ads.facebook_ads__url_tags:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f0 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp id 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f0->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report creative_id 78. model.facebook_ads.int_facebook_ads__creative_history:f0->76. model.facebook_ads.facebook_ads__url_report:f0
89. model.facebook_ads_source.stg_facebook_ads__creative_history
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[id]
    • Cleaning The column is cast as BIGINT
    • Deduplication Used in the window function to determine the most recent record
    • Output Columns:
      • creative_id: Mapped after casting to BIGINT
77. model.facebook_ads.facebook_ads__url_tags
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[creative_id]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • creative_id: Directly copied
78. model.facebook_ads.int_facebook_ads__creative_history
  • Input Column: 77. model.facebook_ads.facebook_ads__url_tags[creative_id]
    • Integration Used to join with the base table
    • Aggregation Used in GROUP BY clause
    • Output Columns:
      • creative_id: Directly copied to the output
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[creative_id]
    • Direct The column is directly copied without transformation
    • Integration Used as the key to join with the ads table
    • Output Columns:
      • creative_id: Directly copied to the output
Column Lineage
%3 89. model.facebook_ads_source.stg_facebook_ads__creative_history 89. model.facebook_ads_source.stg_facebook_ads__creative_history url_tags 77. model.facebook_ads.facebook_ads__url_tags 77. model.facebook_ads.facebook_ads__url_tags key type value 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->77. model.facebook_ads.facebook_ads__url_tags:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->77. model.facebook_ads.facebook_ads__url_tags:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->77. model.facebook_ads.facebook_ads__url_tags:f1 78. model.facebook_ads.int_facebook_ads__creative_history 78. model.facebook_ads.int_facebook_ads__creative_history utm_campaign utm_content utm_medium utm_source utm_term 77. model.facebook_ads.facebook_ads__url_tags:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f3 77. model.facebook_ads.facebook_ads__url_tags:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f2 77. model.facebook_ads.facebook_ads__url_tags:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f0 77. model.facebook_ads.facebook_ads__url_tags:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f1 77. model.facebook_ads.facebook_ads__url_tags:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f4 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp url_tags 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f0->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report utm_campaign utm_content utm_medium utm_source utm_term 78. model.facebook_ads.int_facebook_ads__creative_history:f3->76. model.facebook_ads.facebook_ads__url_report:f3 78. model.facebook_ads.int_facebook_ads__creative_history:f2->76. model.facebook_ads.facebook_ads__url_report:f2 78. model.facebook_ads.int_facebook_ads__creative_history:f0->76. model.facebook_ads.facebook_ads__url_report:f0 78. model.facebook_ads.int_facebook_ads__creative_history:f1->76. model.facebook_ads.facebook_ads__url_report:f1 78. model.facebook_ads.int_facebook_ads__creative_history:f4->76. model.facebook_ads.facebook_ads__url_report:f4
89. model.facebook_ads_source.stg_facebook_ads__creative_history
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[url_tags]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • url_tags: Directly mapped
77. model.facebook_ads.facebook_ads__url_tags
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[url_tags]
    • Filtering The column is filtered to include only non-null values
    • Cleaning The column is cleaned by parsing JSON
    • Other The column is flattened and its contents are extracted into separate columns
    • Output Columns:
      • key: Extracted from flattened url_tags
      • value: Extracted from flattened url_tags
      • type: Extracted from flattened url_tags
78. model.facebook_ads.int_facebook_ads__creative_history
  • Input Column: 77. model.facebook_ads.facebook_ads__url_tags[key]
    • Featurization Used to pivot the data, extracting different UTM parameters
    • Output Columns:
      • utm_source: Mapped when key = 'utm_source'
      • utm_medium: Mapped when key = 'utm_medium'
      • utm_campaign: Mapped when key = 'utm_campaign'
      • utm_content: Mapped when key = 'utm_content'
      • utm_term: Mapped when key = 'utm_term'
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[utm_source]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • utm_source: Directly copied to the output
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[utm_medium]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the creatives table
    • Output Columns:
      • utm_medium: Directly copied to the output
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[utm_campaign]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the creatives table
    • Output Columns:
      • utm_campaign: Directly copied to the output
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[utm_content]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the creatives table
    • Output Columns:
      • utm_content: Directly copied to the output
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[utm_term]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the creatives table
    • Output Columns:
      • utm_term: Directly copied to the output
Column Lineage
%3 89. model.facebook_ads_source.stg_facebook_ads__creative_history 89. model.facebook_ads_source.stg_facebook_ads__creative_history url_tags 77. model.facebook_ads.facebook_ads__url_tags 77. model.facebook_ads.facebook_ads__url_tags key type value 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->77. model.facebook_ads.facebook_ads__url_tags:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->77. model.facebook_ads.facebook_ads__url_tags:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->77. model.facebook_ads.facebook_ads__url_tags:f1 78. model.facebook_ads.int_facebook_ads__creative_history 78. model.facebook_ads.int_facebook_ads__creative_history utm_campaign utm_content utm_medium utm_source utm_term 77. model.facebook_ads.facebook_ads__url_tags:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f3 77. model.facebook_ads.facebook_ads__url_tags:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f2 77. model.facebook_ads.facebook_ads__url_tags:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f0 77. model.facebook_ads.facebook_ads__url_tags:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f1 77. model.facebook_ads.facebook_ads__url_tags:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f4 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp url_tags 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f0->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report utm_campaign utm_content utm_medium utm_source utm_term 78. model.facebook_ads.int_facebook_ads__creative_history:f3->76. model.facebook_ads.facebook_ads__url_report:f3 78. model.facebook_ads.int_facebook_ads__creative_history:f2->76. model.facebook_ads.facebook_ads__url_report:f2 78. model.facebook_ads.int_facebook_ads__creative_history:f0->76. model.facebook_ads.facebook_ads__url_report:f0 78. model.facebook_ads.int_facebook_ads__creative_history:f1->76. model.facebook_ads.facebook_ads__url_report:f1 78. model.facebook_ads.int_facebook_ads__creative_history:f4->76. model.facebook_ads.facebook_ads__url_report:f4
89. model.facebook_ads_source.stg_facebook_ads__creative_history
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[url_tags]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • url_tags: Directly mapped
77. model.facebook_ads.facebook_ads__url_tags
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[url_tags]
    • Filtering The column is filtered to include only non-null values
    • Cleaning The column is cleaned by parsing JSON
    • Other The column is flattened and its contents are extracted into separate columns
    • Output Columns:
      • key: Extracted from flattened url_tags
      • value: Extracted from flattened url_tags
      • type: Extracted from flattened url_tags
78. model.facebook_ads.int_facebook_ads__creative_history
  • Input Column: 77. model.facebook_ads.facebook_ads__url_tags[value]
    • Featurization Used as the value for the pivoted UTM parameters
    • Output Columns:
      • utm_source: Mapped when key = 'utm_source'
      • utm_medium: Mapped when key = 'utm_medium'
      • utm_campaign: Mapped when key = 'utm_campaign'
      • utm_content: Mapped when key = 'utm_content'
      • utm_term: Mapped when key = 'utm_term'
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[utm_source]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • utm_source: Directly copied to the output
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[utm_medium]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the creatives table
    • Output Columns:
      • utm_medium: Directly copied to the output
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[utm_campaign]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the creatives table
    • Output Columns:
      • utm_campaign: Directly copied to the output
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[utm_content]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the creatives table
    • Output Columns:
      • utm_content: Directly copied to the output
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[utm_term]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the creatives table
    • Output Columns:
      • utm_term: Directly copied to the output
Column Lineage
%3 89. model.facebook_ads_source.stg_facebook_ads__creative_history 89. model.facebook_ads_source.stg_facebook_ads__creative_history url_tags 77. model.facebook_ads.facebook_ads__url_tags 77. model.facebook_ads.facebook_ads__url_tags key type value 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->77. model.facebook_ads.facebook_ads__url_tags:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->77. model.facebook_ads.facebook_ads__url_tags:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->77. model.facebook_ads.facebook_ads__url_tags:f1 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp url_tags 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f0->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0
89. model.facebook_ads_source.stg_facebook_ads__creative_history
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[url_tags]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • url_tags: Directly mapped
77. model.facebook_ads.facebook_ads__url_tags
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[url_tags]
    • Filtering The column is filtered to include only non-null values
    • Cleaning The column is cleaned by parsing JSON
    • Other The column is flattened and its contents are extracted into separate columns
    • Output Columns:
      • key: Extracted from flattened url_tags
      • value: Extracted from flattened url_tags
      • type: Extracted from flattened url_tags
78. model.facebook_ads.int_facebook_ads__creative_history

This SQL query processes Facebook ad creative data, focusing on URL-related information. It starts by selecting the most recent records from the creative history, then joins this with URL tag data. The query extensively cleans and extracts various components of URLs (such as base URL, host, and path) and UTM parameters. It also handles cases where UTM parameters might be directly in the URL or in a separate tags table. The result is a comprehensive view of each creative's URL structure and associated tracking parameters.

FilteringCleaningFeaturizationIntegrationOther
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_facebook_ads_source.stg_facebook_ads__creative_history
  WHERE
    is_most_recent_record = TRUE
), url_tags AS (
  SELECT
    *
  FROM TEST.PUBLIC_facebook_ads.facebook_ads__url_tags
), url_tags_pivoted AS (
  SELECT
    source_relation,
    _fivetran_id,
    creative_id,
    MIN(CASE WHEN key = 'utm_source' THEN value END) AS utm_source,
    MIN(CASE WHEN key = 'utm_medium' THEN value END) AS utm_medium,
    MIN(CASE WHEN key = 'utm_campaign' THEN value END) AS utm_campaign,
    MIN(CASE WHEN key = 'utm_content' THEN value END) AS utm_content,
    MIN(CASE WHEN key = 'utm_term' THEN value END) AS utm_term
  FROM url_tags
  GROUP BY
    1,
    2,
    3
), fields AS (
  SELECT
    base.source_relation,
    base._fivetran_id,
    base.creative_id,
    base.account_id,
    base.creative_name,
    COALESCE(page_link, template_page_link) AS url,
    SPLIT_PART(COALESCE(page_link, template_page_link), '?', 1) AS base_url,
    TRY_CAST(SPLIT_PART(
      SPLIT_PART(
        REPLACE(
          REPLACE(
            REPLACE(COALESCE(page_link, template_page_link), 'android-app://', ''),
            'http://',
            ''
          ),
          'https://',
          ''
        ),
        '/',
        1
      ),
      '?',
      1
    ) AS TEXT) AS url_host,
    '/' || TRY_CAST(SPLIT_PART(
      CASE
        WHEN LENGTH(
          REPLACE(REPLACE(COALESCE(page_link, template_page_link), 'http://', ''), 'https://', '')
        ) - COALESCE(
          NULLIF(
            STR_POSITION(
              REPLACE(REPLACE(COALESCE(page_link, template_page_link), 'http://', ''), 'https://', ''),
              '/'
            ),
            0
          ),
          STR_POSITION(
            REPLACE(REPLACE(COALESCE(page_link, template_page_link), 'http://', ''), 'https://', ''),
            '?'
          ) - 1
        ) = 0
        THEN ''
        ELSE RIGHT(
          REPLACE(REPLACE(COALESCE(page_link, template_page_link), 'http://', ''), 'https://', ''),
          LENGTH(
            REPLACE(REPLACE(COALESCE(page_link, template_page_link), 'http://', ''), 'https://', '')
          ) - COALESCE(
            NULLIF(
              STR_POSITION(
                REPLACE(REPLACE(COALESCE(page_link, template_page_link), 'http://', ''), 'https://', ''),
                '/'
              ),
              0
            ),
            STR_POSITION(
              REPLACE(REPLACE(COALESCE(page_link, template_page_link), 'http://', ''), 'https://', ''),
              '?'
            ) - 1
          )
        )
      END,
      '?',
      1
    ) AS TEXT) AS url_path,
    COALESCE(
      url_tags_pivoted.utm_source,
      NULLIF(
        SPLIT_PART(SPLIT_PART(COALESCE(page_link, template_page_link), 'utm_source=', 2), '&', 1),
        ''
      )
    ) AS utm_source,
    COALESCE(
      url_tags_pivoted.utm_medium,
      NULLIF(
        SPLIT_PART(SPLIT_PART(COALESCE(page_link, template_page_link), 'utm_medium=', 2), '&', 1),
        ''
      )
    ) AS utm_medium,
    COALESCE(
      url_tags_pivoted.utm_campaign,
      NULLIF(
        SPLIT_PART(SPLIT_PART(COALESCE(page_link, template_page_link), 'utm_campaign=', 2), '&', 1),
        ''
      )
    ) AS utm_campaign,
    COALESCE(
      url_tags_pivoted.utm_content,
      NULLIF(
        SPLIT_PART(SPLIT_PART(COALESCE(page_link, template_page_link), 'utm_content=', 2), '&', 1),
        ''
      )
    ) AS utm_content,
    COALESCE(
      url_tags_pivoted.utm_term,
      NULLIF(
        SPLIT_PART(SPLIT_PART(COALESCE(page_link, template_page_link), 'utm_term=', 2), '&', 1),
        ''
      )
    ) AS utm_term
  FROM base
  LEFT JOIN url_tags_pivoted
    ON base._fivetran_id = url_tags_pivoted._fivetran_id
    AND base.source_relation = url_tags_pivoted.source_relation
    AND base.creative_id = url_tags_pivoted.creative_id
)
SELECT
  *
FROM fields
%3 78. model.facebook_ads.int_facebook_ads__creative_history 78. model.facebook_ads.int_facebook_ads__creative_history source_relation _fivetran_id creative_id account_id creative_name url base_url url_host url_path utm_source utm_medium utm_campaign utm_content utm_term 77. model.facebook_ads.facebook_ads__url_tags 77. model.facebook_ads.facebook_ads__url_tags source_relation creative_id key value 77. model.facebook_ads.facebook_ads__url_tags:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f0 77. model.facebook_ads.facebook_ads__url_tags:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f2 77. model.facebook_ads.facebook_ads__url_tags:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f9 77. model.facebook_ads.facebook_ads__url_tags:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f10 77. model.facebook_ads.facebook_ads__url_tags:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f11 77. model.facebook_ads.facebook_ads__url_tags:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f12 77. model.facebook_ads.facebook_ads__url_tags:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f13 77. model.facebook_ads.facebook_ads__url_tags:f3->78. model.facebook_ads.int_facebook_ads__creative_history:f9 77. model.facebook_ads.facebook_ads__url_tags:f3->78. model.facebook_ads.int_facebook_ads__creative_history:f10 77. model.facebook_ads.facebook_ads__url_tags:f3->78. model.facebook_ads.int_facebook_ads__creative_history:f11 77. model.facebook_ads.facebook_ads__url_tags:f3->78. model.facebook_ads.int_facebook_ads__creative_history:f12 77. model.facebook_ads.facebook_ads__url_tags:f3->78. model.facebook_ads.int_facebook_ads__creative_history:f13 89. model.facebook_ads_source.stg_facebook_ads__creative_history 89. model.facebook_ads_source.stg_facebook_ads__creative_history source_relation _fivetran_id creative_id account_id creative_name page_link template_page_link object_story_link_data_link 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f1 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f3->78. model.facebook_ads.int_facebook_ads__creative_history:f3 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f4->78. model.facebook_ads.int_facebook_ads__creative_history:f4 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f5->78. model.facebook_ads.int_facebook_ads__creative_history:f5 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f5->78. model.facebook_ads.int_facebook_ads__creative_history:f6 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f5->78. model.facebook_ads.int_facebook_ads__creative_history:f7 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f5->78. model.facebook_ads.int_facebook_ads__creative_history:f8 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f5->78. model.facebook_ads.int_facebook_ads__creative_history:f9 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f5->78. model.facebook_ads.int_facebook_ads__creative_history:f10 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f5->78. model.facebook_ads.int_facebook_ads__creative_history:f11 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f5->78. model.facebook_ads.int_facebook_ads__creative_history:f12 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f5->78. model.facebook_ads.int_facebook_ads__creative_history:f13 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f6->78. model.facebook_ads.int_facebook_ads__creative_history:f5 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f6->78. model.facebook_ads.int_facebook_ads__creative_history:f6 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f6->78. model.facebook_ads.int_facebook_ads__creative_history:f7 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f6->78. model.facebook_ads.int_facebook_ads__creative_history:f8 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f6->78. model.facebook_ads.int_facebook_ads__creative_history:f9 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f6->78. model.facebook_ads.int_facebook_ads__creative_history:f10 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f6->78. model.facebook_ads.int_facebook_ads__creative_history:f11 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f6->78. model.facebook_ads.int_facebook_ads__creative_history:f12 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f6->78. model.facebook_ads.int_facebook_ads__creative_history:f13 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f7->78. model.facebook_ads.int_facebook_ads__creative_history:f5 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f7->78. model.facebook_ads.int_facebook_ads__creative_history:f6 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f7->78. model.facebook_ads.int_facebook_ads__creative_history:f7 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f7->78. model.facebook_ads.int_facebook_ads__creative_history:f8 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f7->78. model.facebook_ads.int_facebook_ads__creative_history:f9 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f7->78. model.facebook_ads.int_facebook_ads__creative_history:f10 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f7->78. model.facebook_ads.int_facebook_ads__creative_history:f11 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f7->78. model.facebook_ads.int_facebook_ads__creative_history:f12 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f7->78. model.facebook_ads.int_facebook_ads__creative_history:f13
Name Type Comment
source_relation text None
_fivetran_id text None
creative_id bigint None
account_id bigint None
creative_name text None
url character varying None
base_url text None
url_host text None
url_path text None
utm_source text None
utm_medium text None
utm_campaign text None
utm_content text None
utm_term text None
Column Lineage
%3 77. model.facebook_ads.facebook_ads__url_tags 77. model.facebook_ads.facebook_ads__url_tags source_relation 78. model.facebook_ads.int_facebook_ads__creative_history 78. model.facebook_ads.int_facebook_ads__creative_history source_relation 77. model.facebook_ads.facebook_ads__url_tags:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f0 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report source_relation 78. model.facebook_ads.int_facebook_ads__creative_history:f0->76. model.facebook_ads.facebook_ads__url_report:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history 89. model.facebook_ads_source.stg_facebook_ads__creative_history source_relation 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->77. model.facebook_ads.facebook_ads__url_tags:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f0
77. model.facebook_ads.facebook_ads__url_tags
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[source_relation]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • source_relation: Directly copied
78. model.facebook_ads.int_facebook_ads__creative_history
  • Input Column: 77. model.facebook_ads.facebook_ads__url_tags[source_relation]
    • Integration Used to join with the base table
    • Direct Directly selected in the final output
    • Output Columns:
      • source_relation: Directly copied to the output
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with url_tags_pivoted
    • Output Columns:
      • source_relation: Directly copied
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[source_relation]
    • Direct The column is directly copied without transformation
    • Integration Used as part of the join condition with other tables
    • Output Columns:
      • source_relation: Directly copied to the output
Column Lineage
%3 89. model.facebook_ads_source.stg_facebook_ads__creative_history 89. model.facebook_ads_source.stg_facebook_ads__creative_history _fivetran_id is_most_recent_record 78. model.facebook_ads.int_facebook_ads__creative_history 78. model.facebook_ads.int_facebook_ads__creative_history _fivetran_id 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f0 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp _fivetran_id 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f0->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f0->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1
89. model.facebook_ads_source.stg_facebook_ads__creative_history
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[_fivetran_id]
    • Direct This column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the 'fields' CTE
    • Deduplication This column is used in the window function to determine the most recent record
    • Output Columns:
      • _fivetran_id: Directly mapped to this output column
      • is_most_recent_record: Indirectly used to determine this flag
78. model.facebook_ads.int_facebook_ads__creative_history
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[_fivetran_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with url_tags_pivoted
    • Output Columns:
      • _fivetran_id: Directly copied
Column Lineage
%3 77. model.facebook_ads.facebook_ads__url_tags 77. model.facebook_ads.facebook_ads__url_tags creative_id 78. model.facebook_ads.int_facebook_ads__creative_history 78. model.facebook_ads.int_facebook_ads__creative_history creative_id 77. model.facebook_ads.facebook_ads__url_tags:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f0 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report creative_id 78. model.facebook_ads.int_facebook_ads__creative_history:f0->76. model.facebook_ads.facebook_ads__url_report:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history 89. model.facebook_ads_source.stg_facebook_ads__creative_history creative_id 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->77. model.facebook_ads.facebook_ads__url_tags:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f0 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp id 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f0->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0
77. model.facebook_ads.facebook_ads__url_tags
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[creative_id]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • creative_id: Directly copied
89. model.facebook_ads_source.stg_facebook_ads__creative_history
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[id]
    • Cleaning The column is cast as BIGINT
    • Deduplication Used in the window function to determine the most recent record
    • Output Columns:
      • creative_id: Mapped after casting to BIGINT
78. model.facebook_ads.int_facebook_ads__creative_history
  • Input Column: 77. model.facebook_ads.facebook_ads__url_tags[creative_id]
    • Integration Used to join with the base table
    • Aggregation Used in GROUP BY clause
    • Output Columns:
      • creative_id: Directly copied to the output
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[creative_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with url_tags_pivoted
    • Output Columns:
      • creative_id: Directly copied
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[creative_id]
    • Direct The column is directly copied without transformation
    • Integration Used as the key to join with the ads table
    • Output Columns:
      • creative_id: Directly copied to the output
Column Lineage
%3 89. model.facebook_ads_source.stg_facebook_ads__creative_history 89. model.facebook_ads_source.stg_facebook_ads__creative_history account_id 78. model.facebook_ads.int_facebook_ads__creative_history 78. model.facebook_ads.int_facebook_ads__creative_history account_id 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f0 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp account_id 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f0->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0
89. model.facebook_ads_source.stg_facebook_ads__creative_history
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[account_id]
    • Cleaning The column is cast as BIGINT
    • Output Columns:
      • account_id: Mapped after casting to BIGINT
78. model.facebook_ads.int_facebook_ads__creative_history
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[account_id]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • account_id: Directly copied
Column Lineage
%3 89. model.facebook_ads_source.stg_facebook_ads__creative_history 89. model.facebook_ads_source.stg_facebook_ads__creative_history creative_name 78. model.facebook_ads.int_facebook_ads__creative_history 78. model.facebook_ads.int_facebook_ads__creative_history creative_name 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f0 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report creative_name 78. model.facebook_ads.int_facebook_ads__creative_history:f0->76. model.facebook_ads.facebook_ads__url_report:f0 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp name 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f0->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0
89. model.facebook_ads_source.stg_facebook_ads__creative_history
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[name]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • creative_name: Renamed and directly mapped
78. model.facebook_ads.int_facebook_ads__creative_history
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[creative_name]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • creative_name: Directly copied
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[creative_name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • creative_name: Directly copied to the output
Column Lineage
%3 89. model.facebook_ads_source.stg_facebook_ads__creative_history 89. model.facebook_ads_source.stg_facebook_ads__creative_history object_story_link_data_link page_link template_page_link 78. model.facebook_ads.int_facebook_ads__creative_history 78. model.facebook_ads.int_facebook_ads__creative_history base_url url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f1 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f3 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f7 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f6 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f4 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f5 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f8 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f1 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f3 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f7 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f6 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f4 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f5 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f8 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f1 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f3 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f7 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f6 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f4 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f5 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f8 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp object_story_link_data_link page_link template_page_link 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f1->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f2->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f0->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0
89. model.facebook_ads_source.stg_facebook_ads__creative_history
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[page_link]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • page_link: Directly mapped
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[template_page_link]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • template_page_link: Directly mapped
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[object_story_link_data_link]
    • Direct This column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the 'fields' CTE
    • Output Columns:
      • object_story_link_data_link: Directly mapped to this output column
78. model.facebook_ads.int_facebook_ads__creative_history
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[page_link]
    • Cleaning Used in COALESCE with template_page_link
    • Featurization Various URL components and UTM parameters are extracted from this column
    • Output Columns:
      • url: COALESCE(page_link, template_page_link)
      • base_url: Extracted from page_link or template_page_link
      • url_host: Extracted from page_link or template_page_link
      • url_path: Extracted from page_link or template_page_link
      • utm_source: Extracted if not found in url_tags_pivoted
      • utm_medium: Extracted if not found in url_tags_pivoted
      • utm_campaign: Extracted if not found in url_tags_pivoted
      • utm_content: Extracted if not found in url_tags_pivoted
      • utm_term: Extracted if not found in url_tags_pivoted
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[template_page_link]
    • Cleaning Used in COALESCE with page_link
    • Featurization Various URL components and UTM parameters are extracted from this column if page_link is null
    • Output Columns:
      • url: COALESCE(page_link, template_page_link)
      • base_url: Extracted from page_link or template_page_link
      • url_host: Extracted from page_link or template_page_link
      • url_path: Extracted from page_link or template_page_link
      • utm_source: Extracted if not found in url_tags_pivoted and page_link
      • utm_medium: Extracted if not found in url_tags_pivoted and page_link
      • utm_campaign: Extracted if not found in url_tags_pivoted and page_link
      • utm_content: Extracted if not found in url_tags_pivoted and page_link
      • utm_term: Extracted if not found in url_tags_pivoted and page_link
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[object_story_link_data_link]
    • Cleaning This column is likely used in the COALESCE function with template_page_link to create the 'url' column.
    • Featurization Various parts of the URL are extracted from this column to create different features.
    • Output Columns:
      • url: Potentially used in COALESCE(page_link, template_page_link)
      • base_url: Extracted from this column
      • url_host: Extracted and cleaned from this column
      • url_path: Extracted and cleaned from this column
      • utm_source: Potentially extracted from this column if not found in url_tags
      • utm_medium: Potentially extracted from this column if not found in url_tags
      • utm_campaign: Potentially extracted from this column if not found in url_tags
      • utm_content: Potentially extracted from this column if not found in url_tags
      • utm_term: Potentially extracted from this column if not found in url_tags
Column Lineage
%3 89. model.facebook_ads_source.stg_facebook_ads__creative_history 89. model.facebook_ads_source.stg_facebook_ads__creative_history object_story_link_data_link page_link template_page_link 78. model.facebook_ads.int_facebook_ads__creative_history 78. model.facebook_ads.int_facebook_ads__creative_history base_url url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f1 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f3 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f7 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f6 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f4 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f5 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f8 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f1 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f3 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f7 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f6 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f4 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f5 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f8 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f1 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f3 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f7 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f6 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f4 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f5 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f8 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report base_url 78. model.facebook_ads.int_facebook_ads__creative_history:f0->76. model.facebook_ads.facebook_ads__url_report:f0 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp object_story_link_data_link page_link template_page_link 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f1->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f2->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f0->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0
89. model.facebook_ads_source.stg_facebook_ads__creative_history
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[page_link]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • page_link: Directly mapped
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[template_page_link]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • template_page_link: Directly mapped
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[object_story_link_data_link]
    • Direct This column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the 'fields' CTE
    • Output Columns:
      • object_story_link_data_link: Directly mapped to this output column
78. model.facebook_ads.int_facebook_ads__creative_history
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[page_link]
    • Cleaning Used in COALESCE with template_page_link
    • Featurization Various URL components and UTM parameters are extracted from this column
    • Output Columns:
      • url: COALESCE(page_link, template_page_link)
      • base_url: Extracted from page_link or template_page_link
      • url_host: Extracted from page_link or template_page_link
      • url_path: Extracted from page_link or template_page_link
      • utm_source: Extracted if not found in url_tags_pivoted
      • utm_medium: Extracted if not found in url_tags_pivoted
      • utm_campaign: Extracted if not found in url_tags_pivoted
      • utm_content: Extracted if not found in url_tags_pivoted
      • utm_term: Extracted if not found in url_tags_pivoted
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[template_page_link]
    • Cleaning Used in COALESCE with page_link
    • Featurization Various URL components and UTM parameters are extracted from this column if page_link is null
    • Output Columns:
      • url: COALESCE(page_link, template_page_link)
      • base_url: Extracted from page_link or template_page_link
      • url_host: Extracted from page_link or template_page_link
      • url_path: Extracted from page_link or template_page_link
      • utm_source: Extracted if not found in url_tags_pivoted and page_link
      • utm_medium: Extracted if not found in url_tags_pivoted and page_link
      • utm_campaign: Extracted if not found in url_tags_pivoted and page_link
      • utm_content: Extracted if not found in url_tags_pivoted and page_link
      • utm_term: Extracted if not found in url_tags_pivoted and page_link
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[object_story_link_data_link]
    • Cleaning This column is likely used in the COALESCE function with template_page_link to create the 'url' column.
    • Featurization Various parts of the URL are extracted from this column to create different features.
    • Output Columns:
      • url: Potentially used in COALESCE(page_link, template_page_link)
      • base_url: Extracted from this column
      • url_host: Extracted and cleaned from this column
      • url_path: Extracted and cleaned from this column
      • utm_source: Potentially extracted from this column if not found in url_tags
      • utm_medium: Potentially extracted from this column if not found in url_tags
      • utm_campaign: Potentially extracted from this column if not found in url_tags
      • utm_content: Potentially extracted from this column if not found in url_tags
      • utm_term: Potentially extracted from this column if not found in url_tags
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[base_url]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • base_url: Directly copied to the output
Column Lineage
%3 89. model.facebook_ads_source.stg_facebook_ads__creative_history 89. model.facebook_ads_source.stg_facebook_ads__creative_history object_story_link_data_link page_link template_page_link 78. model.facebook_ads.int_facebook_ads__creative_history 78. model.facebook_ads.int_facebook_ads__creative_history base_url url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f1 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f3 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f7 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f6 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f4 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f5 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f8 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f1 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f3 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f7 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f6 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f4 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f5 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f8 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f1 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f3 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f7 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f6 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f4 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f5 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f8 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report url_host 78. model.facebook_ads.int_facebook_ads__creative_history:f2->76. model.facebook_ads.facebook_ads__url_report:f0 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp object_story_link_data_link page_link template_page_link 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f1->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f2->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f0->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0
89. model.facebook_ads_source.stg_facebook_ads__creative_history
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[page_link]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • page_link: Directly mapped
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[template_page_link]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • template_page_link: Directly mapped
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[object_story_link_data_link]
    • Direct This column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the 'fields' CTE
    • Output Columns:
      • object_story_link_data_link: Directly mapped to this output column
78. model.facebook_ads.int_facebook_ads__creative_history
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[page_link]
    • Cleaning Used in COALESCE with template_page_link
    • Featurization Various URL components and UTM parameters are extracted from this column
    • Output Columns:
      • url: COALESCE(page_link, template_page_link)
      • base_url: Extracted from page_link or template_page_link
      • url_host: Extracted from page_link or template_page_link
      • url_path: Extracted from page_link or template_page_link
      • utm_source: Extracted if not found in url_tags_pivoted
      • utm_medium: Extracted if not found in url_tags_pivoted
      • utm_campaign: Extracted if not found in url_tags_pivoted
      • utm_content: Extracted if not found in url_tags_pivoted
      • utm_term: Extracted if not found in url_tags_pivoted
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[template_page_link]
    • Cleaning Used in COALESCE with page_link
    • Featurization Various URL components and UTM parameters are extracted from this column if page_link is null
    • Output Columns:
      • url: COALESCE(page_link, template_page_link)
      • base_url: Extracted from page_link or template_page_link
      • url_host: Extracted from page_link or template_page_link
      • url_path: Extracted from page_link or template_page_link
      • utm_source: Extracted if not found in url_tags_pivoted and page_link
      • utm_medium: Extracted if not found in url_tags_pivoted and page_link
      • utm_campaign: Extracted if not found in url_tags_pivoted and page_link
      • utm_content: Extracted if not found in url_tags_pivoted and page_link
      • utm_term: Extracted if not found in url_tags_pivoted and page_link
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[object_story_link_data_link]
    • Cleaning This column is likely used in the COALESCE function with template_page_link to create the 'url' column.
    • Featurization Various parts of the URL are extracted from this column to create different features.
    • Output Columns:
      • url: Potentially used in COALESCE(page_link, template_page_link)
      • base_url: Extracted from this column
      • url_host: Extracted and cleaned from this column
      • url_path: Extracted and cleaned from this column
      • utm_source: Potentially extracted from this column if not found in url_tags
      • utm_medium: Potentially extracted from this column if not found in url_tags
      • utm_campaign: Potentially extracted from this column if not found in url_tags
      • utm_content: Potentially extracted from this column if not found in url_tags
      • utm_term: Potentially extracted from this column if not found in url_tags
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[url_host]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • url_host: Directly copied to the output
Column Lineage
%3 89. model.facebook_ads_source.stg_facebook_ads__creative_history 89. model.facebook_ads_source.stg_facebook_ads__creative_history object_story_link_data_link page_link template_page_link 78. model.facebook_ads.int_facebook_ads__creative_history 78. model.facebook_ads.int_facebook_ads__creative_history base_url url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f1 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f3 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f7 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f6 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f4 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f5 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f8 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f1 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f3 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f7 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f6 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f4 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f5 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f8 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f1 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f3 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f7 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f6 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f4 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f5 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f8 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report url_path 78. model.facebook_ads.int_facebook_ads__creative_history:f3->76. model.facebook_ads.facebook_ads__url_report:f0 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp object_story_link_data_link page_link template_page_link 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f1->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f2->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f0->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0
89. model.facebook_ads_source.stg_facebook_ads__creative_history
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[page_link]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • page_link: Directly mapped
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[template_page_link]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • template_page_link: Directly mapped
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[object_story_link_data_link]
    • Direct This column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the 'fields' CTE
    • Output Columns:
      • object_story_link_data_link: Directly mapped to this output column
78. model.facebook_ads.int_facebook_ads__creative_history
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[page_link]
    • Cleaning Used in COALESCE with template_page_link
    • Featurization Various URL components and UTM parameters are extracted from this column
    • Output Columns:
      • url: COALESCE(page_link, template_page_link)
      • base_url: Extracted from page_link or template_page_link
      • url_host: Extracted from page_link or template_page_link
      • url_path: Extracted from page_link or template_page_link
      • utm_source: Extracted if not found in url_tags_pivoted
      • utm_medium: Extracted if not found in url_tags_pivoted
      • utm_campaign: Extracted if not found in url_tags_pivoted
      • utm_content: Extracted if not found in url_tags_pivoted
      • utm_term: Extracted if not found in url_tags_pivoted
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[template_page_link]
    • Cleaning Used in COALESCE with page_link
    • Featurization Various URL components and UTM parameters are extracted from this column if page_link is null
    • Output Columns:
      • url: COALESCE(page_link, template_page_link)
      • base_url: Extracted from page_link or template_page_link
      • url_host: Extracted from page_link or template_page_link
      • url_path: Extracted from page_link or template_page_link
      • utm_source: Extracted if not found in url_tags_pivoted and page_link
      • utm_medium: Extracted if not found in url_tags_pivoted and page_link
      • utm_campaign: Extracted if not found in url_tags_pivoted and page_link
      • utm_content: Extracted if not found in url_tags_pivoted and page_link
      • utm_term: Extracted if not found in url_tags_pivoted and page_link
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[object_story_link_data_link]
    • Cleaning This column is likely used in the COALESCE function with template_page_link to create the 'url' column.
    • Featurization Various parts of the URL are extracted from this column to create different features.
    • Output Columns:
      • url: Potentially used in COALESCE(page_link, template_page_link)
      • base_url: Extracted from this column
      • url_host: Extracted and cleaned from this column
      • url_path: Extracted and cleaned from this column
      • utm_source: Potentially extracted from this column if not found in url_tags
      • utm_medium: Potentially extracted from this column if not found in url_tags
      • utm_campaign: Potentially extracted from this column if not found in url_tags
      • utm_content: Potentially extracted from this column if not found in url_tags
      • utm_term: Potentially extracted from this column if not found in url_tags
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[url_path]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • url_path: Directly copied to the output
Column Lineage
%3 77. model.facebook_ads.facebook_ads__url_tags 77. model.facebook_ads.facebook_ads__url_tags key type value 78. model.facebook_ads.int_facebook_ads__creative_history 78. model.facebook_ads.int_facebook_ads__creative_history base_url url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 77. model.facebook_ads.facebook_ads__url_tags:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f7 77. model.facebook_ads.facebook_ads__url_tags:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f6 77. model.facebook_ads.facebook_ads__url_tags:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f4 77. model.facebook_ads.facebook_ads__url_tags:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f5 77. model.facebook_ads.facebook_ads__url_tags:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f8 77. model.facebook_ads.facebook_ads__url_tags:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f7 77. model.facebook_ads.facebook_ads__url_tags:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f6 77. model.facebook_ads.facebook_ads__url_tags:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f4 77. model.facebook_ads.facebook_ads__url_tags:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f5 77. model.facebook_ads.facebook_ads__url_tags:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f8 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report utm_source 78. model.facebook_ads.int_facebook_ads__creative_history:f7->76. model.facebook_ads.facebook_ads__url_report:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history 89. model.facebook_ads_source.stg_facebook_ads__creative_history object_story_link_data_link page_link template_page_link url_tags 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f3->77. model.facebook_ads.facebook_ads__url_tags:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f3->77. model.facebook_ads.facebook_ads__url_tags:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f3->77. model.facebook_ads.facebook_ads__url_tags:f1 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f3->77. model.facebook_ads.facebook_ads__url_tags:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f3->77. model.facebook_ads.facebook_ads__url_tags:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f3->77. model.facebook_ads.facebook_ads__url_tags:f1 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f1 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f3 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f7 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f6 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f4 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f5 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f8 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f1 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f3 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f7 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f6 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f4 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f5 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f8 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f1 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f3 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f7 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f6 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f4 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f5 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f8 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp object_story_link_data_link page_link template_page_link url_tags 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f1->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f2->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f0->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f3->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f3
89. model.facebook_ads_source.stg_facebook_ads__creative_history
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[page_link]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • page_link: Directly mapped
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[template_page_link]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • template_page_link: Directly mapped
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[object_story_link_data_link]
    • Direct This column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the 'fields' CTE
    • Output Columns:
      • object_story_link_data_link: Directly mapped to this output column
77. model.facebook_ads.facebook_ads__url_tags
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[url_tags]
    • Filtering The column is filtered to include only non-null values
    • Cleaning The column is cleaned by parsing JSON
    • Other The column is flattened and its contents are extracted into separate columns
    • Output Columns:
      • key: Extracted from flattened url_tags
      • value: Extracted from flattened url_tags
      • type: Extracted from flattened url_tags
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[url_tags]
    • Filtering The column is filtered to include only non-null values
    • Cleaning The column is cleaned by parsing JSON
    • Other The column is flattened and its contents are extracted into separate columns
    • Output Columns:
      • key: Extracted from flattened url_tags
      • value: Extracted from flattened url_tags
      • type: Extracted from flattened url_tags
78. model.facebook_ads.int_facebook_ads__creative_history
  • Input Column: 77. model.facebook_ads.facebook_ads__url_tags[key]
    • Featurization Used to pivot the data, extracting different UTM parameters
    • Output Columns:
      • utm_source: Mapped when key = 'utm_source'
      • utm_medium: Mapped when key = 'utm_medium'
      • utm_campaign: Mapped when key = 'utm_campaign'
      • utm_content: Mapped when key = 'utm_content'
      • utm_term: Mapped when key = 'utm_term'
  • Input Column: 77. model.facebook_ads.facebook_ads__url_tags[value]
    • Featurization Used as the value for the pivoted UTM parameters
    • Output Columns:
      • utm_source: Mapped when key = 'utm_source'
      • utm_medium: Mapped when key = 'utm_medium'
      • utm_campaign: Mapped when key = 'utm_campaign'
      • utm_content: Mapped when key = 'utm_content'
      • utm_term: Mapped when key = 'utm_term'
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[page_link]
    • Cleaning Used in COALESCE with template_page_link
    • Featurization Various URL components and UTM parameters are extracted from this column
    • Output Columns:
      • url: COALESCE(page_link, template_page_link)
      • base_url: Extracted from page_link or template_page_link
      • url_host: Extracted from page_link or template_page_link
      • url_path: Extracted from page_link or template_page_link
      • utm_source: Extracted if not found in url_tags_pivoted
      • utm_medium: Extracted if not found in url_tags_pivoted
      • utm_campaign: Extracted if not found in url_tags_pivoted
      • utm_content: Extracted if not found in url_tags_pivoted
      • utm_term: Extracted if not found in url_tags_pivoted
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[template_page_link]
    • Cleaning Used in COALESCE with page_link
    • Featurization Various URL components and UTM parameters are extracted from this column if page_link is null
    • Output Columns:
      • url: COALESCE(page_link, template_page_link)
      • base_url: Extracted from page_link or template_page_link
      • url_host: Extracted from page_link or template_page_link
      • url_path: Extracted from page_link or template_page_link
      • utm_source: Extracted if not found in url_tags_pivoted and page_link
      • utm_medium: Extracted if not found in url_tags_pivoted and page_link
      • utm_campaign: Extracted if not found in url_tags_pivoted and page_link
      • utm_content: Extracted if not found in url_tags_pivoted and page_link
      • utm_term: Extracted if not found in url_tags_pivoted and page_link
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[object_story_link_data_link]
    • Cleaning This column is likely used in the COALESCE function with template_page_link to create the 'url' column.
    • Featurization Various parts of the URL are extracted from this column to create different features.
    • Output Columns:
      • url: Potentially used in COALESCE(page_link, template_page_link)
      • base_url: Extracted from this column
      • url_host: Extracted and cleaned from this column
      • url_path: Extracted and cleaned from this column
      • utm_source: Potentially extracted from this column if not found in url_tags
      • utm_medium: Potentially extracted from this column if not found in url_tags
      • utm_campaign: Potentially extracted from this column if not found in url_tags
      • utm_content: Potentially extracted from this column if not found in url_tags
      • utm_term: Potentially extracted from this column if not found in url_tags
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[utm_source]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • utm_source: Directly copied to the output
Column Lineage
%3 77. model.facebook_ads.facebook_ads__url_tags 77. model.facebook_ads.facebook_ads__url_tags key type value 78. model.facebook_ads.int_facebook_ads__creative_history 78. model.facebook_ads.int_facebook_ads__creative_history base_url url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 77. model.facebook_ads.facebook_ads__url_tags:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f7 77. model.facebook_ads.facebook_ads__url_tags:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f6 77. model.facebook_ads.facebook_ads__url_tags:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f4 77. model.facebook_ads.facebook_ads__url_tags:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f5 77. model.facebook_ads.facebook_ads__url_tags:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f8 77. model.facebook_ads.facebook_ads__url_tags:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f7 77. model.facebook_ads.facebook_ads__url_tags:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f6 77. model.facebook_ads.facebook_ads__url_tags:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f4 77. model.facebook_ads.facebook_ads__url_tags:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f5 77. model.facebook_ads.facebook_ads__url_tags:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f8 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report utm_medium 78. model.facebook_ads.int_facebook_ads__creative_history:f6->76. model.facebook_ads.facebook_ads__url_report:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history 89. model.facebook_ads_source.stg_facebook_ads__creative_history object_story_link_data_link page_link template_page_link url_tags 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f3->77. model.facebook_ads.facebook_ads__url_tags:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f3->77. model.facebook_ads.facebook_ads__url_tags:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f3->77. model.facebook_ads.facebook_ads__url_tags:f1 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f3->77. model.facebook_ads.facebook_ads__url_tags:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f3->77. model.facebook_ads.facebook_ads__url_tags:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f3->77. model.facebook_ads.facebook_ads__url_tags:f1 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f1 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f3 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f7 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f6 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f4 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f5 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f8 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f1 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f3 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f7 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f6 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f4 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f5 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f8 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f1 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f3 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f7 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f6 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f4 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f5 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f8 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp object_story_link_data_link page_link template_page_link url_tags 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f1->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f2->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f0->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f3->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f3
89. model.facebook_ads_source.stg_facebook_ads__creative_history
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[page_link]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • page_link: Directly mapped
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[template_page_link]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • template_page_link: Directly mapped
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[object_story_link_data_link]
    • Direct This column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the 'fields' CTE
    • Output Columns:
      • object_story_link_data_link: Directly mapped to this output column
77. model.facebook_ads.facebook_ads__url_tags
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[url_tags]
    • Filtering The column is filtered to include only non-null values
    • Cleaning The column is cleaned by parsing JSON
    • Other The column is flattened and its contents are extracted into separate columns
    • Output Columns:
      • key: Extracted from flattened url_tags
      • value: Extracted from flattened url_tags
      • type: Extracted from flattened url_tags
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[url_tags]
    • Filtering The column is filtered to include only non-null values
    • Cleaning The column is cleaned by parsing JSON
    • Other The column is flattened and its contents are extracted into separate columns
    • Output Columns:
      • key: Extracted from flattened url_tags
      • value: Extracted from flattened url_tags
      • type: Extracted from flattened url_tags
78. model.facebook_ads.int_facebook_ads__creative_history
  • Input Column: 77. model.facebook_ads.facebook_ads__url_tags[key]
    • Featurization Used to pivot the data, extracting different UTM parameters
    • Output Columns:
      • utm_source: Mapped when key = 'utm_source'
      • utm_medium: Mapped when key = 'utm_medium'
      • utm_campaign: Mapped when key = 'utm_campaign'
      • utm_content: Mapped when key = 'utm_content'
      • utm_term: Mapped when key = 'utm_term'
  • Input Column: 77. model.facebook_ads.facebook_ads__url_tags[value]
    • Featurization Used as the value for the pivoted UTM parameters
    • Output Columns:
      • utm_source: Mapped when key = 'utm_source'
      • utm_medium: Mapped when key = 'utm_medium'
      • utm_campaign: Mapped when key = 'utm_campaign'
      • utm_content: Mapped when key = 'utm_content'
      • utm_term: Mapped when key = 'utm_term'
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[page_link]
    • Cleaning Used in COALESCE with template_page_link
    • Featurization Various URL components and UTM parameters are extracted from this column
    • Output Columns:
      • url: COALESCE(page_link, template_page_link)
      • base_url: Extracted from page_link or template_page_link
      • url_host: Extracted from page_link or template_page_link
      • url_path: Extracted from page_link or template_page_link
      • utm_source: Extracted if not found in url_tags_pivoted
      • utm_medium: Extracted if not found in url_tags_pivoted
      • utm_campaign: Extracted if not found in url_tags_pivoted
      • utm_content: Extracted if not found in url_tags_pivoted
      • utm_term: Extracted if not found in url_tags_pivoted
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[template_page_link]
    • Cleaning Used in COALESCE with page_link
    • Featurization Various URL components and UTM parameters are extracted from this column if page_link is null
    • Output Columns:
      • url: COALESCE(page_link, template_page_link)
      • base_url: Extracted from page_link or template_page_link
      • url_host: Extracted from page_link or template_page_link
      • url_path: Extracted from page_link or template_page_link
      • utm_source: Extracted if not found in url_tags_pivoted and page_link
      • utm_medium: Extracted if not found in url_tags_pivoted and page_link
      • utm_campaign: Extracted if not found in url_tags_pivoted and page_link
      • utm_content: Extracted if not found in url_tags_pivoted and page_link
      • utm_term: Extracted if not found in url_tags_pivoted and page_link
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[object_story_link_data_link]
    • Cleaning This column is likely used in the COALESCE function with template_page_link to create the 'url' column.
    • Featurization Various parts of the URL are extracted from this column to create different features.
    • Output Columns:
      • url: Potentially used in COALESCE(page_link, template_page_link)
      • base_url: Extracted from this column
      • url_host: Extracted and cleaned from this column
      • url_path: Extracted and cleaned from this column
      • utm_source: Potentially extracted from this column if not found in url_tags
      • utm_medium: Potentially extracted from this column if not found in url_tags
      • utm_campaign: Potentially extracted from this column if not found in url_tags
      • utm_content: Potentially extracted from this column if not found in url_tags
      • utm_term: Potentially extracted from this column if not found in url_tags
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[utm_medium]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the creatives table
    • Output Columns:
      • utm_medium: Directly copied to the output
Column Lineage
%3 77. model.facebook_ads.facebook_ads__url_tags 77. model.facebook_ads.facebook_ads__url_tags key type value 78. model.facebook_ads.int_facebook_ads__creative_history 78. model.facebook_ads.int_facebook_ads__creative_history base_url url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 77. model.facebook_ads.facebook_ads__url_tags:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f7 77. model.facebook_ads.facebook_ads__url_tags:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f6 77. model.facebook_ads.facebook_ads__url_tags:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f4 77. model.facebook_ads.facebook_ads__url_tags:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f5 77. model.facebook_ads.facebook_ads__url_tags:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f8 77. model.facebook_ads.facebook_ads__url_tags:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f7 77. model.facebook_ads.facebook_ads__url_tags:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f6 77. model.facebook_ads.facebook_ads__url_tags:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f4 77. model.facebook_ads.facebook_ads__url_tags:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f5 77. model.facebook_ads.facebook_ads__url_tags:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f8 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report utm_campaign 78. model.facebook_ads.int_facebook_ads__creative_history:f4->76. model.facebook_ads.facebook_ads__url_report:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history 89. model.facebook_ads_source.stg_facebook_ads__creative_history object_story_link_data_link page_link template_page_link url_tags 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f3->77. model.facebook_ads.facebook_ads__url_tags:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f3->77. model.facebook_ads.facebook_ads__url_tags:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f3->77. model.facebook_ads.facebook_ads__url_tags:f1 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f3->77. model.facebook_ads.facebook_ads__url_tags:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f3->77. model.facebook_ads.facebook_ads__url_tags:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f3->77. model.facebook_ads.facebook_ads__url_tags:f1 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f1 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f3 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f7 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f6 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f4 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f5 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f8 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f1 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f3 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f7 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f6 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f4 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f5 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f8 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f1 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f3 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f7 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f6 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f4 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f5 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f8 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp object_story_link_data_link page_link template_page_link url_tags 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f1->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f2->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f0->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f3->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f3
89. model.facebook_ads_source.stg_facebook_ads__creative_history
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[page_link]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • page_link: Directly mapped
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[template_page_link]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • template_page_link: Directly mapped
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[object_story_link_data_link]
    • Direct This column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the 'fields' CTE
    • Output Columns:
      • object_story_link_data_link: Directly mapped to this output column
77. model.facebook_ads.facebook_ads__url_tags
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[url_tags]
    • Filtering The column is filtered to include only non-null values
    • Cleaning The column is cleaned by parsing JSON
    • Other The column is flattened and its contents are extracted into separate columns
    • Output Columns:
      • key: Extracted from flattened url_tags
      • value: Extracted from flattened url_tags
      • type: Extracted from flattened url_tags
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[url_tags]
    • Filtering The column is filtered to include only non-null values
    • Cleaning The column is cleaned by parsing JSON
    • Other The column is flattened and its contents are extracted into separate columns
    • Output Columns:
      • key: Extracted from flattened url_tags
      • value: Extracted from flattened url_tags
      • type: Extracted from flattened url_tags
78. model.facebook_ads.int_facebook_ads__creative_history
  • Input Column: 77. model.facebook_ads.facebook_ads__url_tags[key]
    • Featurization Used to pivot the data, extracting different UTM parameters
    • Output Columns:
      • utm_source: Mapped when key = 'utm_source'
      • utm_medium: Mapped when key = 'utm_medium'
      • utm_campaign: Mapped when key = 'utm_campaign'
      • utm_content: Mapped when key = 'utm_content'
      • utm_term: Mapped when key = 'utm_term'
  • Input Column: 77. model.facebook_ads.facebook_ads__url_tags[value]
    • Featurization Used as the value for the pivoted UTM parameters
    • Output Columns:
      • utm_source: Mapped when key = 'utm_source'
      • utm_medium: Mapped when key = 'utm_medium'
      • utm_campaign: Mapped when key = 'utm_campaign'
      • utm_content: Mapped when key = 'utm_content'
      • utm_term: Mapped when key = 'utm_term'
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[page_link]
    • Cleaning Used in COALESCE with template_page_link
    • Featurization Various URL components and UTM parameters are extracted from this column
    • Output Columns:
      • url: COALESCE(page_link, template_page_link)
      • base_url: Extracted from page_link or template_page_link
      • url_host: Extracted from page_link or template_page_link
      • url_path: Extracted from page_link or template_page_link
      • utm_source: Extracted if not found in url_tags_pivoted
      • utm_medium: Extracted if not found in url_tags_pivoted
      • utm_campaign: Extracted if not found in url_tags_pivoted
      • utm_content: Extracted if not found in url_tags_pivoted
      • utm_term: Extracted if not found in url_tags_pivoted
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[template_page_link]
    • Cleaning Used in COALESCE with page_link
    • Featurization Various URL components and UTM parameters are extracted from this column if page_link is null
    • Output Columns:
      • url: COALESCE(page_link, template_page_link)
      • base_url: Extracted from page_link or template_page_link
      • url_host: Extracted from page_link or template_page_link
      • url_path: Extracted from page_link or template_page_link
      • utm_source: Extracted if not found in url_tags_pivoted and page_link
      • utm_medium: Extracted if not found in url_tags_pivoted and page_link
      • utm_campaign: Extracted if not found in url_tags_pivoted and page_link
      • utm_content: Extracted if not found in url_tags_pivoted and page_link
      • utm_term: Extracted if not found in url_tags_pivoted and page_link
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[object_story_link_data_link]
    • Cleaning This column is likely used in the COALESCE function with template_page_link to create the 'url' column.
    • Featurization Various parts of the URL are extracted from this column to create different features.
    • Output Columns:
      • url: Potentially used in COALESCE(page_link, template_page_link)
      • base_url: Extracted from this column
      • url_host: Extracted and cleaned from this column
      • url_path: Extracted and cleaned from this column
      • utm_source: Potentially extracted from this column if not found in url_tags
      • utm_medium: Potentially extracted from this column if not found in url_tags
      • utm_campaign: Potentially extracted from this column if not found in url_tags
      • utm_content: Potentially extracted from this column if not found in url_tags
      • utm_term: Potentially extracted from this column if not found in url_tags
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[utm_campaign]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the creatives table
    • Output Columns:
      • utm_campaign: Directly copied to the output
Column Lineage
%3 77. model.facebook_ads.facebook_ads__url_tags 77. model.facebook_ads.facebook_ads__url_tags key type value 78. model.facebook_ads.int_facebook_ads__creative_history 78. model.facebook_ads.int_facebook_ads__creative_history base_url url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 77. model.facebook_ads.facebook_ads__url_tags:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f7 77. model.facebook_ads.facebook_ads__url_tags:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f6 77. model.facebook_ads.facebook_ads__url_tags:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f4 77. model.facebook_ads.facebook_ads__url_tags:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f5 77. model.facebook_ads.facebook_ads__url_tags:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f8 77. model.facebook_ads.facebook_ads__url_tags:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f7 77. model.facebook_ads.facebook_ads__url_tags:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f6 77. model.facebook_ads.facebook_ads__url_tags:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f4 77. model.facebook_ads.facebook_ads__url_tags:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f5 77. model.facebook_ads.facebook_ads__url_tags:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f8 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report utm_content 78. model.facebook_ads.int_facebook_ads__creative_history:f5->76. model.facebook_ads.facebook_ads__url_report:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history 89. model.facebook_ads_source.stg_facebook_ads__creative_history object_story_link_data_link page_link template_page_link url_tags 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f3->77. model.facebook_ads.facebook_ads__url_tags:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f3->77. model.facebook_ads.facebook_ads__url_tags:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f3->77. model.facebook_ads.facebook_ads__url_tags:f1 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f3->77. model.facebook_ads.facebook_ads__url_tags:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f3->77. model.facebook_ads.facebook_ads__url_tags:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f3->77. model.facebook_ads.facebook_ads__url_tags:f1 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f1 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f3 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f7 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f6 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f4 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f5 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f8 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f1 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f3 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f7 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f6 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f4 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f5 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f8 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f1 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f3 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f7 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f6 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f4 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f5 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f8 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp object_story_link_data_link page_link template_page_link url_tags 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f1->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f2->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f0->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f3->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f3
89. model.facebook_ads_source.stg_facebook_ads__creative_history
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[page_link]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • page_link: Directly mapped
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[template_page_link]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • template_page_link: Directly mapped
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[object_story_link_data_link]
    • Direct This column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the 'fields' CTE
    • Output Columns:
      • object_story_link_data_link: Directly mapped to this output column
77. model.facebook_ads.facebook_ads__url_tags
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[url_tags]
    • Filtering The column is filtered to include only non-null values
    • Cleaning The column is cleaned by parsing JSON
    • Other The column is flattened and its contents are extracted into separate columns
    • Output Columns:
      • key: Extracted from flattened url_tags
      • value: Extracted from flattened url_tags
      • type: Extracted from flattened url_tags
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[url_tags]
    • Filtering The column is filtered to include only non-null values
    • Cleaning The column is cleaned by parsing JSON
    • Other The column is flattened and its contents are extracted into separate columns
    • Output Columns:
      • key: Extracted from flattened url_tags
      • value: Extracted from flattened url_tags
      • type: Extracted from flattened url_tags
78. model.facebook_ads.int_facebook_ads__creative_history
  • Input Column: 77. model.facebook_ads.facebook_ads__url_tags[key]
    • Featurization Used to pivot the data, extracting different UTM parameters
    • Output Columns:
      • utm_source: Mapped when key = 'utm_source'
      • utm_medium: Mapped when key = 'utm_medium'
      • utm_campaign: Mapped when key = 'utm_campaign'
      • utm_content: Mapped when key = 'utm_content'
      • utm_term: Mapped when key = 'utm_term'
  • Input Column: 77. model.facebook_ads.facebook_ads__url_tags[value]
    • Featurization Used as the value for the pivoted UTM parameters
    • Output Columns:
      • utm_source: Mapped when key = 'utm_source'
      • utm_medium: Mapped when key = 'utm_medium'
      • utm_campaign: Mapped when key = 'utm_campaign'
      • utm_content: Mapped when key = 'utm_content'
      • utm_term: Mapped when key = 'utm_term'
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[page_link]
    • Cleaning Used in COALESCE with template_page_link
    • Featurization Various URL components and UTM parameters are extracted from this column
    • Output Columns:
      • url: COALESCE(page_link, template_page_link)
      • base_url: Extracted from page_link or template_page_link
      • url_host: Extracted from page_link or template_page_link
      • url_path: Extracted from page_link or template_page_link
      • utm_source: Extracted if not found in url_tags_pivoted
      • utm_medium: Extracted if not found in url_tags_pivoted
      • utm_campaign: Extracted if not found in url_tags_pivoted
      • utm_content: Extracted if not found in url_tags_pivoted
      • utm_term: Extracted if not found in url_tags_pivoted
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[template_page_link]
    • Cleaning Used in COALESCE with page_link
    • Featurization Various URL components and UTM parameters are extracted from this column if page_link is null
    • Output Columns:
      • url: COALESCE(page_link, template_page_link)
      • base_url: Extracted from page_link or template_page_link
      • url_host: Extracted from page_link or template_page_link
      • url_path: Extracted from page_link or template_page_link
      • utm_source: Extracted if not found in url_tags_pivoted and page_link
      • utm_medium: Extracted if not found in url_tags_pivoted and page_link
      • utm_campaign: Extracted if not found in url_tags_pivoted and page_link
      • utm_content: Extracted if not found in url_tags_pivoted and page_link
      • utm_term: Extracted if not found in url_tags_pivoted and page_link
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[object_story_link_data_link]
    • Cleaning This column is likely used in the COALESCE function with template_page_link to create the 'url' column.
    • Featurization Various parts of the URL are extracted from this column to create different features.
    • Output Columns:
      • url: Potentially used in COALESCE(page_link, template_page_link)
      • base_url: Extracted from this column
      • url_host: Extracted and cleaned from this column
      • url_path: Extracted and cleaned from this column
      • utm_source: Potentially extracted from this column if not found in url_tags
      • utm_medium: Potentially extracted from this column if not found in url_tags
      • utm_campaign: Potentially extracted from this column if not found in url_tags
      • utm_content: Potentially extracted from this column if not found in url_tags
      • utm_term: Potentially extracted from this column if not found in url_tags
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[utm_content]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the creatives table
    • Output Columns:
      • utm_content: Directly copied to the output
Column Lineage
%3 77. model.facebook_ads.facebook_ads__url_tags 77. model.facebook_ads.facebook_ads__url_tags key type value 78. model.facebook_ads.int_facebook_ads__creative_history 78. model.facebook_ads.int_facebook_ads__creative_history base_url url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 77. model.facebook_ads.facebook_ads__url_tags:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f7 77. model.facebook_ads.facebook_ads__url_tags:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f6 77. model.facebook_ads.facebook_ads__url_tags:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f4 77. model.facebook_ads.facebook_ads__url_tags:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f5 77. model.facebook_ads.facebook_ads__url_tags:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f8 77. model.facebook_ads.facebook_ads__url_tags:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f7 77. model.facebook_ads.facebook_ads__url_tags:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f6 77. model.facebook_ads.facebook_ads__url_tags:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f4 77. model.facebook_ads.facebook_ads__url_tags:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f5 77. model.facebook_ads.facebook_ads__url_tags:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f8 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report utm_term 78. model.facebook_ads.int_facebook_ads__creative_history:f8->76. model.facebook_ads.facebook_ads__url_report:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history 89. model.facebook_ads_source.stg_facebook_ads__creative_history object_story_link_data_link page_link template_page_link url_tags 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f3->77. model.facebook_ads.facebook_ads__url_tags:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f3->77. model.facebook_ads.facebook_ads__url_tags:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f3->77. model.facebook_ads.facebook_ads__url_tags:f1 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f3->77. model.facebook_ads.facebook_ads__url_tags:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f3->77. model.facebook_ads.facebook_ads__url_tags:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f3->77. model.facebook_ads.facebook_ads__url_tags:f1 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f1 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f3 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f7 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f6 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f4 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f5 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1->78. model.facebook_ads.int_facebook_ads__creative_history:f8 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f1 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f3 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f7 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f6 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f4 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f5 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f8 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f1 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f3 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f7 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f6 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f4 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f5 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f8 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp object_story_link_data_link page_link template_page_link url_tags 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f1->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f2->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f0->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f3->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f3
89. model.facebook_ads_source.stg_facebook_ads__creative_history
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[page_link]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • page_link: Directly mapped
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[template_page_link]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • template_page_link: Directly mapped
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[object_story_link_data_link]
    • Direct This column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the 'fields' CTE
    • Output Columns:
      • object_story_link_data_link: Directly mapped to this output column
77. model.facebook_ads.facebook_ads__url_tags
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[url_tags]
    • Filtering The column is filtered to include only non-null values
    • Cleaning The column is cleaned by parsing JSON
    • Other The column is flattened and its contents are extracted into separate columns
    • Output Columns:
      • key: Extracted from flattened url_tags
      • value: Extracted from flattened url_tags
      • type: Extracted from flattened url_tags
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[url_tags]
    • Filtering The column is filtered to include only non-null values
    • Cleaning The column is cleaned by parsing JSON
    • Other The column is flattened and its contents are extracted into separate columns
    • Output Columns:
      • key: Extracted from flattened url_tags
      • value: Extracted from flattened url_tags
      • type: Extracted from flattened url_tags
78. model.facebook_ads.int_facebook_ads__creative_history
  • Input Column: 77. model.facebook_ads.facebook_ads__url_tags[key]
    • Featurization Used to pivot the data, extracting different UTM parameters
    • Output Columns:
      • utm_source: Mapped when key = 'utm_source'
      • utm_medium: Mapped when key = 'utm_medium'
      • utm_campaign: Mapped when key = 'utm_campaign'
      • utm_content: Mapped when key = 'utm_content'
      • utm_term: Mapped when key = 'utm_term'
  • Input Column: 77. model.facebook_ads.facebook_ads__url_tags[value]
    • Featurization Used as the value for the pivoted UTM parameters
    • Output Columns:
      • utm_source: Mapped when key = 'utm_source'
      • utm_medium: Mapped when key = 'utm_medium'
      • utm_campaign: Mapped when key = 'utm_campaign'
      • utm_content: Mapped when key = 'utm_content'
      • utm_term: Mapped when key = 'utm_term'
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[page_link]
    • Cleaning Used in COALESCE with template_page_link
    • Featurization Various URL components and UTM parameters are extracted from this column
    • Output Columns:
      • url: COALESCE(page_link, template_page_link)
      • base_url: Extracted from page_link or template_page_link
      • url_host: Extracted from page_link or template_page_link
      • url_path: Extracted from page_link or template_page_link
      • utm_source: Extracted if not found in url_tags_pivoted
      • utm_medium: Extracted if not found in url_tags_pivoted
      • utm_campaign: Extracted if not found in url_tags_pivoted
      • utm_content: Extracted if not found in url_tags_pivoted
      • utm_term: Extracted if not found in url_tags_pivoted
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[template_page_link]
    • Cleaning Used in COALESCE with page_link
    • Featurization Various URL components and UTM parameters are extracted from this column if page_link is null
    • Output Columns:
      • url: COALESCE(page_link, template_page_link)
      • base_url: Extracted from page_link or template_page_link
      • url_host: Extracted from page_link or template_page_link
      • url_path: Extracted from page_link or template_page_link
      • utm_source: Extracted if not found in url_tags_pivoted and page_link
      • utm_medium: Extracted if not found in url_tags_pivoted and page_link
      • utm_campaign: Extracted if not found in url_tags_pivoted and page_link
      • utm_content: Extracted if not found in url_tags_pivoted and page_link
      • utm_term: Extracted if not found in url_tags_pivoted and page_link
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[object_story_link_data_link]
    • Cleaning This column is likely used in the COALESCE function with template_page_link to create the 'url' column.
    • Featurization Various parts of the URL are extracted from this column to create different features.
    • Output Columns:
      • url: Potentially used in COALESCE(page_link, template_page_link)
      • base_url: Extracted from this column
      • url_host: Extracted and cleaned from this column
      • url_path: Extracted and cleaned from this column
      • utm_source: Potentially extracted from this column if not found in url_tags
      • utm_medium: Potentially extracted from this column if not found in url_tags
      • utm_campaign: Potentially extracted from this column if not found in url_tags
      • utm_content: Potentially extracted from this column if not found in url_tags
      • utm_term: Potentially extracted from this column if not found in url_tags
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[utm_term]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the creatives table
    • Output Columns:
      • utm_term: Directly copied to the output
79. model.facebook_ads_source.stg_facebook_ads__account_history

This SQL query stages data from a Facebook Ads account history source table. It casts fields to specific data types, renames some columns, and adds a flag to identify the most recent record for each account. The query also includes a mechanism to generate a surrogate key when the natural key (id) is missing.

CleaningDeduplicationFeaturization
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_facebook_ads_source.stg_facebook_ads__account_history_tmp
), fields AS (
  SELECT
    CAST(NULL AS INT) AS id,
    CAST(NULL AS TIMESTAMP) AS _fivetran_synced,
    CAST(NULL AS TEXT) AS name,
    CAST(NULL AS TEXT) AS account_status,
    CAST(NULL AS TEXT) AS business_country_code,
    CAST(NULL AS TIMESTAMP) AS created_time,
    CAST(NULL AS TEXT) AS currency,
    CAST(NULL AS TEXT) AS timezone_name,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    CAST(id AS BIGINT) AS account_id,
    _fivetran_synced,
    name AS account_name,
    account_status,
    business_country_code,
    created_time AS created_at,
    currency,
    timezone_name,
    CASE
      WHEN id IS NULL AND _fivetran_synced IS NULL
      THEN ROW_NUMBER() OVER (PARTITION BY source_relation ORDER BY source_relation)
      ELSE ROW_NUMBER() OVER (PARTITION BY source_relation, id ORDER BY _fivetran_synced DESC)
    END = 1 AS is_most_recent_record
  FROM fields
)
SELECT
  *
FROM final
%3 79. model.facebook_ads_source.stg_facebook_ads__account_history 79. model.facebook_ads_source.stg_facebook_ads__account_history source_relation account_id account_name is_most_recent_record _fivetran_synced account_status business_country_code created_at currency timezone_name 80. model.facebook_ads_source.stg_facebook_ads__account_history_tmp 80. model.facebook_ads_source.stg_facebook_ads__account_history_tmp id name _fivetran_synced 80. model.facebook_ads_source.stg_facebook_ads__account_history_tmp:f0->79. model.facebook_ads_source.stg_facebook_ads__account_history:f1 80. model.facebook_ads_source.stg_facebook_ads__account_history_tmp:f1->79. model.facebook_ads_source.stg_facebook_ads__account_history:f2 80. model.facebook_ads_source.stg_facebook_ads__account_history_tmp:f2->79. model.facebook_ads_source.stg_facebook_ads__account_history:f4
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
account_id bigint The ID of the ad account.
account_name character varying Name of the account.
is_most_recent_record boolean Boolean representing whether a record is the most recent version of that record. All records should have this value set to True given we filter on it.
_fivetran_synced text When the record was last synced by Fivetran.
account_status text Current status of account.
business_country_code text Country code of business associated to account.
created_at timestamp without time zone The time account was created.
currency text Currency associated with account.
timezone_name text Timezone associated with account.
Column Lineage
%3 79. model.facebook_ads_source.stg_facebook_ads__account_history 79. model.facebook_ads_source.stg_facebook_ads__account_history source_relation 74. model.facebook_ads.facebook_ads__ad_set_report 74. model.facebook_ads.facebook_ads__ad_set_report source_relation 79. model.facebook_ads_source.stg_facebook_ads__account_history:f0->74. model.facebook_ads.facebook_ads__ad_set_report:f0 72. model.facebook_ads.facebook_ads__account_report 72. model.facebook_ads.facebook_ads__account_report source_relation 79. model.facebook_ads_source.stg_facebook_ads__account_history:f0->72. model.facebook_ads.facebook_ads__account_report:f0 75. model.facebook_ads.facebook_ads__campaign_report 75. model.facebook_ads.facebook_ads__campaign_report source_relation 79. model.facebook_ads_source.stg_facebook_ads__account_history:f0->75. model.facebook_ads.facebook_ads__campaign_report:f0 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report source_relation 79. model.facebook_ads_source.stg_facebook_ads__account_history:f0->76. model.facebook_ads.facebook_ads__url_report:f0 73. model.facebook_ads.facebook_ads__ad_report 73. model.facebook_ads.facebook_ads__ad_report source_relation 79. model.facebook_ads_source.stg_facebook_ads__account_history:f0->73. model.facebook_ads.facebook_ads__ad_report:f0
72. model.facebook_ads.facebook_ads__account_report
  • Input Column: 79. model.facebook_ads_source.stg_facebook_ads__account_history[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as a key to join with the report table
    • Aggregation The column is part of the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to output
73. model.facebook_ads.facebook_ads__ad_report
  • Input Column: 79. model.facebook_ads_source.stg_facebook_ads__account_history[source_relation]
    • Integration used as part of the join condition with the report table
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
74. model.facebook_ads.facebook_ads__ad_set_report
  • Input Column: 79. model.facebook_ads_source.stg_facebook_ads__account_history[source_relation]
    • Integration used as part of the join condition with the report table
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
75. model.facebook_ads.facebook_ads__campaign_report
  • Input Column: 79. model.facebook_ads_source.stg_facebook_ads__account_history[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as a key to join tables
    • Output Columns:
      • source_relation: Directly copied
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 79. model.facebook_ads_source.stg_facebook_ads__account_history[source_relation]
    • Integration Used as part of the join condition with the report table
    • Direct Directly copied to the output
    • Output Columns:
      • source_relation: Directly copied
Column Lineage
%3 80. model.facebook_ads_source.stg_facebook_ads__account_history_tmp 80. model.facebook_ads_source.stg_facebook_ads__account_history_tmp id 79. model.facebook_ads_source.stg_facebook_ads__account_history 79. model.facebook_ads_source.stg_facebook_ads__account_history account_id 80. model.facebook_ads_source.stg_facebook_ads__account_history_tmp:f0->79. model.facebook_ads_source.stg_facebook_ads__account_history:f0 74. model.facebook_ads.facebook_ads__ad_set_report 74. model.facebook_ads.facebook_ads__ad_set_report account_id 79. model.facebook_ads_source.stg_facebook_ads__account_history:f0->74. model.facebook_ads.facebook_ads__ad_set_report:f0 72. model.facebook_ads.facebook_ads__account_report 72. model.facebook_ads.facebook_ads__account_report account_id 79. model.facebook_ads_source.stg_facebook_ads__account_history:f0->72. model.facebook_ads.facebook_ads__account_report:f0 75. model.facebook_ads.facebook_ads__campaign_report 75. model.facebook_ads.facebook_ads__campaign_report account_id 79. model.facebook_ads_source.stg_facebook_ads__account_history:f0->75. model.facebook_ads.facebook_ads__campaign_report:f0 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report account_id 79. model.facebook_ads_source.stg_facebook_ads__account_history:f0->76. model.facebook_ads.facebook_ads__url_report:f0 73. model.facebook_ads.facebook_ads__ad_report 73. model.facebook_ads.facebook_ads__ad_report account_id 79. model.facebook_ads_source.stg_facebook_ads__account_history:f0->73. model.facebook_ads.facebook_ads__ad_report:f0
79. model.facebook_ads_source.stg_facebook_ads__account_history
  • Input Column: 80. model.facebook_ads_source.stg_facebook_ads__account_history_tmp[id]
    • Cleaning The column is cast to BIGINT
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • account_id: Directly mapped after casting to BIGINT
72. model.facebook_ads.facebook_ads__account_report
  • Input Column: 79. model.facebook_ads_source.stg_facebook_ads__account_history[account_id]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as a key to join with the report table
    • Aggregation The column is part of the GROUP BY clause
    • Output Columns:
      • account_id: Directly copied to output
73. model.facebook_ads.facebook_ads__ad_report
  • Input Column: 79. model.facebook_ads_source.stg_facebook_ads__account_history[account_id]
    • Integration used as the join key with the report table
    • Direct directly copied to the output
    • Output Columns:
      • account_id: directly copied
74. model.facebook_ads.facebook_ads__ad_set_report
  • Input Column: 79. model.facebook_ads_source.stg_facebook_ads__account_history[account_id]
    • Integration used as the key to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • account_id: directly copied
75. model.facebook_ads.facebook_ads__campaign_report
  • Input Column: 79. model.facebook_ads_source.stg_facebook_ads__account_history[account_id]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as a key to join tables
    • Output Columns:
      • account_id: Directly copied
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 79. model.facebook_ads_source.stg_facebook_ads__account_history[account_id]
    • Integration Used as part of the join condition with the report table
    • Direct Directly copied to the output
    • Output Columns:
      • account_id: Directly copied
Column Lineage
%3 80. model.facebook_ads_source.stg_facebook_ads__account_history_tmp 80. model.facebook_ads_source.stg_facebook_ads__account_history_tmp name 79. model.facebook_ads_source.stg_facebook_ads__account_history 79. model.facebook_ads_source.stg_facebook_ads__account_history account_name 80. model.facebook_ads_source.stg_facebook_ads__account_history_tmp:f0->79. model.facebook_ads_source.stg_facebook_ads__account_history:f0 74. model.facebook_ads.facebook_ads__ad_set_report 74. model.facebook_ads.facebook_ads__ad_set_report account_name 79. model.facebook_ads_source.stg_facebook_ads__account_history:f0->74. model.facebook_ads.facebook_ads__ad_set_report:f0 72. model.facebook_ads.facebook_ads__account_report 72. model.facebook_ads.facebook_ads__account_report account_name 79. model.facebook_ads_source.stg_facebook_ads__account_history:f0->72. model.facebook_ads.facebook_ads__account_report:f0 75. model.facebook_ads.facebook_ads__campaign_report 75. model.facebook_ads.facebook_ads__campaign_report account_name 79. model.facebook_ads_source.stg_facebook_ads__account_history:f0->75. model.facebook_ads.facebook_ads__campaign_report:f0 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report account_name 79. model.facebook_ads_source.stg_facebook_ads__account_history:f0->76. model.facebook_ads.facebook_ads__url_report:f0 73. model.facebook_ads.facebook_ads__ad_report 73. model.facebook_ads.facebook_ads__ad_report account_name 79. model.facebook_ads_source.stg_facebook_ads__account_history:f0->73. model.facebook_ads.facebook_ads__ad_report:f0
79. model.facebook_ads_source.stg_facebook_ads__account_history
  • Input Column: 80. model.facebook_ads_source.stg_facebook_ads__account_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • account_name: Directly mapped
72. model.facebook_ads.facebook_ads__account_report
  • Input Column: 79. model.facebook_ads_source.stg_facebook_ads__account_history[account_name]
    • Direct The column is directly copied without any transformation
    • Aggregation The column is part of the GROUP BY clause
    • Output Columns:
      • account_name: Directly copied to output
73. model.facebook_ads.facebook_ads__ad_report
  • Input Column: 79. model.facebook_ads_source.stg_facebook_ads__account_history[account_name]
    • Direct directly copied to the output
    • Output Columns:
      • account_name: directly copied
74. model.facebook_ads.facebook_ads__ad_set_report
  • Input Column: 79. model.facebook_ads_source.stg_facebook_ads__account_history[account_name]
    • Direct directly copied to the output
    • Output Columns:
      • account_name: directly copied
75. model.facebook_ads.facebook_ads__campaign_report
  • Input Column: 79. model.facebook_ads_source.stg_facebook_ads__account_history[account_name]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • account_name: Directly copied
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 79. model.facebook_ads_source.stg_facebook_ads__account_history[account_name]
    • Direct Directly copied to the output
    • Output Columns:
      • account_name: Directly copied
Column Lineage
%3 80. model.facebook_ads_source.stg_facebook_ads__account_history_tmp 80. model.facebook_ads_source.stg_facebook_ads__account_history_tmp _fivetran_synced 79. model.facebook_ads_source.stg_facebook_ads__account_history 79. model.facebook_ads_source.stg_facebook_ads__account_history _fivetran_synced 80. model.facebook_ads_source.stg_facebook_ads__account_history_tmp:f0->79. model.facebook_ads_source.stg_facebook_ads__account_history:f0
79. model.facebook_ads_source.stg_facebook_ads__account_history
  • Input Column: 80. model.facebook_ads_source.stg_facebook_ads__account_history_tmp[_fivetran_synced]
    • Direct The column is directly copied without transformation
    • Deduplication Used in the ROW_NUMBER() function to order records and identify the most recent
    • Output Columns:
      • _fivetran_synced: Directly mapped
Column Lineage
%3 79. model.facebook_ads_source.stg_facebook_ads__account_history 79. model.facebook_ads_source.stg_facebook_ads__account_history account_status 72. model.facebook_ads.facebook_ads__account_report 72. model.facebook_ads.facebook_ads__account_report account_status 79. model.facebook_ads_source.stg_facebook_ads__account_history:f0->72. model.facebook_ads.facebook_ads__account_report:f0
72. model.facebook_ads.facebook_ads__account_report
  • Input Column: 79. model.facebook_ads_source.stg_facebook_ads__account_history[account_status]
    • Direct The column is directly copied without any transformation
    • Aggregation The column is part of the GROUP BY clause
    • Output Columns:
      • account_status: Directly copied to output
Column Lineage
%3 79. model.facebook_ads_source.stg_facebook_ads__account_history 79. model.facebook_ads_source.stg_facebook_ads__account_history business_country_code 72. model.facebook_ads.facebook_ads__account_report 72. model.facebook_ads.facebook_ads__account_report business_country_code 79. model.facebook_ads_source.stg_facebook_ads__account_history:f0->72. model.facebook_ads.facebook_ads__account_report:f0
72. model.facebook_ads.facebook_ads__account_report
  • Input Column: 79. model.facebook_ads_source.stg_facebook_ads__account_history[business_country_code]
    • Direct The column is directly copied without any transformation
    • Aggregation The column is part of the GROUP BY clause
    • Output Columns:
      • business_country_code: Directly copied to output
Column Lineage
%3 79. model.facebook_ads_source.stg_facebook_ads__account_history 79. model.facebook_ads_source.stg_facebook_ads__account_history created_at 72. model.facebook_ads.facebook_ads__account_report 72. model.facebook_ads.facebook_ads__account_report created_at 79. model.facebook_ads_source.stg_facebook_ads__account_history:f0->72. model.facebook_ads.facebook_ads__account_report:f0
72. model.facebook_ads.facebook_ads__account_report
  • Input Column: 79. model.facebook_ads_source.stg_facebook_ads__account_history[created_at]
    • Direct The column is directly copied without any transformation
    • Aggregation The column is part of the GROUP BY clause
    • Output Columns:
      • created_at: Directly copied to output
Column Lineage
%3 79. model.facebook_ads_source.stg_facebook_ads__account_history 79. model.facebook_ads_source.stg_facebook_ads__account_history currency 72. model.facebook_ads.facebook_ads__account_report 72. model.facebook_ads.facebook_ads__account_report currency 79. model.facebook_ads_source.stg_facebook_ads__account_history:f0->72. model.facebook_ads.facebook_ads__account_report:f0
72. model.facebook_ads.facebook_ads__account_report
  • Input Column: 79. model.facebook_ads_source.stg_facebook_ads__account_history[currency]
    • Direct The column is directly copied without any transformation
    • Aggregation The column is part of the GROUP BY clause
    • Output Columns:
      • currency: Directly copied to output
Column Lineage
%3 79. model.facebook_ads_source.stg_facebook_ads__account_history 79. model.facebook_ads_source.stg_facebook_ads__account_history timezone_name 72. model.facebook_ads.facebook_ads__account_report 72. model.facebook_ads.facebook_ads__account_report timezone_name 79. model.facebook_ads_source.stg_facebook_ads__account_history:f0->72. model.facebook_ads.facebook_ads__account_report:f0
72. model.facebook_ads.facebook_ads__account_report
  • Input Column: 79. model.facebook_ads_source.stg_facebook_ads__account_history[timezone_name]
    • Direct The column is directly copied without any transformation
    • Aggregation The column is part of the GROUP BY clause
    • Output Columns:
      • timezone_name: Directly copied to output
80. model.facebook_ads_source.stg_facebook_ads__account_history_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of type TEXT. It's likely used as a placeholder or template for further operations in a dbt (data build tool) model.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 80. model.facebook_ads_source.stg_facebook_ads__account_history_tmp 80. model.facebook_ads_source.stg_facebook_ads__account_history_tmp id name _fivetran_synced 300. source.facebook_ads_source.facebook_ads.account_history 300. source.facebook_ads_source.facebook_ads.account_history
Name Type Comment
id bigint None
name character varying None
_fivetran_synced text None
Column Lineage
%3 80. model.facebook_ads_source.stg_facebook_ads__account_history_tmp 80. model.facebook_ads_source.stg_facebook_ads__account_history_tmp id 79. model.facebook_ads_source.stg_facebook_ads__account_history 79. model.facebook_ads_source.stg_facebook_ads__account_history account_id 80. model.facebook_ads_source.stg_facebook_ads__account_history_tmp:f0->79. model.facebook_ads_source.stg_facebook_ads__account_history:f0 74. model.facebook_ads.facebook_ads__ad_set_report 74. model.facebook_ads.facebook_ads__ad_set_report account_id 79. model.facebook_ads_source.stg_facebook_ads__account_history:f0->74. model.facebook_ads.facebook_ads__ad_set_report:f0 72. model.facebook_ads.facebook_ads__account_report 72. model.facebook_ads.facebook_ads__account_report account_id 79. model.facebook_ads_source.stg_facebook_ads__account_history:f0->72. model.facebook_ads.facebook_ads__account_report:f0 75. model.facebook_ads.facebook_ads__campaign_report 75. model.facebook_ads.facebook_ads__campaign_report account_id 79. model.facebook_ads_source.stg_facebook_ads__account_history:f0->75. model.facebook_ads.facebook_ads__campaign_report:f0 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report account_id 79. model.facebook_ads_source.stg_facebook_ads__account_history:f0->76. model.facebook_ads.facebook_ads__url_report:f0 73. model.facebook_ads.facebook_ads__ad_report 73. model.facebook_ads.facebook_ads__ad_report account_id 79. model.facebook_ads_source.stg_facebook_ads__account_history:f0->73. model.facebook_ads.facebook_ads__ad_report:f0
79. model.facebook_ads_source.stg_facebook_ads__account_history
  • Input Column: 80. model.facebook_ads_source.stg_facebook_ads__account_history_tmp[id]
    • Cleaning The column is cast to BIGINT
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • account_id: Directly mapped after casting to BIGINT
72. model.facebook_ads.facebook_ads__account_report
  • Input Column: 79. model.facebook_ads_source.stg_facebook_ads__account_history[account_id]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as a key to join with the report table
    • Aggregation The column is part of the GROUP BY clause
    • Output Columns:
      • account_id: Directly copied to output
73. model.facebook_ads.facebook_ads__ad_report
  • Input Column: 79. model.facebook_ads_source.stg_facebook_ads__account_history[account_id]
    • Integration used as the join key with the report table
    • Direct directly copied to the output
    • Output Columns:
      • account_id: directly copied
74. model.facebook_ads.facebook_ads__ad_set_report
  • Input Column: 79. model.facebook_ads_source.stg_facebook_ads__account_history[account_id]
    • Integration used as the key to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • account_id: directly copied
75. model.facebook_ads.facebook_ads__campaign_report
  • Input Column: 79. model.facebook_ads_source.stg_facebook_ads__account_history[account_id]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as a key to join tables
    • Output Columns:
      • account_id: Directly copied
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 79. model.facebook_ads_source.stg_facebook_ads__account_history[account_id]
    • Integration Used as part of the join condition with the report table
    • Direct Directly copied to the output
    • Output Columns:
      • account_id: Directly copied
Column Lineage
%3 80. model.facebook_ads_source.stg_facebook_ads__account_history_tmp 80. model.facebook_ads_source.stg_facebook_ads__account_history_tmp name 79. model.facebook_ads_source.stg_facebook_ads__account_history 79. model.facebook_ads_source.stg_facebook_ads__account_history account_name 80. model.facebook_ads_source.stg_facebook_ads__account_history_tmp:f0->79. model.facebook_ads_source.stg_facebook_ads__account_history:f0 74. model.facebook_ads.facebook_ads__ad_set_report 74. model.facebook_ads.facebook_ads__ad_set_report account_name 79. model.facebook_ads_source.stg_facebook_ads__account_history:f0->74. model.facebook_ads.facebook_ads__ad_set_report:f0 72. model.facebook_ads.facebook_ads__account_report 72. model.facebook_ads.facebook_ads__account_report account_name 79. model.facebook_ads_source.stg_facebook_ads__account_history:f0->72. model.facebook_ads.facebook_ads__account_report:f0 75. model.facebook_ads.facebook_ads__campaign_report 75. model.facebook_ads.facebook_ads__campaign_report account_name 79. model.facebook_ads_source.stg_facebook_ads__account_history:f0->75. model.facebook_ads.facebook_ads__campaign_report:f0 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report account_name 79. model.facebook_ads_source.stg_facebook_ads__account_history:f0->76. model.facebook_ads.facebook_ads__url_report:f0 73. model.facebook_ads.facebook_ads__ad_report 73. model.facebook_ads.facebook_ads__ad_report account_name 79. model.facebook_ads_source.stg_facebook_ads__account_history:f0->73. model.facebook_ads.facebook_ads__ad_report:f0
79. model.facebook_ads_source.stg_facebook_ads__account_history
  • Input Column: 80. model.facebook_ads_source.stg_facebook_ads__account_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • account_name: Directly mapped
72. model.facebook_ads.facebook_ads__account_report
  • Input Column: 79. model.facebook_ads_source.stg_facebook_ads__account_history[account_name]
    • Direct The column is directly copied without any transformation
    • Aggregation The column is part of the GROUP BY clause
    • Output Columns:
      • account_name: Directly copied to output
73. model.facebook_ads.facebook_ads__ad_report
  • Input Column: 79. model.facebook_ads_source.stg_facebook_ads__account_history[account_name]
    • Direct directly copied to the output
    • Output Columns:
      • account_name: directly copied
74. model.facebook_ads.facebook_ads__ad_set_report
  • Input Column: 79. model.facebook_ads_source.stg_facebook_ads__account_history[account_name]
    • Direct directly copied to the output
    • Output Columns:
      • account_name: directly copied
75. model.facebook_ads.facebook_ads__campaign_report
  • Input Column: 79. model.facebook_ads_source.stg_facebook_ads__account_history[account_name]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • account_name: Directly copied
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 79. model.facebook_ads_source.stg_facebook_ads__account_history[account_name]
    • Direct Directly copied to the output
    • Output Columns:
      • account_name: Directly copied
Column Lineage
%3 80. model.facebook_ads_source.stg_facebook_ads__account_history_tmp 80. model.facebook_ads_source.stg_facebook_ads__account_history_tmp _fivetran_synced 79. model.facebook_ads_source.stg_facebook_ads__account_history 79. model.facebook_ads_source.stg_facebook_ads__account_history _fivetran_synced 80. model.facebook_ads_source.stg_facebook_ads__account_history_tmp:f0->79. model.facebook_ads_source.stg_facebook_ads__account_history:f0
79. model.facebook_ads_source.stg_facebook_ads__account_history
  • Input Column: 80. model.facebook_ads_source.stg_facebook_ads__account_history_tmp[_fivetran_synced]
    • Direct The column is directly copied without transformation
    • Deduplication Used in the ROW_NUMBER() function to order records and identify the most recent
    • Output Columns:
      • _fivetran_synced: Directly mapped
81. model.facebook_ads_source.stg_facebook_ads__ad_history

This SQL query performs several operations on the Facebook Ads data. It starts by selecting all columns from a temporary staging table, then defines a set of fields with specific data types. The final select statement casts various ID fields to BIGINT, renames some columns, and adds an 'is_most_recent_record' flag. This flag is determined using a ROW_NUMBER() function, which helps in identifying the most recent record for each unique ad (or source relation if id is null).

CleaningDeduplicationOther
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_facebook_ads_source.stg_facebook_ads__ad_history_tmp
), fields AS (
  SELECT
    CAST(NULL AS TIMESTAMP) AS updated_time,
    CAST(NULL AS INT) AS id,
    CAST(NULL AS TEXT) AS name,
    CAST(NULL AS INT) AS account_id,
    CAST(NULL AS INT) AS ad_set_id,
    CAST(NULL AS INT) AS campaign_id,
    CAST(NULL AS INT) AS creative_id,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    updated_time AS updated_at,
    CAST(id AS BIGINT) AS ad_id,
    name AS ad_name,
    CAST(account_id AS BIGINT) AS account_id,
    CAST(ad_set_id AS BIGINT) AS ad_set_id,
    CAST(campaign_id AS BIGINT) AS campaign_id,
    CAST(creative_id AS BIGINT) AS creative_id,
    CASE
      WHEN id IS NULL AND updated_time IS NULL
      THEN ROW_NUMBER() OVER (PARTITION BY source_relation ORDER BY source_relation)
      ELSE ROW_NUMBER() OVER (PARTITION BY source_relation, id ORDER BY updated_time DESC)
    END = 1 AS is_most_recent_record
  FROM fields
)
SELECT
  *
FROM final
%3 81. model.facebook_ads_source.stg_facebook_ads__ad_history 81. model.facebook_ads_source.stg_facebook_ads__ad_history source_relation ad_id account_id ad_set_id campaign_id creative_id ad_name is_most_recent_record updated_at 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp id account_id ad_set_id campaign_id creative_id name updated_time 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp:f0->81. model.facebook_ads_source.stg_facebook_ads__ad_history:f1 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp:f1->81. model.facebook_ads_source.stg_facebook_ads__ad_history:f2 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp:f2->81. model.facebook_ads_source.stg_facebook_ads__ad_history:f3 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp:f3->81. model.facebook_ads_source.stg_facebook_ads__ad_history:f4 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp:f4->81. model.facebook_ads_source.stg_facebook_ads__ad_history:f5 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp:f5->81. model.facebook_ads_source.stg_facebook_ads__ad_history:f6 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp:f6->81. model.facebook_ads_source.stg_facebook_ads__ad_history:f8
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
ad_id bigint The ID of this ad.
account_id bigint The ID of the ad account that this ad belongs to.
ad_set_id bigint ID of the ad set that contains the ad.
campaign_id bigint Ad campaign that contains this ad.
creative_id bigint The ID of the ad creative to be used by this ad.
ad_name text Name of the ad.
is_most_recent_record boolean Boolean representing whether a record is the most recent version of that record. All records should have this value set to True given we filter on it.
updated_at timestamp without time zone The timestamp of the last update of a record.
Column Lineage
%3 81. model.facebook_ads_source.stg_facebook_ads__ad_history 81. model.facebook_ads_source.stg_facebook_ads__ad_history source_relation 74. model.facebook_ads.facebook_ads__ad_set_report 74. model.facebook_ads.facebook_ads__ad_set_report source_relation 81. model.facebook_ads_source.stg_facebook_ads__ad_history:f0->74. model.facebook_ads.facebook_ads__ad_set_report:f0 75. model.facebook_ads.facebook_ads__campaign_report 75. model.facebook_ads.facebook_ads__campaign_report source_relation 81. model.facebook_ads_source.stg_facebook_ads__ad_history:f0->75. model.facebook_ads.facebook_ads__campaign_report:f0 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report source_relation 81. model.facebook_ads_source.stg_facebook_ads__ad_history:f0->76. model.facebook_ads.facebook_ads__url_report:f0 73. model.facebook_ads.facebook_ads__ad_report 73. model.facebook_ads.facebook_ads__ad_report source_relation 81. model.facebook_ads_source.stg_facebook_ads__ad_history:f0->73. model.facebook_ads.facebook_ads__ad_report:f0
73. model.facebook_ads.facebook_ads__ad_report
  • Input Column: 81. model.facebook_ads_source.stg_facebook_ads__ad_history[source_relation]
    • Integration used as a key to join with other tables
    • Direct copied directly to the output
    • Output Columns:
      • source_relation: directly copied
74. model.facebook_ads.facebook_ads__ad_set_report
  • Input Column: 81. model.facebook_ads_source.stg_facebook_ads__ad_history[source_relation]
    • Integration used as a key to join with other tables
    • Output Columns:
      • source_relation: directly copied to output
75. model.facebook_ads.facebook_ads__campaign_report
  • Input Column: 81. model.facebook_ads_source.stg_facebook_ads__ad_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct copied directly to the output
    • Output Columns:
      • source_relation: directly copied
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 81. model.facebook_ads_source.stg_facebook_ads__ad_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct copied directly to the output
    • Output Columns:
      • source_relation: directly copied
Column Lineage
%3 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp id 81. model.facebook_ads_source.stg_facebook_ads__ad_history 81. model.facebook_ads_source.stg_facebook_ads__ad_history ad_id 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp:f0->81. model.facebook_ads_source.stg_facebook_ads__ad_history:f0 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report ad_id 81. model.facebook_ads_source.stg_facebook_ads__ad_history:f0->76. model.facebook_ads.facebook_ads__url_report:f0 73. model.facebook_ads.facebook_ads__ad_report 73. model.facebook_ads.facebook_ads__ad_report ad_id 81. model.facebook_ads_source.stg_facebook_ads__ad_history:f0->73. model.facebook_ads.facebook_ads__ad_report:f0
81. model.facebook_ads_source.stg_facebook_ads__ad_history
  • Input Column: 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp[id]
    • Cleaning The column is cast to BIGINT
    • Deduplication Used in ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • ad_id: Directly mapped after casting to BIGINT
73. model.facebook_ads.facebook_ads__ad_report
  • Input Column: 81. model.facebook_ads_source.stg_facebook_ads__ad_history[ad_id]
    • Integration used as a key to join with the report table
    • Direct copied directly to the output
    • Output Columns:
      • ad_id: directly copied
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 81. model.facebook_ads_source.stg_facebook_ads__ad_history[ad_id]
    • Integration used as the key to join with the report table
    • Direct copied directly to the output
    • Output Columns:
      • ad_id: directly copied
Column Lineage
%3 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp account_id 81. model.facebook_ads_source.stg_facebook_ads__ad_history 81. model.facebook_ads_source.stg_facebook_ads__ad_history account_id 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp:f0->81. model.facebook_ads_source.stg_facebook_ads__ad_history:f0
81. model.facebook_ads_source.stg_facebook_ads__ad_history
  • Input Column: 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp[account_id]
    • Cleaning The column is cast to BIGINT
    • Output Columns:
      • account_id: Directly mapped after casting to BIGINT
Column Lineage
%3 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp ad_set_id 81. model.facebook_ads_source.stg_facebook_ads__ad_history 81. model.facebook_ads_source.stg_facebook_ads__ad_history ad_set_id 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp:f0->81. model.facebook_ads_source.stg_facebook_ads__ad_history:f0
81. model.facebook_ads_source.stg_facebook_ads__ad_history
  • Input Column: 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp[ad_set_id]
    • Cleaning The column is cast to BIGINT
    • Output Columns:
      • ad_set_id: Directly mapped after casting to BIGINT
Column Lineage
%3 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp campaign_id 81. model.facebook_ads_source.stg_facebook_ads__ad_history 81. model.facebook_ads_source.stg_facebook_ads__ad_history campaign_id 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp:f0->81. model.facebook_ads_source.stg_facebook_ads__ad_history:f0
81. model.facebook_ads_source.stg_facebook_ads__ad_history
  • Input Column: 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp[campaign_id]
    • Cleaning The column is cast to BIGINT
    • Output Columns:
      • campaign_id: Directly mapped after casting to BIGINT
Column Lineage
%3 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp creative_id 81. model.facebook_ads_source.stg_facebook_ads__ad_history 81. model.facebook_ads_source.stg_facebook_ads__ad_history creative_id 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp:f0->81. model.facebook_ads_source.stg_facebook_ads__ad_history:f0
81. model.facebook_ads_source.stg_facebook_ads__ad_history
  • Input Column: 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp[creative_id]
    • Cleaning The column is cast to BIGINT
    • Output Columns:
      • creative_id: Directly mapped after casting to BIGINT
Column Lineage
%3 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp name 81. model.facebook_ads_source.stg_facebook_ads__ad_history 81. model.facebook_ads_source.stg_facebook_ads__ad_history ad_name 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp:f0->81. model.facebook_ads_source.stg_facebook_ads__ad_history:f0 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report ad_name 81. model.facebook_ads_source.stg_facebook_ads__ad_history:f0->76. model.facebook_ads.facebook_ads__url_report:f0 73. model.facebook_ads.facebook_ads__ad_report 73. model.facebook_ads.facebook_ads__ad_report ad_name 81. model.facebook_ads_source.stg_facebook_ads__ad_history:f0->73. model.facebook_ads.facebook_ads__ad_report:f0
81. model.facebook_ads_source.stg_facebook_ads__ad_history
  • Input Column: 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • ad_name: Directly mapped
73. model.facebook_ads.facebook_ads__ad_report
  • Input Column: 81. model.facebook_ads_source.stg_facebook_ads__ad_history[ad_name]
    • Direct copied directly to the output
    • Output Columns:
      • ad_name: directly copied
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 81. model.facebook_ads_source.stg_facebook_ads__ad_history[ad_name]
    • Direct copied directly to the output
    • Output Columns:
      • ad_name: directly copied
Column Lineage
%3 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp updated_time 81. model.facebook_ads_source.stg_facebook_ads__ad_history 81. model.facebook_ads_source.stg_facebook_ads__ad_history updated_at 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp:f0->81. model.facebook_ads_source.stg_facebook_ads__ad_history:f0
81. model.facebook_ads_source.stg_facebook_ads__ad_history
  • Input Column: 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp[updated_time]
    • Deduplication Used in ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • updated_at: Directly mapped
82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of type TEXT, containing NULL values. The LIMIT 0 clause ensures no rows are returned. This query is likely used as a placeholder or template for generating a schema without actual data.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp id account_id ad_set_id campaign_id creative_id name _fivetran_synced updated_time 301. source.facebook_ads_source.facebook_ads.ad_history 301. source.facebook_ads_source.facebook_ads.ad_history
Name Type Comment
id bigint None
account_id bigint None
ad_set_id bigint None
campaign_id bigint None
creative_id bigint None
name text None
_fivetran_synced timestamp without time zone None
updated_time timestamp without time zone None
Column Lineage
%3 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp id 81. model.facebook_ads_source.stg_facebook_ads__ad_history 81. model.facebook_ads_source.stg_facebook_ads__ad_history ad_id 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp:f0->81. model.facebook_ads_source.stg_facebook_ads__ad_history:f0 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report ad_id 81. model.facebook_ads_source.stg_facebook_ads__ad_history:f0->76. model.facebook_ads.facebook_ads__url_report:f0 73. model.facebook_ads.facebook_ads__ad_report 73. model.facebook_ads.facebook_ads__ad_report ad_id 81. model.facebook_ads_source.stg_facebook_ads__ad_history:f0->73. model.facebook_ads.facebook_ads__ad_report:f0
81. model.facebook_ads_source.stg_facebook_ads__ad_history
  • Input Column: 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp[id]
    • Cleaning The column is cast to BIGINT
    • Deduplication Used in ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • ad_id: Directly mapped after casting to BIGINT
73. model.facebook_ads.facebook_ads__ad_report
  • Input Column: 81. model.facebook_ads_source.stg_facebook_ads__ad_history[ad_id]
    • Integration used as a key to join with the report table
    • Direct copied directly to the output
    • Output Columns:
      • ad_id: directly copied
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 81. model.facebook_ads_source.stg_facebook_ads__ad_history[ad_id]
    • Integration used as the key to join with the report table
    • Direct copied directly to the output
    • Output Columns:
      • ad_id: directly copied
Column Lineage
%3 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp account_id 81. model.facebook_ads_source.stg_facebook_ads__ad_history 81. model.facebook_ads_source.stg_facebook_ads__ad_history account_id 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp:f0->81. model.facebook_ads_source.stg_facebook_ads__ad_history:f0
81. model.facebook_ads_source.stg_facebook_ads__ad_history
  • Input Column: 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp[account_id]
    • Cleaning The column is cast to BIGINT
    • Output Columns:
      • account_id: Directly mapped after casting to BIGINT
Column Lineage
%3 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp ad_set_id 81. model.facebook_ads_source.stg_facebook_ads__ad_history 81. model.facebook_ads_source.stg_facebook_ads__ad_history ad_set_id 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp:f0->81. model.facebook_ads_source.stg_facebook_ads__ad_history:f0
81. model.facebook_ads_source.stg_facebook_ads__ad_history
  • Input Column: 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp[ad_set_id]
    • Cleaning The column is cast to BIGINT
    • Output Columns:
      • ad_set_id: Directly mapped after casting to BIGINT
Column Lineage
%3 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp campaign_id 81. model.facebook_ads_source.stg_facebook_ads__ad_history 81. model.facebook_ads_source.stg_facebook_ads__ad_history campaign_id 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp:f0->81. model.facebook_ads_source.stg_facebook_ads__ad_history:f0
81. model.facebook_ads_source.stg_facebook_ads__ad_history
  • Input Column: 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp[campaign_id]
    • Cleaning The column is cast to BIGINT
    • Output Columns:
      • campaign_id: Directly mapped after casting to BIGINT
Column Lineage
%3 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp creative_id 81. model.facebook_ads_source.stg_facebook_ads__ad_history 81. model.facebook_ads_source.stg_facebook_ads__ad_history creative_id 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp:f0->81. model.facebook_ads_source.stg_facebook_ads__ad_history:f0
81. model.facebook_ads_source.stg_facebook_ads__ad_history
  • Input Column: 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp[creative_id]
    • Cleaning The column is cast to BIGINT
    • Output Columns:
      • creative_id: Directly mapped after casting to BIGINT
Column Lineage
%3 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp name 81. model.facebook_ads_source.stg_facebook_ads__ad_history 81. model.facebook_ads_source.stg_facebook_ads__ad_history ad_name 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp:f0->81. model.facebook_ads_source.stg_facebook_ads__ad_history:f0 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report ad_name 81. model.facebook_ads_source.stg_facebook_ads__ad_history:f0->76. model.facebook_ads.facebook_ads__url_report:f0 73. model.facebook_ads.facebook_ads__ad_report 73. model.facebook_ads.facebook_ads__ad_report ad_name 81. model.facebook_ads_source.stg_facebook_ads__ad_history:f0->73. model.facebook_ads.facebook_ads__ad_report:f0
81. model.facebook_ads_source.stg_facebook_ads__ad_history
  • Input Column: 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • ad_name: Directly mapped
73. model.facebook_ads.facebook_ads__ad_report
  • Input Column: 81. model.facebook_ads_source.stg_facebook_ads__ad_history[ad_name]
    • Direct copied directly to the output
    • Output Columns:
      • ad_name: directly copied
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 81. model.facebook_ads_source.stg_facebook_ads__ad_history[ad_name]
    • Direct copied directly to the output
    • Output Columns:
      • ad_name: directly copied
Column Lineage
%3 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp updated_time 81. model.facebook_ads_source.stg_facebook_ads__ad_history 81. model.facebook_ads_source.stg_facebook_ads__ad_history updated_at 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp:f0->81. model.facebook_ads_source.stg_facebook_ads__ad_history:f0
81. model.facebook_ads_source.stg_facebook_ads__ad_history
  • Input Column: 82. model.facebook_ads_source.stg_facebook_ads__ad_history_tmp[updated_time]
    • Deduplication Used in ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • updated_at: Directly mapped
83. model.facebook_ads_source.stg_facebook_ads__ad_set_history

This SQL query performs several transformations on data from a Facebook Ads source table. It casts various fields to specific data types, renames some columns, and adds a flag to identify the most recent record for each ad set. The query also includes logic to handle cases where 'id' and 'updated_time' might be null.

CleaningDeduplicationOther
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_facebook_ads_source.stg_facebook_ads__ad_set_history_tmp
), fields AS (
  SELECT
    CAST(NULL AS TIMESTAMP) AS updated_time,
    CAST(NULL AS INT) AS id,
    CAST(NULL AS TEXT) AS name,
    CAST(NULL AS INT) AS account_id,
    CAST(NULL AS INT) AS campaign_id,
    CAST(NULL AS TIMESTAMP) AS start_time,
    CAST(NULL AS TIMESTAMP) AS end_time,
    CAST(NULL AS TEXT) AS bid_strategy,
    CAST(NULL AS INT) AS daily_budget,
    CAST(NULL AS INT) AS budget_remaining,
    CAST(NULL AS TEXT) AS status,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    updated_time AS updated_at,
    CAST(id AS BIGINT) AS ad_set_id,
    name AS ad_set_name,
    CAST(account_id AS BIGINT) AS account_id,
    CAST(campaign_id AS BIGINT) AS campaign_id,
    start_time AS start_at,
    end_time AS end_at,
    bid_strategy,
    daily_budget,
    budget_remaining,
    status,
    CASE
      WHEN id IS NULL AND updated_time IS NULL
      THEN ROW_NUMBER() OVER (PARTITION BY source_relation ORDER BY source_relation)
      ELSE ROW_NUMBER() OVER (PARTITION BY source_relation, id ORDER BY updated_time DESC)
    END = 1 AS is_most_recent_record
  FROM fields
)
SELECT
  *
FROM final
%3 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history source_relation ad_set_id account_id campaign_id ad_set_name is_most_recent_record updated_at start_at end_at bid_strategy daily_budget budget_remaining status 84. model.facebook_ads_source.stg_facebook_ads__ad_set_history_tmp 84. model.facebook_ads_source.stg_facebook_ads__ad_set_history_tmp id account_id campaign_id name updated_time 84. model.facebook_ads_source.stg_facebook_ads__ad_set_history_tmp:f0->83. model.facebook_ads_source.stg_facebook_ads__ad_set_history:f1 84. model.facebook_ads_source.stg_facebook_ads__ad_set_history_tmp:f1->83. model.facebook_ads_source.stg_facebook_ads__ad_set_history:f2 84. model.facebook_ads_source.stg_facebook_ads__ad_set_history_tmp:f2->83. model.facebook_ads_source.stg_facebook_ads__ad_set_history:f3 84. model.facebook_ads_source.stg_facebook_ads__ad_set_history_tmp:f3->83. model.facebook_ads_source.stg_facebook_ads__ad_set_history:f4 84. model.facebook_ads_source.stg_facebook_ads__ad_set_history_tmp:f4->83. model.facebook_ads_source.stg_facebook_ads__ad_set_history:f6
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
ad_set_id bigint The ID of the ad set.
account_id bigint The ID of the ad account that this ad set belongs to.
campaign_id bigint Ad campaign that contains this ad set.
ad_set_name text The name of the ad set.
is_most_recent_record boolean Boolean representing whether a record is the most recent version of that record. All records should have this value set to True given we filter on it.
updated_at timestamp without time zone The timestamp of the last update of a record.
start_at timestamp without time zone Timestamp of designated ad set start time.
end_at timestamp without time zone Timestamp of designated ad set end time.
bid_strategy text Bid strategy values are - 'LOWEST_COST_WITHOUT_CAP', 'LOWEST_COST_WITH_BID_CAP', 'COST_CAP', 'LOWEST_COST_WITH_MIN_ROAS'.
daily_budget integer Daily budget of ad set.
budget_remaining integer Remaining budget of ad set.
status text Status values are - 'ACTIVE', 'PAUSED', 'DELETED', 'ARCHIVED'.
Column Lineage
%3 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history source_relation 74. model.facebook_ads.facebook_ads__ad_set_report 74. model.facebook_ads.facebook_ads__ad_set_report source_relation 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history:f0->74. model.facebook_ads.facebook_ads__ad_set_report:f0 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report source_relation 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history:f0->76. model.facebook_ads.facebook_ads__url_report:f0 73. model.facebook_ads.facebook_ads__ad_report 73. model.facebook_ads.facebook_ads__ad_report source_relation 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history:f0->73. model.facebook_ads.facebook_ads__ad_report:f0
73. model.facebook_ads.facebook_ads__ad_report
  • Input Column: 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
74. model.facebook_ads.facebook_ads__ad_set_report
  • Input Column: 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
Column Lineage
%3 84. model.facebook_ads_source.stg_facebook_ads__ad_set_history_tmp 84. model.facebook_ads_source.stg_facebook_ads__ad_set_history_tmp id 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history ad_set_id 84. model.facebook_ads_source.stg_facebook_ads__ad_set_history_tmp:f0->83. model.facebook_ads_source.stg_facebook_ads__ad_set_history:f0 74. model.facebook_ads.facebook_ads__ad_set_report 74. model.facebook_ads.facebook_ads__ad_set_report ad_set_id 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history:f0->74. model.facebook_ads.facebook_ads__ad_set_report:f0 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report ad_set_id 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history:f0->76. model.facebook_ads.facebook_ads__url_report:f0 73. model.facebook_ads.facebook_ads__ad_report 73. model.facebook_ads.facebook_ads__ad_report ad_set_id 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history:f0->73. model.facebook_ads.facebook_ads__ad_report:f0
83. model.facebook_ads_source.stg_facebook_ads__ad_set_history
  • Input Column: 84. model.facebook_ads_source.stg_facebook_ads__ad_set_history_tmp[id]
    • Cleaning The column is cast to BIGINT
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • ad_set_id: Directly mapped after casting to BIGINT
73. model.facebook_ads.facebook_ads__ad_report
  • Input Column: 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history[ad_set_id]
    • Integration used as part of the join condition with the ads table
    • Direct directly copied to the output
    • Output Columns:
      • ad_set_id: directly copied
74. model.facebook_ads.facebook_ads__ad_set_report
  • Input Column: 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history[ad_set_id]
    • Integration used as the key to join with the ads table
    • Direct directly copied to the output
    • Output Columns:
      • ad_set_id: directly copied
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history[ad_set_id]
    • Integration used as the key to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • ad_set_id: directly copied
Column Lineage
%3 84. model.facebook_ads_source.stg_facebook_ads__ad_set_history_tmp 84. model.facebook_ads_source.stg_facebook_ads__ad_set_history_tmp account_id 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history account_id 84. model.facebook_ads_source.stg_facebook_ads__ad_set_history_tmp:f0->83. model.facebook_ads_source.stg_facebook_ads__ad_set_history:f0
83. model.facebook_ads_source.stg_facebook_ads__ad_set_history
  • Input Column: 84. model.facebook_ads_source.stg_facebook_ads__ad_set_history_tmp[account_id]
    • Cleaning The column is cast to BIGINT
    • Output Columns:
      • account_id: Directly mapped after casting to BIGINT
Column Lineage
%3 84. model.facebook_ads_source.stg_facebook_ads__ad_set_history_tmp 84. model.facebook_ads_source.stg_facebook_ads__ad_set_history_tmp campaign_id 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history campaign_id 84. model.facebook_ads_source.stg_facebook_ads__ad_set_history_tmp:f0->83. model.facebook_ads_source.stg_facebook_ads__ad_set_history:f0
83. model.facebook_ads_source.stg_facebook_ads__ad_set_history
  • Input Column: 84. model.facebook_ads_source.stg_facebook_ads__ad_set_history_tmp[campaign_id]
    • Cleaning The column is cast to BIGINT
    • Output Columns:
      • campaign_id: Directly mapped after casting to BIGINT
Column Lineage
%3 84. model.facebook_ads_source.stg_facebook_ads__ad_set_history_tmp 84. model.facebook_ads_source.stg_facebook_ads__ad_set_history_tmp name 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history ad_set_name 84. model.facebook_ads_source.stg_facebook_ads__ad_set_history_tmp:f0->83. model.facebook_ads_source.stg_facebook_ads__ad_set_history:f0 74. model.facebook_ads.facebook_ads__ad_set_report 74. model.facebook_ads.facebook_ads__ad_set_report ad_set_name 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history:f0->74. model.facebook_ads.facebook_ads__ad_set_report:f0 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report ad_set_name 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history:f0->76. model.facebook_ads.facebook_ads__url_report:f0 73. model.facebook_ads.facebook_ads__ad_report 73. model.facebook_ads.facebook_ads__ad_report ad_set_name 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history:f0->73. model.facebook_ads.facebook_ads__ad_report:f0
83. model.facebook_ads_source.stg_facebook_ads__ad_set_history
  • Input Column: 84. model.facebook_ads_source.stg_facebook_ads__ad_set_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • ad_set_name: Directly mapped
73. model.facebook_ads.facebook_ads__ad_report
  • Input Column: 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history[ad_set_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_set_name: directly copied
74. model.facebook_ads.facebook_ads__ad_set_report
  • Input Column: 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history[ad_set_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_set_name: directly copied
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history[ad_set_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_set_name: directly copied
Column Lineage
%3 84. model.facebook_ads_source.stg_facebook_ads__ad_set_history_tmp 84. model.facebook_ads_source.stg_facebook_ads__ad_set_history_tmp updated_time 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history updated_at 84. model.facebook_ads_source.stg_facebook_ads__ad_set_history_tmp:f0->83. model.facebook_ads_source.stg_facebook_ads__ad_set_history:f0
83. model.facebook_ads_source.stg_facebook_ads__ad_set_history
  • Input Column: 84. model.facebook_ads_source.stg_facebook_ads__ad_set_history_tmp[updated_time]
    • Cleaning Cast to TIMESTAMP
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • updated_at: Directly mapped after casting to TIMESTAMP
Column Lineage
%3 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history start_at 74. model.facebook_ads.facebook_ads__ad_set_report 74. model.facebook_ads.facebook_ads__ad_set_report start_at 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history:f0->74. model.facebook_ads.facebook_ads__ad_set_report:f0
74. model.facebook_ads.facebook_ads__ad_set_report
  • Input Column: 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history[start_at]
    • Direct directly copied to the output
    • Output Columns:
      • start_at: directly copied
Column Lineage
%3 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history end_at 74. model.facebook_ads.facebook_ads__ad_set_report 74. model.facebook_ads.facebook_ads__ad_set_report end_at 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history:f0->74. model.facebook_ads.facebook_ads__ad_set_report:f0
74. model.facebook_ads.facebook_ads__ad_set_report
  • Input Column: 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history[end_at]
    • Direct directly copied to the output
    • Output Columns:
      • end_at: directly copied
Column Lineage
%3 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history bid_strategy 74. model.facebook_ads.facebook_ads__ad_set_report 74. model.facebook_ads.facebook_ads__ad_set_report bid_strategy 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history:f0->74. model.facebook_ads.facebook_ads__ad_set_report:f0
74. model.facebook_ads.facebook_ads__ad_set_report
  • Input Column: 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history[bid_strategy]
    • Direct directly copied to the output
    • Output Columns:
      • bid_strategy: directly copied
Column Lineage
%3 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history daily_budget 74. model.facebook_ads.facebook_ads__ad_set_report 74. model.facebook_ads.facebook_ads__ad_set_report daily_budget 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history:f0->74. model.facebook_ads.facebook_ads__ad_set_report:f0
74. model.facebook_ads.facebook_ads__ad_set_report
  • Input Column: 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history[daily_budget]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • daily_budget: Directly copied to the output
Column Lineage
%3 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history budget_remaining 74. model.facebook_ads.facebook_ads__ad_set_report 74. model.facebook_ads.facebook_ads__ad_set_report budget_remaining 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history:f0->74. model.facebook_ads.facebook_ads__ad_set_report:f0
74. model.facebook_ads.facebook_ads__ad_set_report
  • Input Column: 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history[budget_remaining]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • budget_remaining: Directly copied to the output
84. model.facebook_ads_source.stg_facebook_ads__ad_set_history_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of type TEXT, which is set to NULL. The query is limited to 0 rows, effectively returning no data. This type of query is often used as a placeholder or template in data modeling tools like dbt (data build tool) to define the structure of a staging table without actually populating it with data.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 84. model.facebook_ads_source.stg_facebook_ads__ad_set_history_tmp 84. model.facebook_ads_source.stg_facebook_ads__ad_set_history_tmp id account_id campaign_id name _fivetran_synced updated_time 302. source.facebook_ads_source.facebook_ads.ad_set_history 302. source.facebook_ads_source.facebook_ads.ad_set_history
Name Type Comment
id bigint None
account_id bigint None
campaign_id bigint None
name text None
_fivetran_synced timestamp without time zone None
updated_time timestamp without time zone None
Column Lineage
%3 84. model.facebook_ads_source.stg_facebook_ads__ad_set_history_tmp 84. model.facebook_ads_source.stg_facebook_ads__ad_set_history_tmp id 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history ad_set_id 84. model.facebook_ads_source.stg_facebook_ads__ad_set_history_tmp:f0->83. model.facebook_ads_source.stg_facebook_ads__ad_set_history:f0 74. model.facebook_ads.facebook_ads__ad_set_report 74. model.facebook_ads.facebook_ads__ad_set_report ad_set_id 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history:f0->74. model.facebook_ads.facebook_ads__ad_set_report:f0 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report ad_set_id 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history:f0->76. model.facebook_ads.facebook_ads__url_report:f0 73. model.facebook_ads.facebook_ads__ad_report 73. model.facebook_ads.facebook_ads__ad_report ad_set_id 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history:f0->73. model.facebook_ads.facebook_ads__ad_report:f0
83. model.facebook_ads_source.stg_facebook_ads__ad_set_history
  • Input Column: 84. model.facebook_ads_source.stg_facebook_ads__ad_set_history_tmp[id]
    • Cleaning The column is cast to BIGINT
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • ad_set_id: Directly mapped after casting to BIGINT
73. model.facebook_ads.facebook_ads__ad_report
  • Input Column: 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history[ad_set_id]
    • Integration used as part of the join condition with the ads table
    • Direct directly copied to the output
    • Output Columns:
      • ad_set_id: directly copied
74. model.facebook_ads.facebook_ads__ad_set_report
  • Input Column: 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history[ad_set_id]
    • Integration used as the key to join with the ads table
    • Direct directly copied to the output
    • Output Columns:
      • ad_set_id: directly copied
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history[ad_set_id]
    • Integration used as the key to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • ad_set_id: directly copied
Column Lineage
%3 84. model.facebook_ads_source.stg_facebook_ads__ad_set_history_tmp 84. model.facebook_ads_source.stg_facebook_ads__ad_set_history_tmp account_id 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history account_id 84. model.facebook_ads_source.stg_facebook_ads__ad_set_history_tmp:f0->83. model.facebook_ads_source.stg_facebook_ads__ad_set_history:f0
83. model.facebook_ads_source.stg_facebook_ads__ad_set_history
  • Input Column: 84. model.facebook_ads_source.stg_facebook_ads__ad_set_history_tmp[account_id]
    • Cleaning The column is cast to BIGINT
    • Output Columns:
      • account_id: Directly mapped after casting to BIGINT
Column Lineage
%3 84. model.facebook_ads_source.stg_facebook_ads__ad_set_history_tmp 84. model.facebook_ads_source.stg_facebook_ads__ad_set_history_tmp campaign_id 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history campaign_id 84. model.facebook_ads_source.stg_facebook_ads__ad_set_history_tmp:f0->83. model.facebook_ads_source.stg_facebook_ads__ad_set_history:f0
83. model.facebook_ads_source.stg_facebook_ads__ad_set_history
  • Input Column: 84. model.facebook_ads_source.stg_facebook_ads__ad_set_history_tmp[campaign_id]
    • Cleaning The column is cast to BIGINT
    • Output Columns:
      • campaign_id: Directly mapped after casting to BIGINT
Column Lineage
%3 84. model.facebook_ads_source.stg_facebook_ads__ad_set_history_tmp 84. model.facebook_ads_source.stg_facebook_ads__ad_set_history_tmp name 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history ad_set_name 84. model.facebook_ads_source.stg_facebook_ads__ad_set_history_tmp:f0->83. model.facebook_ads_source.stg_facebook_ads__ad_set_history:f0 74. model.facebook_ads.facebook_ads__ad_set_report 74. model.facebook_ads.facebook_ads__ad_set_report ad_set_name 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history:f0->74. model.facebook_ads.facebook_ads__ad_set_report:f0 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report ad_set_name 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history:f0->76. model.facebook_ads.facebook_ads__url_report:f0 73. model.facebook_ads.facebook_ads__ad_report 73. model.facebook_ads.facebook_ads__ad_report ad_set_name 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history:f0->73. model.facebook_ads.facebook_ads__ad_report:f0
83. model.facebook_ads_source.stg_facebook_ads__ad_set_history
  • Input Column: 84. model.facebook_ads_source.stg_facebook_ads__ad_set_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • ad_set_name: Directly mapped
73. model.facebook_ads.facebook_ads__ad_report
  • Input Column: 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history[ad_set_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_set_name: directly copied
74. model.facebook_ads.facebook_ads__ad_set_report
  • Input Column: 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history[ad_set_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_set_name: directly copied
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history[ad_set_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_set_name: directly copied
Column Lineage
%3 84. model.facebook_ads_source.stg_facebook_ads__ad_set_history_tmp 84. model.facebook_ads_source.stg_facebook_ads__ad_set_history_tmp updated_time 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history 83. model.facebook_ads_source.stg_facebook_ads__ad_set_history updated_at 84. model.facebook_ads_source.stg_facebook_ads__ad_set_history_tmp:f0->83. model.facebook_ads_source.stg_facebook_ads__ad_set_history:f0
83. model.facebook_ads_source.stg_facebook_ads__ad_set_history
  • Input Column: 84. model.facebook_ads_source.stg_facebook_ads__ad_set_history_tmp[updated_time]
    • Cleaning Cast to TIMESTAMP
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • updated_at: Directly mapped after casting to TIMESTAMP
85. model.facebook_ads_source.stg_facebook_ads__basic_ad

This SQL query performs data type casting and column renaming on a Facebook ads dataset. It starts by selecting all columns from a temporary staging table, then defines a set of fields with specific data types. Finally, it casts some columns to different data types, renames a few columns, and applies a COALESCE function to handle potential NULL values in the 'clicks' column.

CleaningOther
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_facebook_ads_source.stg_facebook_ads__basic_ad_tmp
), fields AS (
  SELECT
    CAST(NULL AS TEXT) AS ad_id,
    CAST(NULL AS TEXT) AS ad_name,
    CAST(NULL AS TEXT) AS adset_name,
    CAST(NULL AS DATE) AS date,
    CAST(NULL AS INT) AS account_id,
    CAST(NULL AS INT) AS impressions,
    CAST(NULL AS INT) AS inline_link_clicks,
    CAST(NULL AS FLOAT) AS spend,
    CAST(NULL AS INT) AS reach,
    CAST(NULL AS FLOAT) AS frequency,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    CAST(ad_id AS BIGINT) AS ad_id,
    ad_name,
    adset_name AS ad_set_name,
    date AS date_day,
    CAST(account_id AS BIGINT) AS account_id,
    impressions,
    COALESCE(inline_link_clicks, 0) AS clicks,
    spend,
    reach,
    frequency
  FROM fields
)
SELECT
  *
FROM final
%3 85. model.facebook_ads_source.stg_facebook_ads__basic_ad 85. model.facebook_ads_source.stg_facebook_ads__basic_ad source_relation ad_id ad_name ad_set_name date_day account_id impressions clicks spend reach frequency 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp ad_id date account_id impressions inline_link_clicks spend 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp:f0->85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f1 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp:f1->85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f4 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp:f2->85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f5 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp:f3->85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f6 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp:f4->85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f7 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp:f5->85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f8
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
ad_id bigint The ID of the ad the report relates to.
ad_name text Name of the ad the report relates to.
ad_set_name text Name of the ad set the report relates to.
date_day date The date of the reported performance.
account_id bigint The ID of the ad account that this ad belongs to.
impressions integer The number of impressions the ad had on the given day.
clicks integer The number of clicks the ad had on the given day.
spend double precision The spend on the ad in the given day.
reach integer The number of people who saw any content from your Page or about your Page. This metric is estimated.
frequency double precision The average number of times each person saw your ad; it is calculated as impressions divided by reach.
Column Lineage
%3 85. model.facebook_ads_source.stg_facebook_ads__basic_ad 85. model.facebook_ads_source.stg_facebook_ads__basic_ad source_relation 74. model.facebook_ads.facebook_ads__ad_set_report 74. model.facebook_ads.facebook_ads__ad_set_report source_relation 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->74. model.facebook_ads.facebook_ads__ad_set_report:f0 72. model.facebook_ads.facebook_ads__account_report 72. model.facebook_ads.facebook_ads__account_report source_relation 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->72. model.facebook_ads.facebook_ads__account_report:f0 75. model.facebook_ads.facebook_ads__campaign_report 75. model.facebook_ads.facebook_ads__campaign_report source_relation 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->75. model.facebook_ads.facebook_ads__campaign_report:f0 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report source_relation 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->76. model.facebook_ads.facebook_ads__url_report:f0 73. model.facebook_ads.facebook_ads__ad_report 73. model.facebook_ads.facebook_ads__ad_report source_relation 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->73. model.facebook_ads.facebook_ads__ad_report:f0
72. model.facebook_ads.facebook_ads__account_report
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with the accounts table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
73. model.facebook_ads.facebook_ads__ad_report
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with other tables
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
74. model.facebook_ads.facebook_ads__ad_set_report
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with other tables
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
75. model.facebook_ads.facebook_ads__campaign_report
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with other tables
    • Aggregation Part of the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join conditions with other tables
    • Output Columns:
      • source_relation: Directly copied to the output
Column Lineage
%3 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp ad_id 85. model.facebook_ads_source.stg_facebook_ads__basic_ad 85. model.facebook_ads_source.stg_facebook_ads__basic_ad ad_id 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp:f0->85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report ad_id 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->76. model.facebook_ads.facebook_ads__url_report:f0 73. model.facebook_ads.facebook_ads__ad_report 73. model.facebook_ads.facebook_ads__ad_report ad_id 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->73. model.facebook_ads.facebook_ads__ad_report:f0
85. model.facebook_ads_source.stg_facebook_ads__basic_ad
  • Input Column: 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp[ad_id]
    • Cleaning The column is cast to BIGINT data type
    • Output Columns:
      • ad_id: Directly mapped after casting
73. model.facebook_ads.facebook_ads__ad_report
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[ad_id]
    • Integration Used as a join key to connect with the ads table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • ad_id: Directly copied to the output from the joined ads table
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[ad_id]
    • Integration Used as a key to join with the ads table
    • Output Columns:
      • ad_id: Indirectly mapped through the join with ads table
Column Lineage
%3 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp date 85. model.facebook_ads_source.stg_facebook_ads__basic_ad 85. model.facebook_ads_source.stg_facebook_ads__basic_ad date_day 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp:f0->85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0 74. model.facebook_ads.facebook_ads__ad_set_report 74. model.facebook_ads.facebook_ads__ad_set_report date_day 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->74. model.facebook_ads.facebook_ads__ad_set_report:f0 72. model.facebook_ads.facebook_ads__account_report 72. model.facebook_ads.facebook_ads__account_report date_day 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->72. model.facebook_ads.facebook_ads__account_report:f0 75. model.facebook_ads.facebook_ads__campaign_report 75. model.facebook_ads.facebook_ads__campaign_report date_day 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->75. model.facebook_ads.facebook_ads__campaign_report:f0 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report date_day 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->76. model.facebook_ads.facebook_ads__url_report:f0 73. model.facebook_ads.facebook_ads__ad_report 73. model.facebook_ads.facebook_ads__ad_report date_day 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->73. model.facebook_ads.facebook_ads__ad_report:f0
85. model.facebook_ads_source.stg_facebook_ads__basic_ad
  • Input Column: 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp[date]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • date_day: Directly mapped and renamed
72. model.facebook_ads.facebook_ads__account_report
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
73. model.facebook_ads.facebook_ads__ad_report
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
74. model.facebook_ads.facebook_ads__ad_set_report
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
75. model.facebook_ads.facebook_ads__campaign_report
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Part of the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp account_id 85. model.facebook_ads_source.stg_facebook_ads__basic_ad 85. model.facebook_ads_source.stg_facebook_ads__basic_ad account_id 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp:f0->85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0 72. model.facebook_ads.facebook_ads__account_report 72. model.facebook_ads.facebook_ads__account_report account_id 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->72. model.facebook_ads.facebook_ads__account_report:f0 75. model.facebook_ads.facebook_ads__campaign_report 75. model.facebook_ads.facebook_ads__campaign_report account_id 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->75. model.facebook_ads.facebook_ads__campaign_report:f0 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report account_id 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->76. model.facebook_ads.facebook_ads__url_report:f0 73. model.facebook_ads.facebook_ads__ad_report 73. model.facebook_ads.facebook_ads__ad_report account_id 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->73. model.facebook_ads.facebook_ads__ad_report:f0
85. model.facebook_ads_source.stg_facebook_ads__basic_ad
  • Input Column: 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp[account_id]
    • Cleaning The column is cast to BIGINT data type
    • Output Columns:
      • account_id: Directly mapped after casting
72. model.facebook_ads.facebook_ads__account_report
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[account_id]
    • Integration Used as the key to join with the accounts table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • account_id: Directly copied to the output
73. model.facebook_ads.facebook_ads__ad_report
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[account_id]
    • Integration Used as a join key to connect with the accounts table
    • Output Columns:
      • account_id: Directly copied to the output from the joined accounts table
75. model.facebook_ads.facebook_ads__campaign_report
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[account_id]
    • Integration Used as a key to join with the accounts table
    • Output Columns:
      • account_id: Indirectly mapped through the join with accounts table
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[account_id]
    • Integration Used as a key to join with the accounts table
    • Output Columns:
      • account_id: Indirectly mapped through the join with accounts table
Column Lineage
%3 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp impressions 85. model.facebook_ads_source.stg_facebook_ads__basic_ad 85. model.facebook_ads_source.stg_facebook_ads__basic_ad impressions 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp:f0->85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0 74. model.facebook_ads.facebook_ads__ad_set_report 74. model.facebook_ads.facebook_ads__ad_set_report impressions 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->74. model.facebook_ads.facebook_ads__ad_set_report:f0 72. model.facebook_ads.facebook_ads__account_report 72. model.facebook_ads.facebook_ads__account_report impressions 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->72. model.facebook_ads.facebook_ads__account_report:f0 75. model.facebook_ads.facebook_ads__campaign_report 75. model.facebook_ads.facebook_ads__campaign_report impressions 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->75. model.facebook_ads.facebook_ads__campaign_report:f0 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report impressions 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->76. model.facebook_ads.facebook_ads__url_report:f0 73. model.facebook_ads.facebook_ads__ad_report 73. model.facebook_ads.facebook_ads__ad_report impressions 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->73. model.facebook_ads.facebook_ads__ad_report:f0
85. model.facebook_ads_source.stg_facebook_ads__basic_ad
  • Input Column: 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp[impressions]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • impressions: Directly mapped
72. model.facebook_ads.facebook_ads__account_report
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[impressions]
    • Aggregation Summed up in the SELECT clause
    • Output Columns:
      • impressions: Aggregated into the output column
73. model.facebook_ads.facebook_ads__ad_report
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[impressions]
    • Aggregation The column is summed up in the SELECT statement
    • Output Columns:
      • impressions: Aggregated sum in the output
74. model.facebook_ads.facebook_ads__ad_set_report
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[impressions]
    • Aggregation The column is summed up in the SELECT statement
    • Output Columns:
      • impressions: Aggregated sum in the output
75. model.facebook_ads.facebook_ads__campaign_report
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[impressions]
    • Aggregation The column is aggregated using SUM function
    • Output Columns:
      • impressions: Aggregated sum in the output
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[impressions]
    • Aggregation Summed up in the SELECT clause
    • Output Columns:
      • impressions: Aggregated sum in the output
Column Lineage
%3 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp inline_link_clicks 85. model.facebook_ads_source.stg_facebook_ads__basic_ad 85. model.facebook_ads_source.stg_facebook_ads__basic_ad clicks 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp:f0->85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0 74. model.facebook_ads.facebook_ads__ad_set_report 74. model.facebook_ads.facebook_ads__ad_set_report clicks 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->74. model.facebook_ads.facebook_ads__ad_set_report:f0 72. model.facebook_ads.facebook_ads__account_report 72. model.facebook_ads.facebook_ads__account_report clicks 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->72. model.facebook_ads.facebook_ads__account_report:f0 75. model.facebook_ads.facebook_ads__campaign_report 75. model.facebook_ads.facebook_ads__campaign_report clicks 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->75. model.facebook_ads.facebook_ads__campaign_report:f0 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report clicks 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->76. model.facebook_ads.facebook_ads__url_report:f0 73. model.facebook_ads.facebook_ads__ad_report 73. model.facebook_ads.facebook_ads__ad_report clicks 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->73. model.facebook_ads.facebook_ads__ad_report:f0
85. model.facebook_ads_source.stg_facebook_ads__basic_ad
  • Input Column: 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp[inline_link_clicks]
    • Cleaning The column is cleaned by applying COALESCE to handle potential NULL values
    • Output Columns:
      • clicks: Mapped after applying COALESCE and renamed
72. model.facebook_ads.facebook_ads__account_report
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[clicks]
    • Aggregation Summed up in the SELECT clause
    • Output Columns:
      • clicks: Aggregated into the output column
73. model.facebook_ads.facebook_ads__ad_report
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[clicks]
    • Aggregation The column is summed up in the SELECT statement
    • Output Columns:
      • clicks: Aggregated sum in the output
74. model.facebook_ads.facebook_ads__ad_set_report
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[clicks]
    • Aggregation The column is summed up in the SELECT statement
    • Output Columns:
      • clicks: Aggregated sum in the output
75. model.facebook_ads.facebook_ads__campaign_report
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[clicks]
    • Aggregation The column is aggregated using SUM function
    • Output Columns:
      • clicks: Aggregated sum in the output
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[clicks]
    • Aggregation Summed up in the SELECT clause
    • Output Columns:
      • clicks: Aggregated sum in the output
Column Lineage
%3 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp spend 85. model.facebook_ads_source.stg_facebook_ads__basic_ad 85. model.facebook_ads_source.stg_facebook_ads__basic_ad spend 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp:f0->85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0 74. model.facebook_ads.facebook_ads__ad_set_report 74. model.facebook_ads.facebook_ads__ad_set_report spend 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->74. model.facebook_ads.facebook_ads__ad_set_report:f0 72. model.facebook_ads.facebook_ads__account_report 72. model.facebook_ads.facebook_ads__account_report spend 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->72. model.facebook_ads.facebook_ads__account_report:f0 75. model.facebook_ads.facebook_ads__campaign_report 75. model.facebook_ads.facebook_ads__campaign_report spend 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->75. model.facebook_ads.facebook_ads__campaign_report:f0 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report spend 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->76. model.facebook_ads.facebook_ads__url_report:f0 73. model.facebook_ads.facebook_ads__ad_report 73. model.facebook_ads.facebook_ads__ad_report spend 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->73. model.facebook_ads.facebook_ads__ad_report:f0
85. model.facebook_ads_source.stg_facebook_ads__basic_ad
  • Input Column: 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp[spend]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • spend: Directly mapped
72. model.facebook_ads.facebook_ads__account_report
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[spend]
    • Aggregation Summed up in the SELECT clause
    • Output Columns:
      • spend: Aggregated into the output column
73. model.facebook_ads.facebook_ads__ad_report
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[spend]
    • Aggregation The column is summed up in the SELECT statement
    • Output Columns:
      • spend: Aggregated sum in the output
74. model.facebook_ads.facebook_ads__ad_set_report
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[spend]
    • Aggregation The column is summed up in the SELECT statement
    • Output Columns:
      • spend: Aggregated sum in the output
75. model.facebook_ads.facebook_ads__campaign_report
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[spend]
    • Aggregation The column is aggregated using SUM function
    • Output Columns:
      • spend: Aggregated sum in the output
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[spend]
    • Aggregation Summed up in the SELECT clause
    • Output Columns:
      • spend: Aggregated sum in the output
86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of type TEXT, which is set to NULL. The query is limited to 0 rows, effectively returning no data. This type of query is often used as a placeholder or for testing purposes, particularly in data modeling or ETL processes.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp ad_id date account_id impressions inline_link_clicks spend 303. source.facebook_ads_source.facebook_ads.basic_ad 303. source.facebook_ads_source.facebook_ads.basic_ad
Name Type Comment
ad_id bigint None
date date None
account_id bigint None
impressions integer None
inline_link_clicks integer None
spend double precision None
Column Lineage
%3 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp ad_id 85. model.facebook_ads_source.stg_facebook_ads__basic_ad 85. model.facebook_ads_source.stg_facebook_ads__basic_ad ad_id 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp:f0->85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report ad_id 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->76. model.facebook_ads.facebook_ads__url_report:f0 73. model.facebook_ads.facebook_ads__ad_report 73. model.facebook_ads.facebook_ads__ad_report ad_id 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->73. model.facebook_ads.facebook_ads__ad_report:f0
85. model.facebook_ads_source.stg_facebook_ads__basic_ad
  • Input Column: 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp[ad_id]
    • Cleaning The column is cast to BIGINT data type
    • Output Columns:
      • ad_id: Directly mapped after casting
73. model.facebook_ads.facebook_ads__ad_report
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[ad_id]
    • Integration Used as a join key to connect with the ads table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • ad_id: Directly copied to the output from the joined ads table
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[ad_id]
    • Integration Used as a key to join with the ads table
    • Output Columns:
      • ad_id: Indirectly mapped through the join with ads table
Column Lineage
%3 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp date 85. model.facebook_ads_source.stg_facebook_ads__basic_ad 85. model.facebook_ads_source.stg_facebook_ads__basic_ad date_day 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp:f0->85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0 74. model.facebook_ads.facebook_ads__ad_set_report 74. model.facebook_ads.facebook_ads__ad_set_report date_day 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->74. model.facebook_ads.facebook_ads__ad_set_report:f0 72. model.facebook_ads.facebook_ads__account_report 72. model.facebook_ads.facebook_ads__account_report date_day 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->72. model.facebook_ads.facebook_ads__account_report:f0 75. model.facebook_ads.facebook_ads__campaign_report 75. model.facebook_ads.facebook_ads__campaign_report date_day 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->75. model.facebook_ads.facebook_ads__campaign_report:f0 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report date_day 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->76. model.facebook_ads.facebook_ads__url_report:f0 73. model.facebook_ads.facebook_ads__ad_report 73. model.facebook_ads.facebook_ads__ad_report date_day 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->73. model.facebook_ads.facebook_ads__ad_report:f0
85. model.facebook_ads_source.stg_facebook_ads__basic_ad
  • Input Column: 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp[date]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • date_day: Directly mapped and renamed
72. model.facebook_ads.facebook_ads__account_report
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
73. model.facebook_ads.facebook_ads__ad_report
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
74. model.facebook_ads.facebook_ads__ad_set_report
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
75. model.facebook_ads.facebook_ads__campaign_report
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Part of the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp account_id 85. model.facebook_ads_source.stg_facebook_ads__basic_ad 85. model.facebook_ads_source.stg_facebook_ads__basic_ad account_id 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp:f0->85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0 72. model.facebook_ads.facebook_ads__account_report 72. model.facebook_ads.facebook_ads__account_report account_id 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->72. model.facebook_ads.facebook_ads__account_report:f0 75. model.facebook_ads.facebook_ads__campaign_report 75. model.facebook_ads.facebook_ads__campaign_report account_id 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->75. model.facebook_ads.facebook_ads__campaign_report:f0 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report account_id 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->76. model.facebook_ads.facebook_ads__url_report:f0 73. model.facebook_ads.facebook_ads__ad_report 73. model.facebook_ads.facebook_ads__ad_report account_id 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->73. model.facebook_ads.facebook_ads__ad_report:f0
85. model.facebook_ads_source.stg_facebook_ads__basic_ad
  • Input Column: 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp[account_id]
    • Cleaning The column is cast to BIGINT data type
    • Output Columns:
      • account_id: Directly mapped after casting
72. model.facebook_ads.facebook_ads__account_report
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[account_id]
    • Integration Used as the key to join with the accounts table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • account_id: Directly copied to the output
73. model.facebook_ads.facebook_ads__ad_report
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[account_id]
    • Integration Used as a join key to connect with the accounts table
    • Output Columns:
      • account_id: Directly copied to the output from the joined accounts table
75. model.facebook_ads.facebook_ads__campaign_report
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[account_id]
    • Integration Used as a key to join with the accounts table
    • Output Columns:
      • account_id: Indirectly mapped through the join with accounts table
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[account_id]
    • Integration Used as a key to join with the accounts table
    • Output Columns:
      • account_id: Indirectly mapped through the join with accounts table
Column Lineage
%3 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp impressions 85. model.facebook_ads_source.stg_facebook_ads__basic_ad 85. model.facebook_ads_source.stg_facebook_ads__basic_ad impressions 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp:f0->85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0 74. model.facebook_ads.facebook_ads__ad_set_report 74. model.facebook_ads.facebook_ads__ad_set_report impressions 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->74. model.facebook_ads.facebook_ads__ad_set_report:f0 72. model.facebook_ads.facebook_ads__account_report 72. model.facebook_ads.facebook_ads__account_report impressions 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->72. model.facebook_ads.facebook_ads__account_report:f0 75. model.facebook_ads.facebook_ads__campaign_report 75. model.facebook_ads.facebook_ads__campaign_report impressions 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->75. model.facebook_ads.facebook_ads__campaign_report:f0 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report impressions 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->76. model.facebook_ads.facebook_ads__url_report:f0 73. model.facebook_ads.facebook_ads__ad_report 73. model.facebook_ads.facebook_ads__ad_report impressions 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->73. model.facebook_ads.facebook_ads__ad_report:f0
85. model.facebook_ads_source.stg_facebook_ads__basic_ad
  • Input Column: 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp[impressions]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • impressions: Directly mapped
72. model.facebook_ads.facebook_ads__account_report
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[impressions]
    • Aggregation Summed up in the SELECT clause
    • Output Columns:
      • impressions: Aggregated into the output column
73. model.facebook_ads.facebook_ads__ad_report
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[impressions]
    • Aggregation The column is summed up in the SELECT statement
    • Output Columns:
      • impressions: Aggregated sum in the output
74. model.facebook_ads.facebook_ads__ad_set_report
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[impressions]
    • Aggregation The column is summed up in the SELECT statement
    • Output Columns:
      • impressions: Aggregated sum in the output
75. model.facebook_ads.facebook_ads__campaign_report
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[impressions]
    • Aggregation The column is aggregated using SUM function
    • Output Columns:
      • impressions: Aggregated sum in the output
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[impressions]
    • Aggregation Summed up in the SELECT clause
    • Output Columns:
      • impressions: Aggregated sum in the output
Column Lineage
%3 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp spend 85. model.facebook_ads_source.stg_facebook_ads__basic_ad 85. model.facebook_ads_source.stg_facebook_ads__basic_ad spend 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp:f0->85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0 74. model.facebook_ads.facebook_ads__ad_set_report 74. model.facebook_ads.facebook_ads__ad_set_report spend 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->74. model.facebook_ads.facebook_ads__ad_set_report:f0 72. model.facebook_ads.facebook_ads__account_report 72. model.facebook_ads.facebook_ads__account_report spend 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->72. model.facebook_ads.facebook_ads__account_report:f0 75. model.facebook_ads.facebook_ads__campaign_report 75. model.facebook_ads.facebook_ads__campaign_report spend 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->75. model.facebook_ads.facebook_ads__campaign_report:f0 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report spend 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->76. model.facebook_ads.facebook_ads__url_report:f0 73. model.facebook_ads.facebook_ads__ad_report 73. model.facebook_ads.facebook_ads__ad_report spend 85. model.facebook_ads_source.stg_facebook_ads__basic_ad:f0->73. model.facebook_ads.facebook_ads__ad_report:f0
85. model.facebook_ads_source.stg_facebook_ads__basic_ad
  • Input Column: 86. model.facebook_ads_source.stg_facebook_ads__basic_ad_tmp[spend]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • spend: Directly mapped
72. model.facebook_ads.facebook_ads__account_report
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[spend]
    • Aggregation Summed up in the SELECT clause
    • Output Columns:
      • spend: Aggregated into the output column
73. model.facebook_ads.facebook_ads__ad_report
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[spend]
    • Aggregation The column is summed up in the SELECT statement
    • Output Columns:
      • spend: Aggregated sum in the output
74. model.facebook_ads.facebook_ads__ad_set_report
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[spend]
    • Aggregation The column is summed up in the SELECT statement
    • Output Columns:
      • spend: Aggregated sum in the output
75. model.facebook_ads.facebook_ads__campaign_report
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[spend]
    • Aggregation The column is aggregated using SUM function
    • Output Columns:
      • spend: Aggregated sum in the output
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 85. model.facebook_ads_source.stg_facebook_ads__basic_ad[spend]
    • Aggregation Summed up in the SELECT clause
    • Output Columns:
      • spend: Aggregated sum in the output
87. model.facebook_ads_source.stg_facebook_ads__campaign_history

This SQL query stages data from a temporary Facebook Ads campaign history table. It casts columns to specific data types, renames some columns, and adds a flag to identify the most recent record for each campaign. The query also includes a source relation column, though it's set to an empty string in this example.

CleaningDeduplicationOther
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_facebook_ads_source.stg_facebook_ads__campaign_history_tmp
), fields AS (
  SELECT
    CAST(NULL AS TIMESTAMP) AS updated_time,
    CAST(NULL AS TIMESTAMP) AS created_time,
    CAST(NULL AS INT) AS account_id,
    CAST(NULL AS INT) AS id,
    CAST(NULL AS TEXT) AS name,
    CAST(NULL AS TIMESTAMP) AS start_time,
    CAST(NULL AS TIMESTAMP) AS stop_time,
    CAST(NULL AS TEXT) AS status,
    CAST(NULL AS INT) AS daily_budget,
    CAST(NULL AS INT) AS lifetime_budget,
    CAST(NULL AS FLOAT) AS budget_remaining,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    updated_time AS updated_at,
    created_time AS created_at,
    CAST(account_id AS BIGINT) AS account_id,
    CAST(id AS BIGINT) AS campaign_id,
    name AS campaign_name,
    start_time AS start_at,
    stop_time AS end_at,
    status,
    daily_budget,
    lifetime_budget,
    budget_remaining,
    CASE
      WHEN id IS NULL AND updated_time IS NULL
      THEN ROW_NUMBER() OVER (PARTITION BY source_relation ORDER BY source_relation)
      ELSE ROW_NUMBER() OVER (PARTITION BY source_relation, id ORDER BY updated_time DESC)
    END = 1 AS is_most_recent_record
  FROM fields
)
SELECT
  *
FROM final
%3 87. model.facebook_ads_source.stg_facebook_ads__campaign_history 87. model.facebook_ads_source.stg_facebook_ads__campaign_history source_relation campaign_id account_id campaign_name is_most_recent_record updated_at created_at start_at end_at daily_budget budget_remaining lifetime_budget status 88. model.facebook_ads_source.stg_facebook_ads__campaign_history_tmp 88. model.facebook_ads_source.stg_facebook_ads__campaign_history_tmp id account_id name updated_time 88. model.facebook_ads_source.stg_facebook_ads__campaign_history_tmp:f0->87. model.facebook_ads_source.stg_facebook_ads__campaign_history:f1 88. model.facebook_ads_source.stg_facebook_ads__campaign_history_tmp:f1->87. model.facebook_ads_source.stg_facebook_ads__campaign_history:f2 88. model.facebook_ads_source.stg_facebook_ads__campaign_history_tmp:f2->87. model.facebook_ads_source.stg_facebook_ads__campaign_history:f3 88. model.facebook_ads_source.stg_facebook_ads__campaign_history_tmp:f3->87. model.facebook_ads_source.stg_facebook_ads__campaign_history:f5
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
campaign_id bigint The ID of the campaign.
account_id bigint The ID of the ad account that this campaign belongs to.
campaign_name text The name of the campaign.
is_most_recent_record boolean Boolean representing whether a record is the most recent version of that record. All records should have this value set to True given we filter on it.
updated_at timestamp without time zone The timestamp of the last update of a record.
created_at timestamp without time zone The time the campaign was created.
start_at timestamp without time zone Timestamp of designated campaign start time.
end_at timestamp without time zone Timestamp of designated campaign end time.
daily_budget integer Daily budget of campaign.
budget_remaining double precision Remaining budget of campaign.
lifetime_budget integer Lifetime budget of the campaign.
status text Status values are - 'ACTIVE', 'PAUSED', 'DELETED', 'ARCHIVED'.
Column Lineage
%3 87. model.facebook_ads_source.stg_facebook_ads__campaign_history 87. model.facebook_ads_source.stg_facebook_ads__campaign_history source_relation 75. model.facebook_ads.facebook_ads__campaign_report 75. model.facebook_ads.facebook_ads__campaign_report source_relation 87. model.facebook_ads_source.stg_facebook_ads__campaign_history:f0->75. model.facebook_ads.facebook_ads__campaign_report:f0 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report source_relation 87. model.facebook_ads_source.stg_facebook_ads__campaign_history:f0->76. model.facebook_ads.facebook_ads__url_report:f0 73. model.facebook_ads.facebook_ads__ad_report 73. model.facebook_ads.facebook_ads__ad_report source_relation 87. model.facebook_ads_source.stg_facebook_ads__campaign_history:f0->73. model.facebook_ads.facebook_ads__ad_report:f0
73. model.facebook_ads.facebook_ads__ad_report
  • Input Column: 87. model.facebook_ads_source.stg_facebook_ads__campaign_history[source_relation]
    • Integration used to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
75. model.facebook_ads.facebook_ads__campaign_report
  • Input Column: 87. model.facebook_ads_source.stg_facebook_ads__campaign_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 87. model.facebook_ads_source.stg_facebook_ads__campaign_history[source_relation]
    • Integration used to join with other tables
    • Filtering used in the WHERE clause to ensure consistency across joins
    • Output Columns:
      • source_relation: directly copied to output
Column Lineage
%3 88. model.facebook_ads_source.stg_facebook_ads__campaign_history_tmp 88. model.facebook_ads_source.stg_facebook_ads__campaign_history_tmp id 87. model.facebook_ads_source.stg_facebook_ads__campaign_history 87. model.facebook_ads_source.stg_facebook_ads__campaign_history campaign_id 88. model.facebook_ads_source.stg_facebook_ads__campaign_history_tmp:f0->87. model.facebook_ads_source.stg_facebook_ads__campaign_history:f0 74. model.facebook_ads.facebook_ads__ad_set_report 74. model.facebook_ads.facebook_ads__ad_set_report campaign_id 87. model.facebook_ads_source.stg_facebook_ads__campaign_history:f0->74. model.facebook_ads.facebook_ads__ad_set_report:f0 75. model.facebook_ads.facebook_ads__campaign_report 75. model.facebook_ads.facebook_ads__campaign_report campaign_id 87. model.facebook_ads_source.stg_facebook_ads__campaign_history:f0->75. model.facebook_ads.facebook_ads__campaign_report:f0 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report campaign_id 87. model.facebook_ads_source.stg_facebook_ads__campaign_history:f0->76. model.facebook_ads.facebook_ads__url_report:f0 73. model.facebook_ads.facebook_ads__ad_report 73. model.facebook_ads.facebook_ads__ad_report campaign_id 87. model.facebook_ads_source.stg_facebook_ads__campaign_history:f0->73. model.facebook_ads.facebook_ads__ad_report:f0
87. model.facebook_ads_source.stg_facebook_ads__campaign_history
  • Input Column: 88. model.facebook_ads_source.stg_facebook_ads__campaign_history_tmp[id]
    • Cleaning Cast to BIGINT data type
    • Deduplication Used in the ROW_NUMBER() window function to identify the most recent record
    • Output Columns:
      • campaign_id: Directly mapped after casting to BIGINT
73. model.facebook_ads.facebook_ads__ad_report
  • Input Column: 87. model.facebook_ads_source.stg_facebook_ads__campaign_history[campaign_id]
    • Integration used to join with the ads table
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
74. model.facebook_ads.facebook_ads__ad_set_report
  • Input Column: 87. model.facebook_ads_source.stg_facebook_ads__campaign_history[campaign_id]
    • Integration used as the key to join with the ads table
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
75. model.facebook_ads.facebook_ads__campaign_report
  • Input Column: 87. model.facebook_ads_source.stg_facebook_ads__campaign_history[campaign_id]
    • Integration used as the key to join with the ads table
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 87. model.facebook_ads_source.stg_facebook_ads__campaign_history[campaign_id]
    • Integration used to join with the ads table
    • Filtering used in the WHERE clause to ensure consistency across joins
    • Output Columns:
      • campaign_id: directly copied to output
Column Lineage
%3 88. model.facebook_ads_source.stg_facebook_ads__campaign_history_tmp 88. model.facebook_ads_source.stg_facebook_ads__campaign_history_tmp account_id 87. model.facebook_ads_source.stg_facebook_ads__campaign_history 87. model.facebook_ads_source.stg_facebook_ads__campaign_history account_id 88. model.facebook_ads_source.stg_facebook_ads__campaign_history_tmp:f0->87. model.facebook_ads_source.stg_facebook_ads__campaign_history:f0
87. model.facebook_ads_source.stg_facebook_ads__campaign_history
  • Input Column: 88. model.facebook_ads_source.stg_facebook_ads__campaign_history_tmp[account_id]
    • Cleaning Cast to BIGINT data type
    • Output Columns:
      • account_id: Directly mapped after casting to BIGINT
Column Lineage
%3 88. model.facebook_ads_source.stg_facebook_ads__campaign_history_tmp 88. model.facebook_ads_source.stg_facebook_ads__campaign_history_tmp name 87. model.facebook_ads_source.stg_facebook_ads__campaign_history 87. model.facebook_ads_source.stg_facebook_ads__campaign_history campaign_name 88. model.facebook_ads_source.stg_facebook_ads__campaign_history_tmp:f0->87. model.facebook_ads_source.stg_facebook_ads__campaign_history:f0 74. model.facebook_ads.facebook_ads__ad_set_report 74. model.facebook_ads.facebook_ads__ad_set_report campaign_name 87. model.facebook_ads_source.stg_facebook_ads__campaign_history:f0->74. model.facebook_ads.facebook_ads__ad_set_report:f0 75. model.facebook_ads.facebook_ads__campaign_report 75. model.facebook_ads.facebook_ads__campaign_report campaign_name 87. model.facebook_ads_source.stg_facebook_ads__campaign_history:f0->75. model.facebook_ads.facebook_ads__campaign_report:f0 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report campaign_name 87. model.facebook_ads_source.stg_facebook_ads__campaign_history:f0->76. model.facebook_ads.facebook_ads__url_report:f0 73. model.facebook_ads.facebook_ads__ad_report 73. model.facebook_ads.facebook_ads__ad_report campaign_name 87. model.facebook_ads_source.stg_facebook_ads__campaign_history:f0->73. model.facebook_ads.facebook_ads__ad_report:f0
87. model.facebook_ads_source.stg_facebook_ads__campaign_history
  • Input Column: 88. model.facebook_ads_source.stg_facebook_ads__campaign_history_tmp[name]
    • Direct Copied without transformation
    • Output Columns:
      • campaign_name: Directly mapped
73. model.facebook_ads.facebook_ads__ad_report
  • Input Column: 87. model.facebook_ads_source.stg_facebook_ads__campaign_history[campaign_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_name: directly copied
74. model.facebook_ads.facebook_ads__ad_set_report
  • Input Column: 87. model.facebook_ads_source.stg_facebook_ads__campaign_history[campaign_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_name: directly copied
75. model.facebook_ads.facebook_ads__campaign_report
  • Input Column: 87. model.facebook_ads_source.stg_facebook_ads__campaign_history[campaign_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_name: directly copied
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 87. model.facebook_ads_source.stg_facebook_ads__campaign_history[campaign_name]
    • Direct copied without transformation
    • Output Columns:
      • campaign_name: directly copied to output
Column Lineage
%3 88. model.facebook_ads_source.stg_facebook_ads__campaign_history_tmp 88. model.facebook_ads_source.stg_facebook_ads__campaign_history_tmp updated_time 87. model.facebook_ads_source.stg_facebook_ads__campaign_history 87. model.facebook_ads_source.stg_facebook_ads__campaign_history updated_at 88. model.facebook_ads_source.stg_facebook_ads__campaign_history_tmp:f0->87. model.facebook_ads_source.stg_facebook_ads__campaign_history:f0
87. model.facebook_ads_source.stg_facebook_ads__campaign_history
  • Input Column: 88. model.facebook_ads_source.stg_facebook_ads__campaign_history_tmp[updated_time]
    • Deduplication Used in the ROW_NUMBER() window function to order and identify the most recent record
    • Direct Copied without transformation
    • Output Columns:
      • updated_at: Directly mapped
Column Lineage
%3 87. model.facebook_ads_source.stg_facebook_ads__campaign_history 87. model.facebook_ads_source.stg_facebook_ads__campaign_history start_at 75. model.facebook_ads.facebook_ads__campaign_report 75. model.facebook_ads.facebook_ads__campaign_report start_at 87. model.facebook_ads_source.stg_facebook_ads__campaign_history:f0->75. model.facebook_ads.facebook_ads__campaign_report:f0
75. model.facebook_ads.facebook_ads__campaign_report
  • Input Column: 87. model.facebook_ads_source.stg_facebook_ads__campaign_history[start_at]
    • Direct directly copied to the output
    • Output Columns:
      • start_at: directly copied
Column Lineage
%3 87. model.facebook_ads_source.stg_facebook_ads__campaign_history 87. model.facebook_ads_source.stg_facebook_ads__campaign_history end_at 75. model.facebook_ads.facebook_ads__campaign_report 75. model.facebook_ads.facebook_ads__campaign_report end_at 87. model.facebook_ads_source.stg_facebook_ads__campaign_history:f0->75. model.facebook_ads.facebook_ads__campaign_report:f0
75. model.facebook_ads.facebook_ads__campaign_report
  • Input Column: 87. model.facebook_ads_source.stg_facebook_ads__campaign_history[end_at]
    • Direct directly copied to the output
    • Output Columns:
      • end_at: directly copied
Column Lineage
%3 87. model.facebook_ads_source.stg_facebook_ads__campaign_history 87. model.facebook_ads_source.stg_facebook_ads__campaign_history daily_budget 75. model.facebook_ads.facebook_ads__campaign_report 75. model.facebook_ads.facebook_ads__campaign_report daily_budget 87. model.facebook_ads_source.stg_facebook_ads__campaign_history:f0->75. model.facebook_ads.facebook_ads__campaign_report:f0
75. model.facebook_ads.facebook_ads__campaign_report
  • Input Column: 87. model.facebook_ads_source.stg_facebook_ads__campaign_history[daily_budget]
    • Direct directly copied to the output
    • Output Columns:
      • daily_budget: directly copied
Column Lineage
%3 87. model.facebook_ads_source.stg_facebook_ads__campaign_history 87. model.facebook_ads_source.stg_facebook_ads__campaign_history budget_remaining 75. model.facebook_ads.facebook_ads__campaign_report 75. model.facebook_ads.facebook_ads__campaign_report budget_remaining 87. model.facebook_ads_source.stg_facebook_ads__campaign_history:f0->75. model.facebook_ads.facebook_ads__campaign_report:f0
75. model.facebook_ads.facebook_ads__campaign_report
  • Input Column: 87. model.facebook_ads_source.stg_facebook_ads__campaign_history[budget_remaining]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the ads table
    • Output Columns:
      • budget_remaining: Directly copied to the output
Column Lineage
%3 87. model.facebook_ads_source.stg_facebook_ads__campaign_history 87. model.facebook_ads_source.stg_facebook_ads__campaign_history lifetime_budget 75. model.facebook_ads.facebook_ads__campaign_report 75. model.facebook_ads.facebook_ads__campaign_report lifetime_budget 87. model.facebook_ads_source.stg_facebook_ads__campaign_history:f0->75. model.facebook_ads.facebook_ads__campaign_report:f0
75. model.facebook_ads.facebook_ads__campaign_report
  • Input Column: 87. model.facebook_ads_source.stg_facebook_ads__campaign_history[lifetime_budget]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the ads table
    • Output Columns:
      • lifetime_budget: Directly copied to the output
Column Lineage
%3 87. model.facebook_ads_source.stg_facebook_ads__campaign_history 87. model.facebook_ads_source.stg_facebook_ads__campaign_history status 75. model.facebook_ads.facebook_ads__campaign_report 75. model.facebook_ads.facebook_ads__campaign_report status 87. model.facebook_ads_source.stg_facebook_ads__campaign_history:f0->75. model.facebook_ads.facebook_ads__campaign_report:f0
75. model.facebook_ads.facebook_ads__campaign_report
  • Input Column: 87. model.facebook_ads_source.stg_facebook_ads__campaign_history[status]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the ads table
    • Output Columns:
      • status: Directly copied to the output
88. model.facebook_ads_source.stg_facebook_ads__campaign_history_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of type TEXT, which is set to NULL. The query is limited to 0 rows, effectively creating a schema-only representation of the table without any actual data.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 88. model.facebook_ads_source.stg_facebook_ads__campaign_history_tmp 88. model.facebook_ads_source.stg_facebook_ads__campaign_history_tmp id account_id name _fivetran_synced updated_time 304. source.facebook_ads_source.facebook_ads.campaign_history 304. source.facebook_ads_source.facebook_ads.campaign_history
Name Type Comment
id bigint None
account_id bigint None
name text None
_fivetran_synced timestamp without time zone None
updated_time timestamp without time zone None
Column Lineage
%3 88. model.facebook_ads_source.stg_facebook_ads__campaign_history_tmp 88. model.facebook_ads_source.stg_facebook_ads__campaign_history_tmp id 87. model.facebook_ads_source.stg_facebook_ads__campaign_history 87. model.facebook_ads_source.stg_facebook_ads__campaign_history campaign_id 88. model.facebook_ads_source.stg_facebook_ads__campaign_history_tmp:f0->87. model.facebook_ads_source.stg_facebook_ads__campaign_history:f0 74. model.facebook_ads.facebook_ads__ad_set_report 74. model.facebook_ads.facebook_ads__ad_set_report campaign_id 87. model.facebook_ads_source.stg_facebook_ads__campaign_history:f0->74. model.facebook_ads.facebook_ads__ad_set_report:f0 75. model.facebook_ads.facebook_ads__campaign_report 75. model.facebook_ads.facebook_ads__campaign_report campaign_id 87. model.facebook_ads_source.stg_facebook_ads__campaign_history:f0->75. model.facebook_ads.facebook_ads__campaign_report:f0 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report campaign_id 87. model.facebook_ads_source.stg_facebook_ads__campaign_history:f0->76. model.facebook_ads.facebook_ads__url_report:f0 73. model.facebook_ads.facebook_ads__ad_report 73. model.facebook_ads.facebook_ads__ad_report campaign_id 87. model.facebook_ads_source.stg_facebook_ads__campaign_history:f0->73. model.facebook_ads.facebook_ads__ad_report:f0
87. model.facebook_ads_source.stg_facebook_ads__campaign_history
  • Input Column: 88. model.facebook_ads_source.stg_facebook_ads__campaign_history_tmp[id]
    • Cleaning Cast to BIGINT data type
    • Deduplication Used in the ROW_NUMBER() window function to identify the most recent record
    • Output Columns:
      • campaign_id: Directly mapped after casting to BIGINT
73. model.facebook_ads.facebook_ads__ad_report
  • Input Column: 87. model.facebook_ads_source.stg_facebook_ads__campaign_history[campaign_id]
    • Integration used to join with the ads table
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
74. model.facebook_ads.facebook_ads__ad_set_report
  • Input Column: 87. model.facebook_ads_source.stg_facebook_ads__campaign_history[campaign_id]
    • Integration used as the key to join with the ads table
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
75. model.facebook_ads.facebook_ads__campaign_report
  • Input Column: 87. model.facebook_ads_source.stg_facebook_ads__campaign_history[campaign_id]
    • Integration used as the key to join with the ads table
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 87. model.facebook_ads_source.stg_facebook_ads__campaign_history[campaign_id]
    • Integration used to join with the ads table
    • Filtering used in the WHERE clause to ensure consistency across joins
    • Output Columns:
      • campaign_id: directly copied to output
Column Lineage
%3 88. model.facebook_ads_source.stg_facebook_ads__campaign_history_tmp 88. model.facebook_ads_source.stg_facebook_ads__campaign_history_tmp account_id 87. model.facebook_ads_source.stg_facebook_ads__campaign_history 87. model.facebook_ads_source.stg_facebook_ads__campaign_history account_id 88. model.facebook_ads_source.stg_facebook_ads__campaign_history_tmp:f0->87. model.facebook_ads_source.stg_facebook_ads__campaign_history:f0
87. model.facebook_ads_source.stg_facebook_ads__campaign_history
  • Input Column: 88. model.facebook_ads_source.stg_facebook_ads__campaign_history_tmp[account_id]
    • Cleaning Cast to BIGINT data type
    • Output Columns:
      • account_id: Directly mapped after casting to BIGINT
Column Lineage
%3 88. model.facebook_ads_source.stg_facebook_ads__campaign_history_tmp 88. model.facebook_ads_source.stg_facebook_ads__campaign_history_tmp name 87. model.facebook_ads_source.stg_facebook_ads__campaign_history 87. model.facebook_ads_source.stg_facebook_ads__campaign_history campaign_name 88. model.facebook_ads_source.stg_facebook_ads__campaign_history_tmp:f0->87. model.facebook_ads_source.stg_facebook_ads__campaign_history:f0 74. model.facebook_ads.facebook_ads__ad_set_report 74. model.facebook_ads.facebook_ads__ad_set_report campaign_name 87. model.facebook_ads_source.stg_facebook_ads__campaign_history:f0->74. model.facebook_ads.facebook_ads__ad_set_report:f0 75. model.facebook_ads.facebook_ads__campaign_report 75. model.facebook_ads.facebook_ads__campaign_report campaign_name 87. model.facebook_ads_source.stg_facebook_ads__campaign_history:f0->75. model.facebook_ads.facebook_ads__campaign_report:f0 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report campaign_name 87. model.facebook_ads_source.stg_facebook_ads__campaign_history:f0->76. model.facebook_ads.facebook_ads__url_report:f0 73. model.facebook_ads.facebook_ads__ad_report 73. model.facebook_ads.facebook_ads__ad_report campaign_name 87. model.facebook_ads_source.stg_facebook_ads__campaign_history:f0->73. model.facebook_ads.facebook_ads__ad_report:f0
87. model.facebook_ads_source.stg_facebook_ads__campaign_history
  • Input Column: 88. model.facebook_ads_source.stg_facebook_ads__campaign_history_tmp[name]
    • Direct Copied without transformation
    • Output Columns:
      • campaign_name: Directly mapped
73. model.facebook_ads.facebook_ads__ad_report
  • Input Column: 87. model.facebook_ads_source.stg_facebook_ads__campaign_history[campaign_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_name: directly copied
74. model.facebook_ads.facebook_ads__ad_set_report
  • Input Column: 87. model.facebook_ads_source.stg_facebook_ads__campaign_history[campaign_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_name: directly copied
75. model.facebook_ads.facebook_ads__campaign_report
  • Input Column: 87. model.facebook_ads_source.stg_facebook_ads__campaign_history[campaign_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_name: directly copied
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 87. model.facebook_ads_source.stg_facebook_ads__campaign_history[campaign_name]
    • Direct copied without transformation
    • Output Columns:
      • campaign_name: directly copied to output
Column Lineage
%3 88. model.facebook_ads_source.stg_facebook_ads__campaign_history_tmp 88. model.facebook_ads_source.stg_facebook_ads__campaign_history_tmp updated_time 87. model.facebook_ads_source.stg_facebook_ads__campaign_history 87. model.facebook_ads_source.stg_facebook_ads__campaign_history updated_at 88. model.facebook_ads_source.stg_facebook_ads__campaign_history_tmp:f0->87. model.facebook_ads_source.stg_facebook_ads__campaign_history:f0
87. model.facebook_ads_source.stg_facebook_ads__campaign_history
  • Input Column: 88. model.facebook_ads_source.stg_facebook_ads__campaign_history_tmp[updated_time]
    • Deduplication Used in the ROW_NUMBER() window function to order and identify the most recent record
    • Direct Copied without transformation
    • Output Columns:
      • updated_at: Directly mapped
89. model.facebook_ads_source.stg_facebook_ads__creative_history

This SQL query performs several data transformations on the Facebook Ads creative history data. It starts by selecting all columns from a temporary table, then casts various fields to specific data types. The query renames some columns, such as changing 'id' to 'creative_id'. It also adds a 'source_relation' column and creates an 'is_most_recent_record' flag using window functions to identify the most recent record for each creative ID. Finally, it selects all columns from the transformed data.

CleaningDeduplicationOther
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_facebook_ads_source.stg_facebook_ads__creative_history_tmp
), fields AS (
  SELECT
    CAST(NULL AS TEXT) AS _fivetran_id,
    CAST(NULL AS TIMESTAMP) AS _fivetran_synced,
    CAST(NULL AS INT) AS id,
    CAST(NULL AS INT) AS account_id,
    CAST(NULL AS TEXT) AS name,
    CAST(NULL AS TEXT) AS page_link,
    CAST(NULL AS TEXT) AS template_page_link,
    CAST(NULL AS TEXT) AS url_tags,
    CAST(NULL AS TEXT) AS asset_feed_spec_link_urls,
    CAST(NULL AS TEXT) AS object_story_link_data_child_attachments,
    CAST(NULL AS TEXT) AS object_story_link_data_caption,
    CAST(NULL AS TEXT) AS object_story_link_data_description,
    CAST(NULL AS TEXT) AS object_story_link_data_link,
    CAST(NULL AS TEXT) AS object_story_link_data_message,
    CAST(NULL AS TEXT) AS template_app_link_spec_android,
    CAST(NULL AS TEXT) AS template_app_link_spec_ios,
    CAST(NULL AS TEXT) AS template_app_link_spec_ipad,
    CAST(NULL AS TEXT) AS template_app_link_spec_iphone,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    _fivetran_id,
    _fivetran_synced,
    CAST(id AS BIGINT) AS creative_id,
    CAST(account_id AS BIGINT) AS account_id,
    name AS creative_name,
    page_link,
    template_page_link,
    url_tags,
    asset_feed_spec_link_urls,
    object_story_link_data_child_attachments,
    object_story_link_data_caption,
    object_story_link_data_description,
    object_story_link_data_link,
    object_story_link_data_message,
    template_app_link_spec_ios,
    template_app_link_spec_ipad,
    template_app_link_spec_android,
    template_app_link_spec_iphone,
    CASE
      WHEN id IS NULL AND _fivetran_synced IS NULL
      THEN ROW_NUMBER() OVER (PARTITION BY source_relation ORDER BY source_relation)
      ELSE ROW_NUMBER() OVER (PARTITION BY source_relation, id ORDER BY _fivetran_synced DESC)
    END = 1 AS is_most_recent_record
  FROM fields
)
SELECT
  *
FROM final
%3 89. model.facebook_ads_source.stg_facebook_ads__creative_history 89. model.facebook_ads_source.stg_facebook_ads__creative_history source_relation _fivetran_id _fivetran_synced creative_id account_id creative_name url_tags is_most_recent_record page_link template_page_link asset_feed_spec_link_urls object_story_link_data_child_attachments object_story_link_data_caption object_story_link_data_description object_story_link_data_link object_story_link_data_message template_app_link_spec_ios template_app_link_spec_ipad template_app_link_spec_android template_app_link_spec_iphone 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp page_link template_page_link id account_id name url_tags _fivetran_synced asset_feed_spec_link_urls object_story_link_data_child_attachments object_story_link_data_caption object_story_link_data_description object_story_link_data_link object_story_link_data_message template_app_link_spec_ios _fivetran_id 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f0->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f8 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f1->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f9 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f2->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f3 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f3->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f4 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f4->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f5 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f5->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f6 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f6->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f2 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f7->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f10 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f8->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f11 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f9->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f12 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f10->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f13 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f11->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f14 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f12->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f15 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f13->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f16 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f14->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f14->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f7
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
_fivetran_id text Unique record identifier
_fivetran_synced text When the record was last synced by Fivetran.
creative_id bigint Unique ID for an ad creative.
account_id bigint Ad account ID for the account this ad creative belongs to.
creative_name text Name of this ad creative as seen in the ad account's library.
url_tags text A set of query string parameters which will replace or be appended to urls clicked from page post ads, message of the post, and canvas app install creatives only.
is_most_recent_record boolean Indicates whether a record is the most recent version of that record.
page_link character varying Link for the page.
template_page_link character varying URL destination of Facebook dynamic ads.
asset_feed_spec_link_urls text Link to the asset feed spec
object_story_link_data_child_attachments text Link of the object story child attachments
object_story_link_data_caption text Link of the object story caption
object_story_link_data_description text Link of the object story description
object_story_link_data_link text Link of the object story link
object_story_link_data_message text Link of the object story message
template_app_link_spec_ios text Link of the object story spec for ios
template_app_link_spec_ipad text Link of the template app spec for ipad
template_app_link_spec_android text Link of the template app for android
template_app_link_spec_iphone text Link of the template app for iphone
Column Lineage
%3 89. model.facebook_ads_source.stg_facebook_ads__creative_history 89. model.facebook_ads_source.stg_facebook_ads__creative_history source_relation 77. model.facebook_ads.facebook_ads__url_tags 77. model.facebook_ads.facebook_ads__url_tags source_relation 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->77. model.facebook_ads.facebook_ads__url_tags:f0 78. model.facebook_ads.int_facebook_ads__creative_history 78. model.facebook_ads.int_facebook_ads__creative_history source_relation 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f0 77. model.facebook_ads.facebook_ads__url_tags:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f0 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report source_relation 78. model.facebook_ads.int_facebook_ads__creative_history:f0->76. model.facebook_ads.facebook_ads__url_report:f0
77. model.facebook_ads.facebook_ads__url_tags
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[source_relation]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • source_relation: Directly copied
78. model.facebook_ads.int_facebook_ads__creative_history
  • Input Column: 77. model.facebook_ads.facebook_ads__url_tags[source_relation]
    • Integration Used to join with the base table
    • Direct Directly selected in the final output
    • Output Columns:
      • source_relation: Directly copied to the output
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[source_relation]
    • Direct The column is directly copied without transformation
    • Integration Used as part of the join condition with other tables
    • Output Columns:
      • source_relation: Directly copied to the output
Column Lineage
%3 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp _fivetran_id 89. model.facebook_ads_source.stg_facebook_ads__creative_history 89. model.facebook_ads_source.stg_facebook_ads__creative_history _fivetran_id is_most_recent_record 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f0->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f0->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1 77. model.facebook_ads.facebook_ads__url_tags 77. model.facebook_ads.facebook_ads__url_tags _fivetran_id 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->77. model.facebook_ads.facebook_ads__url_tags:f0 78. model.facebook_ads.int_facebook_ads__creative_history 78. model.facebook_ads.int_facebook_ads__creative_history _fivetran_id 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f0
89. model.facebook_ads_source.stg_facebook_ads__creative_history
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[_fivetran_id]
    • Direct This column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the 'fields' CTE
    • Deduplication This column is used in the window function to determine the most recent record
    • Output Columns:
      • _fivetran_id: Directly mapped to this output column
      • is_most_recent_record: Indirectly used to determine this flag
77. model.facebook_ads.facebook_ads__url_tags
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[_fivetran_id]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • _fivetran_id: Directly copied
78. model.facebook_ads.int_facebook_ads__creative_history
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[_fivetran_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with url_tags_pivoted
    • Output Columns:
      • _fivetran_id: Directly copied
Column Lineage
%3 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp _fivetran_synced 89. model.facebook_ads_source.stg_facebook_ads__creative_history 89. model.facebook_ads_source.stg_facebook_ads__creative_history _fivetran_synced 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f0->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0
89. model.facebook_ads_source.stg_facebook_ads__creative_history
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[_fivetran_synced]
    • Cleaning The column is cast as TIMESTAMP
    • Deduplication Used in the window function to determine the most recent record
    • Output Columns:
      • _fivetran_synced: Directly mapped
Column Lineage
%3 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp id 89. model.facebook_ads_source.stg_facebook_ads__creative_history 89. model.facebook_ads_source.stg_facebook_ads__creative_history creative_id 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f0->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0 77. model.facebook_ads.facebook_ads__url_tags 77. model.facebook_ads.facebook_ads__url_tags creative_id 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->77. model.facebook_ads.facebook_ads__url_tags:f0 78. model.facebook_ads.int_facebook_ads__creative_history 78. model.facebook_ads.int_facebook_ads__creative_history creative_id 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f0 77. model.facebook_ads.facebook_ads__url_tags:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f0 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report creative_id 78. model.facebook_ads.int_facebook_ads__creative_history:f0->76. model.facebook_ads.facebook_ads__url_report:f0
89. model.facebook_ads_source.stg_facebook_ads__creative_history
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[id]
    • Cleaning The column is cast as BIGINT
    • Deduplication Used in the window function to determine the most recent record
    • Output Columns:
      • creative_id: Mapped after casting to BIGINT
77. model.facebook_ads.facebook_ads__url_tags
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[creative_id]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • creative_id: Directly copied
78. model.facebook_ads.int_facebook_ads__creative_history
  • Input Column: 77. model.facebook_ads.facebook_ads__url_tags[creative_id]
    • Integration Used to join with the base table
    • Aggregation Used in GROUP BY clause
    • Output Columns:
      • creative_id: Directly copied to the output
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[creative_id]
    • Direct The column is directly copied without transformation
    • Integration Used as the key to join with the ads table
    • Output Columns:
      • creative_id: Directly copied to the output
Column Lineage
%3 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp account_id 89. model.facebook_ads_source.stg_facebook_ads__creative_history 89. model.facebook_ads_source.stg_facebook_ads__creative_history account_id 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f0->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0 78. model.facebook_ads.int_facebook_ads__creative_history 78. model.facebook_ads.int_facebook_ads__creative_history account_id 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f0
89. model.facebook_ads_source.stg_facebook_ads__creative_history
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[account_id]
    • Cleaning The column is cast as BIGINT
    • Output Columns:
      • account_id: Mapped after casting to BIGINT
78. model.facebook_ads.int_facebook_ads__creative_history
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[account_id]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • account_id: Directly copied
Column Lineage
%3 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp name 89. model.facebook_ads_source.stg_facebook_ads__creative_history 89. model.facebook_ads_source.stg_facebook_ads__creative_history creative_name 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f0->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0 78. model.facebook_ads.int_facebook_ads__creative_history 78. model.facebook_ads.int_facebook_ads__creative_history creative_name 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f0 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report creative_name 78. model.facebook_ads.int_facebook_ads__creative_history:f0->76. model.facebook_ads.facebook_ads__url_report:f0
89. model.facebook_ads_source.stg_facebook_ads__creative_history
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[name]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • creative_name: Renamed and directly mapped
78. model.facebook_ads.int_facebook_ads__creative_history
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[creative_name]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • creative_name: Directly copied
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[creative_name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • creative_name: Directly copied to the output
Column Lineage
%3 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp url_tags 89. model.facebook_ads_source.stg_facebook_ads__creative_history 89. model.facebook_ads_source.stg_facebook_ads__creative_history url_tags 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f0->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0 77. model.facebook_ads.facebook_ads__url_tags 77. model.facebook_ads.facebook_ads__url_tags key type value 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->77. model.facebook_ads.facebook_ads__url_tags:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->77. model.facebook_ads.facebook_ads__url_tags:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->77. model.facebook_ads.facebook_ads__url_tags:f1 78. model.facebook_ads.int_facebook_ads__creative_history 78. model.facebook_ads.int_facebook_ads__creative_history utm_campaign utm_content utm_medium utm_source utm_term 77. model.facebook_ads.facebook_ads__url_tags:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f3 77. model.facebook_ads.facebook_ads__url_tags:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f2 77. model.facebook_ads.facebook_ads__url_tags:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f0 77. model.facebook_ads.facebook_ads__url_tags:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f1 77. model.facebook_ads.facebook_ads__url_tags:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f4 77. model.facebook_ads.facebook_ads__url_tags:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f3 77. model.facebook_ads.facebook_ads__url_tags:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f2 77. model.facebook_ads.facebook_ads__url_tags:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f0 77. model.facebook_ads.facebook_ads__url_tags:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f1 77. model.facebook_ads.facebook_ads__url_tags:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f4 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report utm_campaign utm_content utm_medium utm_source utm_term 78. model.facebook_ads.int_facebook_ads__creative_history:f3->76. model.facebook_ads.facebook_ads__url_report:f3 78. model.facebook_ads.int_facebook_ads__creative_history:f2->76. model.facebook_ads.facebook_ads__url_report:f2 78. model.facebook_ads.int_facebook_ads__creative_history:f0->76. model.facebook_ads.facebook_ads__url_report:f0 78. model.facebook_ads.int_facebook_ads__creative_history:f1->76. model.facebook_ads.facebook_ads__url_report:f1 78. model.facebook_ads.int_facebook_ads__creative_history:f4->76. model.facebook_ads.facebook_ads__url_report:f4
89. model.facebook_ads_source.stg_facebook_ads__creative_history
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[url_tags]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • url_tags: Directly mapped
77. model.facebook_ads.facebook_ads__url_tags
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[url_tags]
    • Filtering The column is filtered to include only non-null values
    • Cleaning The column is cleaned by parsing JSON
    • Other The column is flattened and its contents are extracted into separate columns
    • Output Columns:
      • key: Extracted from flattened url_tags
      • value: Extracted from flattened url_tags
      • type: Extracted from flattened url_tags
78. model.facebook_ads.int_facebook_ads__creative_history
  • Input Column: 77. model.facebook_ads.facebook_ads__url_tags[key]
    • Featurization Used to pivot the data, extracting different UTM parameters
    • Output Columns:
      • utm_source: Mapped when key = 'utm_source'
      • utm_medium: Mapped when key = 'utm_medium'
      • utm_campaign: Mapped when key = 'utm_campaign'
      • utm_content: Mapped when key = 'utm_content'
      • utm_term: Mapped when key = 'utm_term'
  • Input Column: 77. model.facebook_ads.facebook_ads__url_tags[value]
    • Featurization Used as the value for the pivoted UTM parameters
    • Output Columns:
      • utm_source: Mapped when key = 'utm_source'
      • utm_medium: Mapped when key = 'utm_medium'
      • utm_campaign: Mapped when key = 'utm_campaign'
      • utm_content: Mapped when key = 'utm_content'
      • utm_term: Mapped when key = 'utm_term'
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[utm_source]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • utm_source: Directly copied to the output
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[utm_medium]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the creatives table
    • Output Columns:
      • utm_medium: Directly copied to the output
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[utm_campaign]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the creatives table
    • Output Columns:
      • utm_campaign: Directly copied to the output
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[utm_content]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the creatives table
    • Output Columns:
      • utm_content: Directly copied to the output
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[utm_term]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the creatives table
    • Output Columns:
      • utm_term: Directly copied to the output
Column Lineage
%3 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp _fivetran_id 89. model.facebook_ads_source.stg_facebook_ads__creative_history 89. model.facebook_ads_source.stg_facebook_ads__creative_history _fivetran_id is_most_recent_record 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f0->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f0->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1
89. model.facebook_ads_source.stg_facebook_ads__creative_history
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[_fivetran_id]
    • Direct This column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the 'fields' CTE
    • Deduplication This column is used in the window function to determine the most recent record
    • Output Columns:
      • _fivetran_id: Directly mapped to this output column
      • is_most_recent_record: Indirectly used to determine this flag
Column Lineage
%3 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp page_link 89. model.facebook_ads_source.stg_facebook_ads__creative_history 89. model.facebook_ads_source.stg_facebook_ads__creative_history page_link 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f0->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0 78. model.facebook_ads.int_facebook_ads__creative_history 78. model.facebook_ads.int_facebook_ads__creative_history base_url url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f1 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f3 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f7 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f6 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f4 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f5 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f8 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report base_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 78. model.facebook_ads.int_facebook_ads__creative_history:f0->76. model.facebook_ads.facebook_ads__url_report:f0 78. model.facebook_ads.int_facebook_ads__creative_history:f2->76. model.facebook_ads.facebook_ads__url_report:f1 78. model.facebook_ads.int_facebook_ads__creative_history:f3->76. model.facebook_ads.facebook_ads__url_report:f2 78. model.facebook_ads.int_facebook_ads__creative_history:f7->76. model.facebook_ads.facebook_ads__url_report:f6 78. model.facebook_ads.int_facebook_ads__creative_history:f6->76. model.facebook_ads.facebook_ads__url_report:f5 78. model.facebook_ads.int_facebook_ads__creative_history:f4->76. model.facebook_ads.facebook_ads__url_report:f3 78. model.facebook_ads.int_facebook_ads__creative_history:f5->76. model.facebook_ads.facebook_ads__url_report:f4 78. model.facebook_ads.int_facebook_ads__creative_history:f8->76. model.facebook_ads.facebook_ads__url_report:f7
89. model.facebook_ads_source.stg_facebook_ads__creative_history
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[page_link]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • page_link: Directly mapped
78. model.facebook_ads.int_facebook_ads__creative_history
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[page_link]
    • Cleaning Used in COALESCE with template_page_link
    • Featurization Various URL components and UTM parameters are extracted from this column
    • Output Columns:
      • url: COALESCE(page_link, template_page_link)
      • base_url: Extracted from page_link or template_page_link
      • url_host: Extracted from page_link or template_page_link
      • url_path: Extracted from page_link or template_page_link
      • utm_source: Extracted if not found in url_tags_pivoted
      • utm_medium: Extracted if not found in url_tags_pivoted
      • utm_campaign: Extracted if not found in url_tags_pivoted
      • utm_content: Extracted if not found in url_tags_pivoted
      • utm_term: Extracted if not found in url_tags_pivoted
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[base_url]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • base_url: Directly copied to the output
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[url_host]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • url_host: Directly copied to the output
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[url_path]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • url_path: Directly copied to the output
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[utm_source]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • utm_source: Directly copied to the output
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[utm_medium]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the creatives table
    • Output Columns:
      • utm_medium: Directly copied to the output
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[utm_campaign]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the creatives table
    • Output Columns:
      • utm_campaign: Directly copied to the output
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[utm_content]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the creatives table
    • Output Columns:
      • utm_content: Directly copied to the output
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[utm_term]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the creatives table
    • Output Columns:
      • utm_term: Directly copied to the output
Column Lineage
%3 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp template_page_link 89. model.facebook_ads_source.stg_facebook_ads__creative_history 89. model.facebook_ads_source.stg_facebook_ads__creative_history template_page_link 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f0->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0 78. model.facebook_ads.int_facebook_ads__creative_history 78. model.facebook_ads.int_facebook_ads__creative_history base_url url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f1 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f3 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f7 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f6 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f4 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f5 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f8 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report base_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 78. model.facebook_ads.int_facebook_ads__creative_history:f0->76. model.facebook_ads.facebook_ads__url_report:f0 78. model.facebook_ads.int_facebook_ads__creative_history:f2->76. model.facebook_ads.facebook_ads__url_report:f1 78. model.facebook_ads.int_facebook_ads__creative_history:f3->76. model.facebook_ads.facebook_ads__url_report:f2 78. model.facebook_ads.int_facebook_ads__creative_history:f7->76. model.facebook_ads.facebook_ads__url_report:f6 78. model.facebook_ads.int_facebook_ads__creative_history:f6->76. model.facebook_ads.facebook_ads__url_report:f5 78. model.facebook_ads.int_facebook_ads__creative_history:f4->76. model.facebook_ads.facebook_ads__url_report:f3 78. model.facebook_ads.int_facebook_ads__creative_history:f5->76. model.facebook_ads.facebook_ads__url_report:f4 78. model.facebook_ads.int_facebook_ads__creative_history:f8->76. model.facebook_ads.facebook_ads__url_report:f7
89. model.facebook_ads_source.stg_facebook_ads__creative_history
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[template_page_link]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • template_page_link: Directly mapped
78. model.facebook_ads.int_facebook_ads__creative_history
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[template_page_link]
    • Cleaning Used in COALESCE with page_link
    • Featurization Various URL components and UTM parameters are extracted from this column if page_link is null
    • Output Columns:
      • url: COALESCE(page_link, template_page_link)
      • base_url: Extracted from page_link or template_page_link
      • url_host: Extracted from page_link or template_page_link
      • url_path: Extracted from page_link or template_page_link
      • utm_source: Extracted if not found in url_tags_pivoted and page_link
      • utm_medium: Extracted if not found in url_tags_pivoted and page_link
      • utm_campaign: Extracted if not found in url_tags_pivoted and page_link
      • utm_content: Extracted if not found in url_tags_pivoted and page_link
      • utm_term: Extracted if not found in url_tags_pivoted and page_link
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[base_url]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • base_url: Directly copied to the output
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[url_host]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • url_host: Directly copied to the output
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[url_path]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • url_path: Directly copied to the output
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[utm_source]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • utm_source: Directly copied to the output
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[utm_medium]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the creatives table
    • Output Columns:
      • utm_medium: Directly copied to the output
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[utm_campaign]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the creatives table
    • Output Columns:
      • utm_campaign: Directly copied to the output
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[utm_content]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the creatives table
    • Output Columns:
      • utm_content: Directly copied to the output
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[utm_term]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the creatives table
    • Output Columns:
      • utm_term: Directly copied to the output
Column Lineage
%3 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp object_story_link_data_child_attachments 89. model.facebook_ads_source.stg_facebook_ads__creative_history 89. model.facebook_ads_source.stg_facebook_ads__creative_history object_story_link_data_child_attachments 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f0->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0
89. model.facebook_ads_source.stg_facebook_ads__creative_history
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[object_story_link_data_child_attachments]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • object_story_link_data_child_attachments: Directly mapped
Column Lineage
%3 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp object_story_link_data_caption 89. model.facebook_ads_source.stg_facebook_ads__creative_history 89. model.facebook_ads_source.stg_facebook_ads__creative_history object_story_link_data_caption 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f0->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0
89. model.facebook_ads_source.stg_facebook_ads__creative_history
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[object_story_link_data_caption]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • object_story_link_data_caption: Directly mapped
Column Lineage
%3 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp object_story_link_data_description 89. model.facebook_ads_source.stg_facebook_ads__creative_history 89. model.facebook_ads_source.stg_facebook_ads__creative_history object_story_link_data_description 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f0->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0
89. model.facebook_ads_source.stg_facebook_ads__creative_history
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[object_story_link_data_description]
    • Direct This column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the 'fields' CTE
    • Output Columns:
      • object_story_link_data_description: Directly mapped to this output column
Column Lineage
%3 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp object_story_link_data_link 89. model.facebook_ads_source.stg_facebook_ads__creative_history 89. model.facebook_ads_source.stg_facebook_ads__creative_history object_story_link_data_link 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f0->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0 78. model.facebook_ads.int_facebook_ads__creative_history 78. model.facebook_ads.int_facebook_ads__creative_history base_url url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f1 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f3 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f7 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f6 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f4 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f5 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f8 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report base_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 78. model.facebook_ads.int_facebook_ads__creative_history:f0->76. model.facebook_ads.facebook_ads__url_report:f0 78. model.facebook_ads.int_facebook_ads__creative_history:f2->76. model.facebook_ads.facebook_ads__url_report:f1 78. model.facebook_ads.int_facebook_ads__creative_history:f3->76. model.facebook_ads.facebook_ads__url_report:f2 78. model.facebook_ads.int_facebook_ads__creative_history:f7->76. model.facebook_ads.facebook_ads__url_report:f6 78. model.facebook_ads.int_facebook_ads__creative_history:f6->76. model.facebook_ads.facebook_ads__url_report:f5 78. model.facebook_ads.int_facebook_ads__creative_history:f4->76. model.facebook_ads.facebook_ads__url_report:f3 78. model.facebook_ads.int_facebook_ads__creative_history:f5->76. model.facebook_ads.facebook_ads__url_report:f4 78. model.facebook_ads.int_facebook_ads__creative_history:f8->76. model.facebook_ads.facebook_ads__url_report:f7
89. model.facebook_ads_source.stg_facebook_ads__creative_history
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[object_story_link_data_link]
    • Direct This column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the 'fields' CTE
    • Output Columns:
      • object_story_link_data_link: Directly mapped to this output column
78. model.facebook_ads.int_facebook_ads__creative_history
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[object_story_link_data_link]
    • Cleaning This column is likely used in the COALESCE function with template_page_link to create the 'url' column.
    • Featurization Various parts of the URL are extracted from this column to create different features.
    • Output Columns:
      • url: Potentially used in COALESCE(page_link, template_page_link)
      • base_url: Extracted from this column
      • url_host: Extracted and cleaned from this column
      • url_path: Extracted and cleaned from this column
      • utm_source: Potentially extracted from this column if not found in url_tags
      • utm_medium: Potentially extracted from this column if not found in url_tags
      • utm_campaign: Potentially extracted from this column if not found in url_tags
      • utm_content: Potentially extracted from this column if not found in url_tags
      • utm_term: Potentially extracted from this column if not found in url_tags
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[base_url]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • base_url: Directly copied to the output
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[url_host]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • url_host: Directly copied to the output
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[url_path]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • url_path: Directly copied to the output
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[utm_source]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • utm_source: Directly copied to the output
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[utm_medium]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the creatives table
    • Output Columns:
      • utm_medium: Directly copied to the output
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[utm_campaign]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the creatives table
    • Output Columns:
      • utm_campaign: Directly copied to the output
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[utm_content]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the creatives table
    • Output Columns:
      • utm_content: Directly copied to the output
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[utm_term]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the creatives table
    • Output Columns:
      • utm_term: Directly copied to the output
Column Lineage
%3 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp object_story_link_data_message 89. model.facebook_ads_source.stg_facebook_ads__creative_history 89. model.facebook_ads_source.stg_facebook_ads__creative_history object_story_link_data_message 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f0->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0
89. model.facebook_ads_source.stg_facebook_ads__creative_history
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[object_story_link_data_message]
    • Direct This column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the 'fields' CTE
    • Output Columns:
      • object_story_link_data_message: Directly mapped to this output column
90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of type TEXT, initialized to NULL. The query is likely used as a placeholder or template for further development, or to establish the structure of a table without populating it with data.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp page_link template_page_link id account_id name url_tags _fivetran_synced asset_feed_spec_link_urls object_story_link_data_child_attachments object_story_link_data_caption object_story_link_data_description object_story_link_data_link object_story_link_data_message template_app_link_spec_ios _fivetran_id 305. source.facebook_ads_source.facebook_ads.creative_history 305. source.facebook_ads_source.facebook_ads.creative_history
Name Type Comment
page_link character varying None
template_page_link character varying None
id bigint None
account_id bigint None
name text None
url_tags text None
_fivetran_synced text None
asset_feed_spec_link_urls text None
object_story_link_data_child_attachments text None
object_story_link_data_caption text None
object_story_link_data_description text None
object_story_link_data_link text None
object_story_link_data_message text None
template_app_link_spec_ios text None
_fivetran_id text None
Column Lineage
%3 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp page_link 89. model.facebook_ads_source.stg_facebook_ads__creative_history 89. model.facebook_ads_source.stg_facebook_ads__creative_history page_link 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f0->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0 78. model.facebook_ads.int_facebook_ads__creative_history 78. model.facebook_ads.int_facebook_ads__creative_history base_url url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f1 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f3 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f7 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f6 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f4 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f5 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f8 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report base_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 78. model.facebook_ads.int_facebook_ads__creative_history:f0->76. model.facebook_ads.facebook_ads__url_report:f0 78. model.facebook_ads.int_facebook_ads__creative_history:f2->76. model.facebook_ads.facebook_ads__url_report:f1 78. model.facebook_ads.int_facebook_ads__creative_history:f3->76. model.facebook_ads.facebook_ads__url_report:f2 78. model.facebook_ads.int_facebook_ads__creative_history:f7->76. model.facebook_ads.facebook_ads__url_report:f6 78. model.facebook_ads.int_facebook_ads__creative_history:f6->76. model.facebook_ads.facebook_ads__url_report:f5 78. model.facebook_ads.int_facebook_ads__creative_history:f4->76. model.facebook_ads.facebook_ads__url_report:f3 78. model.facebook_ads.int_facebook_ads__creative_history:f5->76. model.facebook_ads.facebook_ads__url_report:f4 78. model.facebook_ads.int_facebook_ads__creative_history:f8->76. model.facebook_ads.facebook_ads__url_report:f7
89. model.facebook_ads_source.stg_facebook_ads__creative_history
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[page_link]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • page_link: Directly mapped
78. model.facebook_ads.int_facebook_ads__creative_history
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[page_link]
    • Cleaning Used in COALESCE with template_page_link
    • Featurization Various URL components and UTM parameters are extracted from this column
    • Output Columns:
      • url: COALESCE(page_link, template_page_link)
      • base_url: Extracted from page_link or template_page_link
      • url_host: Extracted from page_link or template_page_link
      • url_path: Extracted from page_link or template_page_link
      • utm_source: Extracted if not found in url_tags_pivoted
      • utm_medium: Extracted if not found in url_tags_pivoted
      • utm_campaign: Extracted if not found in url_tags_pivoted
      • utm_content: Extracted if not found in url_tags_pivoted
      • utm_term: Extracted if not found in url_tags_pivoted
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[base_url]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • base_url: Directly copied to the output
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[url_host]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • url_host: Directly copied to the output
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[url_path]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • url_path: Directly copied to the output
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[utm_source]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • utm_source: Directly copied to the output
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[utm_medium]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the creatives table
    • Output Columns:
      • utm_medium: Directly copied to the output
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[utm_campaign]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the creatives table
    • Output Columns:
      • utm_campaign: Directly copied to the output
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[utm_content]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the creatives table
    • Output Columns:
      • utm_content: Directly copied to the output
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[utm_term]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the creatives table
    • Output Columns:
      • utm_term: Directly copied to the output
Column Lineage
%3 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp template_page_link 89. model.facebook_ads_source.stg_facebook_ads__creative_history 89. model.facebook_ads_source.stg_facebook_ads__creative_history template_page_link 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f0->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0 78. model.facebook_ads.int_facebook_ads__creative_history 78. model.facebook_ads.int_facebook_ads__creative_history base_url url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f1 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f3 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f7 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f6 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f4 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f5 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f8 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report base_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 78. model.facebook_ads.int_facebook_ads__creative_history:f0->76. model.facebook_ads.facebook_ads__url_report:f0 78. model.facebook_ads.int_facebook_ads__creative_history:f2->76. model.facebook_ads.facebook_ads__url_report:f1 78. model.facebook_ads.int_facebook_ads__creative_history:f3->76. model.facebook_ads.facebook_ads__url_report:f2 78. model.facebook_ads.int_facebook_ads__creative_history:f7->76. model.facebook_ads.facebook_ads__url_report:f6 78. model.facebook_ads.int_facebook_ads__creative_history:f6->76. model.facebook_ads.facebook_ads__url_report:f5 78. model.facebook_ads.int_facebook_ads__creative_history:f4->76. model.facebook_ads.facebook_ads__url_report:f3 78. model.facebook_ads.int_facebook_ads__creative_history:f5->76. model.facebook_ads.facebook_ads__url_report:f4 78. model.facebook_ads.int_facebook_ads__creative_history:f8->76. model.facebook_ads.facebook_ads__url_report:f7
89. model.facebook_ads_source.stg_facebook_ads__creative_history
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[template_page_link]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • template_page_link: Directly mapped
78. model.facebook_ads.int_facebook_ads__creative_history
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[template_page_link]
    • Cleaning Used in COALESCE with page_link
    • Featurization Various URL components and UTM parameters are extracted from this column if page_link is null
    • Output Columns:
      • url: COALESCE(page_link, template_page_link)
      • base_url: Extracted from page_link or template_page_link
      • url_host: Extracted from page_link or template_page_link
      • url_path: Extracted from page_link or template_page_link
      • utm_source: Extracted if not found in url_tags_pivoted and page_link
      • utm_medium: Extracted if not found in url_tags_pivoted and page_link
      • utm_campaign: Extracted if not found in url_tags_pivoted and page_link
      • utm_content: Extracted if not found in url_tags_pivoted and page_link
      • utm_term: Extracted if not found in url_tags_pivoted and page_link
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[base_url]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • base_url: Directly copied to the output
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[url_host]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • url_host: Directly copied to the output
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[url_path]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • url_path: Directly copied to the output
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[utm_source]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • utm_source: Directly copied to the output
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[utm_medium]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the creatives table
    • Output Columns:
      • utm_medium: Directly copied to the output
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[utm_campaign]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the creatives table
    • Output Columns:
      • utm_campaign: Directly copied to the output
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[utm_content]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the creatives table
    • Output Columns:
      • utm_content: Directly copied to the output
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[utm_term]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the creatives table
    • Output Columns:
      • utm_term: Directly copied to the output
Column Lineage
%3 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp id 89. model.facebook_ads_source.stg_facebook_ads__creative_history 89. model.facebook_ads_source.stg_facebook_ads__creative_history creative_id 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f0->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0 77. model.facebook_ads.facebook_ads__url_tags 77. model.facebook_ads.facebook_ads__url_tags creative_id 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->77. model.facebook_ads.facebook_ads__url_tags:f0 78. model.facebook_ads.int_facebook_ads__creative_history 78. model.facebook_ads.int_facebook_ads__creative_history creative_id 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f0 77. model.facebook_ads.facebook_ads__url_tags:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f0 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report creative_id 78. model.facebook_ads.int_facebook_ads__creative_history:f0->76. model.facebook_ads.facebook_ads__url_report:f0
89. model.facebook_ads_source.stg_facebook_ads__creative_history
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[id]
    • Cleaning The column is cast as BIGINT
    • Deduplication Used in the window function to determine the most recent record
    • Output Columns:
      • creative_id: Mapped after casting to BIGINT
77. model.facebook_ads.facebook_ads__url_tags
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[creative_id]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • creative_id: Directly copied
78. model.facebook_ads.int_facebook_ads__creative_history
  • Input Column: 77. model.facebook_ads.facebook_ads__url_tags[creative_id]
    • Integration Used to join with the base table
    • Aggregation Used in GROUP BY clause
    • Output Columns:
      • creative_id: Directly copied to the output
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[creative_id]
    • Direct The column is directly copied without transformation
    • Integration Used as the key to join with the ads table
    • Output Columns:
      • creative_id: Directly copied to the output
Column Lineage
%3 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp account_id 89. model.facebook_ads_source.stg_facebook_ads__creative_history 89. model.facebook_ads_source.stg_facebook_ads__creative_history account_id 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f0->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0 78. model.facebook_ads.int_facebook_ads__creative_history 78. model.facebook_ads.int_facebook_ads__creative_history account_id 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f0
89. model.facebook_ads_source.stg_facebook_ads__creative_history
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[account_id]
    • Cleaning The column is cast as BIGINT
    • Output Columns:
      • account_id: Mapped after casting to BIGINT
78. model.facebook_ads.int_facebook_ads__creative_history
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[account_id]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • account_id: Directly copied
Column Lineage
%3 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp name 89. model.facebook_ads_source.stg_facebook_ads__creative_history 89. model.facebook_ads_source.stg_facebook_ads__creative_history creative_name 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f0->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0 78. model.facebook_ads.int_facebook_ads__creative_history 78. model.facebook_ads.int_facebook_ads__creative_history creative_name 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f0 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report creative_name 78. model.facebook_ads.int_facebook_ads__creative_history:f0->76. model.facebook_ads.facebook_ads__url_report:f0
89. model.facebook_ads_source.stg_facebook_ads__creative_history
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[name]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • creative_name: Renamed and directly mapped
78. model.facebook_ads.int_facebook_ads__creative_history
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[creative_name]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • creative_name: Directly copied
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[creative_name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • creative_name: Directly copied to the output
Column Lineage
%3 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp url_tags 89. model.facebook_ads_source.stg_facebook_ads__creative_history 89. model.facebook_ads_source.stg_facebook_ads__creative_history url_tags 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f0->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0 77. model.facebook_ads.facebook_ads__url_tags 77. model.facebook_ads.facebook_ads__url_tags key type value 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->77. model.facebook_ads.facebook_ads__url_tags:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->77. model.facebook_ads.facebook_ads__url_tags:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->77. model.facebook_ads.facebook_ads__url_tags:f1 78. model.facebook_ads.int_facebook_ads__creative_history 78. model.facebook_ads.int_facebook_ads__creative_history utm_campaign utm_content utm_medium utm_source utm_term 77. model.facebook_ads.facebook_ads__url_tags:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f3 77. model.facebook_ads.facebook_ads__url_tags:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f2 77. model.facebook_ads.facebook_ads__url_tags:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f0 77. model.facebook_ads.facebook_ads__url_tags:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f1 77. model.facebook_ads.facebook_ads__url_tags:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f4 77. model.facebook_ads.facebook_ads__url_tags:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f3 77. model.facebook_ads.facebook_ads__url_tags:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f2 77. model.facebook_ads.facebook_ads__url_tags:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f0 77. model.facebook_ads.facebook_ads__url_tags:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f1 77. model.facebook_ads.facebook_ads__url_tags:f2->78. model.facebook_ads.int_facebook_ads__creative_history:f4 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report utm_campaign utm_content utm_medium utm_source utm_term 78. model.facebook_ads.int_facebook_ads__creative_history:f3->76. model.facebook_ads.facebook_ads__url_report:f3 78. model.facebook_ads.int_facebook_ads__creative_history:f2->76. model.facebook_ads.facebook_ads__url_report:f2 78. model.facebook_ads.int_facebook_ads__creative_history:f0->76. model.facebook_ads.facebook_ads__url_report:f0 78. model.facebook_ads.int_facebook_ads__creative_history:f1->76. model.facebook_ads.facebook_ads__url_report:f1 78. model.facebook_ads.int_facebook_ads__creative_history:f4->76. model.facebook_ads.facebook_ads__url_report:f4
89. model.facebook_ads_source.stg_facebook_ads__creative_history
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[url_tags]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • url_tags: Directly mapped
77. model.facebook_ads.facebook_ads__url_tags
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[url_tags]
    • Filtering The column is filtered to include only non-null values
    • Cleaning The column is cleaned by parsing JSON
    • Other The column is flattened and its contents are extracted into separate columns
    • Output Columns:
      • key: Extracted from flattened url_tags
      • value: Extracted from flattened url_tags
      • type: Extracted from flattened url_tags
78. model.facebook_ads.int_facebook_ads__creative_history
  • Input Column: 77. model.facebook_ads.facebook_ads__url_tags[key]
    • Featurization Used to pivot the data, extracting different UTM parameters
    • Output Columns:
      • utm_source: Mapped when key = 'utm_source'
      • utm_medium: Mapped when key = 'utm_medium'
      • utm_campaign: Mapped when key = 'utm_campaign'
      • utm_content: Mapped when key = 'utm_content'
      • utm_term: Mapped when key = 'utm_term'
  • Input Column: 77. model.facebook_ads.facebook_ads__url_tags[value]
    • Featurization Used as the value for the pivoted UTM parameters
    • Output Columns:
      • utm_source: Mapped when key = 'utm_source'
      • utm_medium: Mapped when key = 'utm_medium'
      • utm_campaign: Mapped when key = 'utm_campaign'
      • utm_content: Mapped when key = 'utm_content'
      • utm_term: Mapped when key = 'utm_term'
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[utm_source]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • utm_source: Directly copied to the output
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[utm_medium]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the creatives table
    • Output Columns:
      • utm_medium: Directly copied to the output
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[utm_campaign]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the creatives table
    • Output Columns:
      • utm_campaign: Directly copied to the output
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[utm_content]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the creatives table
    • Output Columns:
      • utm_content: Directly copied to the output
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[utm_term]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the creatives table
    • Output Columns:
      • utm_term: Directly copied to the output
Column Lineage
%3 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp _fivetran_synced 89. model.facebook_ads_source.stg_facebook_ads__creative_history 89. model.facebook_ads_source.stg_facebook_ads__creative_history _fivetran_synced 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f0->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0
89. model.facebook_ads_source.stg_facebook_ads__creative_history
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[_fivetran_synced]
    • Cleaning The column is cast as TIMESTAMP
    • Deduplication Used in the window function to determine the most recent record
    • Output Columns:
      • _fivetran_synced: Directly mapped
Column Lineage
%3 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp object_story_link_data_child_attachments 89. model.facebook_ads_source.stg_facebook_ads__creative_history 89. model.facebook_ads_source.stg_facebook_ads__creative_history object_story_link_data_child_attachments 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f0->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0
89. model.facebook_ads_source.stg_facebook_ads__creative_history
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[object_story_link_data_child_attachments]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • object_story_link_data_child_attachments: Directly mapped
Column Lineage
%3 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp object_story_link_data_caption 89. model.facebook_ads_source.stg_facebook_ads__creative_history 89. model.facebook_ads_source.stg_facebook_ads__creative_history object_story_link_data_caption 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f0->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0
89. model.facebook_ads_source.stg_facebook_ads__creative_history
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[object_story_link_data_caption]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • object_story_link_data_caption: Directly mapped
Column Lineage
%3 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp object_story_link_data_description 89. model.facebook_ads_source.stg_facebook_ads__creative_history 89. model.facebook_ads_source.stg_facebook_ads__creative_history object_story_link_data_description 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f0->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0
89. model.facebook_ads_source.stg_facebook_ads__creative_history
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[object_story_link_data_description]
    • Direct This column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the 'fields' CTE
    • Output Columns:
      • object_story_link_data_description: Directly mapped to this output column
Column Lineage
%3 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp object_story_link_data_link 89. model.facebook_ads_source.stg_facebook_ads__creative_history 89. model.facebook_ads_source.stg_facebook_ads__creative_history object_story_link_data_link 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f0->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0 78. model.facebook_ads.int_facebook_ads__creative_history 78. model.facebook_ads.int_facebook_ads__creative_history base_url url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f1 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f0 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f2 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f3 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f7 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f6 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f4 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f5 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f8 76. model.facebook_ads.facebook_ads__url_report 76. model.facebook_ads.facebook_ads__url_report base_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 78. model.facebook_ads.int_facebook_ads__creative_history:f0->76. model.facebook_ads.facebook_ads__url_report:f0 78. model.facebook_ads.int_facebook_ads__creative_history:f2->76. model.facebook_ads.facebook_ads__url_report:f1 78. model.facebook_ads.int_facebook_ads__creative_history:f3->76. model.facebook_ads.facebook_ads__url_report:f2 78. model.facebook_ads.int_facebook_ads__creative_history:f7->76. model.facebook_ads.facebook_ads__url_report:f6 78. model.facebook_ads.int_facebook_ads__creative_history:f6->76. model.facebook_ads.facebook_ads__url_report:f5 78. model.facebook_ads.int_facebook_ads__creative_history:f4->76. model.facebook_ads.facebook_ads__url_report:f3 78. model.facebook_ads.int_facebook_ads__creative_history:f5->76. model.facebook_ads.facebook_ads__url_report:f4 78. model.facebook_ads.int_facebook_ads__creative_history:f8->76. model.facebook_ads.facebook_ads__url_report:f7
89. model.facebook_ads_source.stg_facebook_ads__creative_history
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[object_story_link_data_link]
    • Direct This column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the 'fields' CTE
    • Output Columns:
      • object_story_link_data_link: Directly mapped to this output column
78. model.facebook_ads.int_facebook_ads__creative_history
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[object_story_link_data_link]
    • Cleaning This column is likely used in the COALESCE function with template_page_link to create the 'url' column.
    • Featurization Various parts of the URL are extracted from this column to create different features.
    • Output Columns:
      • url: Potentially used in COALESCE(page_link, template_page_link)
      • base_url: Extracted from this column
      • url_host: Extracted and cleaned from this column
      • url_path: Extracted and cleaned from this column
      • utm_source: Potentially extracted from this column if not found in url_tags
      • utm_medium: Potentially extracted from this column if not found in url_tags
      • utm_campaign: Potentially extracted from this column if not found in url_tags
      • utm_content: Potentially extracted from this column if not found in url_tags
      • utm_term: Potentially extracted from this column if not found in url_tags
76. model.facebook_ads.facebook_ads__url_report
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[base_url]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • base_url: Directly copied to the output
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[url_host]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • url_host: Directly copied to the output
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[url_path]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • url_path: Directly copied to the output
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[utm_source]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • utm_source: Directly copied to the output
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[utm_medium]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the creatives table
    • Output Columns:
      • utm_medium: Directly copied to the output
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[utm_campaign]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the creatives table
    • Output Columns:
      • utm_campaign: Directly copied to the output
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[utm_content]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the creatives table
    • Output Columns:
      • utm_content: Directly copied to the output
  • Input Column: 78. model.facebook_ads.int_facebook_ads__creative_history[utm_term]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the creatives table
    • Output Columns:
      • utm_term: Directly copied to the output
Column Lineage
%3 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp object_story_link_data_message 89. model.facebook_ads_source.stg_facebook_ads__creative_history 89. model.facebook_ads_source.stg_facebook_ads__creative_history object_story_link_data_message 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f0->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0
89. model.facebook_ads_source.stg_facebook_ads__creative_history
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[object_story_link_data_message]
    • Direct This column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the 'fields' CTE
    • Output Columns:
      • object_story_link_data_message: Directly mapped to this output column
Column Lineage
%3 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp _fivetran_id 89. model.facebook_ads_source.stg_facebook_ads__creative_history 89. model.facebook_ads_source.stg_facebook_ads__creative_history _fivetran_id is_most_recent_record 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f0->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp:f0->89. model.facebook_ads_source.stg_facebook_ads__creative_history:f1 77. model.facebook_ads.facebook_ads__url_tags 77. model.facebook_ads.facebook_ads__url_tags _fivetran_id 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->77. model.facebook_ads.facebook_ads__url_tags:f0 78. model.facebook_ads.int_facebook_ads__creative_history 78. model.facebook_ads.int_facebook_ads__creative_history _fivetran_id 89. model.facebook_ads_source.stg_facebook_ads__creative_history:f0->78. model.facebook_ads.int_facebook_ads__creative_history:f0
89. model.facebook_ads_source.stg_facebook_ads__creative_history
  • Input Column: 90. model.facebook_ads_source.stg_facebook_ads__creative_history_tmp[_fivetran_id]
    • Direct This column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the 'fields' CTE
    • Deduplication This column is used in the window function to determine the most recent record
    • Output Columns:
      • _fivetran_id: Directly mapped to this output column
      • is_most_recent_record: Indirectly used to determine this flag
77. model.facebook_ads.facebook_ads__url_tags
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[_fivetran_id]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • _fivetran_id: Directly copied
78. model.facebook_ads.int_facebook_ads__creative_history
  • Input Column: 89. model.facebook_ads_source.stg_facebook_ads__creative_history[_fivetran_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with url_tags_pivoted
    • Output Columns:
      • _fivetran_id: Directly copied
91. model.google_ads.google_ads__account_report

This SQL query combines data from Google Ads account statistics and account history. It filters the account history to only include the most recent records, joins this with the account statistics, and then aggregates various metrics (spend, clicks, impressions, conversions) at the account level. The result provides a comprehensive view of each account's performance and characteristics.

FilteringIntegrationAggregation
SQL Query
WITH stats AS (
  SELECT
    *
  FROM TEST.PUBLIC_google_ads_source.stg_google_ads__account_stats
), accounts AS (
  SELECT
    *
  FROM TEST.PUBLIC_google_ads_source.stg_google_ads__account_history
  WHERE
    is_most_recent_record = TRUE
), fields AS (
  SELECT
    stats.source_relation,
    stats.date_day,
    accounts.account_name,
    stats.account_id,
    accounts.currency_code,
    accounts.auto_tagging_enabled,
    accounts.time_zone,
    SUM(stats.spend) AS spend,
    SUM(stats.clicks) AS clicks,
    SUM(stats.impressions) AS impressions,
    SUM(stats.conversions) AS conversions,
    SUM(stats.conversions_value) AS conversions_value,
    SUM(stats.view_through_conversions) AS view_through_conversions
  FROM stats
  LEFT JOIN accounts
    ON stats.account_id = accounts.account_id
    AND stats.source_relation = accounts.source_relation
  GROUP BY
    1,
    2,
    3,
    4,
    5,
    6,
    7
)
SELECT
  *
FROM fields
%3 91. model.google_ads.google_ads__account_report 91. model.google_ads.google_ads__account_report source_relation date_day account_name account_id time_zone currency_code auto_tagging_enabled spend clicks impressions conversions conversions_value view_through_conversions 97. model.google_ads_source.stg_google_ads__account_history 97. model.google_ads_source.stg_google_ads__account_history source_relation account_id currency_code auto_tagging_enabled time_zone account_name 97. model.google_ads_source.stg_google_ads__account_history:f0->91. model.google_ads.google_ads__account_report:f0 97. model.google_ads_source.stg_google_ads__account_history:f1->91. model.google_ads.google_ads__account_report:f3 97. model.google_ads_source.stg_google_ads__account_history:f2->91. model.google_ads.google_ads__account_report:f5 97. model.google_ads_source.stg_google_ads__account_history:f3->91. model.google_ads.google_ads__account_report:f6 97. model.google_ads_source.stg_google_ads__account_history:f4->91. model.google_ads.google_ads__account_report:f4 97. model.google_ads_source.stg_google_ads__account_history:f5->91. model.google_ads.google_ads__account_report:f2 99. model.google_ads_source.stg_google_ads__account_stats 99. model.google_ads_source.stg_google_ads__account_stats source_relation account_id date_day clicks spend impressions conversions conversions_value view_through_conversions 99. model.google_ads_source.stg_google_ads__account_stats:f0->91. model.google_ads.google_ads__account_report:f0 99. model.google_ads_source.stg_google_ads__account_stats:f1->91. model.google_ads.google_ads__account_report:f3 99. model.google_ads_source.stg_google_ads__account_stats:f2->91. model.google_ads.google_ads__account_report:f1 99. model.google_ads_source.stg_google_ads__account_stats:f3->91. model.google_ads.google_ads__account_report:f8 99. model.google_ads_source.stg_google_ads__account_stats:f4->91. model.google_ads.google_ads__account_report:f7 99. model.google_ads_source.stg_google_ads__account_stats:f5->91. model.google_ads.google_ads__account_report:f9 99. model.google_ads_source.stg_google_ads__account_stats:f6->91. model.google_ads.google_ads__account_report:f10 99. model.google_ads_source.stg_google_ads__account_stats:f7->91. model.google_ads.google_ads__account_report:f11 99. model.google_ads_source.stg_google_ads__account_stats:f8->91. model.google_ads.google_ads__account_report:f12
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
date_day date The date being reported on.
account_name integer The descriptive name of the Customer account.
account_id integer The Customer ID.
time_zone integer The time zone which the account is located.
currency_code text The currency which the account uses.
auto_tagging_enabled boolean Boolean indicating if the account uses auto tagging within ad urls.
spend numeric Total cost of ad clicks.
clicks bigint The count of clicks.
impressions bigint The count of impressions.
conversions bigint The number of conversions you've received, across your conversion actions. Conversions are measured with conversion tracking and may include [modeled](https://support.google.com/google-ads/answer/10081327?sjid=12862894247631803415-NC) conversions in cases where you are not able to observe all conversions that took place. You can use this column to see how often your ads led customers to actions that you’ve defined as valuable for your business.
conversions_value bigint The sum of monetary values for your `conversions`. You have to enter a value in the Google Ads UI for your conversion actions to make this metric useful.
view_through_conversions bigint For video campaigns, view-through conversions tell you when an _impression_ of your video ad leads to a conversion on your site. The last impression of a video ad will get credit for the view-through conversion. Keep in mind: An impression is different than a “view” of a video ad. A “view” is counted when someone watches 30 seconds (or the whole ad if it’s shorter than 30 seconds) or clicks on a part of the ad. A “view” that leads to a conversion is counted in the `conversions` column.
Column Lineage
%3 97. model.google_ads_source.stg_google_ads__account_history 97. model.google_ads_source.stg_google_ads__account_history source_relation 91. model.google_ads.google_ads__account_report 91. model.google_ads.google_ads__account_report source_relation 97. model.google_ads_source.stg_google_ads__account_history:f0->91. model.google_ads.google_ads__account_report:f0 99. model.google_ads_source.stg_google_ads__account_stats 99. model.google_ads_source.stg_google_ads__account_stats source_relation 99. model.google_ads_source.stg_google_ads__account_stats:f0->91. model.google_ads.google_ads__account_report:f0
91. model.google_ads.google_ads__account_report
  • Input Column: 97. model.google_ads_source.stg_google_ads__account_history[source_relation]
    • Direct The column is directly copied without transformation
    • Integration Used as part of the join condition with stats table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to output
  • Input Column: 99. model.google_ads_source.stg_google_ads__account_stats[source_relation]
    • Direct The column is directly copied without transformation
    • Integration Used as part of the join condition with accounts table
    • Aggregation Used in GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to output
Column Lineage
%3 99. model.google_ads_source.stg_google_ads__account_stats 99. model.google_ads_source.stg_google_ads__account_stats date_day 91. model.google_ads.google_ads__account_report 91. model.google_ads.google_ads__account_report date_day 99. model.google_ads_source.stg_google_ads__account_stats:f0->91. model.google_ads.google_ads__account_report:f0 100. model.google_ads_source.stg_google_ads__account_stats_tmp 100. model.google_ads_source.stg_google_ads__account_stats_tmp date 100. model.google_ads_source.stg_google_ads__account_stats_tmp:f0->99. model.google_ads_source.stg_google_ads__account_stats:f0
99. model.google_ads_source.stg_google_ads__account_stats
  • Input Column: 100. model.google_ads_source.stg_google_ads__account_stats_tmp[date]
    • Cleaning The column is cast to DATE data type
    • Direct The column is directly copied to the output
    • Output Columns:
      • date_day: Directly mapped and renamed
91. model.google_ads.google_ads__account_report
  • Input Column: 99. model.google_ads_source.stg_google_ads__account_stats[date_day]
    • Direct The column is directly copied without transformation
    • Aggregation Used in GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to output
Column Lineage
%3 97. model.google_ads_source.stg_google_ads__account_history 97. model.google_ads_source.stg_google_ads__account_history account_name 91. model.google_ads.google_ads__account_report 91. model.google_ads.google_ads__account_report account_name 97. model.google_ads_source.stg_google_ads__account_history:f0->91. model.google_ads.google_ads__account_report:f0 98. model.google_ads_source.stg_google_ads__account_history_tmp 98. model.google_ads_source.stg_google_ads__account_history_tmp descriptive_name 98. model.google_ads_source.stg_google_ads__account_history_tmp:f0->97. model.google_ads_source.stg_google_ads__account_history:f0
97. model.google_ads_source.stg_google_ads__account_history
  • Input Column: 98. model.google_ads_source.stg_google_ads__account_history_tmp[descriptive_name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • account_name: Directly mapped
91. model.google_ads.google_ads__account_report
  • Input Column: 97. model.google_ads_source.stg_google_ads__account_history[account_name]
    • Direct The column is directly copied without transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • account_name: Directly copied to output
Column Lineage
%3 97. model.google_ads_source.stg_google_ads__account_history 97. model.google_ads_source.stg_google_ads__account_history account_id 91. model.google_ads.google_ads__account_report 91. model.google_ads.google_ads__account_report account_id 97. model.google_ads_source.stg_google_ads__account_history:f0->91. model.google_ads.google_ads__account_report:f0 99. model.google_ads_source.stg_google_ads__account_stats 99. model.google_ads_source.stg_google_ads__account_stats account_id 99. model.google_ads_source.stg_google_ads__account_stats:f0->91. model.google_ads.google_ads__account_report:f0 98. model.google_ads_source.stg_google_ads__account_history_tmp 98. model.google_ads_source.stg_google_ads__account_history_tmp id 98. model.google_ads_source.stg_google_ads__account_history_tmp:f0->97. model.google_ads_source.stg_google_ads__account_history:f0 100. model.google_ads_source.stg_google_ads__account_stats_tmp 100. model.google_ads_source.stg_google_ads__account_stats_tmp customer_id 100. model.google_ads_source.stg_google_ads__account_stats_tmp:f0->99. model.google_ads_source.stg_google_ads__account_stats:f0
97. model.google_ads_source.stg_google_ads__account_history
  • Input Column: 98. model.google_ads_source.stg_google_ads__account_history_tmp[id]
    • Direct The column is directly copied without transformation
    • Deduplication Used in ROW_NUMBER() function to determine the most recent record
    • Output Columns:
      • account_id: Directly mapped
99. model.google_ads_source.stg_google_ads__account_stats
  • Input Column: 100. model.google_ads_source.stg_google_ads__account_stats_tmp[customer_id]
    • Cleaning The column is cast to INT data type
    • Direct The column is directly copied to the output
    • Output Columns:
      • account_id: Directly mapped and renamed
91. model.google_ads.google_ads__account_report
  • Input Column: 97. model.google_ads_source.stg_google_ads__account_history[account_id]
    • Direct The column is directly copied without transformation
    • Integration Used as the key to join with stats table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • account_id: Directly copied to output
  • Input Column: 99. model.google_ads_source.stg_google_ads__account_stats[account_id]
    • Direct The column is directly copied without transformation
    • Integration Used as the key to join with accounts table
    • Aggregation Used in GROUP BY clause
    • Output Columns:
      • account_id: Directly copied to output
Column Lineage
%3 97. model.google_ads_source.stg_google_ads__account_history 97. model.google_ads_source.stg_google_ads__account_history time_zone 91. model.google_ads.google_ads__account_report 91. model.google_ads.google_ads__account_report time_zone 97. model.google_ads_source.stg_google_ads__account_history:f0->91. model.google_ads.google_ads__account_report:f0 98. model.google_ads_source.stg_google_ads__account_history_tmp 98. model.google_ads_source.stg_google_ads__account_history_tmp time_zone 98. model.google_ads_source.stg_google_ads__account_history_tmp:f0->97. model.google_ads_source.stg_google_ads__account_history:f0
97. model.google_ads_source.stg_google_ads__account_history
  • Input Column: 98. model.google_ads_source.stg_google_ads__account_history_tmp[time_zone]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • time_zone: Directly mapped to the output 'time_zone' column
91. model.google_ads.google_ads__account_report
  • Input Column: 97. model.google_ads_source.stg_google_ads__account_history[time_zone]
    • Direct The column is directly copied without transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • time_zone: Directly copied to output
Column Lineage
%3 97. model.google_ads_source.stg_google_ads__account_history 97. model.google_ads_source.stg_google_ads__account_history currency_code 91. model.google_ads.google_ads__account_report 91. model.google_ads.google_ads__account_report currency_code 97. model.google_ads_source.stg_google_ads__account_history:f0->91. model.google_ads.google_ads__account_report:f0 98. model.google_ads_source.stg_google_ads__account_history_tmp 98. model.google_ads_source.stg_google_ads__account_history_tmp currency_code 98. model.google_ads_source.stg_google_ads__account_history_tmp:f0->97. model.google_ads_source.stg_google_ads__account_history:f0
97. model.google_ads_source.stg_google_ads__account_history
  • Input Column: 98. model.google_ads_source.stg_google_ads__account_history_tmp[currency_code]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • currency_code: Directly mapped
91. model.google_ads.google_ads__account_report
  • Input Column: 97. model.google_ads_source.stg_google_ads__account_history[currency_code]
    • Direct The column is directly copied without transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • currency_code: Directly copied to output
Column Lineage
%3 97. model.google_ads_source.stg_google_ads__account_history 97. model.google_ads_source.stg_google_ads__account_history auto_tagging_enabled 91. model.google_ads.google_ads__account_report 91. model.google_ads.google_ads__account_report auto_tagging_enabled 97. model.google_ads_source.stg_google_ads__account_history:f0->91. model.google_ads.google_ads__account_report:f0 98. model.google_ads_source.stg_google_ads__account_history_tmp 98. model.google_ads_source.stg_google_ads__account_history_tmp auto_tagging_enabled 98. model.google_ads_source.stg_google_ads__account_history_tmp:f0->97. model.google_ads_source.stg_google_ads__account_history:f0
97. model.google_ads_source.stg_google_ads__account_history
  • Input Column: 98. model.google_ads_source.stg_google_ads__account_history_tmp[auto_tagging_enabled]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • auto_tagging_enabled: Directly mapped
91. model.google_ads.google_ads__account_report
  • Input Column: 97. model.google_ads_source.stg_google_ads__account_history[auto_tagging_enabled]
    • Direct The column is directly copied without transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • auto_tagging_enabled: Directly copied to output
Column Lineage
%3 99. model.google_ads_source.stg_google_ads__account_stats 99. model.google_ads_source.stg_google_ads__account_stats spend 91. model.google_ads.google_ads__account_report 91. model.google_ads.google_ads__account_report spend 99. model.google_ads_source.stg_google_ads__account_stats:f0->91. model.google_ads.google_ads__account_report:f0 100. model.google_ads_source.stg_google_ads__account_stats_tmp 100. model.google_ads_source.stg_google_ads__account_stats_tmp cost_micros 100. model.google_ads_source.stg_google_ads__account_stats_tmp:f0->99. model.google_ads_source.stg_google_ads__account_stats:f0
99. model.google_ads_source.stg_google_ads__account_stats
  • Input Column: 100. model.google_ads_source.stg_google_ads__account_stats_tmp[cost_micros]
    • Cleaning The column is coalesced with 0 to handle null values
    • Other The value is divided by 1,000,000 to convert from micros to a decimal value
    • Output Columns:
      • spend: Transformed and mapped to this output column
91. model.google_ads.google_ads__account_report
  • Input Column: 99. model.google_ads_source.stg_google_ads__account_stats[spend]
    • Aggregation The column is summed up in the SELECT clause
    • Output Columns:
      • spend: Aggregated sum in output
Column Lineage
%3 99. model.google_ads_source.stg_google_ads__account_stats 99. model.google_ads_source.stg_google_ads__account_stats clicks 91. model.google_ads.google_ads__account_report 91. model.google_ads.google_ads__account_report clicks 99. model.google_ads_source.stg_google_ads__account_stats:f0->91. model.google_ads.google_ads__account_report:f0 100. model.google_ads_source.stg_google_ads__account_stats_tmp 100. model.google_ads_source.stg_google_ads__account_stats_tmp clicks 100. model.google_ads_source.stg_google_ads__account_stats_tmp:f0->99. model.google_ads_source.stg_google_ads__account_stats:f0
99. model.google_ads_source.stg_google_ads__account_stats
  • Input Column: 100. model.google_ads_source.stg_google_ads__account_stats_tmp[clicks]
    • Cleaning The column is coalesced with 0 to handle null values
    • Output Columns:
      • clicks: Directly mapped after cleaning
91. model.google_ads.google_ads__account_report
  • Input Column: 99. model.google_ads_source.stg_google_ads__account_stats[clicks]
    • Aggregation The column is summed up in the SELECT clause
    • Output Columns:
      • clicks: Aggregated sum in output
Column Lineage
%3 99. model.google_ads_source.stg_google_ads__account_stats 99. model.google_ads_source.stg_google_ads__account_stats impressions 91. model.google_ads.google_ads__account_report 91. model.google_ads.google_ads__account_report impressions 99. model.google_ads_source.stg_google_ads__account_stats:f0->91. model.google_ads.google_ads__account_report:f0 100. model.google_ads_source.stg_google_ads__account_stats_tmp 100. model.google_ads_source.stg_google_ads__account_stats_tmp impressions 100. model.google_ads_source.stg_google_ads__account_stats_tmp:f0->99. model.google_ads_source.stg_google_ads__account_stats:f0
99. model.google_ads_source.stg_google_ads__account_stats
  • Input Column: 100. model.google_ads_source.stg_google_ads__account_stats_tmp[impressions]
    • Cleaning The column is coalesced with 0 to handle null values
    • Output Columns:
      • impressions: Directly mapped after cleaning
91. model.google_ads.google_ads__account_report
  • Input Column: 99. model.google_ads_source.stg_google_ads__account_stats[impressions]
    • Aggregation The column is summed up in the SELECT clause
    • Output Columns:
      • impressions: Aggregated sum in output
Column Lineage
%3 99. model.google_ads_source.stg_google_ads__account_stats 99. model.google_ads_source.stg_google_ads__account_stats conversions 91. model.google_ads.google_ads__account_report 91. model.google_ads.google_ads__account_report conversions 99. model.google_ads_source.stg_google_ads__account_stats:f0->91. model.google_ads.google_ads__account_report:f0 100. model.google_ads_source.stg_google_ads__account_stats_tmp 100. model.google_ads_source.stg_google_ads__account_stats_tmp conversions 100. model.google_ads_source.stg_google_ads__account_stats_tmp:f0->99. model.google_ads_source.stg_google_ads__account_stats:f0
99. model.google_ads_source.stg_google_ads__account_stats
  • Input Column: 100. model.google_ads_source.stg_google_ads__account_stats_tmp[conversions]
    • Cleaning The column is coalesced with 0 to handle null values
    • Output Columns:
      • conversions: Directly mapped after cleaning
91. model.google_ads.google_ads__account_report
  • Input Column: 99. model.google_ads_source.stg_google_ads__account_stats[conversions]
    • Aggregation The column is summed up in the SELECT clause
    • Output Columns:
      • conversions: Aggregated sum in output
Column Lineage
%3 99. model.google_ads_source.stg_google_ads__account_stats 99. model.google_ads_source.stg_google_ads__account_stats conversions_value 91. model.google_ads.google_ads__account_report 91. model.google_ads.google_ads__account_report conversions_value 99. model.google_ads_source.stg_google_ads__account_stats:f0->91. model.google_ads.google_ads__account_report:f0 100. model.google_ads_source.stg_google_ads__account_stats_tmp 100. model.google_ads_source.stg_google_ads__account_stats_tmp conversions_value 100. model.google_ads_source.stg_google_ads__account_stats_tmp:f0->99. model.google_ads_source.stg_google_ads__account_stats:f0
99. model.google_ads_source.stg_google_ads__account_stats
  • Input Column: 100. model.google_ads_source.stg_google_ads__account_stats_tmp[conversions_value]
    • Cleaning The column is coalesced with 0 to handle null values
    • Output Columns:
      • conversions_value: Directly mapped after cleaning
91. model.google_ads.google_ads__account_report
  • Input Column: 99. model.google_ads_source.stg_google_ads__account_stats[conversions_value]
    • Aggregation The column is summed up in the SELECT clause
    • Output Columns:
      • conversions_value: Aggregated sum in output
Column Lineage
%3 99. model.google_ads_source.stg_google_ads__account_stats 99. model.google_ads_source.stg_google_ads__account_stats view_through_conversions 91. model.google_ads.google_ads__account_report 91. model.google_ads.google_ads__account_report view_through_conversions 99. model.google_ads_source.stg_google_ads__account_stats:f0->91. model.google_ads.google_ads__account_report:f0 100. model.google_ads_source.stg_google_ads__account_stats_tmp 100. model.google_ads_source.stg_google_ads__account_stats_tmp view_through_conversions 100. model.google_ads_source.stg_google_ads__account_stats_tmp:f0->99. model.google_ads_source.stg_google_ads__account_stats:f0
99. model.google_ads_source.stg_google_ads__account_stats
  • Input Column: 100. model.google_ads_source.stg_google_ads__account_stats_tmp[view_through_conversions]
    • Cleaning The column is coalesced with 0 to handle null values
    • Output Columns:
      • view_through_conversions: Directly mapped after cleaning
91. model.google_ads.google_ads__account_report
  • Input Column: 99. model.google_ads_source.stg_google_ads__account_stats[view_through_conversions]
    • Aggregation This column is summed up in the GROUP BY clause
    • Output Columns:
      • view_through_conversions: The column is aggregated using SUM() function and mapped directly to the output column of the same name
92. model.google_ads.google_ads__ad_group_report

This SQL query integrates data from multiple Google Ads-related tables (ad group stats, account history, campaign history, and ad group history) to create a comprehensive ad group report. It joins these tables, filters for the most recent records in the history tables, and aggregates metrics such as spend, clicks, impressions, and conversions at the ad group level. The result provides a detailed view of ad group performance with associated account, campaign, and ad group attributes.

FilteringIntegrationAggregation
SQL Query
WITH stats AS (
  SELECT
    *
  FROM TEST.PUBLIC_google_ads_source.stg_google_ads__ad_group_stats
), accounts AS (
  SELECT
    *
  FROM TEST.PUBLIC_google_ads_source.stg_google_ads__account_history
  WHERE
    is_most_recent_record = TRUE
), campaigns AS (
  SELECT
    *
  FROM TEST.PUBLIC_google_ads_source.stg_google_ads__campaign_history
  WHERE
    is_most_recent_record = TRUE
), ad_groups AS (
  SELECT
    *
  FROM TEST.PUBLIC_google_ads_source.stg_google_ads__ad_group_history
  WHERE
    is_most_recent_record = TRUE
), fields AS (
  SELECT
    stats.source_relation,
    stats.date_day,
    accounts.account_name,
    accounts.account_id,
    accounts.currency_code,
    campaigns.campaign_name,
    campaigns.campaign_id,
    ad_groups.ad_group_name,
    stats.ad_group_id,
    ad_groups.ad_group_status,
    ad_groups.ad_group_type,
    SUM(stats.spend) AS spend,
    SUM(stats.clicks) AS clicks,
    SUM(stats.impressions) AS impressions,
    SUM(conversions) AS conversions,
    SUM(conversions_value) AS conversions_value,
    SUM(view_through_conversions) AS view_through_conversions
  FROM stats
  LEFT JOIN ad_groups
    ON stats.ad_group_id = ad_groups.ad_group_id
    AND stats.source_relation = ad_groups.source_relation
  LEFT JOIN campaigns
    ON ad_groups.campaign_id = campaigns.campaign_id
    AND ad_groups.source_relation = campaigns.source_relation
  LEFT JOIN accounts
    ON campaigns.account_id = accounts.account_id
    AND campaigns.source_relation = accounts.source_relation
  GROUP BY
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10,
    11
)
SELECT
  *
FROM fields
%3 92. model.google_ads.google_ads__ad_group_report 92. model.google_ads.google_ads__ad_group_report source_relation date_day account_name account_id currency_code campaign_name campaign_id ad_group_name ad_group_id ad_group_status ad_group_type spend clicks impressions conversions conversions_value view_through_conversions 97. model.google_ads_source.stg_google_ads__account_history 97. model.google_ads_source.stg_google_ads__account_history source_relation account_id currency_code account_name 97. model.google_ads_source.stg_google_ads__account_history:f0->92. model.google_ads.google_ads__ad_group_report:f0 97. model.google_ads_source.stg_google_ads__account_history:f1->92. model.google_ads.google_ads__ad_group_report:f3 97. model.google_ads_source.stg_google_ads__account_history:f2->92. model.google_ads.google_ads__ad_group_report:f4 97. model.google_ads_source.stg_google_ads__account_history:f3->92. model.google_ads.google_ads__ad_group_report:f2 103. model.google_ads_source.stg_google_ads__ad_group_history 103. model.google_ads_source.stg_google_ads__ad_group_history source_relation ad_group_id ad_group_type ad_group_name ad_group_status 103. model.google_ads_source.stg_google_ads__ad_group_history:f0->92. model.google_ads.google_ads__ad_group_report:f0 103. model.google_ads_source.stg_google_ads__ad_group_history:f1->92. model.google_ads.google_ads__ad_group_report:f8 103. model.google_ads_source.stg_google_ads__ad_group_history:f2->92. model.google_ads.google_ads__ad_group_report:f10 103. model.google_ads_source.stg_google_ads__ad_group_history:f3->92. model.google_ads.google_ads__ad_group_report:f7 103. model.google_ads_source.stg_google_ads__ad_group_history:f4->92. model.google_ads.google_ads__ad_group_report:f9 105. model.google_ads_source.stg_google_ads__ad_group_stats 105. model.google_ads_source.stg_google_ads__ad_group_stats source_relation date_day ad_group_id clicks spend impressions conversions conversions_value view_through_conversions 105. model.google_ads_source.stg_google_ads__ad_group_stats:f0->92. model.google_ads.google_ads__ad_group_report:f0 105. model.google_ads_source.stg_google_ads__ad_group_stats:f1->92. model.google_ads.google_ads__ad_group_report:f1 105. model.google_ads_source.stg_google_ads__ad_group_stats:f2->92. model.google_ads.google_ads__ad_group_report:f8 105. model.google_ads_source.stg_google_ads__ad_group_stats:f3->92. model.google_ads.google_ads__ad_group_report:f12 105. model.google_ads_source.stg_google_ads__ad_group_stats:f4->92. model.google_ads.google_ads__ad_group_report:f11 105. model.google_ads_source.stg_google_ads__ad_group_stats:f5->92. model.google_ads.google_ads__ad_group_report:f13 105. model.google_ads_source.stg_google_ads__ad_group_stats:f6->92. model.google_ads.google_ads__ad_group_report:f14 105. model.google_ads_source.stg_google_ads__ad_group_stats:f7->92. model.google_ads.google_ads__ad_group_report:f15 105. model.google_ads_source.stg_google_ads__ad_group_stats:f8->92. model.google_ads.google_ads__ad_group_report:f16 111. model.google_ads_source.stg_google_ads__campaign_history 111. model.google_ads_source.stg_google_ads__campaign_history source_relation campaign_id campaign_name 111. model.google_ads_source.stg_google_ads__campaign_history:f0->92. model.google_ads.google_ads__ad_group_report:f0 111. model.google_ads_source.stg_google_ads__campaign_history:f1->92. model.google_ads.google_ads__ad_group_report:f6 111. model.google_ads_source.stg_google_ads__campaign_history:f2->92. model.google_ads.google_ads__ad_group_report:f5
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
date_day date The date being reported on.
account_name integer The descriptive name of the Customer account.
account_id integer The Customer ID.
currency_code text The currency which the account uses.
campaign_name text The name of the campaign, if present in the source data.
campaign_id bigint The ID representing the campaign, if present in the source data.
ad_group_name text The name of the ad group, if present in the source data.
ad_group_id text The ID representing the ad group, if present in the source data.
ad_group_status text The status of the ad group.
ad_group_type text The type of ad group which is serving ads.
spend numeric Total cost of ad clicks.
clicks bigint The count of clicks.
impressions bigint The count of impressions.
conversions double precision The number of conversions you've received, across your conversion actions. Conversions are measured with conversion tracking and may include [modeled](https://support.google.com/google-ads/answer/10081327?sjid=12862894247631803415-NC) conversions in cases where you are not able to observe all conversions that took place. You can use this column to see how often your ads led customers to actions that you’ve defined as valuable for your business.
conversions_value bigint The sum of monetary values for your `conversions`. You have to enter a value in the Google Ads UI for your conversion actions to make this metric useful.
view_through_conversions bigint For video campaigns, view-through conversions tell you when an _impression_ of your video ad leads to a conversion on your site. The last impression of a video ad will get credit for the view-through conversion. Keep in mind: An impression is different than a “view” of a video ad. A “view” is counted when someone watches 30 seconds (or the whole ad if it’s shorter than 30 seconds) or clicks on a part of the ad. A “view” that leads to a conversion is counted in the `conversions` column.
Column Lineage
%3 97. model.google_ads_source.stg_google_ads__account_history 97. model.google_ads_source.stg_google_ads__account_history source_relation 92. model.google_ads.google_ads__ad_group_report 92. model.google_ads.google_ads__ad_group_report source_relation 97. model.google_ads_source.stg_google_ads__account_history:f0->92. model.google_ads.google_ads__ad_group_report:f0 103. model.google_ads_source.stg_google_ads__ad_group_history 103. model.google_ads_source.stg_google_ads__ad_group_history source_relation 103. model.google_ads_source.stg_google_ads__ad_group_history:f0->92. model.google_ads.google_ads__ad_group_report:f0 105. model.google_ads_source.stg_google_ads__ad_group_stats 105. model.google_ads_source.stg_google_ads__ad_group_stats source_relation 105. model.google_ads_source.stg_google_ads__ad_group_stats:f0->92. model.google_ads.google_ads__ad_group_report:f0 111. model.google_ads_source.stg_google_ads__campaign_history 111. model.google_ads_source.stg_google_ads__campaign_history source_relation 111. model.google_ads_source.stg_google_ads__campaign_history:f0->92. model.google_ads.google_ads__ad_group_report:f0
92. model.google_ads.google_ads__ad_group_report
  • Input Column: 97. model.google_ads_source.stg_google_ads__account_history[source_relation]
    • Integration Used as part of the JOIN condition to link accounts with other tables
    • Direct Directly copied to the output
    • Output Columns:
      • source_relation: Directly copied
  • Input Column: 103. model.google_ads_source.stg_google_ads__ad_group_history[source_relation]
    • Direct The column is directly copied without transformation
    • Integration Used as part of the JOIN condition
    • Output Columns:
      • source_relation: Directly copied to the output
  • Input Column: 105. model.google_ads_source.stg_google_ads__ad_group_stats[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with other tables
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
  • Input Column: 111. model.google_ads_source.stg_google_ads__campaign_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly selected in the final output
    • Output Columns:
      • source_relation: directly copied to the output
Column Lineage
%3 105. model.google_ads_source.stg_google_ads__ad_group_stats 105. model.google_ads_source.stg_google_ads__ad_group_stats date_day 92. model.google_ads.google_ads__ad_group_report 92. model.google_ads.google_ads__ad_group_report date_day 105. model.google_ads_source.stg_google_ads__ad_group_stats:f0->92. model.google_ads.google_ads__ad_group_report:f0 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp date 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp:f0->105. model.google_ads_source.stg_google_ads__ad_group_stats:f0
105. model.google_ads_source.stg_google_ads__ad_group_stats
  • Input Column: 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp[date]
    • Cleaning The column is cast to DATE type
    • Direct The column is directly copied to the output
    • Output Columns:
      • date_day: Directly mapped after casting
92. model.google_ads.google_ads__ad_group_report
  • Input Column: 105. model.google_ads_source.stg_google_ads__ad_group_stats[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 97. model.google_ads_source.stg_google_ads__account_history 97. model.google_ads_source.stg_google_ads__account_history account_name 92. model.google_ads.google_ads__ad_group_report 92. model.google_ads.google_ads__ad_group_report account_name 97. model.google_ads_source.stg_google_ads__account_history:f0->92. model.google_ads.google_ads__ad_group_report:f0 98. model.google_ads_source.stg_google_ads__account_history_tmp 98. model.google_ads_source.stg_google_ads__account_history_tmp descriptive_name 98. model.google_ads_source.stg_google_ads__account_history_tmp:f0->97. model.google_ads_source.stg_google_ads__account_history:f0
97. model.google_ads_source.stg_google_ads__account_history
  • Input Column: 98. model.google_ads_source.stg_google_ads__account_history_tmp[descriptive_name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • account_name: Directly mapped
92. model.google_ads.google_ads__ad_group_report
  • Input Column: 97. model.google_ads_source.stg_google_ads__account_history[account_name]
    • Direct Directly copied to the output
    • Output Columns:
      • account_name: Directly copied
Column Lineage
%3 97. model.google_ads_source.stg_google_ads__account_history 97. model.google_ads_source.stg_google_ads__account_history account_id 92. model.google_ads.google_ads__ad_group_report 92. model.google_ads.google_ads__ad_group_report account_id 97. model.google_ads_source.stg_google_ads__account_history:f0->92. model.google_ads.google_ads__ad_group_report:f0 98. model.google_ads_source.stg_google_ads__account_history_tmp 98. model.google_ads_source.stg_google_ads__account_history_tmp id 98. model.google_ads_source.stg_google_ads__account_history_tmp:f0->97. model.google_ads_source.stg_google_ads__account_history:f0
97. model.google_ads_source.stg_google_ads__account_history
  • Input Column: 98. model.google_ads_source.stg_google_ads__account_history_tmp[id]
    • Direct The column is directly copied without transformation
    • Deduplication Used in ROW_NUMBER() function to determine the most recent record
    • Output Columns:
      • account_id: Directly mapped
92. model.google_ads.google_ads__ad_group_report
  • Input Column: 97. model.google_ads_source.stg_google_ads__account_history[account_id]
    • Integration Used as part of the JOIN condition to link accounts with other tables
    • Direct Directly copied to the output
    • Output Columns:
      • account_id: Directly copied
Column Lineage
%3 97. model.google_ads_source.stg_google_ads__account_history 97. model.google_ads_source.stg_google_ads__account_history currency_code 92. model.google_ads.google_ads__ad_group_report 92. model.google_ads.google_ads__ad_group_report currency_code 97. model.google_ads_source.stg_google_ads__account_history:f0->92. model.google_ads.google_ads__ad_group_report:f0 98. model.google_ads_source.stg_google_ads__account_history_tmp 98. model.google_ads_source.stg_google_ads__account_history_tmp currency_code 98. model.google_ads_source.stg_google_ads__account_history_tmp:f0->97. model.google_ads_source.stg_google_ads__account_history:f0
97. model.google_ads_source.stg_google_ads__account_history
  • Input Column: 98. model.google_ads_source.stg_google_ads__account_history_tmp[currency_code]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • currency_code: Directly mapped
92. model.google_ads.google_ads__ad_group_report
  • Input Column: 97. model.google_ads_source.stg_google_ads__account_history[currency_code]
    • Direct Directly copied to the output
    • Output Columns:
      • currency_code: Directly copied
Column Lineage
%3 111. model.google_ads_source.stg_google_ads__campaign_history 111. model.google_ads_source.stg_google_ads__campaign_history campaign_name 92. model.google_ads.google_ads__ad_group_report 92. model.google_ads.google_ads__ad_group_report campaign_name 111. model.google_ads_source.stg_google_ads__campaign_history:f0->92. model.google_ads.google_ads__ad_group_report:f0 112. model.google_ads_source.stg_google_ads__campaign_history_tmp 112. model.google_ads_source.stg_google_ads__campaign_history_tmp name 112. model.google_ads_source.stg_google_ads__campaign_history_tmp:f0->111. model.google_ads_source.stg_google_ads__campaign_history:f0
111. model.google_ads_source.stg_google_ads__campaign_history
  • Input Column: 112. model.google_ads_source.stg_google_ads__campaign_history_tmp[name]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • campaign_name: Directly mapped to this output column
92. model.google_ads.google_ads__ad_group_report
  • Input Column: 111. model.google_ads_source.stg_google_ads__campaign_history[campaign_name]
    • Direct The campaign_name is directly copied to the output without transformation
    • Integration Used as part of the join condition with the ad_groups table
    • Output Columns:
      • campaign_name: Directly mapped to the output column
Column Lineage
%3 111. model.google_ads_source.stg_google_ads__campaign_history 111. model.google_ads_source.stg_google_ads__campaign_history campaign_id 92. model.google_ads.google_ads__ad_group_report 92. model.google_ads.google_ads__ad_group_report campaign_id 111. model.google_ads_source.stg_google_ads__campaign_history:f0->92. model.google_ads.google_ads__ad_group_report:f0 112. model.google_ads_source.stg_google_ads__campaign_history_tmp 112. model.google_ads_source.stg_google_ads__campaign_history_tmp id 112. model.google_ads_source.stg_google_ads__campaign_history_tmp:f0->111. model.google_ads_source.stg_google_ads__campaign_history:f0
111. model.google_ads_source.stg_google_ads__campaign_history
  • Input Column: 112. model.google_ads_source.stg_google_ads__campaign_history_tmp[id]
    • Direct The column is directly copied without any transformation
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • campaign_id: Directly mapped to this output column
92. model.google_ads.google_ads__ad_group_report
  • Input Column: 111. model.google_ads_source.stg_google_ads__campaign_history[campaign_id]
    • Integration used as the join key between campaigns and ad_groups tables
    • Direct directly selected in the final output
    • Output Columns:
      • campaign_id: directly copied to the output
Column Lineage
%3 103. model.google_ads_source.stg_google_ads__ad_group_history 103. model.google_ads_source.stg_google_ads__ad_group_history ad_group_name 92. model.google_ads.google_ads__ad_group_report 92. model.google_ads.google_ads__ad_group_report ad_group_name 103. model.google_ads_source.stg_google_ads__ad_group_history:f0->92. model.google_ads.google_ads__ad_group_report:f0 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp name 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp:f0->103. model.google_ads_source.stg_google_ads__ad_group_history:f0
103. model.google_ads_source.stg_google_ads__ad_group_history
  • Input Column: 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp[name]
    • Direct Copied without transformation
    • Output Columns:
      • ad_group_name: Directly mapped and renamed
92. model.google_ads.google_ads__ad_group_report
  • Input Column: 103. model.google_ads_source.stg_google_ads__ad_group_history[ad_group_name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • ad_group_name: Directly copied to the output
Column Lineage
%3 103. model.google_ads_source.stg_google_ads__ad_group_history 103. model.google_ads_source.stg_google_ads__ad_group_history ad_group_id 92. model.google_ads.google_ads__ad_group_report 92. model.google_ads.google_ads__ad_group_report ad_group_id 103. model.google_ads_source.stg_google_ads__ad_group_history:f0->92. model.google_ads.google_ads__ad_group_report:f0 105. model.google_ads_source.stg_google_ads__ad_group_stats 105. model.google_ads_source.stg_google_ads__ad_group_stats ad_group_id 105. model.google_ads_source.stg_google_ads__ad_group_stats:f0->92. model.google_ads.google_ads__ad_group_report:f0 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp id 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp:f0->103. model.google_ads_source.stg_google_ads__ad_group_history:f0 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp id 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp:f0->105. model.google_ads_source.stg_google_ads__ad_group_stats:f0
103. model.google_ads_source.stg_google_ads__ad_group_history
  • Input Column: 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp[id]
    • Cleaning The column is cast to TEXT type
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • ad_group_id: Directly mapped after casting to TEXT
105. model.google_ads_source.stg_google_ads__ad_group_stats
  • Input Column: 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp[id]
    • Cleaning The column is cast as INT in the fields CTE and then cast as TEXT in the final CTE
    • Output Columns:
      • ad_group_id: Mapped after casting to TEXT
92. model.google_ads.google_ads__ad_group_report
  • Input Column: 103. model.google_ads_source.stg_google_ads__ad_group_history[ad_group_id]
    • Direct The column is directly copied without transformation
    • Integration Used as part of the JOIN condition
    • Output Columns:
      • ad_group_id: Directly copied to the output
  • Input Column: 105. model.google_ads_source.stg_google_ads__ad_group_stats[ad_group_id]
    • Direct The column is directly copied without any transformation
    • Integration Used to join with the ad_groups table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • ad_group_id: Directly copied to the output
Column Lineage
%3 103. model.google_ads_source.stg_google_ads__ad_group_history 103. model.google_ads_source.stg_google_ads__ad_group_history ad_group_status 92. model.google_ads.google_ads__ad_group_report 92. model.google_ads.google_ads__ad_group_report ad_group_status 103. model.google_ads_source.stg_google_ads__ad_group_history:f0->92. model.google_ads.google_ads__ad_group_report:f0 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp status 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp:f0->103. model.google_ads_source.stg_google_ads__ad_group_history:f0
103. model.google_ads_source.stg_google_ads__ad_group_history
  • Input Column: 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp[status]
    • Direct Copied without transformation
    • Output Columns:
      • ad_group_status: Directly mapped and renamed
92. model.google_ads.google_ads__ad_group_report
  • Input Column: 103. model.google_ads_source.stg_google_ads__ad_group_history[ad_group_status]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • ad_group_status: Directly copied to the output
Column Lineage
%3 103. model.google_ads_source.stg_google_ads__ad_group_history 103. model.google_ads_source.stg_google_ads__ad_group_history ad_group_type 92. model.google_ads.google_ads__ad_group_report 92. model.google_ads.google_ads__ad_group_report ad_group_type 103. model.google_ads_source.stg_google_ads__ad_group_history:f0->92. model.google_ads.google_ads__ad_group_report:f0 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp type 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp:f0->103. model.google_ads_source.stg_google_ads__ad_group_history:f0
103. model.google_ads_source.stg_google_ads__ad_group_history
  • Input Column: 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp[type]
    • Direct Copied without transformation
    • Output Columns:
      • ad_group_type: Directly mapped and renamed
92. model.google_ads.google_ads__ad_group_report
  • Input Column: 103. model.google_ads_source.stg_google_ads__ad_group_history[ad_group_type]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • ad_group_type: Directly copied to the output
Column Lineage
%3 105. model.google_ads_source.stg_google_ads__ad_group_stats 105. model.google_ads_source.stg_google_ads__ad_group_stats spend 92. model.google_ads.google_ads__ad_group_report 92. model.google_ads.google_ads__ad_group_report spend 105. model.google_ads_source.stg_google_ads__ad_group_stats:f0->92. model.google_ads.google_ads__ad_group_report:f0 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp cost_micros 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp:f0->105. model.google_ads_source.stg_google_ads__ad_group_stats:f0
105. model.google_ads_source.stg_google_ads__ad_group_stats
  • Input Column: 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp[cost_micros]
    • Cleaning The column is cast as INT in the fields CTE, COALESCE is applied to replace NULL with 0, and then divided by 1,000,000
    • Output Columns:
      • spend: Mapped after cleaning and calculation
92. model.google_ads.google_ads__ad_group_report
  • Input Column: 105. model.google_ads_source.stg_google_ads__ad_group_stats[spend]
    • Aggregation Summed up in the SELECT clause
    • Output Columns:
      • spend: Aggregated sum in the output
Column Lineage
%3 105. model.google_ads_source.stg_google_ads__ad_group_stats 105. model.google_ads_source.stg_google_ads__ad_group_stats clicks 92. model.google_ads.google_ads__ad_group_report 92. model.google_ads.google_ads__ad_group_report clicks 105. model.google_ads_source.stg_google_ads__ad_group_stats:f0->92. model.google_ads.google_ads__ad_group_report:f0 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp clicks 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp:f0->105. model.google_ads_source.stg_google_ads__ad_group_stats:f0
105. model.google_ads_source.stg_google_ads__ad_group_stats
  • Input Column: 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp[clicks]
    • Cleaning The column is cast as INT in the fields CTE and COALESCE is applied to replace NULL with 0
    • Output Columns:
      • clicks: Mapped after COALESCE is applied
92. model.google_ads.google_ads__ad_group_report
  • Input Column: 105. model.google_ads_source.stg_google_ads__ad_group_stats[clicks]
    • Aggregation Summed up in the SELECT clause
    • Output Columns:
      • clicks: Aggregated sum in the output
Column Lineage
%3 105. model.google_ads_source.stg_google_ads__ad_group_stats 105. model.google_ads_source.stg_google_ads__ad_group_stats impressions 92. model.google_ads.google_ads__ad_group_report 92. model.google_ads.google_ads__ad_group_report impressions 105. model.google_ads_source.stg_google_ads__ad_group_stats:f0->92. model.google_ads.google_ads__ad_group_report:f0 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp impressions 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp:f0->105. model.google_ads_source.stg_google_ads__ad_group_stats:f0
105. model.google_ads_source.stg_google_ads__ad_group_stats
  • Input Column: 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp[impressions]
    • Cleaning The column is cast as INT in the fields CTE and COALESCE is applied to replace NULL with 0
    • Output Columns:
      • impressions: Mapped after COALESCE is applied
92. model.google_ads.google_ads__ad_group_report
  • Input Column: 105. model.google_ads_source.stg_google_ads__ad_group_stats[impressions]
    • Aggregation Summed up in the SELECT clause
    • Output Columns:
      • impressions: Aggregated sum in the output
Column Lineage
%3 105. model.google_ads_source.stg_google_ads__ad_group_stats 105. model.google_ads_source.stg_google_ads__ad_group_stats conversions 92. model.google_ads.google_ads__ad_group_report 92. model.google_ads.google_ads__ad_group_report conversions 105. model.google_ads_source.stg_google_ads__ad_group_stats:f0->92. model.google_ads.google_ads__ad_group_report:f0 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp conversions 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp:f0->105. model.google_ads_source.stg_google_ads__ad_group_stats:f0
105. model.google_ads_source.stg_google_ads__ad_group_stats
  • Input Column: 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp[conversions]
    • Cleaning The column is cast as INT in the fields CTE and COALESCE is applied to replace NULL with 0
    • Output Columns:
      • conversions: Mapped after COALESCE is applied
92. model.google_ads.google_ads__ad_group_report
  • Input Column: 105. model.google_ads_source.stg_google_ads__ad_group_stats[conversions]
    • Aggregation This column is summed up in the GROUP BY clause
    • Output Columns:
      • conversions: The sum of conversions is mapped to the output 'conversions' column
Column Lineage
%3 105. model.google_ads_source.stg_google_ads__ad_group_stats 105. model.google_ads_source.stg_google_ads__ad_group_stats conversions_value 92. model.google_ads.google_ads__ad_group_report 92. model.google_ads.google_ads__ad_group_report conversions_value 105. model.google_ads_source.stg_google_ads__ad_group_stats:f0->92. model.google_ads.google_ads__ad_group_report:f0 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp conversions_value 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp:f0->105. model.google_ads_source.stg_google_ads__ad_group_stats:f0
105. model.google_ads_source.stg_google_ads__ad_group_stats
  • Input Column: 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp[conversions_value]
    • Cleaning The column is cast as INT in the fields CTE and COALESCE is applied to replace NULL with 0
    • Output Columns:
      • conversions_value: Mapped after COALESCE is applied
92. model.google_ads.google_ads__ad_group_report
  • Input Column: 105. model.google_ads_source.stg_google_ads__ad_group_stats[conversions_value]
    • Aggregation This column is summed up in the GROUP BY clause
    • Output Columns:
      • conversions_value: The sum of conversions_value is mapped to the output 'conversions_value' column
Column Lineage
%3 105. model.google_ads_source.stg_google_ads__ad_group_stats 105. model.google_ads_source.stg_google_ads__ad_group_stats view_through_conversions 92. model.google_ads.google_ads__ad_group_report 92. model.google_ads.google_ads__ad_group_report view_through_conversions 105. model.google_ads_source.stg_google_ads__ad_group_stats:f0->92. model.google_ads.google_ads__ad_group_report:f0 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp view_through_conversions 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp:f0->105. model.google_ads_source.stg_google_ads__ad_group_stats:f0
105. model.google_ads_source.stg_google_ads__ad_group_stats
  • Input Column: 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp[view_through_conversions]
    • Cleaning The column is cast to INT in the 'fields' CTE
    • Direct The column is directly copied in the 'final' CTE
    • Output Columns:
      • view_through_conversions: It is directly copied and wrapped in a COALESCE function to replace NULL values with 0
92. model.google_ads.google_ads__ad_group_report
  • Input Column: 105. model.google_ads_source.stg_google_ads__ad_group_stats[view_through_conversions]
    • Aggregation This column is summed up in the GROUP BY clause
    • Output Columns:
      • view_through_conversions: The sum of view_through_conversions is mapped to the output 'view_through_conversions' column
93. model.google_ads.google_ads__ad_report

This SQL query combines data from multiple Google Ads-related tables (ad stats, accounts, campaigns, ad groups, and ads) to create a comprehensive ad performance report. It joins these tables, filters for the most recent records in some cases, and aggregates metrics such as spend, clicks, impressions, and conversions. The result is a detailed view of ad performance across various dimensions like account, campaign, ad group, and individual ad level.

FilteringIntegrationAggregation
SQL Query
WITH stats AS (
  SELECT
    *
  FROM TEST.PUBLIC_google_ads_source.stg_google_ads__ad_stats
), accounts AS (
  SELECT
    *
  FROM TEST.PUBLIC_google_ads_source.stg_google_ads__account_history
  WHERE
    is_most_recent_record = TRUE
), campaigns AS (
  SELECT
    *
  FROM TEST.PUBLIC_google_ads_source.stg_google_ads__campaign_history
  WHERE
    is_most_recent_record = TRUE
), ad_groups AS (
  SELECT
    *
  FROM TEST.PUBLIC_google_ads_source.stg_google_ads__ad_group_history
  WHERE
    is_most_recent_record = TRUE
), ads AS (
  SELECT
    *
  FROM TEST.PUBLIC_google_ads_source.stg_google_ads__ad_history
  WHERE
    is_most_recent_record = TRUE
), fields AS (
  SELECT
    stats.source_relation,
    stats.date_day,
    accounts.account_name,
    accounts.account_id,
    accounts.currency_code,
    campaigns.campaign_name,
    campaigns.campaign_id,
    ad_groups.ad_group_name,
    stats.ad_group_id,
    stats.ad_id,
    ads.ad_name,
    ads.ad_status,
    ads.ad_type,
    ads.display_url,
    ads.source_final_urls,
    SUM(stats.spend) AS spend,
    SUM(stats.clicks) AS clicks,
    SUM(stats.impressions) AS impressions,
    SUM(conversions) AS conversions,
    SUM(conversions_value) AS conversions_value,
    SUM(view_through_conversions) AS view_through_conversions
  FROM stats
  LEFT JOIN ads
    ON stats.ad_id = ads.ad_id
    AND stats.source_relation = ads.source_relation
    AND stats.ad_group_id = ads.ad_group_id
  LEFT JOIN ad_groups
    ON ads.ad_group_id = ad_groups.ad_group_id
    AND ads.source_relation = ad_groups.source_relation
  LEFT JOIN campaigns
    ON ad_groups.campaign_id = campaigns.campaign_id
    AND ad_groups.source_relation = campaigns.source_relation
  LEFT JOIN accounts
    ON campaigns.account_id = accounts.account_id
    AND campaigns.source_relation = accounts.source_relation
  GROUP BY
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10,
    11,
    12,
    13,
    14,
    15
)
SELECT
  *
FROM fields
%3 93. model.google_ads.google_ads__ad_report 93. model.google_ads.google_ads__ad_report source_relation date_day account_name account_id currency_code campaign_name campaign_id ad_group_name ad_group_id ad_id display_url source_final_urls ad_status ad_type spend clicks impressions conversions conversions_value view_through_conversions ad_name 97. model.google_ads_source.stg_google_ads__account_history 97. model.google_ads_source.stg_google_ads__account_history source_relation account_id currency_code account_name 97. model.google_ads_source.stg_google_ads__account_history:f0->93. model.google_ads.google_ads__ad_report:f0 97. model.google_ads_source.stg_google_ads__account_history:f1->93. model.google_ads.google_ads__ad_report:f3 97. model.google_ads_source.stg_google_ads__account_history:f2->93. model.google_ads.google_ads__ad_report:f4 97. model.google_ads_source.stg_google_ads__account_history:f3->93. model.google_ads.google_ads__ad_report:f2 103. model.google_ads_source.stg_google_ads__ad_group_history 103. model.google_ads_source.stg_google_ads__ad_group_history source_relation ad_group_id ad_group_name 103. model.google_ads_source.stg_google_ads__ad_group_history:f0->93. model.google_ads.google_ads__ad_report:f0 103. model.google_ads_source.stg_google_ads__ad_group_history:f1->93. model.google_ads.google_ads__ad_report:f8 103. model.google_ads_source.stg_google_ads__ad_group_history:f2->93. model.google_ads.google_ads__ad_report:f7 107. model.google_ads_source.stg_google_ads__ad_history 107. model.google_ads_source.stg_google_ads__ad_history source_relation ad_group_id ad_id display_url ad_type ad_status source_final_urls ad_name final_urls 107. model.google_ads_source.stg_google_ads__ad_history:f0->93. model.google_ads.google_ads__ad_report:f0 107. model.google_ads_source.stg_google_ads__ad_history:f1->93. model.google_ads.google_ads__ad_report:f8 107. model.google_ads_source.stg_google_ads__ad_history:f2->93. model.google_ads.google_ads__ad_report:f9 107. model.google_ads_source.stg_google_ads__ad_history:f3->93. model.google_ads.google_ads__ad_report:f10 107. model.google_ads_source.stg_google_ads__ad_history:f4->93. model.google_ads.google_ads__ad_report:f13 107. model.google_ads_source.stg_google_ads__ad_history:f5->93. model.google_ads.google_ads__ad_report:f12 107. model.google_ads_source.stg_google_ads__ad_history:f6->93. model.google_ads.google_ads__ad_report:f11 107. model.google_ads_source.stg_google_ads__ad_history:f7->93. model.google_ads.google_ads__ad_report:f20 107. model.google_ads_source.stg_google_ads__ad_history:f8->93. model.google_ads.google_ads__ad_report:f11 109. model.google_ads_source.stg_google_ads__ad_stats 109. model.google_ads_source.stg_google_ads__ad_stats source_relation account_id date_day ad_group_id ad_id clicks spend impressions conversions conversions_value view_through_conversions 109. model.google_ads_source.stg_google_ads__ad_stats:f0->93. model.google_ads.google_ads__ad_report:f0 109. model.google_ads_source.stg_google_ads__ad_stats:f1->93. model.google_ads.google_ads__ad_report:f3 109. model.google_ads_source.stg_google_ads__ad_stats:f2->93. model.google_ads.google_ads__ad_report:f1 109. model.google_ads_source.stg_google_ads__ad_stats:f3->93. model.google_ads.google_ads__ad_report:f8 109. model.google_ads_source.stg_google_ads__ad_stats:f4->93. model.google_ads.google_ads__ad_report:f9 109. model.google_ads_source.stg_google_ads__ad_stats:f5->93. model.google_ads.google_ads__ad_report:f15 109. model.google_ads_source.stg_google_ads__ad_stats:f6->93. model.google_ads.google_ads__ad_report:f14 109. model.google_ads_source.stg_google_ads__ad_stats:f7->93. model.google_ads.google_ads__ad_report:f16 109. model.google_ads_source.stg_google_ads__ad_stats:f8->93. model.google_ads.google_ads__ad_report:f17 109. model.google_ads_source.stg_google_ads__ad_stats:f9->93. model.google_ads.google_ads__ad_report:f18 109. model.google_ads_source.stg_google_ads__ad_stats:f10->93. model.google_ads.google_ads__ad_report:f19 111. model.google_ads_source.stg_google_ads__campaign_history 111. model.google_ads_source.stg_google_ads__campaign_history source_relation campaign_id campaign_name 111. model.google_ads_source.stg_google_ads__campaign_history:f0->93. model.google_ads.google_ads__ad_report:f0 111. model.google_ads_source.stg_google_ads__campaign_history:f1->93. model.google_ads.google_ads__ad_report:f6 111. model.google_ads_source.stg_google_ads__campaign_history:f2->93. model.google_ads.google_ads__ad_report:f5
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
date_day date The date being reported on.
account_name integer The descriptive name of the Customer account.
account_id integer The Customer ID.
currency_code text The currency which the account uses.
campaign_name text The name of the campaign, if present in the source data.
campaign_id bigint The ID representing the campaign, if present in the source data.
ad_group_name text The name of the ad group, if present in the source data.
ad_group_id text The ID representing the ad group, if present in the source data.
ad_id bigint The unique identifier of the ad.
display_url integer The url which is displayed with the ad.
source_final_urls text The final urls that are used within the ad.
ad_status text The status of the ad.
ad_type integer The type of the ad that is being served.
spend numeric Total cost of ad clicks.
clicks bigint The count of clicks.
impressions bigint The count of impressions.
conversions bigint The number of conversions you've received, across your conversion actions. Conversions are measured with conversion tracking and may include [modeled](https://support.google.com/google-ads/answer/10081327?sjid=12862894247631803415-NC) conversions in cases where you are not able to observe all conversions that took place. You can use this column to see how often your ads led customers to actions that you’ve defined as valuable for your business.
conversions_value bigint The sum of monetary values for your `conversions`. You have to enter a value in the Google Ads UI for your conversion actions to make this metric useful.
view_through_conversions bigint For video campaigns, view-through conversions tell you when an _impression_ of your video ad leads to a conversion on your site. The last impression of a video ad will get credit for the view-through conversion. Keep in mind: An impression is different than a “view” of a video ad. A “view” is counted when someone watches 30 seconds (or the whole ad if it’s shorter than 30 seconds) or clicks on a part of the ad. A “view” that leads to a conversion is counted in the `conversions` column.
ad_name integer None
Column Lineage
%3 97. model.google_ads_source.stg_google_ads__account_history 97. model.google_ads_source.stg_google_ads__account_history source_relation 93. model.google_ads.google_ads__ad_report 93. model.google_ads.google_ads__ad_report source_relation 97. model.google_ads_source.stg_google_ads__account_history:f0->93. model.google_ads.google_ads__ad_report:f0 103. model.google_ads_source.stg_google_ads__ad_group_history 103. model.google_ads_source.stg_google_ads__ad_group_history source_relation 103. model.google_ads_source.stg_google_ads__ad_group_history:f0->93. model.google_ads.google_ads__ad_report:f0 107. model.google_ads_source.stg_google_ads__ad_history 107. model.google_ads_source.stg_google_ads__ad_history source_relation 107. model.google_ads_source.stg_google_ads__ad_history:f0->93. model.google_ads.google_ads__ad_report:f0 109. model.google_ads_source.stg_google_ads__ad_stats 109. model.google_ads_source.stg_google_ads__ad_stats source_relation 109. model.google_ads_source.stg_google_ads__ad_stats:f0->93. model.google_ads.google_ads__ad_report:f0 111. model.google_ads_source.stg_google_ads__campaign_history 111. model.google_ads_source.stg_google_ads__campaign_history source_relation 111. model.google_ads_source.stg_google_ads__campaign_history:f0->93. model.google_ads.google_ads__ad_report:f0
93. model.google_ads.google_ads__ad_report
  • Input Column: 97. model.google_ads_source.stg_google_ads__account_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 103. model.google_ads_source.stg_google_ads__ad_group_history[source_relation]
    • Integration used as a key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 107. model.google_ads_source.stg_google_ads__ad_history[source_relation]
    • Integration used to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 109. model.google_ads_source.stg_google_ads__ad_stats[source_relation]
    • Direct The column is directly copied without transformation
    • Integration Used as a key to join with other tables
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to output
  • Input Column: 111. model.google_ads_source.stg_google_ads__campaign_history[source_relation]
    • Integration used as a key to join with other tables
    • Direct copied directly to the output
    • Output Columns:
      • source_relation: directly copied
Column Lineage
%3 109. model.google_ads_source.stg_google_ads__ad_stats 109. model.google_ads_source.stg_google_ads__ad_stats date_day 93. model.google_ads.google_ads__ad_report 93. model.google_ads.google_ads__ad_report date_day 109. model.google_ads_source.stg_google_ads__ad_stats:f0->93. model.google_ads.google_ads__ad_report:f0 110. model.google_ads_source.stg_google_ads__ad_stats_tmp 110. model.google_ads_source.stg_google_ads__ad_stats_tmp date 110. model.google_ads_source.stg_google_ads__ad_stats_tmp:f0->109. model.google_ads_source.stg_google_ads__ad_stats:f0
109. model.google_ads_source.stg_google_ads__ad_stats
  • Input Column: 110. model.google_ads_source.stg_google_ads__ad_stats_tmp[date]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as DATE in the fields CTE
    • Output Columns:
      • date_day: Directly mapped and renamed
93. model.google_ads.google_ads__ad_report
  • Input Column: 109. model.google_ads_source.stg_google_ads__ad_stats[date_day]
    • Direct The column is directly copied without transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to output
Column Lineage
%3 97. model.google_ads_source.stg_google_ads__account_history 97. model.google_ads_source.stg_google_ads__account_history account_name 93. model.google_ads.google_ads__ad_report 93. model.google_ads.google_ads__ad_report account_name 97. model.google_ads_source.stg_google_ads__account_history:f0->93. model.google_ads.google_ads__ad_report:f0 98. model.google_ads_source.stg_google_ads__account_history_tmp 98. model.google_ads_source.stg_google_ads__account_history_tmp descriptive_name 98. model.google_ads_source.stg_google_ads__account_history_tmp:f0->97. model.google_ads_source.stg_google_ads__account_history:f0
97. model.google_ads_source.stg_google_ads__account_history
  • Input Column: 98. model.google_ads_source.stg_google_ads__account_history_tmp[descriptive_name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • account_name: Directly mapped
93. model.google_ads.google_ads__ad_report
  • Input Column: 97. model.google_ads_source.stg_google_ads__account_history[account_name]
    • Direct directly copied to the output
    • Output Columns:
      • account_name: directly copied
Column Lineage
%3 97. model.google_ads_source.stg_google_ads__account_history 97. model.google_ads_source.stg_google_ads__account_history account_id 93. model.google_ads.google_ads__ad_report 93. model.google_ads.google_ads__ad_report account_id 97. model.google_ads_source.stg_google_ads__account_history:f0->93. model.google_ads.google_ads__ad_report:f0 109. model.google_ads_source.stg_google_ads__ad_stats 109. model.google_ads_source.stg_google_ads__ad_stats account_id 109. model.google_ads_source.stg_google_ads__ad_stats:f0->93. model.google_ads.google_ads__ad_report:f0 98. model.google_ads_source.stg_google_ads__account_history_tmp 98. model.google_ads_source.stg_google_ads__account_history_tmp id 98. model.google_ads_source.stg_google_ads__account_history_tmp:f0->97. model.google_ads_source.stg_google_ads__account_history:f0 110. model.google_ads_source.stg_google_ads__ad_stats_tmp 110. model.google_ads_source.stg_google_ads__ad_stats_tmp customer_id 110. model.google_ads_source.stg_google_ads__ad_stats_tmp:f0->109. model.google_ads_source.stg_google_ads__ad_stats:f0
97. model.google_ads_source.stg_google_ads__account_history
  • Input Column: 98. model.google_ads_source.stg_google_ads__account_history_tmp[id]
    • Direct The column is directly copied without transformation
    • Deduplication Used in ROW_NUMBER() function to determine the most recent record
    • Output Columns:
      • account_id: Directly mapped
109. model.google_ads_source.stg_google_ads__ad_stats
  • Input Column: 110. model.google_ads_source.stg_google_ads__ad_stats_tmp[customer_id]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as INT in the fields CTE
    • Output Columns:
      • account_id: Directly mapped and renamed
93. model.google_ads.google_ads__ad_report
  • Input Column: 97. model.google_ads_source.stg_google_ads__account_history[account_id]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • account_id: directly copied
  • Input Column: 109. model.google_ads_source.stg_google_ads__ad_stats[account_id]
    • Integration Used as a key to join with the accounts table
    • Output Columns:
      • account_id: Indirectly mapped through the join with accounts table
Column Lineage
%3 97. model.google_ads_source.stg_google_ads__account_history 97. model.google_ads_source.stg_google_ads__account_history currency_code 93. model.google_ads.google_ads__ad_report 93. model.google_ads.google_ads__ad_report currency_code 97. model.google_ads_source.stg_google_ads__account_history:f0->93. model.google_ads.google_ads__ad_report:f0 98. model.google_ads_source.stg_google_ads__account_history_tmp 98. model.google_ads_source.stg_google_ads__account_history_tmp currency_code 98. model.google_ads_source.stg_google_ads__account_history_tmp:f0->97. model.google_ads_source.stg_google_ads__account_history:f0
97. model.google_ads_source.stg_google_ads__account_history
  • Input Column: 98. model.google_ads_source.stg_google_ads__account_history_tmp[currency_code]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • currency_code: Directly mapped
93. model.google_ads.google_ads__ad_report
  • Input Column: 97. model.google_ads_source.stg_google_ads__account_history[currency_code]
    • Direct directly copied to the output
    • Output Columns:
      • currency_code: directly copied
Column Lineage
%3 111. model.google_ads_source.stg_google_ads__campaign_history 111. model.google_ads_source.stg_google_ads__campaign_history campaign_name 93. model.google_ads.google_ads__ad_report 93. model.google_ads.google_ads__ad_report campaign_name 111. model.google_ads_source.stg_google_ads__campaign_history:f0->93. model.google_ads.google_ads__ad_report:f0 112. model.google_ads_source.stg_google_ads__campaign_history_tmp 112. model.google_ads_source.stg_google_ads__campaign_history_tmp name 112. model.google_ads_source.stg_google_ads__campaign_history_tmp:f0->111. model.google_ads_source.stg_google_ads__campaign_history:f0
111. model.google_ads_source.stg_google_ads__campaign_history
  • Input Column: 112. model.google_ads_source.stg_google_ads__campaign_history_tmp[name]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • campaign_name: Directly mapped to this output column
93. model.google_ads.google_ads__ad_report
  • Input Column: 111. model.google_ads_source.stg_google_ads__campaign_history[campaign_name]
    • Direct The campaign_name is directly copied to the output without transformation
    • Integration Used as part of the JOIN condition to link campaign data with other tables
    • Output Columns:
      • campaign_name: Directly copied to the output column
Column Lineage
%3 111. model.google_ads_source.stg_google_ads__campaign_history 111. model.google_ads_source.stg_google_ads__campaign_history campaign_id 93. model.google_ads.google_ads__ad_report 93. model.google_ads.google_ads__ad_report campaign_id 111. model.google_ads_source.stg_google_ads__campaign_history:f0->93. model.google_ads.google_ads__ad_report:f0 112. model.google_ads_source.stg_google_ads__campaign_history_tmp 112. model.google_ads_source.stg_google_ads__campaign_history_tmp id 112. model.google_ads_source.stg_google_ads__campaign_history_tmp:f0->111. model.google_ads_source.stg_google_ads__campaign_history:f0
111. model.google_ads_source.stg_google_ads__campaign_history
  • Input Column: 112. model.google_ads_source.stg_google_ads__campaign_history_tmp[id]
    • Direct The column is directly copied without any transformation
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • campaign_id: Directly mapped to this output column
93. model.google_ads.google_ads__ad_report
  • Input Column: 111. model.google_ads_source.stg_google_ads__campaign_history[campaign_id]
    • Integration used as a key to join with other tables
    • Direct copied directly to the output
    • Output Columns:
      • campaign_id: directly copied
Column Lineage
%3 103. model.google_ads_source.stg_google_ads__ad_group_history 103. model.google_ads_source.stg_google_ads__ad_group_history ad_group_name 93. model.google_ads.google_ads__ad_report 93. model.google_ads.google_ads__ad_report ad_group_name 103. model.google_ads_source.stg_google_ads__ad_group_history:f0->93. model.google_ads.google_ads__ad_report:f0 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp name 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp:f0->103. model.google_ads_source.stg_google_ads__ad_group_history:f0
103. model.google_ads_source.stg_google_ads__ad_group_history
  • Input Column: 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp[name]
    • Direct Copied without transformation
    • Output Columns:
      • ad_group_name: Directly mapped and renamed
93. model.google_ads.google_ads__ad_report
  • Input Column: 103. model.google_ads_source.stg_google_ads__ad_group_history[ad_group_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_name: directly copied
Column Lineage
%3 103. model.google_ads_source.stg_google_ads__ad_group_history 103. model.google_ads_source.stg_google_ads__ad_group_history ad_group_id 93. model.google_ads.google_ads__ad_report 93. model.google_ads.google_ads__ad_report ad_group_id 103. model.google_ads_source.stg_google_ads__ad_group_history:f0->93. model.google_ads.google_ads__ad_report:f0 107. model.google_ads_source.stg_google_ads__ad_history 107. model.google_ads_source.stg_google_ads__ad_history ad_group_id 107. model.google_ads_source.stg_google_ads__ad_history:f0->93. model.google_ads.google_ads__ad_report:f0 109. model.google_ads_source.stg_google_ads__ad_stats 109. model.google_ads_source.stg_google_ads__ad_stats ad_group_id 109. model.google_ads_source.stg_google_ads__ad_stats:f0->93. model.google_ads.google_ads__ad_report:f0 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp id 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp:f0->103. model.google_ads_source.stg_google_ads__ad_group_history:f0 108. model.google_ads_source.stg_google_ads__ad_history_tmp 108. model.google_ads_source.stg_google_ads__ad_history_tmp ad_group_id 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f0 110. model.google_ads_source.stg_google_ads__ad_stats_tmp 110. model.google_ads_source.stg_google_ads__ad_stats_tmp ad_group ad_group_id 110. model.google_ads_source.stg_google_ads__ad_stats_tmp:f1->109. model.google_ads_source.stg_google_ads__ad_stats:f0 110. model.google_ads_source.stg_google_ads__ad_stats_tmp:f0->109. model.google_ads_source.stg_google_ads__ad_stats:f0
103. model.google_ads_source.stg_google_ads__ad_group_history
  • Input Column: 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp[id]
    • Cleaning The column is cast to TEXT type
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • ad_group_id: Directly mapped after casting to TEXT
107. model.google_ads_source.stg_google_ads__ad_history
  • Input Column: 108. model.google_ads_source.stg_google_ads__ad_history_tmp[ad_group_id]
    • Cleaning Cast to TEXT type
    • Deduplication Used in ROW_NUMBER() OVER (PARTITION BY ...) for deduplication
    • Output Columns:
      • ad_group_id: Directly mapped after casting to TEXT
109. model.google_ads_source.stg_google_ads__ad_stats
  • Input Column: 110. model.google_ads_source.stg_google_ads__ad_stats_tmp[ad_group_id]
    • Cleaning The column is cast as TEXT in the fields CTE
    • Other Used in a COALESCE function with ad_group
    • Output Columns:
      • ad_group_id: Mapped through COALESCE with ad_group
  • Input Column: 110. model.google_ads_source.stg_google_ads__ad_stats_tmp[ad_group]
    • Cleaning The column is cast as TEXT in the fields CTE
    • Featurization The ad_group_id is extracted from this column using SPLIT_PART
    • Output Columns:
      • ad_group_id: Used as fallback in COALESCE if ad_group_id is null
93. model.google_ads.google_ads__ad_report
  • Input Column: 103. model.google_ads_source.stg_google_ads__ad_group_history[ad_group_id]
    • Integration used as a key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_id: directly copied
  • Input Column: 107. model.google_ads_source.stg_google_ads__ad_history[ad_group_id]
    • Integration used to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_id: directly copied
  • Input Column: 109. model.google_ads_source.stg_google_ads__ad_stats[ad_group_id]
    • Direct The column is directly copied without transformation
    • Integration Used as a key to join with other tables
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • ad_group_id: Directly copied to output
Column Lineage
%3 107. model.google_ads_source.stg_google_ads__ad_history 107. model.google_ads_source.stg_google_ads__ad_history ad_id 93. model.google_ads.google_ads__ad_report 93. model.google_ads.google_ads__ad_report ad_id 107. model.google_ads_source.stg_google_ads__ad_history:f0->93. model.google_ads.google_ads__ad_report:f0 109. model.google_ads_source.stg_google_ads__ad_stats 109. model.google_ads_source.stg_google_ads__ad_stats ad_id 109. model.google_ads_source.stg_google_ads__ad_stats:f0->93. model.google_ads.google_ads__ad_report:f0 108. model.google_ads_source.stg_google_ads__ad_history_tmp 108. model.google_ads_source.stg_google_ads__ad_history_tmp id 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f0 110. model.google_ads_source.stg_google_ads__ad_stats_tmp 110. model.google_ads_source.stg_google_ads__ad_stats_tmp ad_id 110. model.google_ads_source.stg_google_ads__ad_stats_tmp:f0->109. model.google_ads_source.stg_google_ads__ad_stats:f0
107. model.google_ads_source.stg_google_ads__ad_history
  • Input Column: 108. model.google_ads_source.stg_google_ads__ad_history_tmp[id]
    • Cleaning Used as is (implicitly cast to INT)
    • Deduplication Used in ROW_NUMBER() OVER (PARTITION BY ...) for deduplication
    • Output Columns:
      • ad_id: Directly mapped
109. model.google_ads_source.stg_google_ads__ad_stats
  • Input Column: 110. model.google_ads_source.stg_google_ads__ad_stats_tmp[ad_id]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as INT in the fields CTE
    • Output Columns:
      • ad_id: Directly mapped
93. model.google_ads.google_ads__ad_report
  • Input Column: 107. model.google_ads_source.stg_google_ads__ad_history[ad_id]
    • Integration used to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • ad_id: directly copied
  • Input Column: 109. model.google_ads_source.stg_google_ads__ad_stats[ad_id]
    • Direct The column is directly copied without transformation
    • Integration Used as a key to join with the ads table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • ad_id: Directly copied to output
Column Lineage
%3 107. model.google_ads_source.stg_google_ads__ad_history 107. model.google_ads_source.stg_google_ads__ad_history display_url 93. model.google_ads.google_ads__ad_report 93. model.google_ads.google_ads__ad_report display_url 107. model.google_ads_source.stg_google_ads__ad_history:f0->93. model.google_ads.google_ads__ad_report:f0 108. model.google_ads_source.stg_google_ads__ad_history_tmp 108. model.google_ads_source.stg_google_ads__ad_history_tmp display_url 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f0
107. model.google_ads_source.stg_google_ads__ad_history
  • Input Column: 108. model.google_ads_source.stg_google_ads__ad_history_tmp[display_url]
    • Direct Copied without transformation
    • Output Columns:
      • display_url: Directly mapped
93. model.google_ads.google_ads__ad_report
  • Input Column: 107. model.google_ads_source.stg_google_ads__ad_history[display_url]
    • Direct directly copied to the output
    • Output Columns:
      • display_url: directly copied
Column Lineage
%3 107. model.google_ads_source.stg_google_ads__ad_history 107. model.google_ads_source.stg_google_ads__ad_history base_url final_url final_urls source_final_urls url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 93. model.google_ads.google_ads__ad_report 93. model.google_ads.google_ads__ad_report source_final_urls 107. model.google_ads_source.stg_google_ads__ad_history:f3->93. model.google_ads.google_ads__ad_report:f0 107. model.google_ads_source.stg_google_ads__ad_history:f2->93. model.google_ads.google_ads__ad_report:f0 108. model.google_ads_source.stg_google_ads__ad_history_tmp 108. model.google_ads_source.stg_google_ads__ad_history_tmp final_urls 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f3 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f2 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f1 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f0 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f4 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f5 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f9 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f8 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f6 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f7 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f10 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f3 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f2 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f1 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f0 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f4 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f5 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f9 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f8 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f6 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f7 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f10
107. model.google_ads_source.stg_google_ads__ad_history
  • Input Column: 108. model.google_ads_source.stg_google_ads__ad_history_tmp[final_urls]
    • Cleaning Brackets removed, cast to TEXT
    • Featurization Used to extract various URL components and UTM parameters
    • Output Columns:
      • source_final_urls: Directly mapped before cleaning
      • final_urls: Mapped after cleaning (removing brackets)
      • final_url: First URL extracted from the cleaned list
      • base_url: Extracted from final_url
      • url_host: Extracted from final_url
      • url_path: Extracted from final_url
      • utm_source: Extracted from final_url
      • utm_medium: Extracted from final_url
      • utm_campaign: Extracted from final_url
      • utm_content: Extracted from final_url
      • utm_term: Extracted from final_url
  • Input Column: 108. model.google_ads_source.stg_google_ads__ad_history_tmp[final_urls]
    • Cleaning Brackets removed, cast to TEXT
    • Featurization Used to extract various URL components and UTM parameters
    • Output Columns:
      • source_final_urls: Directly mapped before cleaning
      • final_urls: Mapped after cleaning (removing brackets)
      • final_url: First URL extracted from the cleaned list
      • base_url: Extracted from final_url
      • url_host: Extracted from final_url
      • url_path: Extracted from final_url
      • utm_source: Extracted from final_url
      • utm_medium: Extracted from final_url
      • utm_campaign: Extracted from final_url
      • utm_content: Extracted from final_url
      • utm_term: Extracted from final_url
93. model.google_ads.google_ads__ad_report
  • Input Column: 107. model.google_ads_source.stg_google_ads__ad_history[source_final_urls]
    • Direct directly copied to the output
    • Output Columns:
      • source_final_urls: directly copied
  • Input Column: 107. model.google_ads_source.stg_google_ads__ad_history[final_urls]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition
    • Output Columns:
      • source_final_urls: Directly mapped to the output column
Column Lineage
%3 107. model.google_ads_source.stg_google_ads__ad_history 107. model.google_ads_source.stg_google_ads__ad_history ad_status 93. model.google_ads.google_ads__ad_report 93. model.google_ads.google_ads__ad_report ad_status 107. model.google_ads_source.stg_google_ads__ad_history:f0->93. model.google_ads.google_ads__ad_report:f0 108. model.google_ads_source.stg_google_ads__ad_history_tmp 108. model.google_ads_source.stg_google_ads__ad_history_tmp status 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f0
107. model.google_ads_source.stg_google_ads__ad_history
  • Input Column: 108. model.google_ads_source.stg_google_ads__ad_history_tmp[status]
    • Direct Copied without transformation
    • Output Columns:
      • ad_status: Directly mapped
93. model.google_ads.google_ads__ad_report
  • Input Column: 107. model.google_ads_source.stg_google_ads__ad_history[ad_status]
    • Direct directly copied to the output
    • Output Columns:
      • ad_status: directly copied
Column Lineage
%3 107. model.google_ads_source.stg_google_ads__ad_history 107. model.google_ads_source.stg_google_ads__ad_history ad_type 93. model.google_ads.google_ads__ad_report 93. model.google_ads.google_ads__ad_report ad_type 107. model.google_ads_source.stg_google_ads__ad_history:f0->93. model.google_ads.google_ads__ad_report:f0 108. model.google_ads_source.stg_google_ads__ad_history_tmp 108. model.google_ads_source.stg_google_ads__ad_history_tmp type 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f0
107. model.google_ads_source.stg_google_ads__ad_history
  • Input Column: 108. model.google_ads_source.stg_google_ads__ad_history_tmp[type]
    • Direct Copied without transformation
    • Output Columns:
      • ad_type: Directly mapped
93. model.google_ads.google_ads__ad_report
  • Input Column: 107. model.google_ads_source.stg_google_ads__ad_history[ad_type]
    • Direct directly copied to the output
    • Output Columns:
      • ad_type: directly copied
Column Lineage
%3 109. model.google_ads_source.stg_google_ads__ad_stats 109. model.google_ads_source.stg_google_ads__ad_stats spend 93. model.google_ads.google_ads__ad_report 93. model.google_ads.google_ads__ad_report spend 109. model.google_ads_source.stg_google_ads__ad_stats:f0->93. model.google_ads.google_ads__ad_report:f0 110. model.google_ads_source.stg_google_ads__ad_stats_tmp 110. model.google_ads_source.stg_google_ads__ad_stats_tmp cost_micros 110. model.google_ads_source.stg_google_ads__ad_stats_tmp:f0->109. model.google_ads_source.stg_google_ads__ad_stats:f0
109. model.google_ads_source.stg_google_ads__ad_stats
  • Input Column: 110. model.google_ads_source.stg_google_ads__ad_stats_tmp[cost_micros]
    • Cleaning The column is cleaned by casting to INT and then divided by 1,000,000 to convert from micros to dollars.
    • Output Columns:
      • spend: The cost_micros is divided by 1,000,000 and mapped to the 'spend' column in the output.
93. model.google_ads.google_ads__ad_report
  • Input Column: 109. model.google_ads_source.stg_google_ads__ad_stats[spend]
    • Aggregation The spend is summed up in the GROUP BY clause
    • Output Columns:
      • spend: Directly mapped after aggregation
Column Lineage
%3 109. model.google_ads_source.stg_google_ads__ad_stats 109. model.google_ads_source.stg_google_ads__ad_stats clicks 93. model.google_ads.google_ads__ad_report 93. model.google_ads.google_ads__ad_report clicks 109. model.google_ads_source.stg_google_ads__ad_stats:f0->93. model.google_ads.google_ads__ad_report:f0 110. model.google_ads_source.stg_google_ads__ad_stats_tmp 110. model.google_ads_source.stg_google_ads__ad_stats_tmp clicks 110. model.google_ads_source.stg_google_ads__ad_stats_tmp:f0->109. model.google_ads_source.stg_google_ads__ad_stats:f0
109. model.google_ads_source.stg_google_ads__ad_stats
  • Input Column: 110. model.google_ads_source.stg_google_ads__ad_stats_tmp[clicks]
    • Cleaning The column is cast as INT in the fields CTE
    • Other COALESCE is used to replace NULL values with 0
    • Output Columns:
      • clicks: Mapped with COALESCE to handle NULL values
93. model.google_ads.google_ads__ad_report
  • Input Column: 109. model.google_ads_source.stg_google_ads__ad_stats[clicks]
    • Aggregation Summed up in the SELECT clause
    • Output Columns:
      • clicks: Aggregated into the total clicks
Column Lineage
%3 109. model.google_ads_source.stg_google_ads__ad_stats 109. model.google_ads_source.stg_google_ads__ad_stats impressions 93. model.google_ads.google_ads__ad_report 93. model.google_ads.google_ads__ad_report impressions 109. model.google_ads_source.stg_google_ads__ad_stats:f0->93. model.google_ads.google_ads__ad_report:f0 110. model.google_ads_source.stg_google_ads__ad_stats_tmp 110. model.google_ads_source.stg_google_ads__ad_stats_tmp impressions 110. model.google_ads_source.stg_google_ads__ad_stats_tmp:f0->109. model.google_ads_source.stg_google_ads__ad_stats:f0
109. model.google_ads_source.stg_google_ads__ad_stats
  • Input Column: 110. model.google_ads_source.stg_google_ads__ad_stats_tmp[impressions]
    • Cleaning The column is cleaned by casting to INT and using COALESCE to handle null values.
    • Output Columns:
      • impressions: The impressions column is directly mapped to the 'impressions' column in the output, with null values replaced by 0.
93. model.google_ads.google_ads__ad_report
  • Input Column: 109. model.google_ads_source.stg_google_ads__ad_stats[impressions]
    • Aggregation The impressions are summed up in the GROUP BY clause
    • Output Columns:
      • impressions: Directly mapped after aggregation
Column Lineage
%3 109. model.google_ads_source.stg_google_ads__ad_stats 109. model.google_ads_source.stg_google_ads__ad_stats conversions 93. model.google_ads.google_ads__ad_report 93. model.google_ads.google_ads__ad_report conversions 109. model.google_ads_source.stg_google_ads__ad_stats:f0->93. model.google_ads.google_ads__ad_report:f0
93. model.google_ads.google_ads__ad_report
  • Input Column: 109. model.google_ads_source.stg_google_ads__ad_stats[conversions]
    • Aggregation The conversions are summed up in the GROUP BY clause
    • Output Columns:
      • conversions: Directly mapped after aggregation
Column Lineage
%3 109. model.google_ads_source.stg_google_ads__ad_stats 109. model.google_ads_source.stg_google_ads__ad_stats conversions_value 93. model.google_ads.google_ads__ad_report 93. model.google_ads.google_ads__ad_report conversions_value 109. model.google_ads_source.stg_google_ads__ad_stats:f0->93. model.google_ads.google_ads__ad_report:f0
93. model.google_ads.google_ads__ad_report
  • Input Column: 109. model.google_ads_source.stg_google_ads__ad_stats[conversions_value]
    • Aggregation The conversions_value is summed up in the GROUP BY clause
    • Output Columns:
      • conversions_value: Directly mapped after aggregation
Column Lineage
%3 109. model.google_ads_source.stg_google_ads__ad_stats 109. model.google_ads_source.stg_google_ads__ad_stats view_through_conversions 93. model.google_ads.google_ads__ad_report 93. model.google_ads.google_ads__ad_report view_through_conversions 109. model.google_ads_source.stg_google_ads__ad_stats:f0->93. model.google_ads.google_ads__ad_report:f0
93. model.google_ads.google_ads__ad_report
  • Input Column: 109. model.google_ads_source.stg_google_ads__ad_stats[view_through_conversions]
    • Aggregation The view_through_conversions are summed up in the GROUP BY clause
    • Output Columns:
      • view_through_conversions: Directly mapped after aggregation
Column Lineage
%3 107. model.google_ads_source.stg_google_ads__ad_history 107. model.google_ads_source.stg_google_ads__ad_history ad_name 93. model.google_ads.google_ads__ad_report 93. model.google_ads.google_ads__ad_report ad_name 107. model.google_ads_source.stg_google_ads__ad_history:f0->93. model.google_ads.google_ads__ad_report:f0 108. model.google_ads_source.stg_google_ads__ad_history_tmp 108. model.google_ads_source.stg_google_ads__ad_history_tmp name 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f0
107. model.google_ads_source.stg_google_ads__ad_history
  • Input Column: 108. model.google_ads_source.stg_google_ads__ad_history_tmp[name]
    • Direct Copied without transformation
    • Output Columns:
      • ad_name: Directly mapped
93. model.google_ads.google_ads__ad_report
  • Input Column: 107. model.google_ads_source.stg_google_ads__ad_history[ad_name]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition
    • Output Columns:
      • ad_name: Directly mapped to the output column
94. model.google_ads.google_ads__campaign_report

This SQL query integrates data from three different staging tables (campaign stats, account history, and campaign history) to create a comprehensive campaign report. It joins these tables, filters for the most recent records in the history tables, and aggregates various metrics like spend, clicks, impressions, and conversions. The result is a detailed view of campaign performance across different accounts and campaigns.

FilteringIntegrationAggregation
SQL Query
WITH stats AS (
  SELECT
    *
  FROM TEST.PUBLIC_google_ads_source.stg_google_ads__campaign_stats
), accounts AS (
  SELECT
    *
  FROM TEST.PUBLIC_google_ads_source.stg_google_ads__account_history
  WHERE
    is_most_recent_record = TRUE
), campaigns AS (
  SELECT
    *
  FROM TEST.PUBLIC_google_ads_source.stg_google_ads__campaign_history
  WHERE
    is_most_recent_record = TRUE
), fields AS (
  SELECT
    stats.source_relation,
    stats.date_day,
    accounts.account_name,
    accounts.account_id,
    accounts.currency_code,
    campaigns.campaign_name,
    stats.campaign_id,
    campaigns.advertising_channel_type,
    campaigns.advertising_channel_subtype,
    campaigns.status,
    SUM(stats.spend) AS spend,
    SUM(stats.clicks) AS clicks,
    SUM(stats.impressions) AS impressions,
    SUM(conversions) AS conversions,
    SUM(conversions_value) AS conversions_value,
    SUM(view_through_conversions) AS view_through_conversions
  FROM stats
  LEFT JOIN campaigns
    ON stats.campaign_id = campaigns.campaign_id
    AND stats.source_relation = campaigns.source_relation
  LEFT JOIN accounts
    ON campaigns.account_id = accounts.account_id
    AND campaigns.source_relation = accounts.source_relation
  GROUP BY
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10
)
SELECT
  *
FROM fields
%3 94. model.google_ads.google_ads__campaign_report 94. model.google_ads.google_ads__campaign_report source_relation date_day account_name account_id currency_code campaign_name campaign_id advertising_channel_type advertising_channel_subtype status spend clicks impressions conversions conversions_value view_through_conversions 97. model.google_ads_source.stg_google_ads__account_history 97. model.google_ads_source.stg_google_ads__account_history source_relation account_id currency_code account_name 97. model.google_ads_source.stg_google_ads__account_history:f0->94. model.google_ads.google_ads__campaign_report:f0 97. model.google_ads_source.stg_google_ads__account_history:f1->94. model.google_ads.google_ads__campaign_report:f3 97. model.google_ads_source.stg_google_ads__account_history:f2->94. model.google_ads.google_ads__campaign_report:f4 97. model.google_ads_source.stg_google_ads__account_history:f3->94. model.google_ads.google_ads__campaign_report:f2 111. model.google_ads_source.stg_google_ads__campaign_history 111. model.google_ads_source.stg_google_ads__campaign_history source_relation campaign_id advertising_channel_type advertising_channel_subtype status campaign_name 111. model.google_ads_source.stg_google_ads__campaign_history:f0->94. model.google_ads.google_ads__campaign_report:f0 111. model.google_ads_source.stg_google_ads__campaign_history:f1->94. model.google_ads.google_ads__campaign_report:f6 111. model.google_ads_source.stg_google_ads__campaign_history:f2->94. model.google_ads.google_ads__campaign_report:f7 111. model.google_ads_source.stg_google_ads__campaign_history:f3->94. model.google_ads.google_ads__campaign_report:f8 111. model.google_ads_source.stg_google_ads__campaign_history:f4->94. model.google_ads.google_ads__campaign_report:f9 111. model.google_ads_source.stg_google_ads__campaign_history:f5->94. model.google_ads.google_ads__campaign_report:f5 113. model.google_ads_source.stg_google_ads__campaign_stats 113. model.google_ads_source.stg_google_ads__campaign_stats source_relation date_day campaign_id clicks spend impressions conversions conversions_value view_through_conversions 113. model.google_ads_source.stg_google_ads__campaign_stats:f0->94. model.google_ads.google_ads__campaign_report:f0 113. model.google_ads_source.stg_google_ads__campaign_stats:f1->94. model.google_ads.google_ads__campaign_report:f1 113. model.google_ads_source.stg_google_ads__campaign_stats:f2->94. model.google_ads.google_ads__campaign_report:f6 113. model.google_ads_source.stg_google_ads__campaign_stats:f3->94. model.google_ads.google_ads__campaign_report:f11 113. model.google_ads_source.stg_google_ads__campaign_stats:f4->94. model.google_ads.google_ads__campaign_report:f10 113. model.google_ads_source.stg_google_ads__campaign_stats:f5->94. model.google_ads.google_ads__campaign_report:f12 113. model.google_ads_source.stg_google_ads__campaign_stats:f6->94. model.google_ads.google_ads__campaign_report:f13 113. model.google_ads_source.stg_google_ads__campaign_stats:f7->94. model.google_ads.google_ads__campaign_report:f14 113. model.google_ads_source.stg_google_ads__campaign_stats:f8->94. model.google_ads.google_ads__campaign_report:f15
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
date_day date The date being reported on.
account_name integer The descriptive name of the Customer account.
account_id integer The Customer ID.
currency_code text The currency which the account uses.
campaign_name text The name of the campaign, if present in the source data.
campaign_id bigint The ID representing the campaign, if present in the source data.
advertising_channel_type text The channel type of the ads being served within the campaign.
advertising_channel_subtype text The channel subtype of the ads being served within the campaign.
status text The status of the campaign.
spend numeric Total cost of ad clicks.
clicks bigint The count of clicks.
impressions bigint The count of impressions.
conversions bigint The number of conversions you've received, across your conversion actions. Conversions are measured with conversion tracking and may include [modeled](https://support.google.com/google-ads/answer/10081327?sjid=12862894247631803415-NC) conversions in cases where you are not able to observe all conversions that took place. You can use this column to see how often your ads led customers to actions that you’ve defined as valuable for your business.
conversions_value bigint The sum of monetary values for your `conversions`. You have to enter a value in the Google Ads UI for your conversion actions to make this metric useful.
view_through_conversions bigint For video campaigns, view-through conversions tell you when an _impression_ of your video ad leads to a conversion on your site. The last impression of a video ad will get credit for the view-through conversion. Keep in mind: An impression is different than a “view” of a video ad. A “view” is counted when someone watches 30 seconds (or the whole ad if it’s shorter than 30 seconds) or clicks on a part of the ad. A “view” that leads to a conversion is counted in the `conversions` column.
Column Lineage
%3 97. model.google_ads_source.stg_google_ads__account_history 97. model.google_ads_source.stg_google_ads__account_history source_relation 94. model.google_ads.google_ads__campaign_report 94. model.google_ads.google_ads__campaign_report source_relation 97. model.google_ads_source.stg_google_ads__account_history:f0->94. model.google_ads.google_ads__campaign_report:f0 111. model.google_ads_source.stg_google_ads__campaign_history 111. model.google_ads_source.stg_google_ads__campaign_history source_relation 111. model.google_ads_source.stg_google_ads__campaign_history:f0->94. model.google_ads.google_ads__campaign_report:f0 113. model.google_ads_source.stg_google_ads__campaign_stats 113. model.google_ads_source.stg_google_ads__campaign_stats source_relation 113. model.google_ads_source.stg_google_ads__campaign_stats:f0->94. model.google_ads.google_ads__campaign_report:f0
94. model.google_ads.google_ads__campaign_report
  • Input Column: 97. model.google_ads_source.stg_google_ads__account_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 111. model.google_ads_source.stg_google_ads__campaign_history[source_relation]
    • Direct The column is directly used in the SELECT statement
    • Integration Used to join with other tables
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
  • Input Column: 113. model.google_ads_source.stg_google_ads__campaign_stats[source_relation]
    • Direct The column is directly copied without transformation
    • Integration Used as part of the join condition with other tables
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly mapped to output column
Column Lineage
%3 113. model.google_ads_source.stg_google_ads__campaign_stats 113. model.google_ads_source.stg_google_ads__campaign_stats date_day 94. model.google_ads.google_ads__campaign_report 94. model.google_ads.google_ads__campaign_report date_day 113. model.google_ads_source.stg_google_ads__campaign_stats:f0->94. model.google_ads.google_ads__campaign_report:f0 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp date 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp:f0->113. model.google_ads_source.stg_google_ads__campaign_stats:f0
113. model.google_ads_source.stg_google_ads__campaign_stats
  • Input Column: 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp[date]
    • Cleaning The column is cast to DATE type in the fields CTE
    • Direct The column is directly copied to the final output
    • Output Columns:
      • date_day: Directly mapped and renamed
94. model.google_ads.google_ads__campaign_report
  • Input Column: 113. model.google_ads_source.stg_google_ads__campaign_stats[date_day]
    • Direct The column is directly copied without transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly mapped to output column
Column Lineage
%3 97. model.google_ads_source.stg_google_ads__account_history 97. model.google_ads_source.stg_google_ads__account_history account_name 94. model.google_ads.google_ads__campaign_report 94. model.google_ads.google_ads__campaign_report account_name 97. model.google_ads_source.stg_google_ads__account_history:f0->94. model.google_ads.google_ads__campaign_report:f0 98. model.google_ads_source.stg_google_ads__account_history_tmp 98. model.google_ads_source.stg_google_ads__account_history_tmp descriptive_name 98. model.google_ads_source.stg_google_ads__account_history_tmp:f0->97. model.google_ads_source.stg_google_ads__account_history:f0
97. model.google_ads_source.stg_google_ads__account_history
  • Input Column: 98. model.google_ads_source.stg_google_ads__account_history_tmp[descriptive_name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • account_name: Directly mapped
94. model.google_ads.google_ads__campaign_report
  • Input Column: 97. model.google_ads_source.stg_google_ads__account_history[account_name]
    • Direct directly copied to the output
    • Output Columns:
      • account_name: directly copied
Column Lineage
%3 97. model.google_ads_source.stg_google_ads__account_history 97. model.google_ads_source.stg_google_ads__account_history account_id 94. model.google_ads.google_ads__campaign_report 94. model.google_ads.google_ads__campaign_report account_id 97. model.google_ads_source.stg_google_ads__account_history:f0->94. model.google_ads.google_ads__campaign_report:f0 98. model.google_ads_source.stg_google_ads__account_history_tmp 98. model.google_ads_source.stg_google_ads__account_history_tmp id 98. model.google_ads_source.stg_google_ads__account_history_tmp:f0->97. model.google_ads_source.stg_google_ads__account_history:f0
97. model.google_ads_source.stg_google_ads__account_history
  • Input Column: 98. model.google_ads_source.stg_google_ads__account_history_tmp[id]
    • Direct The column is directly copied without transformation
    • Deduplication Used in ROW_NUMBER() function to determine the most recent record
    • Output Columns:
      • account_id: Directly mapped
94. model.google_ads.google_ads__campaign_report
  • Input Column: 97. model.google_ads_source.stg_google_ads__account_history[account_id]
    • Integration used as the key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • account_id: directly copied
Column Lineage
%3 97. model.google_ads_source.stg_google_ads__account_history 97. model.google_ads_source.stg_google_ads__account_history currency_code 94. model.google_ads.google_ads__campaign_report 94. model.google_ads.google_ads__campaign_report currency_code 97. model.google_ads_source.stg_google_ads__account_history:f0->94. model.google_ads.google_ads__campaign_report:f0 98. model.google_ads_source.stg_google_ads__account_history_tmp 98. model.google_ads_source.stg_google_ads__account_history_tmp currency_code 98. model.google_ads_source.stg_google_ads__account_history_tmp:f0->97. model.google_ads_source.stg_google_ads__account_history:f0
97. model.google_ads_source.stg_google_ads__account_history
  • Input Column: 98. model.google_ads_source.stg_google_ads__account_history_tmp[currency_code]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • currency_code: Directly mapped
94. model.google_ads.google_ads__campaign_report
  • Input Column: 97. model.google_ads_source.stg_google_ads__account_history[currency_code]
    • Direct directly copied to the output
    • Output Columns:
      • currency_code: directly copied
Column Lineage
%3 111. model.google_ads_source.stg_google_ads__campaign_history 111. model.google_ads_source.stg_google_ads__campaign_history campaign_name 94. model.google_ads.google_ads__campaign_report 94. model.google_ads.google_ads__campaign_report campaign_name 111. model.google_ads_source.stg_google_ads__campaign_history:f0->94. model.google_ads.google_ads__campaign_report:f0 112. model.google_ads_source.stg_google_ads__campaign_history_tmp 112. model.google_ads_source.stg_google_ads__campaign_history_tmp name 112. model.google_ads_source.stg_google_ads__campaign_history_tmp:f0->111. model.google_ads_source.stg_google_ads__campaign_history:f0
111. model.google_ads_source.stg_google_ads__campaign_history
  • Input Column: 112. model.google_ads_source.stg_google_ads__campaign_history_tmp[name]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • campaign_name: Directly mapped to this output column
94. model.google_ads.google_ads__campaign_report
  • Input Column: 111. model.google_ads_source.stg_google_ads__campaign_history[campaign_name]
    • Direct The campaign_name is directly copied to the output without transformation
    • Integration Used as part of the join condition with the stats table
    • Output Columns:
      • campaign_name: Directly mapped to the output column
Column Lineage
%3 111. model.google_ads_source.stg_google_ads__campaign_history 111. model.google_ads_source.stg_google_ads__campaign_history campaign_id 94. model.google_ads.google_ads__campaign_report 94. model.google_ads.google_ads__campaign_report campaign_id 111. model.google_ads_source.stg_google_ads__campaign_history:f0->94. model.google_ads.google_ads__campaign_report:f0 113. model.google_ads_source.stg_google_ads__campaign_stats 113. model.google_ads_source.stg_google_ads__campaign_stats campaign_id 113. model.google_ads_source.stg_google_ads__campaign_stats:f0->94. model.google_ads.google_ads__campaign_report:f0 112. model.google_ads_source.stg_google_ads__campaign_history_tmp 112. model.google_ads_source.stg_google_ads__campaign_history_tmp id 112. model.google_ads_source.stg_google_ads__campaign_history_tmp:f0->111. model.google_ads_source.stg_google_ads__campaign_history:f0 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp id 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp:f0->113. model.google_ads_source.stg_google_ads__campaign_stats:f0
111. model.google_ads_source.stg_google_ads__campaign_history
  • Input Column: 112. model.google_ads_source.stg_google_ads__campaign_history_tmp[id]
    • Direct The column is directly copied without any transformation
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • campaign_id: Directly mapped to this output column
113. model.google_ads_source.stg_google_ads__campaign_stats
  • Input Column: 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp[id]
    • Cleaning The column is cleaned by casting to INT
    • Direct The cleaned value is directly copied to the output
    • Output Columns:
      • campaign_id: Directly mapped after cleaning
94. model.google_ads.google_ads__campaign_report
  • Input Column: 111. model.google_ads_source.stg_google_ads__campaign_history[campaign_id]
    • Direct The column is directly used in the SELECT statement
    • Integration Used to join with other tables
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • campaign_id: Directly copied to the output
  • Input Column: 113. model.google_ads_source.stg_google_ads__campaign_stats[campaign_id]
    • Direct The column is directly copied without transformation
    • Integration Used as a join key to connect with the campaigns table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • campaign_id: Directly mapped to output column
Column Lineage
%3 111. model.google_ads_source.stg_google_ads__campaign_history 111. model.google_ads_source.stg_google_ads__campaign_history advertising_channel_type 94. model.google_ads.google_ads__campaign_report 94. model.google_ads.google_ads__campaign_report advertising_channel_type 111. model.google_ads_source.stg_google_ads__campaign_history:f0->94. model.google_ads.google_ads__campaign_report:f0 112. model.google_ads_source.stg_google_ads__campaign_history_tmp 112. model.google_ads_source.stg_google_ads__campaign_history_tmp advertising_channel_type 112. model.google_ads_source.stg_google_ads__campaign_history_tmp:f0->111. model.google_ads_source.stg_google_ads__campaign_history:f0
111. model.google_ads_source.stg_google_ads__campaign_history
  • Input Column: 112. model.google_ads_source.stg_google_ads__campaign_history_tmp[advertising_channel_type]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • advertising_channel_type: Directly mapped to this output column
94. model.google_ads.google_ads__campaign_report
  • Input Column: 111. model.google_ads_source.stg_google_ads__campaign_history[advertising_channel_type]
    • Direct The column is directly used in the SELECT statement
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • advertising_channel_type: Directly copied to the output
Column Lineage
%3 111. model.google_ads_source.stg_google_ads__campaign_history 111. model.google_ads_source.stg_google_ads__campaign_history advertising_channel_subtype 94. model.google_ads.google_ads__campaign_report 94. model.google_ads.google_ads__campaign_report advertising_channel_subtype 111. model.google_ads_source.stg_google_ads__campaign_history:f0->94. model.google_ads.google_ads__campaign_report:f0 112. model.google_ads_source.stg_google_ads__campaign_history_tmp 112. model.google_ads_source.stg_google_ads__campaign_history_tmp advertising_channel_subtype 112. model.google_ads_source.stg_google_ads__campaign_history_tmp:f0->111. model.google_ads_source.stg_google_ads__campaign_history:f0
111. model.google_ads_source.stg_google_ads__campaign_history
  • Input Column: 112. model.google_ads_source.stg_google_ads__campaign_history_tmp[advertising_channel_subtype]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • advertising_channel_subtype: Directly mapped to this output column
94. model.google_ads.google_ads__campaign_report
  • Input Column: 111. model.google_ads_source.stg_google_ads__campaign_history[advertising_channel_subtype]
    • Direct The column is directly used in the SELECT statement
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • advertising_channel_subtype: Directly copied to the output
Column Lineage
%3 111. model.google_ads_source.stg_google_ads__campaign_history 111. model.google_ads_source.stg_google_ads__campaign_history status 94. model.google_ads.google_ads__campaign_report 94. model.google_ads.google_ads__campaign_report status 111. model.google_ads_source.stg_google_ads__campaign_history:f0->94. model.google_ads.google_ads__campaign_report:f0 112. model.google_ads_source.stg_google_ads__campaign_history_tmp 112. model.google_ads_source.stg_google_ads__campaign_history_tmp status 112. model.google_ads_source.stg_google_ads__campaign_history_tmp:f0->111. model.google_ads_source.stg_google_ads__campaign_history:f0
111. model.google_ads_source.stg_google_ads__campaign_history
  • Input Column: 112. model.google_ads_source.stg_google_ads__campaign_history_tmp[status]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • status: Directly mapped to this output column
94. model.google_ads.google_ads__campaign_report
  • Input Column: 111. model.google_ads_source.stg_google_ads__campaign_history[status]
    • Direct The column is directly used in the SELECT statement
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • status: Directly copied to the output
Column Lineage
%3 113. model.google_ads_source.stg_google_ads__campaign_stats 113. model.google_ads_source.stg_google_ads__campaign_stats spend 94. model.google_ads.google_ads__campaign_report 94. model.google_ads.google_ads__campaign_report spend 113. model.google_ads_source.stg_google_ads__campaign_stats:f0->94. model.google_ads.google_ads__campaign_report:f0 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp cost_micros 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp:f0->113. model.google_ads_source.stg_google_ads__campaign_stats:f0
113. model.google_ads_source.stg_google_ads__campaign_stats
  • Input Column: 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp[cost_micros]
    • Cleaning The column is cleaned by casting to INT and replacing NULL with 0
    • Other The value is divided by 1,000,000 to convert micros to regular currency units
    • Output Columns:
      • spend: Transformed (divided by 1,000,000) and mapped
94. model.google_ads.google_ads__campaign_report
  • Input Column: 113. model.google_ads_source.stg_google_ads__campaign_stats[spend]
    • Aggregation The column is summed up in the SELECT clause
    • Output Columns:
      • spend: Aggregated sum is mapped to output column
Column Lineage
%3 113. model.google_ads_source.stg_google_ads__campaign_stats 113. model.google_ads_source.stg_google_ads__campaign_stats clicks 94. model.google_ads.google_ads__campaign_report 94. model.google_ads.google_ads__campaign_report clicks 113. model.google_ads_source.stg_google_ads__campaign_stats:f0->94. model.google_ads.google_ads__campaign_report:f0 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp clicks 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp:f0->113. model.google_ads_source.stg_google_ads__campaign_stats:f0
113. model.google_ads_source.stg_google_ads__campaign_stats
  • Input Column: 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp[clicks]
    • Cleaning The column is cleaned by casting to INT and replacing NULL with 0
    • Direct The cleaned value is directly copied to the output
    • Output Columns:
      • clicks: Directly mapped after cleaning
94. model.google_ads.google_ads__campaign_report
  • Input Column: 113. model.google_ads_source.stg_google_ads__campaign_stats[clicks]
    • Aggregation The column is summed up in the SELECT clause
    • Output Columns:
      • clicks: Aggregated sum is mapped to output column
Column Lineage
%3 113. model.google_ads_source.stg_google_ads__campaign_stats 113. model.google_ads_source.stg_google_ads__campaign_stats impressions 94. model.google_ads.google_ads__campaign_report 94. model.google_ads.google_ads__campaign_report impressions 113. model.google_ads_source.stg_google_ads__campaign_stats:f0->94. model.google_ads.google_ads__campaign_report:f0 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp impressions 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp:f0->113. model.google_ads_source.stg_google_ads__campaign_stats:f0
113. model.google_ads_source.stg_google_ads__campaign_stats
  • Input Column: 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp[impressions]
    • Cleaning The column is cleaned by casting to INT and replacing NULL with 0
    • Direct The cleaned value is directly copied to the output
    • Output Columns:
      • impressions: Directly mapped after cleaning
94. model.google_ads.google_ads__campaign_report
  • Input Column: 113. model.google_ads_source.stg_google_ads__campaign_stats[impressions]
    • Aggregation The column is summed up in the SELECT clause
    • Output Columns:
      • impressions: Aggregated sum is mapped to output column
Column Lineage
%3 113. model.google_ads_source.stg_google_ads__campaign_stats 113. model.google_ads_source.stg_google_ads__campaign_stats conversions 94. model.google_ads.google_ads__campaign_report 94. model.google_ads.google_ads__campaign_report conversions 113. model.google_ads_source.stg_google_ads__campaign_stats:f0->94. model.google_ads.google_ads__campaign_report:f0 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp conversions 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp:f0->113. model.google_ads_source.stg_google_ads__campaign_stats:f0
113. model.google_ads_source.stg_google_ads__campaign_stats
  • Input Column: 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp[conversions]
    • Cleaning The column is cleaned by casting to INT and replacing NULL with 0
    • Direct The cleaned value is directly copied to the output
    • Output Columns:
      • conversions: Directly mapped after cleaning
94. model.google_ads.google_ads__campaign_report
  • Input Column: 113. model.google_ads_source.stg_google_ads__campaign_stats[conversions]
    • Aggregation The column is summed up in the SELECT clause
    • Output Columns:
      • conversions: Aggregated sum is mapped to output column
Column Lineage
%3 113. model.google_ads_source.stg_google_ads__campaign_stats 113. model.google_ads_source.stg_google_ads__campaign_stats conversions_value 94. model.google_ads.google_ads__campaign_report 94. model.google_ads.google_ads__campaign_report conversions_value 113. model.google_ads_source.stg_google_ads__campaign_stats:f0->94. model.google_ads.google_ads__campaign_report:f0 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp conversions_value 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp:f0->113. model.google_ads_source.stg_google_ads__campaign_stats:f0
113. model.google_ads_source.stg_google_ads__campaign_stats
  • Input Column: 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp[conversions_value]
    • Cleaning The column is cleaned by casting to INT and replacing NULL with 0
    • Direct The cleaned value is directly copied to the output
    • Output Columns:
      • conversions_value: Directly mapped after cleaning
94. model.google_ads.google_ads__campaign_report
  • Input Column: 113. model.google_ads_source.stg_google_ads__campaign_stats[conversions_value]
    • Aggregation This column is summed up in the GROUP BY clause
    • Output Columns:
      • conversions_value: It is directly mapped to the output column 'conversions_value' after being aggregated
Column Lineage
%3 113. model.google_ads_source.stg_google_ads__campaign_stats 113. model.google_ads_source.stg_google_ads__campaign_stats view_through_conversions 94. model.google_ads.google_ads__campaign_report 94. model.google_ads.google_ads__campaign_report view_through_conversions 113. model.google_ads_source.stg_google_ads__campaign_stats:f0->94. model.google_ads.google_ads__campaign_report:f0 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp view_through_conversions 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp:f0->113. model.google_ads_source.stg_google_ads__campaign_stats:f0
113. model.google_ads_source.stg_google_ads__campaign_stats
  • Input Column: 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp[view_through_conversions]
    • Cleaning The column is cleaned by replacing NULL values with 0 using the COALESCE function.
    • Direct After cleaning, the column is directly copied to the output.
    • Output Columns:
      • view_through_conversions: The input column is cleaned (NULL replaced with 0) and then directly mapped to the output column of the same name.
94. model.google_ads.google_ads__campaign_report
  • Input Column: 113. model.google_ads_source.stg_google_ads__campaign_stats[view_through_conversions]
    • Aggregation This column is summed up in the GROUP BY clause
    • Output Columns:
      • view_through_conversions: It is directly mapped to the output column 'view_through_conversions' after being aggregated
95. model.google_ads.google_ads__keyword_report

This SQL query integrates data from multiple Google Ads-related tables (keyword stats, account history, campaign history, ad group history, and ad group criterion history) to create a comprehensive keyword report. It joins these tables based on various IDs and the source relation, filters for the most recent records in the history tables, and aggregates metrics such as spend, clicks, impressions, and conversions. The result is a detailed view of keyword performance across different levels of the account structure (account, campaign, ad group) with associated metadata.

FilteringIntegrationAggregation
SQL Query
WITH stats AS (
  SELECT
    *
  FROM TEST.PUBLIC_google_ads_source.stg_google_ads__keyword_stats
), accounts AS (
  SELECT
    *
  FROM TEST.PUBLIC_google_ads_source.stg_google_ads__account_history
  WHERE
    is_most_recent_record = TRUE
), campaigns AS (
  SELECT
    *
  FROM TEST.PUBLIC_google_ads_source.stg_google_ads__campaign_history
  WHERE
    is_most_recent_record = TRUE
), ad_groups AS (
  SELECT
    *
  FROM TEST.PUBLIC_google_ads_source.stg_google_ads__ad_group_history
  WHERE
    is_most_recent_record = TRUE
), criterions AS (
  SELECT
    *
  FROM TEST.PUBLIC_google_ads_source.stg_google_ads__ad_group_criterion_history
  WHERE
    is_most_recent_record = TRUE
), fields AS (
  SELECT
    stats.source_relation,
    stats.date_day,
    accounts.account_name,
    stats.account_id,
    accounts.currency_code,
    campaigns.campaign_name,
    stats.campaign_id,
    ad_groups.ad_group_name,
    stats.ad_group_id,
    stats.criterion_id,
    criterions.type,
    criterions.status,
    criterions.keyword_match_type,
    criterions.keyword_text,
    SUM(stats.spend) AS spend,
    SUM(stats.clicks) AS clicks,
    SUM(stats.impressions) AS impressions,
    SUM(conversions) AS conversions,
    SUM(conversions_value) AS conversions_value,
    SUM(view_through_conversions) AS view_through_conversions
  FROM stats
  LEFT JOIN criterions
    ON stats.criterion_id = criterions.criterion_id
    AND stats.source_relation = criterions.source_relation
  LEFT JOIN ad_groups
    ON stats.ad_group_id = ad_groups.ad_group_id
    AND stats.source_relation = ad_groups.source_relation
  LEFT JOIN campaigns
    ON stats.campaign_id = campaigns.campaign_id
    AND stats.source_relation = campaigns.source_relation
  LEFT JOIN accounts
    ON stats.account_id = accounts.account_id
    AND stats.source_relation = accounts.source_relation
  GROUP BY
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10,
    11,
    12,
    13,
    14
)
SELECT
  *
FROM fields
%3 95. model.google_ads.google_ads__keyword_report 95. model.google_ads.google_ads__keyword_report source_relation date_day account_name account_id currency_code campaign_name campaign_id ad_group_name ad_group_id criterion_id type status keyword_match_type keyword_text spend clicks impressions conversions conversions_value view_through_conversions 97. model.google_ads_source.stg_google_ads__account_history 97. model.google_ads_source.stg_google_ads__account_history source_relation account_id currency_code account_name 97. model.google_ads_source.stg_google_ads__account_history:f0->95. model.google_ads.google_ads__keyword_report:f0 97. model.google_ads_source.stg_google_ads__account_history:f1->95. model.google_ads.google_ads__keyword_report:f3 97. model.google_ads_source.stg_google_ads__account_history:f2->95. model.google_ads.google_ads__keyword_report:f4 97. model.google_ads_source.stg_google_ads__account_history:f3->95. model.google_ads.google_ads__keyword_report:f2 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history source_relation criterion_id type status keyword_match_type keyword_text 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history:f0->95. model.google_ads.google_ads__keyword_report:f0 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history:f1->95. model.google_ads.google_ads__keyword_report:f9 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history:f2->95. model.google_ads.google_ads__keyword_report:f10 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history:f3->95. model.google_ads.google_ads__keyword_report:f11 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history:f4->95. model.google_ads.google_ads__keyword_report:f12 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history:f5->95. model.google_ads.google_ads__keyword_report:f13 103. model.google_ads_source.stg_google_ads__ad_group_history 103. model.google_ads_source.stg_google_ads__ad_group_history source_relation ad_group_id ad_group_name 103. model.google_ads_source.stg_google_ads__ad_group_history:f0->95. model.google_ads.google_ads__keyword_report:f0 103. model.google_ads_source.stg_google_ads__ad_group_history:f1->95. model.google_ads.google_ads__keyword_report:f8 103. model.google_ads_source.stg_google_ads__ad_group_history:f2->95. model.google_ads.google_ads__keyword_report:f7 111. model.google_ads_source.stg_google_ads__campaign_history 111. model.google_ads_source.stg_google_ads__campaign_history source_relation campaign_id campaign_name 111. model.google_ads_source.stg_google_ads__campaign_history:f0->95. model.google_ads.google_ads__keyword_report:f0 111. model.google_ads_source.stg_google_ads__campaign_history:f1->95. model.google_ads.google_ads__keyword_report:f6 111. model.google_ads_source.stg_google_ads__campaign_history:f2->95. model.google_ads.google_ads__keyword_report:f5 115. model.google_ads_source.stg_google_ads__keyword_stats 115. model.google_ads_source.stg_google_ads__keyword_stats source_relation account_id date_day ad_group_id campaign_id criterion_id clicks spend impressions conversions conversions_value view_through_conversions 115. model.google_ads_source.stg_google_ads__keyword_stats:f0->95. model.google_ads.google_ads__keyword_report:f0 115. model.google_ads_source.stg_google_ads__keyword_stats:f1->95. model.google_ads.google_ads__keyword_report:f3 115. model.google_ads_source.stg_google_ads__keyword_stats:f2->95. model.google_ads.google_ads__keyword_report:f1 115. model.google_ads_source.stg_google_ads__keyword_stats:f3->95. model.google_ads.google_ads__keyword_report:f8 115. model.google_ads_source.stg_google_ads__keyword_stats:f4->95. model.google_ads.google_ads__keyword_report:f6 115. model.google_ads_source.stg_google_ads__keyword_stats:f5->95. model.google_ads.google_ads__keyword_report:f9 115. model.google_ads_source.stg_google_ads__keyword_stats:f6->95. model.google_ads.google_ads__keyword_report:f15 115. model.google_ads_source.stg_google_ads__keyword_stats:f7->95. model.google_ads.google_ads__keyword_report:f14 115. model.google_ads_source.stg_google_ads__keyword_stats:f8->95. model.google_ads.google_ads__keyword_report:f16 115. model.google_ads_source.stg_google_ads__keyword_stats:f9->95. model.google_ads.google_ads__keyword_report:f17 115. model.google_ads_source.stg_google_ads__keyword_stats:f10->95. model.google_ads.google_ads__keyword_report:f18 115. model.google_ads_source.stg_google_ads__keyword_stats:f11->95. model.google_ads.google_ads__keyword_report:f19
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
date_day date The date being reported on.
account_name integer The descriptive name of the Customer account.
account_id bigint The Customer ID.
currency_code text The currency which the account uses.
campaign_name text The name of the campaign, if present in the source data.
campaign_id bigint The ID representing the campaign, if present in the source data.
ad_group_name text The name of the ad group, if present in the source data.
ad_group_id text The ID representing the ad group, if present in the source data.
criterion_id bigint The unique identifier of the criterion being served.
type text The type of keyword ad being served.
status text The status of the keyword ads.
keyword_match_type text The match type criteria used for the keyword ads.
keyword_text text The specific keyword text that is used.
spend numeric Total cost of ad clicks.
clicks bigint The count of clicks.
impressions bigint The count of impressions.
conversions bigint The number of conversions you've received, across your conversion actions. Conversions are measured with conversion tracking and may include [modeled](https://support.google.com/google-ads/answer/10081327?sjid=12862894247631803415-NC) conversions in cases where you are not able to observe all conversions that took place. You can use this column to see how often your ads led customers to actions that you’ve defined as valuable for your business.
conversions_value bigint The sum of monetary values for your `conversions`. You have to enter a value in the Google Ads UI for your conversion actions to make this metric useful.
view_through_conversions bigint For video campaigns, view-through conversions tell you when an _impression_ of your video ad leads to a conversion on your site. The last impression of a video ad will get credit for the view-through conversion. Keep in mind: An impression is different than a “view” of a video ad. A “view” is counted when someone watches 30 seconds (or the whole ad if it’s shorter than 30 seconds) or clicks on a part of the ad. A “view” that leads to a conversion is counted in the `conversions` column.
Column Lineage
%3 97. model.google_ads_source.stg_google_ads__account_history 97. model.google_ads_source.stg_google_ads__account_history source_relation 95. model.google_ads.google_ads__keyword_report 95. model.google_ads.google_ads__keyword_report source_relation 97. model.google_ads_source.stg_google_ads__account_history:f0->95. model.google_ads.google_ads__keyword_report:f0 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history source_relation 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history:f0->95. model.google_ads.google_ads__keyword_report:f0 103. model.google_ads_source.stg_google_ads__ad_group_history 103. model.google_ads_source.stg_google_ads__ad_group_history source_relation 103. model.google_ads_source.stg_google_ads__ad_group_history:f0->95. model.google_ads.google_ads__keyword_report:f0 111. model.google_ads_source.stg_google_ads__campaign_history 111. model.google_ads_source.stg_google_ads__campaign_history source_relation 111. model.google_ads_source.stg_google_ads__campaign_history:f0->95. model.google_ads.google_ads__keyword_report:f0 115. model.google_ads_source.stg_google_ads__keyword_stats 115. model.google_ads_source.stg_google_ads__keyword_stats source_relation 115. model.google_ads_source.stg_google_ads__keyword_stats:f0->95. model.google_ads.google_ads__keyword_report:f0
95. model.google_ads.google_ads__keyword_report
  • Input Column: 97. model.google_ads_source.stg_google_ads__account_history[source_relation]
    • Integration used as a key to join with other tables
    • Direct copied directly to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history[source_relation]
    • Integration used as a key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 103. model.google_ads_source.stg_google_ads__ad_group_history[source_relation]
    • Integration used as a key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 111. model.google_ads_source.stg_google_ads__campaign_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 115. model.google_ads_source.stg_google_ads__keyword_stats[source_relation]
    • Direct The column is directly copied without transformation
    • Integration Used as part of the join condition with other tables
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to output
Column Lineage
%3 115. model.google_ads_source.stg_google_ads__keyword_stats 115. model.google_ads_source.stg_google_ads__keyword_stats date_day 95. model.google_ads.google_ads__keyword_report 95. model.google_ads.google_ads__keyword_report date_day 115. model.google_ads_source.stg_google_ads__keyword_stats:f0->95. model.google_ads.google_ads__keyword_report:f0 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp date 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp:f0->115. model.google_ads_source.stg_google_ads__keyword_stats:f0
115. model.google_ads_source.stg_google_ads__keyword_stats
  • Input Column: 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp[date]
    • Cleaning The column is cast to DATE type
    • Direct The column is directly copied to date_day
    • Output Columns:
      • date_day: Directly mapped after casting to DATE
95. model.google_ads.google_ads__keyword_report
  • Input Column: 115. model.google_ads_source.stg_google_ads__keyword_stats[date_day]
    • Direct The column is directly copied without transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to output
Column Lineage
%3 97. model.google_ads_source.stg_google_ads__account_history 97. model.google_ads_source.stg_google_ads__account_history account_name 95. model.google_ads.google_ads__keyword_report 95. model.google_ads.google_ads__keyword_report account_name 97. model.google_ads_source.stg_google_ads__account_history:f0->95. model.google_ads.google_ads__keyword_report:f0 98. model.google_ads_source.stg_google_ads__account_history_tmp 98. model.google_ads_source.stg_google_ads__account_history_tmp descriptive_name 98. model.google_ads_source.stg_google_ads__account_history_tmp:f0->97. model.google_ads_source.stg_google_ads__account_history:f0
97. model.google_ads_source.stg_google_ads__account_history
  • Input Column: 98. model.google_ads_source.stg_google_ads__account_history_tmp[descriptive_name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • account_name: Directly mapped
95. model.google_ads.google_ads__keyword_report
  • Input Column: 97. model.google_ads_source.stg_google_ads__account_history[account_name]
    • Direct copied directly to the output
    • Output Columns:
      • account_name: directly copied
Column Lineage
%3 97. model.google_ads_source.stg_google_ads__account_history 97. model.google_ads_source.stg_google_ads__account_history account_id 95. model.google_ads.google_ads__keyword_report 95. model.google_ads.google_ads__keyword_report account_id 97. model.google_ads_source.stg_google_ads__account_history:f0->95. model.google_ads.google_ads__keyword_report:f0 115. model.google_ads_source.stg_google_ads__keyword_stats 115. model.google_ads_source.stg_google_ads__keyword_stats account_id 115. model.google_ads_source.stg_google_ads__keyword_stats:f0->95. model.google_ads.google_ads__keyword_report:f0 98. model.google_ads_source.stg_google_ads__account_history_tmp 98. model.google_ads_source.stg_google_ads__account_history_tmp id 98. model.google_ads_source.stg_google_ads__account_history_tmp:f0->97. model.google_ads_source.stg_google_ads__account_history:f0 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp customer_id 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp:f0->115. model.google_ads_source.stg_google_ads__keyword_stats:f0
97. model.google_ads_source.stg_google_ads__account_history
  • Input Column: 98. model.google_ads_source.stg_google_ads__account_history_tmp[id]
    • Direct The column is directly copied without transformation
    • Deduplication Used in ROW_NUMBER() function to determine the most recent record
    • Output Columns:
      • account_id: Directly mapped
115. model.google_ads_source.stg_google_ads__keyword_stats
  • Input Column: 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp[customer_id]
    • Cleaning The column is cast to INT type
    • Direct The column is directly copied to account_id
    • Output Columns:
      • account_id: Directly mapped after casting to INT
95. model.google_ads.google_ads__keyword_report
  • Input Column: 97. model.google_ads_source.stg_google_ads__account_history[account_id]
    • Integration used as a key to join with other tables
    • Direct copied directly to the output
    • Output Columns:
      • account_id: directly copied
  • Input Column: 115. model.google_ads_source.stg_google_ads__keyword_stats[account_id]
    • Direct The column is directly copied without transformation
    • Integration Used as part of the join condition with the accounts table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • account_id: Directly copied to output
Column Lineage
%3 97. model.google_ads_source.stg_google_ads__account_history 97. model.google_ads_source.stg_google_ads__account_history currency_code 95. model.google_ads.google_ads__keyword_report 95. model.google_ads.google_ads__keyword_report currency_code 97. model.google_ads_source.stg_google_ads__account_history:f0->95. model.google_ads.google_ads__keyword_report:f0 98. model.google_ads_source.stg_google_ads__account_history_tmp 98. model.google_ads_source.stg_google_ads__account_history_tmp currency_code 98. model.google_ads_source.stg_google_ads__account_history_tmp:f0->97. model.google_ads_source.stg_google_ads__account_history:f0
97. model.google_ads_source.stg_google_ads__account_history
  • Input Column: 98. model.google_ads_source.stg_google_ads__account_history_tmp[currency_code]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • currency_code: Directly mapped
95. model.google_ads.google_ads__keyword_report
  • Input Column: 97. model.google_ads_source.stg_google_ads__account_history[currency_code]
    • Direct copied directly to the output
    • Output Columns:
      • currency_code: directly copied
Column Lineage
%3 111. model.google_ads_source.stg_google_ads__campaign_history 111. model.google_ads_source.stg_google_ads__campaign_history campaign_name 95. model.google_ads.google_ads__keyword_report 95. model.google_ads.google_ads__keyword_report campaign_name 111. model.google_ads_source.stg_google_ads__campaign_history:f0->95. model.google_ads.google_ads__keyword_report:f0 112. model.google_ads_source.stg_google_ads__campaign_history_tmp 112. model.google_ads_source.stg_google_ads__campaign_history_tmp name 112. model.google_ads_source.stg_google_ads__campaign_history_tmp:f0->111. model.google_ads_source.stg_google_ads__campaign_history:f0
111. model.google_ads_source.stg_google_ads__campaign_history
  • Input Column: 112. model.google_ads_source.stg_google_ads__campaign_history_tmp[name]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • campaign_name: Directly mapped to this output column
95. model.google_ads.google_ads__keyword_report
  • Input Column: 111. model.google_ads_source.stg_google_ads__campaign_history[campaign_name]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the stats table
    • Output Columns:
      • campaign_name: Directly copied to the output
Column Lineage
%3 111. model.google_ads_source.stg_google_ads__campaign_history 111. model.google_ads_source.stg_google_ads__campaign_history campaign_id 95. model.google_ads.google_ads__keyword_report 95. model.google_ads.google_ads__keyword_report campaign_id 111. model.google_ads_source.stg_google_ads__campaign_history:f0->95. model.google_ads.google_ads__keyword_report:f0 115. model.google_ads_source.stg_google_ads__keyword_stats 115. model.google_ads_source.stg_google_ads__keyword_stats campaign_id 115. model.google_ads_source.stg_google_ads__keyword_stats:f0->95. model.google_ads.google_ads__keyword_report:f0 112. model.google_ads_source.stg_google_ads__campaign_history_tmp 112. model.google_ads_source.stg_google_ads__campaign_history_tmp id 112. model.google_ads_source.stg_google_ads__campaign_history_tmp:f0->111. model.google_ads_source.stg_google_ads__campaign_history:f0 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp campaign_id 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp:f0->115. model.google_ads_source.stg_google_ads__keyword_stats:f0
111. model.google_ads_source.stg_google_ads__campaign_history
  • Input Column: 112. model.google_ads_source.stg_google_ads__campaign_history_tmp[id]
    • Direct The column is directly copied without any transformation
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • campaign_id: Directly mapped to this output column
115. model.google_ads_source.stg_google_ads__keyword_stats
  • Input Column: 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp[campaign_id]
    • Direct The column is directly copied
    • Cleaning The column is cast to INT type
    • Output Columns:
      • campaign_id: Directly mapped after casting
95. model.google_ads.google_ads__keyword_report
  • Input Column: 111. model.google_ads_source.stg_google_ads__campaign_history[campaign_id]
    • Integration used as the key to join with the stats table
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
  • Input Column: 115. model.google_ads_source.stg_google_ads__keyword_stats[campaign_id]
    • Direct The column is directly copied without transformation
    • Integration Used as part of the join condition with the campaigns table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • campaign_id: Directly copied to output
Column Lineage
%3 103. model.google_ads_source.stg_google_ads__ad_group_history 103. model.google_ads_source.stg_google_ads__ad_group_history ad_group_name 95. model.google_ads.google_ads__keyword_report 95. model.google_ads.google_ads__keyword_report ad_group_name 103. model.google_ads_source.stg_google_ads__ad_group_history:f0->95. model.google_ads.google_ads__keyword_report:f0 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp name 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp:f0->103. model.google_ads_source.stg_google_ads__ad_group_history:f0
103. model.google_ads_source.stg_google_ads__ad_group_history
  • Input Column: 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp[name]
    • Direct Copied without transformation
    • Output Columns:
      • ad_group_name: Directly mapped and renamed
95. model.google_ads.google_ads__keyword_report
  • Input Column: 103. model.google_ads_source.stg_google_ads__ad_group_history[ad_group_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_name: directly copied
Column Lineage
%3 103. model.google_ads_source.stg_google_ads__ad_group_history 103. model.google_ads_source.stg_google_ads__ad_group_history ad_group_id 95. model.google_ads.google_ads__keyword_report 95. model.google_ads.google_ads__keyword_report ad_group_id 103. model.google_ads_source.stg_google_ads__ad_group_history:f0->95. model.google_ads.google_ads__keyword_report:f0 115. model.google_ads_source.stg_google_ads__keyword_stats 115. model.google_ads_source.stg_google_ads__keyword_stats ad_group_id 115. model.google_ads_source.stg_google_ads__keyword_stats:f0->95. model.google_ads.google_ads__keyword_report:f0 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp id 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp:f0->103. model.google_ads_source.stg_google_ads__ad_group_history:f0 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp ad_group_id 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp:f0->115. model.google_ads_source.stg_google_ads__keyword_stats:f0
103. model.google_ads_source.stg_google_ads__ad_group_history
  • Input Column: 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp[id]
    • Cleaning The column is cast to TEXT type
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • ad_group_id: Directly mapped after casting to TEXT
115. model.google_ads_source.stg_google_ads__keyword_stats
  • Input Column: 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp[ad_group_id]
    • Direct The column is directly copied
    • Cleaning The column is cast to INT type, then to TEXT type
    • Output Columns:
      • ad_group_id: Mapped after casting to TEXT
95. model.google_ads.google_ads__keyword_report
  • Input Column: 103. model.google_ads_source.stg_google_ads__ad_group_history[ad_group_id]
    • Integration used as a key to join with the stats table
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_id: directly copied
  • Input Column: 115. model.google_ads_source.stg_google_ads__keyword_stats[ad_group_id]
    • Direct The column is directly copied without transformation
    • Integration Used as part of the join condition with the ad_groups table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • ad_group_id: Directly copied to output
Column Lineage
%3 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history criterion_id 95. model.google_ads.google_ads__keyword_report 95. model.google_ads.google_ads__keyword_report criterion_id 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history:f0->95. model.google_ads.google_ads__keyword_report:f0 115. model.google_ads_source.stg_google_ads__keyword_stats 115. model.google_ads_source.stg_google_ads__keyword_stats criterion_id 115. model.google_ads_source.stg_google_ads__keyword_stats:f0->95. model.google_ads.google_ads__keyword_report:f0 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp id 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp:f0->101. model.google_ads_source.stg_google_ads__ad_group_criterion_history:f0 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp ad_group_criterion_criterion_id 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp:f0->115. model.google_ads_source.stg_google_ads__keyword_stats:f0
101. model.google_ads_source.stg_google_ads__ad_group_criterion_history
  • Input Column: 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp[id]
    • Cleaning The column is cast to INT type
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • criterion_id: Directly mapped and renamed
115. model.google_ads_source.stg_google_ads__keyword_stats
  • Input Column: 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp[ad_group_criterion_criterion_id]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast to INT type
    • Output Columns:
      • criterion_id: Directly mapped after casting
95. model.google_ads.google_ads__keyword_report
  • Input Column: 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history[criterion_id]
    • Integration used as a key to join with the stats table
    • Direct directly copied to the output
    • Output Columns:
      • criterion_id: directly copied
  • Input Column: 115. model.google_ads_source.stg_google_ads__keyword_stats[criterion_id]
    • Direct The column is directly copied without transformation
    • Integration Used as part of the join condition with the criterions table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • criterion_id: Directly copied to output
Column Lineage
%3 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history type 95. model.google_ads.google_ads__keyword_report 95. model.google_ads.google_ads__keyword_report type 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history:f0->95. model.google_ads.google_ads__keyword_report:f0 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp type 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp:f0->101. model.google_ads_source.stg_google_ads__ad_group_criterion_history:f0
101. model.google_ads_source.stg_google_ads__ad_group_criterion_history
  • Input Column: 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp[type]
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • type: Directly mapped
95. model.google_ads.google_ads__keyword_report
  • Input Column: 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history[type]
    • Direct directly copied to the output
    • Output Columns:
      • type: directly copied
Column Lineage
%3 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history status 95. model.google_ads.google_ads__keyword_report 95. model.google_ads.google_ads__keyword_report status 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history:f0->95. model.google_ads.google_ads__keyword_report:f0 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp status 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp:f0->101. model.google_ads_source.stg_google_ads__ad_group_criterion_history:f0
101. model.google_ads_source.stg_google_ads__ad_group_criterion_history
  • Input Column: 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp[status]
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • status: Directly mapped
95. model.google_ads.google_ads__keyword_report
  • Input Column: 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history[status]
    • Direct directly copied to the output
    • Output Columns:
      • status: directly copied
Column Lineage
%3 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history keyword_match_type 95. model.google_ads.google_ads__keyword_report 95. model.google_ads.google_ads__keyword_report keyword_match_type 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history:f0->95. model.google_ads.google_ads__keyword_report:f0 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp keyword_match_type 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp:f0->101. model.google_ads_source.stg_google_ads__ad_group_criterion_history:f0
101. model.google_ads_source.stg_google_ads__ad_group_criterion_history
  • Input Column: 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp[keyword_match_type]
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • keyword_match_type: Directly mapped
95. model.google_ads.google_ads__keyword_report
  • Input Column: 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history[keyword_match_type]
    • Direct directly copied to the output
    • Output Columns:
      • keyword_match_type: directly copied
Column Lineage
%3 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history keyword_text 95. model.google_ads.google_ads__keyword_report 95. model.google_ads.google_ads__keyword_report keyword_text 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history:f0->95. model.google_ads.google_ads__keyword_report:f0 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp keyword_text 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp:f0->101. model.google_ads_source.stg_google_ads__ad_group_criterion_history:f0
101. model.google_ads_source.stg_google_ads__ad_group_criterion_history
  • Input Column: 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp[keyword_text]
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • keyword_text: Directly mapped
95. model.google_ads.google_ads__keyword_report
  • Input Column: 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history[keyword_text]
    • Direct directly copied to the output
    • Output Columns:
      • keyword_text: directly copied
Column Lineage
%3 115. model.google_ads_source.stg_google_ads__keyword_stats 115. model.google_ads_source.stg_google_ads__keyword_stats spend 95. model.google_ads.google_ads__keyword_report 95. model.google_ads.google_ads__keyword_report spend 115. model.google_ads_source.stg_google_ads__keyword_stats:f0->95. model.google_ads.google_ads__keyword_report:f0 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp cost_micros 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp:f0->115. model.google_ads_source.stg_google_ads__keyword_stats:f0
115. model.google_ads_source.stg_google_ads__keyword_stats
  • Input Column: 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp[cost_micros]
    • Direct The column is used in calculation
    • Cleaning The column is cast to INT type, NULL values are replaced with 0, and divided by 1,000,000
    • Output Columns:
      • spend: Mapped after cleaning and calculation
95. model.google_ads.google_ads__keyword_report
  • Input Column: 115. model.google_ads_source.stg_google_ads__keyword_stats[spend]
    • Aggregation The column is summed up in the SELECT clause
    • Output Columns:
      • spend: Aggregated sum in the output
Column Lineage
%3 115. model.google_ads_source.stg_google_ads__keyword_stats 115. model.google_ads_source.stg_google_ads__keyword_stats clicks 95. model.google_ads.google_ads__keyword_report 95. model.google_ads.google_ads__keyword_report clicks 115. model.google_ads_source.stg_google_ads__keyword_stats:f0->95. model.google_ads.google_ads__keyword_report:f0 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp clicks 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp:f0->115. model.google_ads_source.stg_google_ads__keyword_stats:f0
115. model.google_ads_source.stg_google_ads__keyword_stats
  • Input Column: 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp[clicks]
    • Direct The column is directly copied
    • Cleaning The column is cast to INT type and NULL values are replaced with 0
    • Output Columns:
      • clicks: Mapped after cleaning
95. model.google_ads.google_ads__keyword_report
  • Input Column: 115. model.google_ads_source.stg_google_ads__keyword_stats[clicks]
    • Aggregation The column is summed up in the SELECT clause
    • Output Columns:
      • clicks: Aggregated sum in the output
Column Lineage
%3 115. model.google_ads_source.stg_google_ads__keyword_stats 115. model.google_ads_source.stg_google_ads__keyword_stats impressions 95. model.google_ads.google_ads__keyword_report 95. model.google_ads.google_ads__keyword_report impressions 115. model.google_ads_source.stg_google_ads__keyword_stats:f0->95. model.google_ads.google_ads__keyword_report:f0 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp impressions 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp:f0->115. model.google_ads_source.stg_google_ads__keyword_stats:f0
115. model.google_ads_source.stg_google_ads__keyword_stats
  • Input Column: 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp[impressions]
    • Cleaning The column is cast to INT and then COALESCE is applied to replace NULL values with 0.
    • Direct After cleaning, the column is directly copied to the output.
    • Output Columns:
      • impressions: Directly mapped after cleaning.
95. model.google_ads.google_ads__keyword_report
  • Input Column: 115. model.google_ads_source.stg_google_ads__keyword_stats[impressions]
    • Aggregation The column is summed up in the SELECT clause
    • Output Columns:
      • impressions: Aggregated sum in the output
Column Lineage
%3 115. model.google_ads_source.stg_google_ads__keyword_stats 115. model.google_ads_source.stg_google_ads__keyword_stats conversions 95. model.google_ads.google_ads__keyword_report 95. model.google_ads.google_ads__keyword_report conversions 115. model.google_ads_source.stg_google_ads__keyword_stats:f0->95. model.google_ads.google_ads__keyword_report:f0 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp conversions 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp:f0->115. model.google_ads_source.stg_google_ads__keyword_stats:f0
115. model.google_ads_source.stg_google_ads__keyword_stats
  • Input Column: 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp[conversions]
    • Direct The column is directly copied
    • Cleaning The column is cast to INT type and NULL values are replaced with 0
    • Output Columns:
      • conversions: Mapped after cleaning
95. model.google_ads.google_ads__keyword_report
  • Input Column: 115. model.google_ads_source.stg_google_ads__keyword_stats[conversions]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • conversions: It is directly mapped to the output 'conversions' column after aggregation
Column Lineage
%3 115. model.google_ads_source.stg_google_ads__keyword_stats 115. model.google_ads_source.stg_google_ads__keyword_stats conversions_value 95. model.google_ads.google_ads__keyword_report 95. model.google_ads.google_ads__keyword_report conversions_value 115. model.google_ads_source.stg_google_ads__keyword_stats:f0->95. model.google_ads.google_ads__keyword_report:f0 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp conversions_value 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp:f0->115. model.google_ads_source.stg_google_ads__keyword_stats:f0
115. model.google_ads_source.stg_google_ads__keyword_stats
  • Input Column: 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp[conversions_value]
    • Direct The column is directly copied
    • Cleaning The column is cast to INT type and NULL values are replaced with 0
    • Output Columns:
      • conversions_value: Mapped after cleaning
95. model.google_ads.google_ads__keyword_report
  • Input Column: 115. model.google_ads_source.stg_google_ads__keyword_stats[conversions_value]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • conversions_value: It is directly mapped to the output 'conversions_value' column after aggregation
Column Lineage
%3 115. model.google_ads_source.stg_google_ads__keyword_stats 115. model.google_ads_source.stg_google_ads__keyword_stats view_through_conversions 95. model.google_ads.google_ads__keyword_report 95. model.google_ads.google_ads__keyword_report view_through_conversions 115. model.google_ads_source.stg_google_ads__keyword_stats:f0->95. model.google_ads.google_ads__keyword_report:f0 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp view_through_conversions 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp:f0->115. model.google_ads_source.stg_google_ads__keyword_stats:f0
115. model.google_ads_source.stg_google_ads__keyword_stats
  • Input Column: 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp[view_through_conversions]
    • Cleaning The column is cast to INT and then COALESCE is applied to replace NULL values with 0.
    • Direct After cleaning, the column is directly copied to the output.
    • Output Columns:
      • view_through_conversions: Directly mapped after cleaning.
95. model.google_ads.google_ads__keyword_report
  • Input Column: 115. model.google_ads_source.stg_google_ads__keyword_stats[view_through_conversions]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • view_through_conversions: It is directly mapped to the output 'view_through_conversions' column after aggregation
96. model.google_ads.google_ads__url_report

This SQL query integrates data from multiple Google Ads-related tables (ad stats, accounts, campaigns, ad groups, and ads) to create a comprehensive URL report. It filters for the most recent records in history tables, joins these tables together, and aggregates various metrics (spend, clicks, impressions, conversions) grouped by different dimensions such as account, campaign, ad group, and URL components. The query also includes UTM parameters for tracking purposes.

FilteringIntegrationAggregation
SQL Query
WITH stats AS (
  SELECT
    *
  FROM TEST.PUBLIC_google_ads_source.stg_google_ads__ad_stats
), accounts AS (
  SELECT
    *
  FROM TEST.PUBLIC_google_ads_source.stg_google_ads__account_history
  WHERE
    is_most_recent_record = TRUE
), campaigns AS (
  SELECT
    *
  FROM TEST.PUBLIC_google_ads_source.stg_google_ads__campaign_history
  WHERE
    is_most_recent_record = TRUE
), ad_groups AS (
  SELECT
    *
  FROM TEST.PUBLIC_google_ads_source.stg_google_ads__ad_group_history
  WHERE
    is_most_recent_record = TRUE
), ads AS (
  SELECT
    *
  FROM TEST.PUBLIC_google_ads_source.stg_google_ads__ad_history
  WHERE
    is_most_recent_record = TRUE
), fields AS (
  SELECT
    stats.source_relation,
    stats.date_day,
    accounts.account_name,
    accounts.account_id,
    accounts.currency_code,
    campaigns.campaign_name,
    campaigns.campaign_id,
    ad_groups.ad_group_name,
    stats.ad_group_id,
    stats.ad_id,
    ads.base_url,
    ads.url_host,
    ads.url_path,
    ads.utm_source,
    ads.utm_medium,
    ads.utm_campaign,
    ads.utm_content,
    ads.utm_term,
    SUM(stats.spend) AS spend,
    SUM(stats.clicks) AS clicks,
    SUM(stats.impressions) AS impressions,
    SUM(conversions) AS conversions,
    SUM(conversions_value) AS conversions_value,
    SUM(view_through_conversions) AS view_through_conversions
  FROM stats
  LEFT JOIN ads
    ON stats.ad_id = ads.ad_id
    AND stats.source_relation = ads.source_relation
    AND stats.ad_group_id = ads.ad_group_id
  LEFT JOIN ad_groups
    ON ads.ad_group_id = ad_groups.ad_group_id
    AND ads.source_relation = ad_groups.source_relation
  LEFT JOIN campaigns
    ON ad_groups.campaign_id = campaigns.campaign_id
    AND ad_groups.source_relation = campaigns.source_relation
  LEFT JOIN accounts
    ON campaigns.account_id = accounts.account_id
    AND campaigns.source_relation = accounts.source_relation
  WHERE
    NOT ads.source_final_urls IS NULL
  GROUP BY
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10,
    11,
    12,
    13,
    14,
    15,
    16,
    17,
    18
)
SELECT
  *
FROM fields
%3 96. model.google_ads.google_ads__url_report 96. model.google_ads.google_ads__url_report source_relation date_day account_name account_id currency_code campaign_name campaign_id ad_group_name ad_group_id ad_id base_url url_host url_path utm_source utm_medium utm_campaign utm_content utm_term spend clicks impressions conversions conversions_value view_through_conversions 97. model.google_ads_source.stg_google_ads__account_history 97. model.google_ads_source.stg_google_ads__account_history source_relation account_id currency_code account_name 97. model.google_ads_source.stg_google_ads__account_history:f0->96. model.google_ads.google_ads__url_report:f0 97. model.google_ads_source.stg_google_ads__account_history:f1->96. model.google_ads.google_ads__url_report:f3 97. model.google_ads_source.stg_google_ads__account_history:f2->96. model.google_ads.google_ads__url_report:f4 97. model.google_ads_source.stg_google_ads__account_history:f3->96. model.google_ads.google_ads__url_report:f2 103. model.google_ads_source.stg_google_ads__ad_group_history 103. model.google_ads_source.stg_google_ads__ad_group_history source_relation ad_group_id ad_group_name 103. model.google_ads_source.stg_google_ads__ad_group_history:f0->96. model.google_ads.google_ads__url_report:f0 103. model.google_ads_source.stg_google_ads__ad_group_history:f1->96. model.google_ads.google_ads__url_report:f8 103. model.google_ads_source.stg_google_ads__ad_group_history:f2->96. model.google_ads.google_ads__url_report:f7 107. model.google_ads_source.stg_google_ads__ad_history 107. model.google_ads_source.stg_google_ads__ad_history source_relation ad_group_id ad_id final_url base_url url_host url_path utm_source utm_medium utm_campaign utm_content utm_term 107. model.google_ads_source.stg_google_ads__ad_history:f0->96. model.google_ads.google_ads__url_report:f0 107. model.google_ads_source.stg_google_ads__ad_history:f1->96. model.google_ads.google_ads__url_report:f8 107. model.google_ads_source.stg_google_ads__ad_history:f2->96. model.google_ads.google_ads__url_report:f9 107. model.google_ads_source.stg_google_ads__ad_history:f3->96. model.google_ads.google_ads__url_report:f10 107. model.google_ads_source.stg_google_ads__ad_history:f3->96. model.google_ads.google_ads__url_report:f11 107. model.google_ads_source.stg_google_ads__ad_history:f3->96. model.google_ads.google_ads__url_report:f12 107. model.google_ads_source.stg_google_ads__ad_history:f3->96. model.google_ads.google_ads__url_report:f13 107. model.google_ads_source.stg_google_ads__ad_history:f3->96. model.google_ads.google_ads__url_report:f14 107. model.google_ads_source.stg_google_ads__ad_history:f3->96. model.google_ads.google_ads__url_report:f15 107. model.google_ads_source.stg_google_ads__ad_history:f3->96. model.google_ads.google_ads__url_report:f16 107. model.google_ads_source.stg_google_ads__ad_history:f3->96. model.google_ads.google_ads__url_report:f17 107. model.google_ads_source.stg_google_ads__ad_history:f4->96. model.google_ads.google_ads__url_report:f10 107. model.google_ads_source.stg_google_ads__ad_history:f5->96. model.google_ads.google_ads__url_report:f11 107. model.google_ads_source.stg_google_ads__ad_history:f6->96. model.google_ads.google_ads__url_report:f12 107. model.google_ads_source.stg_google_ads__ad_history:f7->96. model.google_ads.google_ads__url_report:f13 107. model.google_ads_source.stg_google_ads__ad_history:f8->96. model.google_ads.google_ads__url_report:f14 107. model.google_ads_source.stg_google_ads__ad_history:f9->96. model.google_ads.google_ads__url_report:f15 107. model.google_ads_source.stg_google_ads__ad_history:f10->96. model.google_ads.google_ads__url_report:f16 107. model.google_ads_source.stg_google_ads__ad_history:f11->96. model.google_ads.google_ads__url_report:f17 109. model.google_ads_source.stg_google_ads__ad_stats 109. model.google_ads_source.stg_google_ads__ad_stats source_relation date_day ad_group_id ad_id clicks spend impressions conversions conversions_value view_through_conversions 109. model.google_ads_source.stg_google_ads__ad_stats:f0->96. model.google_ads.google_ads__url_report:f0 109. model.google_ads_source.stg_google_ads__ad_stats:f1->96. model.google_ads.google_ads__url_report:f1 109. model.google_ads_source.stg_google_ads__ad_stats:f2->96. model.google_ads.google_ads__url_report:f8 109. model.google_ads_source.stg_google_ads__ad_stats:f3->96. model.google_ads.google_ads__url_report:f9 109. model.google_ads_source.stg_google_ads__ad_stats:f4->96. model.google_ads.google_ads__url_report:f19 109. model.google_ads_source.stg_google_ads__ad_stats:f5->96. model.google_ads.google_ads__url_report:f18 109. model.google_ads_source.stg_google_ads__ad_stats:f6->96. model.google_ads.google_ads__url_report:f20 109. model.google_ads_source.stg_google_ads__ad_stats:f7->96. model.google_ads.google_ads__url_report:f21 109. model.google_ads_source.stg_google_ads__ad_stats:f8->96. model.google_ads.google_ads__url_report:f22 109. model.google_ads_source.stg_google_ads__ad_stats:f9->96. model.google_ads.google_ads__url_report:f23 111. model.google_ads_source.stg_google_ads__campaign_history 111. model.google_ads_source.stg_google_ads__campaign_history source_relation campaign_id campaign_name 111. model.google_ads_source.stg_google_ads__campaign_history:f0->96. model.google_ads.google_ads__url_report:f0 111. model.google_ads_source.stg_google_ads__campaign_history:f1->96. model.google_ads.google_ads__url_report:f6 111. model.google_ads_source.stg_google_ads__campaign_history:f2->96. model.google_ads.google_ads__url_report:f5
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
date_day date The date being reported on.
account_name integer The descriptive name of the Customer account.
account_id integer The Customer ID.
currency_code text The currency which the account uses.
campaign_name text The name of the campaign, if present in the source data.
campaign_id bigint The ID representing the campaign, if present in the source data.
ad_group_name text The name of the ad group, if present in the source data.
ad_group_id text The ID representing the ad group, if present in the source data.
ad_id bigint The unique identifier of the ad.
base_url text The base url of the ad.
url_host text The URL host of the ad.
url_path text The URL path of the ad.
utm_source text The utm_source parameter of the ad.
utm_medium text The utm_medium parameter of the ad.
utm_campaign text The utm_campaign parameter of the ad.
utm_content text The utm_content parameter of the ad.
utm_term text The utm_term parameter of the ad.
spend numeric Total cost of ad clicks.
clicks bigint The count of clicks.
impressions bigint The count of impressions.
conversions bigint The number of conversions you've received, across your conversion actions. Conversions are measured with conversion tracking and may include [modeled](https://support.google.com/google-ads/answer/10081327?sjid=12862894247631803415-NC) conversions in cases where you are not able to observe all conversions that took place. You can use this column to see how often your ads led customers to actions that you’ve defined as valuable for your business.
conversions_value bigint The sum of monetary values for your `conversions`. You have to enter a value in the Google Ads UI for your conversion actions to make this metric useful.
view_through_conversions bigint For video campaigns, view-through conversions tell you when an _impression_ of your video ad leads to a conversion on your site. The last impression of a video ad will get credit for the view-through conversion. Keep in mind: An impression is different than a “view” of a video ad. A “view” is counted when someone watches 30 seconds (or the whole ad if it’s shorter than 30 seconds) or clicks on a part of the ad. A “view” that leads to a conversion is counted in the `conversions` column.
Column Lineage
%3 97. model.google_ads_source.stg_google_ads__account_history 97. model.google_ads_source.stg_google_ads__account_history source_relation 96. model.google_ads.google_ads__url_report 96. model.google_ads.google_ads__url_report source_relation 97. model.google_ads_source.stg_google_ads__account_history:f0->96. model.google_ads.google_ads__url_report:f0 103. model.google_ads_source.stg_google_ads__ad_group_history 103. model.google_ads_source.stg_google_ads__ad_group_history source_relation 103. model.google_ads_source.stg_google_ads__ad_group_history:f0->96. model.google_ads.google_ads__url_report:f0 107. model.google_ads_source.stg_google_ads__ad_history 107. model.google_ads_source.stg_google_ads__ad_history source_relation 107. model.google_ads_source.stg_google_ads__ad_history:f0->96. model.google_ads.google_ads__url_report:f0 109. model.google_ads_source.stg_google_ads__ad_stats 109. model.google_ads_source.stg_google_ads__ad_stats source_relation 109. model.google_ads_source.stg_google_ads__ad_stats:f0->96. model.google_ads.google_ads__url_report:f0 111. model.google_ads_source.stg_google_ads__campaign_history 111. model.google_ads_source.stg_google_ads__campaign_history source_relation 111. model.google_ads_source.stg_google_ads__campaign_history:f0->96. model.google_ads.google_ads__url_report:f0
96. model.google_ads.google_ads__url_report
  • Input Column: 97. model.google_ads_source.stg_google_ads__account_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 103. model.google_ads_source.stg_google_ads__ad_group_history[source_relation]
    • Integration used as a key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 107. model.google_ads_source.stg_google_ads__ad_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 109. model.google_ads_source.stg_google_ads__ad_stats[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with other tables
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
  • Input Column: 111. model.google_ads_source.stg_google_ads__campaign_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
Column Lineage
%3 109. model.google_ads_source.stg_google_ads__ad_stats 109. model.google_ads_source.stg_google_ads__ad_stats date_day 96. model.google_ads.google_ads__url_report 96. model.google_ads.google_ads__url_report date_day 109. model.google_ads_source.stg_google_ads__ad_stats:f0->96. model.google_ads.google_ads__url_report:f0 110. model.google_ads_source.stg_google_ads__ad_stats_tmp 110. model.google_ads_source.stg_google_ads__ad_stats_tmp date 110. model.google_ads_source.stg_google_ads__ad_stats_tmp:f0->109. model.google_ads_source.stg_google_ads__ad_stats:f0
109. model.google_ads_source.stg_google_ads__ad_stats
  • Input Column: 110. model.google_ads_source.stg_google_ads__ad_stats_tmp[date]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as DATE in the fields CTE
    • Output Columns:
      • date_day: Directly mapped and renamed
96. model.google_ads.google_ads__url_report
  • Input Column: 109. model.google_ads_source.stg_google_ads__ad_stats[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 97. model.google_ads_source.stg_google_ads__account_history 97. model.google_ads_source.stg_google_ads__account_history account_name 96. model.google_ads.google_ads__url_report 96. model.google_ads.google_ads__url_report account_name 97. model.google_ads_source.stg_google_ads__account_history:f0->96. model.google_ads.google_ads__url_report:f0 98. model.google_ads_source.stg_google_ads__account_history_tmp 98. model.google_ads_source.stg_google_ads__account_history_tmp descriptive_name 98. model.google_ads_source.stg_google_ads__account_history_tmp:f0->97. model.google_ads_source.stg_google_ads__account_history:f0
97. model.google_ads_source.stg_google_ads__account_history
  • Input Column: 98. model.google_ads_source.stg_google_ads__account_history_tmp[descriptive_name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • account_name: Directly mapped
96. model.google_ads.google_ads__url_report
  • Input Column: 97. model.google_ads_source.stg_google_ads__account_history[account_name]
    • Direct directly copied to the output
    • Output Columns:
      • account_name: directly copied
Column Lineage
%3 97. model.google_ads_source.stg_google_ads__account_history 97. model.google_ads_source.stg_google_ads__account_history account_id 96. model.google_ads.google_ads__url_report 96. model.google_ads.google_ads__url_report account_id 97. model.google_ads_source.stg_google_ads__account_history:f0->96. model.google_ads.google_ads__url_report:f0 98. model.google_ads_source.stg_google_ads__account_history_tmp 98. model.google_ads_source.stg_google_ads__account_history_tmp id 98. model.google_ads_source.stg_google_ads__account_history_tmp:f0->97. model.google_ads_source.stg_google_ads__account_history:f0
97. model.google_ads_source.stg_google_ads__account_history
  • Input Column: 98. model.google_ads_source.stg_google_ads__account_history_tmp[id]
    • Direct The column is directly copied without transformation
    • Deduplication Used in ROW_NUMBER() function to determine the most recent record
    • Output Columns:
      • account_id: Directly mapped
96. model.google_ads.google_ads__url_report
  • Input Column: 97. model.google_ads_source.stg_google_ads__account_history[account_id]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • account_id: directly copied
Column Lineage
%3 97. model.google_ads_source.stg_google_ads__account_history 97. model.google_ads_source.stg_google_ads__account_history currency_code 96. model.google_ads.google_ads__url_report 96. model.google_ads.google_ads__url_report currency_code 97. model.google_ads_source.stg_google_ads__account_history:f0->96. model.google_ads.google_ads__url_report:f0 98. model.google_ads_source.stg_google_ads__account_history_tmp 98. model.google_ads_source.stg_google_ads__account_history_tmp currency_code 98. model.google_ads_source.stg_google_ads__account_history_tmp:f0->97. model.google_ads_source.stg_google_ads__account_history:f0
97. model.google_ads_source.stg_google_ads__account_history
  • Input Column: 98. model.google_ads_source.stg_google_ads__account_history_tmp[currency_code]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • currency_code: Directly mapped
96. model.google_ads.google_ads__url_report
  • Input Column: 97. model.google_ads_source.stg_google_ads__account_history[currency_code]
    • Direct directly copied to the output
    • Output Columns:
      • currency_code: directly copied
Column Lineage
%3 111. model.google_ads_source.stg_google_ads__campaign_history 111. model.google_ads_source.stg_google_ads__campaign_history campaign_name 96. model.google_ads.google_ads__url_report 96. model.google_ads.google_ads__url_report campaign_name 111. model.google_ads_source.stg_google_ads__campaign_history:f0->96. model.google_ads.google_ads__url_report:f0 112. model.google_ads_source.stg_google_ads__campaign_history_tmp 112. model.google_ads_source.stg_google_ads__campaign_history_tmp name 112. model.google_ads_source.stg_google_ads__campaign_history_tmp:f0->111. model.google_ads_source.stg_google_ads__campaign_history:f0
111. model.google_ads_source.stg_google_ads__campaign_history
  • Input Column: 112. model.google_ads_source.stg_google_ads__campaign_history_tmp[name]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • campaign_name: Directly mapped to this output column
96. model.google_ads.google_ads__url_report
  • Input Column: 111. model.google_ads_source.stg_google_ads__campaign_history[campaign_name]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition between campaigns and ad_groups tables
    • Output Columns:
      • campaign_name: Directly copied to the output
Column Lineage
%3 111. model.google_ads_source.stg_google_ads__campaign_history 111. model.google_ads_source.stg_google_ads__campaign_history campaign_id 96. model.google_ads.google_ads__url_report 96. model.google_ads.google_ads__url_report campaign_id 111. model.google_ads_source.stg_google_ads__campaign_history:f0->96. model.google_ads.google_ads__url_report:f0 112. model.google_ads_source.stg_google_ads__campaign_history_tmp 112. model.google_ads_source.stg_google_ads__campaign_history_tmp id 112. model.google_ads_source.stg_google_ads__campaign_history_tmp:f0->111. model.google_ads_source.stg_google_ads__campaign_history:f0
111. model.google_ads_source.stg_google_ads__campaign_history
  • Input Column: 112. model.google_ads_source.stg_google_ads__campaign_history_tmp[id]
    • Direct The column is directly copied without any transformation
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • campaign_id: Directly mapped to this output column
96. model.google_ads.google_ads__url_report
  • Input Column: 111. model.google_ads_source.stg_google_ads__campaign_history[campaign_id]
    • Integration used as the key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
Column Lineage
%3 103. model.google_ads_source.stg_google_ads__ad_group_history 103. model.google_ads_source.stg_google_ads__ad_group_history ad_group_name 96. model.google_ads.google_ads__url_report 96. model.google_ads.google_ads__url_report ad_group_name 103. model.google_ads_source.stg_google_ads__ad_group_history:f0->96. model.google_ads.google_ads__url_report:f0 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp name 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp:f0->103. model.google_ads_source.stg_google_ads__ad_group_history:f0
103. model.google_ads_source.stg_google_ads__ad_group_history
  • Input Column: 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp[name]
    • Direct Copied without transformation
    • Output Columns:
      • ad_group_name: Directly mapped and renamed
96. model.google_ads.google_ads__url_report
  • Input Column: 103. model.google_ads_source.stg_google_ads__ad_group_history[ad_group_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_name: directly copied
Column Lineage
%3 103. model.google_ads_source.stg_google_ads__ad_group_history 103. model.google_ads_source.stg_google_ads__ad_group_history ad_group_id 96. model.google_ads.google_ads__url_report 96. model.google_ads.google_ads__url_report ad_group_id 103. model.google_ads_source.stg_google_ads__ad_group_history:f0->96. model.google_ads.google_ads__url_report:f0 107. model.google_ads_source.stg_google_ads__ad_history 107. model.google_ads_source.stg_google_ads__ad_history ad_group_id 107. model.google_ads_source.stg_google_ads__ad_history:f0->96. model.google_ads.google_ads__url_report:f0 109. model.google_ads_source.stg_google_ads__ad_stats 109. model.google_ads_source.stg_google_ads__ad_stats ad_group_id 109. model.google_ads_source.stg_google_ads__ad_stats:f0->96. model.google_ads.google_ads__url_report:f0 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp id 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp:f0->103. model.google_ads_source.stg_google_ads__ad_group_history:f0 108. model.google_ads_source.stg_google_ads__ad_history_tmp 108. model.google_ads_source.stg_google_ads__ad_history_tmp ad_group_id 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f0 110. model.google_ads_source.stg_google_ads__ad_stats_tmp 110. model.google_ads_source.stg_google_ads__ad_stats_tmp ad_group ad_group_id 110. model.google_ads_source.stg_google_ads__ad_stats_tmp:f1->109. model.google_ads_source.stg_google_ads__ad_stats:f0 110. model.google_ads_source.stg_google_ads__ad_stats_tmp:f0->109. model.google_ads_source.stg_google_ads__ad_stats:f0
103. model.google_ads_source.stg_google_ads__ad_group_history
  • Input Column: 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp[id]
    • Cleaning The column is cast to TEXT type
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • ad_group_id: Directly mapped after casting to TEXT
107. model.google_ads_source.stg_google_ads__ad_history
  • Input Column: 108. model.google_ads_source.stg_google_ads__ad_history_tmp[ad_group_id]
    • Cleaning Cast to TEXT type
    • Deduplication Used in ROW_NUMBER() OVER (PARTITION BY ...) for deduplication
    • Output Columns:
      • ad_group_id: Directly mapped after casting to TEXT
109. model.google_ads_source.stg_google_ads__ad_stats
  • Input Column: 110. model.google_ads_source.stg_google_ads__ad_stats_tmp[ad_group_id]
    • Cleaning The column is cast as TEXT in the fields CTE
    • Other Used in a COALESCE function with ad_group
    • Output Columns:
      • ad_group_id: Mapped through COALESCE with ad_group
  • Input Column: 110. model.google_ads_source.stg_google_ads__ad_stats_tmp[ad_group]
    • Cleaning The column is cast as TEXT in the fields CTE
    • Featurization The ad_group_id is extracted from this column using SPLIT_PART
    • Output Columns:
      • ad_group_id: Used as fallback in COALESCE if ad_group_id is null
96. model.google_ads.google_ads__url_report
  • Input Column: 103. model.google_ads_source.stg_google_ads__ad_group_history[ad_group_id]
    • Integration used as a key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_id: directly copied
  • Input Column: 107. model.google_ads_source.stg_google_ads__ad_history[ad_group_id]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_id: directly copied
  • Input Column: 109. model.google_ads_source.stg_google_ads__ad_stats[ad_group_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with other tables
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • ad_group_id: Directly copied to the output
Column Lineage
%3 107. model.google_ads_source.stg_google_ads__ad_history 107. model.google_ads_source.stg_google_ads__ad_history ad_id 96. model.google_ads.google_ads__url_report 96. model.google_ads.google_ads__url_report ad_id 107. model.google_ads_source.stg_google_ads__ad_history:f0->96. model.google_ads.google_ads__url_report:f0 109. model.google_ads_source.stg_google_ads__ad_stats 109. model.google_ads_source.stg_google_ads__ad_stats ad_id 109. model.google_ads_source.stg_google_ads__ad_stats:f0->96. model.google_ads.google_ads__url_report:f0 108. model.google_ads_source.stg_google_ads__ad_history_tmp 108. model.google_ads_source.stg_google_ads__ad_history_tmp id 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f0 110. model.google_ads_source.stg_google_ads__ad_stats_tmp 110. model.google_ads_source.stg_google_ads__ad_stats_tmp ad_id 110. model.google_ads_source.stg_google_ads__ad_stats_tmp:f0->109. model.google_ads_source.stg_google_ads__ad_stats:f0
107. model.google_ads_source.stg_google_ads__ad_history
  • Input Column: 108. model.google_ads_source.stg_google_ads__ad_history_tmp[id]
    • Cleaning Used as is (implicitly cast to INT)
    • Deduplication Used in ROW_NUMBER() OVER (PARTITION BY ...) for deduplication
    • Output Columns:
      • ad_id: Directly mapped
109. model.google_ads_source.stg_google_ads__ad_stats
  • Input Column: 110. model.google_ads_source.stg_google_ads__ad_stats_tmp[ad_id]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as INT in the fields CTE
    • Output Columns:
      • ad_id: Directly mapped
96. model.google_ads.google_ads__url_report
  • Input Column: 107. model.google_ads_source.stg_google_ads__ad_history[ad_id]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • ad_id: directly copied
  • Input Column: 109. model.google_ads_source.stg_google_ads__ad_stats[ad_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with the ads table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • ad_id: Directly copied to the output
Column Lineage
%3 107. model.google_ads_source.stg_google_ads__ad_history 107. model.google_ads_source.stg_google_ads__ad_history base_url final_url final_urls source_final_urls url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 96. model.google_ads.google_ads__url_report 96. model.google_ads.google_ads__url_report base_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 107. model.google_ads_source.stg_google_ads__ad_history:f1->96. model.google_ads.google_ads__url_report:f0 107. model.google_ads_source.stg_google_ads__ad_history:f1->96. model.google_ads.google_ads__url_report:f1 107. model.google_ads_source.stg_google_ads__ad_history:f1->96. model.google_ads.google_ads__url_report:f2 107. model.google_ads_source.stg_google_ads__ad_history:f1->96. model.google_ads.google_ads__url_report:f6 107. model.google_ads_source.stg_google_ads__ad_history:f1->96. model.google_ads.google_ads__url_report:f5 107. model.google_ads_source.stg_google_ads__ad_history:f1->96. model.google_ads.google_ads__url_report:f3 107. model.google_ads_source.stg_google_ads__ad_history:f1->96. model.google_ads.google_ads__url_report:f4 107. model.google_ads_source.stg_google_ads__ad_history:f1->96. model.google_ads.google_ads__url_report:f7 107. model.google_ads_source.stg_google_ads__ad_history:f0->96. model.google_ads.google_ads__url_report:f0 108. model.google_ads_source.stg_google_ads__ad_history_tmp 108. model.google_ads_source.stg_google_ads__ad_history_tmp final_urls 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f3 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f2 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f1 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f0 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f4 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f5 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f9 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f8 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f6 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f7 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f10 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f3 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f2 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f1 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f0 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f4 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f5 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f9 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f8 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f6 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f7 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f10
107. model.google_ads_source.stg_google_ads__ad_history
  • Input Column: 108. model.google_ads_source.stg_google_ads__ad_history_tmp[final_urls]
    • Cleaning Brackets removed, cast to TEXT
    • Featurization Used to extract various URL components and UTM parameters
    • Output Columns:
      • source_final_urls: Directly mapped before cleaning
      • final_urls: Mapped after cleaning (removing brackets)
      • final_url: First URL extracted from the cleaned list
      • base_url: Extracted from final_url
      • url_host: Extracted from final_url
      • url_path: Extracted from final_url
      • utm_source: Extracted from final_url
      • utm_medium: Extracted from final_url
      • utm_campaign: Extracted from final_url
      • utm_content: Extracted from final_url
      • utm_term: Extracted from final_url
  • Input Column: 108. model.google_ads_source.stg_google_ads__ad_history_tmp[final_urls]
    • Cleaning Brackets removed, cast to TEXT
    • Featurization Used to extract various URL components and UTM parameters
    • Output Columns:
      • source_final_urls: Directly mapped before cleaning
      • final_urls: Mapped after cleaning (removing brackets)
      • final_url: First URL extracted from the cleaned list
      • base_url: Extracted from final_url
      • url_host: Extracted from final_url
      • url_path: Extracted from final_url
      • utm_source: Extracted from final_url
      • utm_medium: Extracted from final_url
      • utm_campaign: Extracted from final_url
      • utm_content: Extracted from final_url
      • utm_term: Extracted from final_url
96. model.google_ads.google_ads__url_report
  • Input Column: 107. model.google_ads_source.stg_google_ads__ad_history[final_url]
    • Featurization used to extract various URL components
    • Output Columns:
      • base_url: extracted from this column
      • url_host: extracted from this column
      • url_path: extracted from this column
      • utm_source: extracted from this column
      • utm_medium: extracted from this column
      • utm_campaign: extracted from this column
      • utm_content: extracted from this column
      • utm_term: extracted from this column
  • Input Column: 107. model.google_ads_source.stg_google_ads__ad_history[base_url]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • base_url: Directly copied to the output
Column Lineage
%3 107. model.google_ads_source.stg_google_ads__ad_history 107. model.google_ads_source.stg_google_ads__ad_history base_url final_url final_urls source_final_urls url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 96. model.google_ads.google_ads__url_report 96. model.google_ads.google_ads__url_report base_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 107. model.google_ads_source.stg_google_ads__ad_history:f1->96. model.google_ads.google_ads__url_report:f0 107. model.google_ads_source.stg_google_ads__ad_history:f1->96. model.google_ads.google_ads__url_report:f1 107. model.google_ads_source.stg_google_ads__ad_history:f1->96. model.google_ads.google_ads__url_report:f2 107. model.google_ads_source.stg_google_ads__ad_history:f1->96. model.google_ads.google_ads__url_report:f6 107. model.google_ads_source.stg_google_ads__ad_history:f1->96. model.google_ads.google_ads__url_report:f5 107. model.google_ads_source.stg_google_ads__ad_history:f1->96. model.google_ads.google_ads__url_report:f3 107. model.google_ads_source.stg_google_ads__ad_history:f1->96. model.google_ads.google_ads__url_report:f4 107. model.google_ads_source.stg_google_ads__ad_history:f1->96. model.google_ads.google_ads__url_report:f7 107. model.google_ads_source.stg_google_ads__ad_history:f4->96. model.google_ads.google_ads__url_report:f1 108. model.google_ads_source.stg_google_ads__ad_history_tmp 108. model.google_ads_source.stg_google_ads__ad_history_tmp final_urls 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f3 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f2 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f1 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f0 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f4 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f5 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f9 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f8 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f6 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f7 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f10 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f3 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f2 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f1 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f0 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f4 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f5 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f9 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f8 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f6 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f7 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f10
107. model.google_ads_source.stg_google_ads__ad_history
  • Input Column: 108. model.google_ads_source.stg_google_ads__ad_history_tmp[final_urls]
    • Cleaning Brackets removed, cast to TEXT
    • Featurization Used to extract various URL components and UTM parameters
    • Output Columns:
      • source_final_urls: Directly mapped before cleaning
      • final_urls: Mapped after cleaning (removing brackets)
      • final_url: First URL extracted from the cleaned list
      • base_url: Extracted from final_url
      • url_host: Extracted from final_url
      • url_path: Extracted from final_url
      • utm_source: Extracted from final_url
      • utm_medium: Extracted from final_url
      • utm_campaign: Extracted from final_url
      • utm_content: Extracted from final_url
      • utm_term: Extracted from final_url
  • Input Column: 108. model.google_ads_source.stg_google_ads__ad_history_tmp[final_urls]
    • Cleaning Brackets removed, cast to TEXT
    • Featurization Used to extract various URL components and UTM parameters
    • Output Columns:
      • source_final_urls: Directly mapped before cleaning
      • final_urls: Mapped after cleaning (removing brackets)
      • final_url: First URL extracted from the cleaned list
      • base_url: Extracted from final_url
      • url_host: Extracted from final_url
      • url_path: Extracted from final_url
      • utm_source: Extracted from final_url
      • utm_medium: Extracted from final_url
      • utm_campaign: Extracted from final_url
      • utm_content: Extracted from final_url
      • utm_term: Extracted from final_url
96. model.google_ads.google_ads__url_report
  • Input Column: 107. model.google_ads_source.stg_google_ads__ad_history[final_url]
    • Featurization used to extract various URL components
    • Output Columns:
      • base_url: extracted from this column
      • url_host: extracted from this column
      • url_path: extracted from this column
      • utm_source: extracted from this column
      • utm_medium: extracted from this column
      • utm_campaign: extracted from this column
      • utm_content: extracted from this column
      • utm_term: extracted from this column
  • Input Column: 107. model.google_ads_source.stg_google_ads__ad_history[url_host]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • url_host: Directly copied to the output
Column Lineage
%3 107. model.google_ads_source.stg_google_ads__ad_history 107. model.google_ads_source.stg_google_ads__ad_history base_url final_url final_urls source_final_urls url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 96. model.google_ads.google_ads__url_report 96. model.google_ads.google_ads__url_report base_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 107. model.google_ads_source.stg_google_ads__ad_history:f1->96. model.google_ads.google_ads__url_report:f0 107. model.google_ads_source.stg_google_ads__ad_history:f1->96. model.google_ads.google_ads__url_report:f1 107. model.google_ads_source.stg_google_ads__ad_history:f1->96. model.google_ads.google_ads__url_report:f2 107. model.google_ads_source.stg_google_ads__ad_history:f1->96. model.google_ads.google_ads__url_report:f6 107. model.google_ads_source.stg_google_ads__ad_history:f1->96. model.google_ads.google_ads__url_report:f5 107. model.google_ads_source.stg_google_ads__ad_history:f1->96. model.google_ads.google_ads__url_report:f3 107. model.google_ads_source.stg_google_ads__ad_history:f1->96. model.google_ads.google_ads__url_report:f4 107. model.google_ads_source.stg_google_ads__ad_history:f1->96. model.google_ads.google_ads__url_report:f7 107. model.google_ads_source.stg_google_ads__ad_history:f5->96. model.google_ads.google_ads__url_report:f2 108. model.google_ads_source.stg_google_ads__ad_history_tmp 108. model.google_ads_source.stg_google_ads__ad_history_tmp final_urls 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f3 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f2 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f1 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f0 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f4 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f5 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f9 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f8 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f6 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f7 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f10 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f3 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f2 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f1 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f0 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f4 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f5 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f9 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f8 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f6 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f7 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f10
107. model.google_ads_source.stg_google_ads__ad_history
  • Input Column: 108. model.google_ads_source.stg_google_ads__ad_history_tmp[final_urls]
    • Cleaning Brackets removed, cast to TEXT
    • Featurization Used to extract various URL components and UTM parameters
    • Output Columns:
      • source_final_urls: Directly mapped before cleaning
      • final_urls: Mapped after cleaning (removing brackets)
      • final_url: First URL extracted from the cleaned list
      • base_url: Extracted from final_url
      • url_host: Extracted from final_url
      • url_path: Extracted from final_url
      • utm_source: Extracted from final_url
      • utm_medium: Extracted from final_url
      • utm_campaign: Extracted from final_url
      • utm_content: Extracted from final_url
      • utm_term: Extracted from final_url
  • Input Column: 108. model.google_ads_source.stg_google_ads__ad_history_tmp[final_urls]
    • Cleaning Brackets removed, cast to TEXT
    • Featurization Used to extract various URL components and UTM parameters
    • Output Columns:
      • source_final_urls: Directly mapped before cleaning
      • final_urls: Mapped after cleaning (removing brackets)
      • final_url: First URL extracted from the cleaned list
      • base_url: Extracted from final_url
      • url_host: Extracted from final_url
      • url_path: Extracted from final_url
      • utm_source: Extracted from final_url
      • utm_medium: Extracted from final_url
      • utm_campaign: Extracted from final_url
      • utm_content: Extracted from final_url
      • utm_term: Extracted from final_url
96. model.google_ads.google_ads__url_report
  • Input Column: 107. model.google_ads_source.stg_google_ads__ad_history[final_url]
    • Featurization used to extract various URL components
    • Output Columns:
      • base_url: extracted from this column
      • url_host: extracted from this column
      • url_path: extracted from this column
      • utm_source: extracted from this column
      • utm_medium: extracted from this column
      • utm_campaign: extracted from this column
      • utm_content: extracted from this column
      • utm_term: extracted from this column
  • Input Column: 107. model.google_ads_source.stg_google_ads__ad_history[url_path]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • url_path: Directly copied to the output
Column Lineage
%3 107. model.google_ads_source.stg_google_ads__ad_history 107. model.google_ads_source.stg_google_ads__ad_history base_url final_url final_urls source_final_urls url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 96. model.google_ads.google_ads__url_report 96. model.google_ads.google_ads__url_report base_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 107. model.google_ads_source.stg_google_ads__ad_history:f1->96. model.google_ads.google_ads__url_report:f0 107. model.google_ads_source.stg_google_ads__ad_history:f1->96. model.google_ads.google_ads__url_report:f1 107. model.google_ads_source.stg_google_ads__ad_history:f1->96. model.google_ads.google_ads__url_report:f2 107. model.google_ads_source.stg_google_ads__ad_history:f1->96. model.google_ads.google_ads__url_report:f6 107. model.google_ads_source.stg_google_ads__ad_history:f1->96. model.google_ads.google_ads__url_report:f5 107. model.google_ads_source.stg_google_ads__ad_history:f1->96. model.google_ads.google_ads__url_report:f3 107. model.google_ads_source.stg_google_ads__ad_history:f1->96. model.google_ads.google_ads__url_report:f4 107. model.google_ads_source.stg_google_ads__ad_history:f1->96. model.google_ads.google_ads__url_report:f7 107. model.google_ads_source.stg_google_ads__ad_history:f9->96. model.google_ads.google_ads__url_report:f6 108. model.google_ads_source.stg_google_ads__ad_history_tmp 108. model.google_ads_source.stg_google_ads__ad_history_tmp final_urls 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f3 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f2 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f1 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f0 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f4 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f5 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f9 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f8 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f6 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f7 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f10 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f3 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f2 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f1 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f0 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f4 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f5 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f9 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f8 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f6 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f7 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f10
107. model.google_ads_source.stg_google_ads__ad_history
  • Input Column: 108. model.google_ads_source.stg_google_ads__ad_history_tmp[final_urls]
    • Cleaning Brackets removed, cast to TEXT
    • Featurization Used to extract various URL components and UTM parameters
    • Output Columns:
      • source_final_urls: Directly mapped before cleaning
      • final_urls: Mapped after cleaning (removing brackets)
      • final_url: First URL extracted from the cleaned list
      • base_url: Extracted from final_url
      • url_host: Extracted from final_url
      • url_path: Extracted from final_url
      • utm_source: Extracted from final_url
      • utm_medium: Extracted from final_url
      • utm_campaign: Extracted from final_url
      • utm_content: Extracted from final_url
      • utm_term: Extracted from final_url
  • Input Column: 108. model.google_ads_source.stg_google_ads__ad_history_tmp[final_urls]
    • Cleaning Brackets removed, cast to TEXT
    • Featurization Used to extract various URL components and UTM parameters
    • Output Columns:
      • source_final_urls: Directly mapped before cleaning
      • final_urls: Mapped after cleaning (removing brackets)
      • final_url: First URL extracted from the cleaned list
      • base_url: Extracted from final_url
      • url_host: Extracted from final_url
      • url_path: Extracted from final_url
      • utm_source: Extracted from final_url
      • utm_medium: Extracted from final_url
      • utm_campaign: Extracted from final_url
      • utm_content: Extracted from final_url
      • utm_term: Extracted from final_url
96. model.google_ads.google_ads__url_report
  • Input Column: 107. model.google_ads_source.stg_google_ads__ad_history[final_url]
    • Featurization used to extract various URL components
    • Output Columns:
      • base_url: extracted from this column
      • url_host: extracted from this column
      • url_path: extracted from this column
      • utm_source: extracted from this column
      • utm_medium: extracted from this column
      • utm_campaign: extracted from this column
      • utm_content: extracted from this column
      • utm_term: extracted from this column
  • Input Column: 107. model.google_ads_source.stg_google_ads__ad_history[utm_source]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • utm_source: Directly copied to the output
Column Lineage
%3 107. model.google_ads_source.stg_google_ads__ad_history 107. model.google_ads_source.stg_google_ads__ad_history base_url final_url final_urls source_final_urls url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 96. model.google_ads.google_ads__url_report 96. model.google_ads.google_ads__url_report base_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 107. model.google_ads_source.stg_google_ads__ad_history:f1->96. model.google_ads.google_ads__url_report:f0 107. model.google_ads_source.stg_google_ads__ad_history:f1->96. model.google_ads.google_ads__url_report:f1 107. model.google_ads_source.stg_google_ads__ad_history:f1->96. model.google_ads.google_ads__url_report:f2 107. model.google_ads_source.stg_google_ads__ad_history:f1->96. model.google_ads.google_ads__url_report:f6 107. model.google_ads_source.stg_google_ads__ad_history:f1->96. model.google_ads.google_ads__url_report:f5 107. model.google_ads_source.stg_google_ads__ad_history:f1->96. model.google_ads.google_ads__url_report:f3 107. model.google_ads_source.stg_google_ads__ad_history:f1->96. model.google_ads.google_ads__url_report:f4 107. model.google_ads_source.stg_google_ads__ad_history:f1->96. model.google_ads.google_ads__url_report:f7 107. model.google_ads_source.stg_google_ads__ad_history:f8->96. model.google_ads.google_ads__url_report:f5 108. model.google_ads_source.stg_google_ads__ad_history_tmp 108. model.google_ads_source.stg_google_ads__ad_history_tmp final_urls 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f3 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f2 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f1 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f0 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f4 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f5 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f9 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f8 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f6 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f7 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f10 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f3 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f2 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f1 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f0 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f4 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f5 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f9 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f8 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f6 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f7 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f10
107. model.google_ads_source.stg_google_ads__ad_history
  • Input Column: 108. model.google_ads_source.stg_google_ads__ad_history_tmp[final_urls]
    • Cleaning Brackets removed, cast to TEXT
    • Featurization Used to extract various URL components and UTM parameters
    • Output Columns:
      • source_final_urls: Directly mapped before cleaning
      • final_urls: Mapped after cleaning (removing brackets)
      • final_url: First URL extracted from the cleaned list
      • base_url: Extracted from final_url
      • url_host: Extracted from final_url
      • url_path: Extracted from final_url
      • utm_source: Extracted from final_url
      • utm_medium: Extracted from final_url
      • utm_campaign: Extracted from final_url
      • utm_content: Extracted from final_url
      • utm_term: Extracted from final_url
  • Input Column: 108. model.google_ads_source.stg_google_ads__ad_history_tmp[final_urls]
    • Cleaning Brackets removed, cast to TEXT
    • Featurization Used to extract various URL components and UTM parameters
    • Output Columns:
      • source_final_urls: Directly mapped before cleaning
      • final_urls: Mapped after cleaning (removing brackets)
      • final_url: First URL extracted from the cleaned list
      • base_url: Extracted from final_url
      • url_host: Extracted from final_url
      • url_path: Extracted from final_url
      • utm_source: Extracted from final_url
      • utm_medium: Extracted from final_url
      • utm_campaign: Extracted from final_url
      • utm_content: Extracted from final_url
      • utm_term: Extracted from final_url
96. model.google_ads.google_ads__url_report
  • Input Column: 107. model.google_ads_source.stg_google_ads__ad_history[final_url]
    • Featurization used to extract various URL components
    • Output Columns:
      • base_url: extracted from this column
      • url_host: extracted from this column
      • url_path: extracted from this column
      • utm_source: extracted from this column
      • utm_medium: extracted from this column
      • utm_campaign: extracted from this column
      • utm_content: extracted from this column
      • utm_term: extracted from this column
  • Input Column: 107. model.google_ads_source.stg_google_ads__ad_history[utm_medium]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • utm_medium: Directly copied to the output
Column Lineage
%3 107. model.google_ads_source.stg_google_ads__ad_history 107. model.google_ads_source.stg_google_ads__ad_history base_url final_url final_urls source_final_urls url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 96. model.google_ads.google_ads__url_report 96. model.google_ads.google_ads__url_report base_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 107. model.google_ads_source.stg_google_ads__ad_history:f1->96. model.google_ads.google_ads__url_report:f0 107. model.google_ads_source.stg_google_ads__ad_history:f1->96. model.google_ads.google_ads__url_report:f1 107. model.google_ads_source.stg_google_ads__ad_history:f1->96. model.google_ads.google_ads__url_report:f2 107. model.google_ads_source.stg_google_ads__ad_history:f1->96. model.google_ads.google_ads__url_report:f6 107. model.google_ads_source.stg_google_ads__ad_history:f1->96. model.google_ads.google_ads__url_report:f5 107. model.google_ads_source.stg_google_ads__ad_history:f1->96. model.google_ads.google_ads__url_report:f3 107. model.google_ads_source.stg_google_ads__ad_history:f1->96. model.google_ads.google_ads__url_report:f4 107. model.google_ads_source.stg_google_ads__ad_history:f1->96. model.google_ads.google_ads__url_report:f7 107. model.google_ads_source.stg_google_ads__ad_history:f6->96. model.google_ads.google_ads__url_report:f3 108. model.google_ads_source.stg_google_ads__ad_history_tmp 108. model.google_ads_source.stg_google_ads__ad_history_tmp final_urls 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f3 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f2 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f1 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f0 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f4 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f5 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f9 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f8 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f6 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f7 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f10 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f3 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f2 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f1 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f0 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f4 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f5 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f9 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f8 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f6 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f7 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f10
107. model.google_ads_source.stg_google_ads__ad_history
  • Input Column: 108. model.google_ads_source.stg_google_ads__ad_history_tmp[final_urls]
    • Cleaning Brackets removed, cast to TEXT
    • Featurization Used to extract various URL components and UTM parameters
    • Output Columns:
      • source_final_urls: Directly mapped before cleaning
      • final_urls: Mapped after cleaning (removing brackets)
      • final_url: First URL extracted from the cleaned list
      • base_url: Extracted from final_url
      • url_host: Extracted from final_url
      • url_path: Extracted from final_url
      • utm_source: Extracted from final_url
      • utm_medium: Extracted from final_url
      • utm_campaign: Extracted from final_url
      • utm_content: Extracted from final_url
      • utm_term: Extracted from final_url
  • Input Column: 108. model.google_ads_source.stg_google_ads__ad_history_tmp[final_urls]
    • Cleaning Brackets removed, cast to TEXT
    • Featurization Used to extract various URL components and UTM parameters
    • Output Columns:
      • source_final_urls: Directly mapped before cleaning
      • final_urls: Mapped after cleaning (removing brackets)
      • final_url: First URL extracted from the cleaned list
      • base_url: Extracted from final_url
      • url_host: Extracted from final_url
      • url_path: Extracted from final_url
      • utm_source: Extracted from final_url
      • utm_medium: Extracted from final_url
      • utm_campaign: Extracted from final_url
      • utm_content: Extracted from final_url
      • utm_term: Extracted from final_url
96. model.google_ads.google_ads__url_report
  • Input Column: 107. model.google_ads_source.stg_google_ads__ad_history[final_url]
    • Featurization used to extract various URL components
    • Output Columns:
      • base_url: extracted from this column
      • url_host: extracted from this column
      • url_path: extracted from this column
      • utm_source: extracted from this column
      • utm_medium: extracted from this column
      • utm_campaign: extracted from this column
      • utm_content: extracted from this column
      • utm_term: extracted from this column
  • Input Column: 107. model.google_ads_source.stg_google_ads__ad_history[utm_campaign]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • utm_campaign: Directly copied to the output
Column Lineage
%3 107. model.google_ads_source.stg_google_ads__ad_history 107. model.google_ads_source.stg_google_ads__ad_history base_url final_url final_urls source_final_urls url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 96. model.google_ads.google_ads__url_report 96. model.google_ads.google_ads__url_report base_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 107. model.google_ads_source.stg_google_ads__ad_history:f1->96. model.google_ads.google_ads__url_report:f0 107. model.google_ads_source.stg_google_ads__ad_history:f1->96. model.google_ads.google_ads__url_report:f1 107. model.google_ads_source.stg_google_ads__ad_history:f1->96. model.google_ads.google_ads__url_report:f2 107. model.google_ads_source.stg_google_ads__ad_history:f1->96. model.google_ads.google_ads__url_report:f6 107. model.google_ads_source.stg_google_ads__ad_history:f1->96. model.google_ads.google_ads__url_report:f5 107. model.google_ads_source.stg_google_ads__ad_history:f1->96. model.google_ads.google_ads__url_report:f3 107. model.google_ads_source.stg_google_ads__ad_history:f1->96. model.google_ads.google_ads__url_report:f4 107. model.google_ads_source.stg_google_ads__ad_history:f1->96. model.google_ads.google_ads__url_report:f7 107. model.google_ads_source.stg_google_ads__ad_history:f7->96. model.google_ads.google_ads__url_report:f4 108. model.google_ads_source.stg_google_ads__ad_history_tmp 108. model.google_ads_source.stg_google_ads__ad_history_tmp final_urls 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f3 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f2 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f1 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f0 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f4 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f5 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f9 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f8 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f6 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f7 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f10 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f3 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f2 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f1 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f0 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f4 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f5 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f9 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f8 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f6 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f7 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f10
107. model.google_ads_source.stg_google_ads__ad_history
  • Input Column: 108. model.google_ads_source.stg_google_ads__ad_history_tmp[final_urls]
    • Cleaning Brackets removed, cast to TEXT
    • Featurization Used to extract various URL components and UTM parameters
    • Output Columns:
      • source_final_urls: Directly mapped before cleaning
      • final_urls: Mapped after cleaning (removing brackets)
      • final_url: First URL extracted from the cleaned list
      • base_url: Extracted from final_url
      • url_host: Extracted from final_url
      • url_path: Extracted from final_url
      • utm_source: Extracted from final_url
      • utm_medium: Extracted from final_url
      • utm_campaign: Extracted from final_url
      • utm_content: Extracted from final_url
      • utm_term: Extracted from final_url
  • Input Column: 108. model.google_ads_source.stg_google_ads__ad_history_tmp[final_urls]
    • Cleaning Brackets removed, cast to TEXT
    • Featurization Used to extract various URL components and UTM parameters
    • Output Columns:
      • source_final_urls: Directly mapped before cleaning
      • final_urls: Mapped after cleaning (removing brackets)
      • final_url: First URL extracted from the cleaned list
      • base_url: Extracted from final_url
      • url_host: Extracted from final_url
      • url_path: Extracted from final_url
      • utm_source: Extracted from final_url
      • utm_medium: Extracted from final_url
      • utm_campaign: Extracted from final_url
      • utm_content: Extracted from final_url
      • utm_term: Extracted from final_url
96. model.google_ads.google_ads__url_report
  • Input Column: 107. model.google_ads_source.stg_google_ads__ad_history[final_url]
    • Featurization used to extract various URL components
    • Output Columns:
      • base_url: extracted from this column
      • url_host: extracted from this column
      • url_path: extracted from this column
      • utm_source: extracted from this column
      • utm_medium: extracted from this column
      • utm_campaign: extracted from this column
      • utm_content: extracted from this column
      • utm_term: extracted from this column
  • Input Column: 107. model.google_ads_source.stg_google_ads__ad_history[utm_content]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • utm_content: Directly copied to the output
Column Lineage
%3 107. model.google_ads_source.stg_google_ads__ad_history 107. model.google_ads_source.stg_google_ads__ad_history base_url final_url final_urls source_final_urls url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 96. model.google_ads.google_ads__url_report 96. model.google_ads.google_ads__url_report base_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 107. model.google_ads_source.stg_google_ads__ad_history:f1->96. model.google_ads.google_ads__url_report:f0 107. model.google_ads_source.stg_google_ads__ad_history:f1->96. model.google_ads.google_ads__url_report:f1 107. model.google_ads_source.stg_google_ads__ad_history:f1->96. model.google_ads.google_ads__url_report:f2 107. model.google_ads_source.stg_google_ads__ad_history:f1->96. model.google_ads.google_ads__url_report:f6 107. model.google_ads_source.stg_google_ads__ad_history:f1->96. model.google_ads.google_ads__url_report:f5 107. model.google_ads_source.stg_google_ads__ad_history:f1->96. model.google_ads.google_ads__url_report:f3 107. model.google_ads_source.stg_google_ads__ad_history:f1->96. model.google_ads.google_ads__url_report:f4 107. model.google_ads_source.stg_google_ads__ad_history:f1->96. model.google_ads.google_ads__url_report:f7 107. model.google_ads_source.stg_google_ads__ad_history:f10->96. model.google_ads.google_ads__url_report:f7 108. model.google_ads_source.stg_google_ads__ad_history_tmp 108. model.google_ads_source.stg_google_ads__ad_history_tmp final_urls 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f3 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f2 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f1 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f0 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f4 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f5 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f9 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f8 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f6 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f7 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f10 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f3 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f2 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f1 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f0 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f4 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f5 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f9 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f8 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f6 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f7 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f10
107. model.google_ads_source.stg_google_ads__ad_history
  • Input Column: 108. model.google_ads_source.stg_google_ads__ad_history_tmp[final_urls]
    • Cleaning Brackets removed, cast to TEXT
    • Featurization Used to extract various URL components and UTM parameters
    • Output Columns:
      • source_final_urls: Directly mapped before cleaning
      • final_urls: Mapped after cleaning (removing brackets)
      • final_url: First URL extracted from the cleaned list
      • base_url: Extracted from final_url
      • url_host: Extracted from final_url
      • url_path: Extracted from final_url
      • utm_source: Extracted from final_url
      • utm_medium: Extracted from final_url
      • utm_campaign: Extracted from final_url
      • utm_content: Extracted from final_url
      • utm_term: Extracted from final_url
  • Input Column: 108. model.google_ads_source.stg_google_ads__ad_history_tmp[final_urls]
    • Cleaning Brackets removed, cast to TEXT
    • Featurization Used to extract various URL components and UTM parameters
    • Output Columns:
      • source_final_urls: Directly mapped before cleaning
      • final_urls: Mapped after cleaning (removing brackets)
      • final_url: First URL extracted from the cleaned list
      • base_url: Extracted from final_url
      • url_host: Extracted from final_url
      • url_path: Extracted from final_url
      • utm_source: Extracted from final_url
      • utm_medium: Extracted from final_url
      • utm_campaign: Extracted from final_url
      • utm_content: Extracted from final_url
      • utm_term: Extracted from final_url
96. model.google_ads.google_ads__url_report
  • Input Column: 107. model.google_ads_source.stg_google_ads__ad_history[final_url]
    • Featurization used to extract various URL components
    • Output Columns:
      • base_url: extracted from this column
      • url_host: extracted from this column
      • url_path: extracted from this column
      • utm_source: extracted from this column
      • utm_medium: extracted from this column
      • utm_campaign: extracted from this column
      • utm_content: extracted from this column
      • utm_term: extracted from this column
  • Input Column: 107. model.google_ads_source.stg_google_ads__ad_history[utm_term]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • utm_term: Directly copied to the output
Column Lineage
%3 109. model.google_ads_source.stg_google_ads__ad_stats 109. model.google_ads_source.stg_google_ads__ad_stats spend 96. model.google_ads.google_ads__url_report 96. model.google_ads.google_ads__url_report spend 109. model.google_ads_source.stg_google_ads__ad_stats:f0->96. model.google_ads.google_ads__url_report:f0 110. model.google_ads_source.stg_google_ads__ad_stats_tmp 110. model.google_ads_source.stg_google_ads__ad_stats_tmp cost_micros 110. model.google_ads_source.stg_google_ads__ad_stats_tmp:f0->109. model.google_ads_source.stg_google_ads__ad_stats:f0
109. model.google_ads_source.stg_google_ads__ad_stats
  • Input Column: 110. model.google_ads_source.stg_google_ads__ad_stats_tmp[cost_micros]
    • Cleaning The column is cleaned by casting to INT and then divided by 1,000,000 to convert from micros to dollars.
    • Output Columns:
      • spend: The cost_micros is divided by 1,000,000 and mapped to the 'spend' column in the output.
96. model.google_ads.google_ads__url_report
  • Input Column: 109. model.google_ads_source.stg_google_ads__ad_stats[spend]
    • Aggregation The spend is summed up in the GROUP BY clause
    • Output Columns:
      • spend: It is directly mapped to the output 'spend' column after aggregation
Column Lineage
%3 109. model.google_ads_source.stg_google_ads__ad_stats 109. model.google_ads_source.stg_google_ads__ad_stats clicks 96. model.google_ads.google_ads__url_report 96. model.google_ads.google_ads__url_report clicks 109. model.google_ads_source.stg_google_ads__ad_stats:f0->96. model.google_ads.google_ads__url_report:f0 110. model.google_ads_source.stg_google_ads__ad_stats_tmp 110. model.google_ads_source.stg_google_ads__ad_stats_tmp clicks 110. model.google_ads_source.stg_google_ads__ad_stats_tmp:f0->109. model.google_ads_source.stg_google_ads__ad_stats:f0
109. model.google_ads_source.stg_google_ads__ad_stats
  • Input Column: 110. model.google_ads_source.stg_google_ads__ad_stats_tmp[clicks]
    • Cleaning The column is cast as INT in the fields CTE
    • Other COALESCE is used to replace NULL values with 0
    • Output Columns:
      • clicks: Mapped with COALESCE to handle NULL values
96. model.google_ads.google_ads__url_report
  • Input Column: 109. model.google_ads_source.stg_google_ads__ad_stats[clicks]
    • Aggregation The column is summed up in the SELECT clause
    • Output Columns:
      • clicks: Aggregated sum in the output
Column Lineage
%3 109. model.google_ads_source.stg_google_ads__ad_stats 109. model.google_ads_source.stg_google_ads__ad_stats impressions 96. model.google_ads.google_ads__url_report 96. model.google_ads.google_ads__url_report impressions 109. model.google_ads_source.stg_google_ads__ad_stats:f0->96. model.google_ads.google_ads__url_report:f0 110. model.google_ads_source.stg_google_ads__ad_stats_tmp 110. model.google_ads_source.stg_google_ads__ad_stats_tmp impressions 110. model.google_ads_source.stg_google_ads__ad_stats_tmp:f0->109. model.google_ads_source.stg_google_ads__ad_stats:f0
109. model.google_ads_source.stg_google_ads__ad_stats
  • Input Column: 110. model.google_ads_source.stg_google_ads__ad_stats_tmp[impressions]
    • Cleaning The column is cleaned by casting to INT and using COALESCE to handle null values.
    • Output Columns:
      • impressions: The impressions column is directly mapped to the 'impressions' column in the output, with null values replaced by 0.
96. model.google_ads.google_ads__url_report
  • Input Column: 109. model.google_ads_source.stg_google_ads__ad_stats[impressions]
    • Aggregation The impressions are summed up in the GROUP BY clause
    • Output Columns:
      • impressions: It is directly mapped to the output 'impressions' column after aggregation
Column Lineage
%3 109. model.google_ads_source.stg_google_ads__ad_stats 109. model.google_ads_source.stg_google_ads__ad_stats conversions 96. model.google_ads.google_ads__url_report 96. model.google_ads.google_ads__url_report conversions 109. model.google_ads_source.stg_google_ads__ad_stats:f0->96. model.google_ads.google_ads__url_report:f0
96. model.google_ads.google_ads__url_report
  • Input Column: 109. model.google_ads_source.stg_google_ads__ad_stats[conversions]
    • Aggregation The conversions are summed up in the GROUP BY clause
    • Output Columns:
      • conversions: It is directly mapped to the output 'conversions' column after aggregation
Column Lineage
%3 109. model.google_ads_source.stg_google_ads__ad_stats 109. model.google_ads_source.stg_google_ads__ad_stats conversions_value 96. model.google_ads.google_ads__url_report 96. model.google_ads.google_ads__url_report conversions_value 109. model.google_ads_source.stg_google_ads__ad_stats:f0->96. model.google_ads.google_ads__url_report:f0
96. model.google_ads.google_ads__url_report
  • Input Column: 109. model.google_ads_source.stg_google_ads__ad_stats[conversions_value]
    • Aggregation The conversions_value is summed up in the GROUP BY clause
    • Output Columns:
      • conversions_value: It is directly mapped to the output 'conversions_value' column after aggregation
Column Lineage
%3 109. model.google_ads_source.stg_google_ads__ad_stats 109. model.google_ads_source.stg_google_ads__ad_stats view_through_conversions 96. model.google_ads.google_ads__url_report 96. model.google_ads.google_ads__url_report view_through_conversions 109. model.google_ads_source.stg_google_ads__ad_stats:f0->96. model.google_ads.google_ads__url_report:f0
96. model.google_ads.google_ads__url_report
  • Input Column: 109. model.google_ads_source.stg_google_ads__ad_stats[view_through_conversions]
    • Aggregation The view_through_conversions are summed up in the GROUP BY clause
    • Output Columns:
      • view_through_conversions: It is directly mapped to the output 'view_through_conversions' column after aggregation
97. model.google_ads_source.stg_google_ads__account_history

This SQL query processes Google Ads account history data. It starts by selecting all columns from a temporary staging table, then defines a set of fields with specific data types. The final selection includes various account details, adds a source relation field, and determines the most recent record for each account. The query also filters out inactive records.

CleaningDeduplicationFiltering
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_google_ads_source.stg_google_ads__account_history_tmp
), fields AS (
  SELECT
    CAST(NULL AS TIMESTAMP) AS _fivetran_synced,
    CAST(NULL AS BOOLEAN) AS auto_tagging_enabled,
    CAST(NULL AS TEXT) AS currency_code,
    CAST(NULL AS TEXT) AS descriptive_name,
    CAST(NULL AS INT) AS id,
    CAST(NULL AS TEXT) AS time_zone,
    CAST(NULL AS TIMESTAMP) AS updated_at,
    CAST(NULL AS BOOLEAN) AS _fivetran_active,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    id AS account_id,
    updated_at,
    currency_code,
    auto_tagging_enabled,
    time_zone,
    descriptive_name AS account_name,
    ROW_NUMBER() OVER (PARTITION BY source_relation, id ORDER BY updated_at DESC) = 1 AS is_most_recent_record
  FROM fields
  WHERE
    COALESCE(_fivetran_active, TRUE)
)
SELECT
  *
FROM final
%3 97. model.google_ads_source.stg_google_ads__account_history 97. model.google_ads_source.stg_google_ads__account_history source_relation account_id currency_code auto_tagging_enabled time_zone account_name updated_at is_most_recent_record 98. model.google_ads_source.stg_google_ads__account_history_tmp 98. model.google_ads_source.stg_google_ads__account_history_tmp id updated_at auto_tagging_enabled currency_code descriptive_name time_zone 98. model.google_ads_source.stg_google_ads__account_history_tmp:f0->97. model.google_ads_source.stg_google_ads__account_history:f1 98. model.google_ads_source.stg_google_ads__account_history_tmp:f1->97. model.google_ads_source.stg_google_ads__account_history:f6 98. model.google_ads_source.stg_google_ads__account_history_tmp:f2->97. model.google_ads_source.stg_google_ads__account_history:f3 98. model.google_ads_source.stg_google_ads__account_history_tmp:f3->97. model.google_ads_source.stg_google_ads__account_history:f2 98. model.google_ads_source.stg_google_ads__account_history_tmp:f4->97. model.google_ads_source.stg_google_ads__account_history:f5 98. model.google_ads_source.stg_google_ads__account_history_tmp:f5->97. model.google_ads_source.stg_google_ads__account_history:f4
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
account_id integer The ID representing the account.
currency_code text The currency of the spend reported.
auto_tagging_enabled boolean Boolean indicating if auto tagging is enabled on the account ads.
time_zone integer The time zone of the account ads.
account_name integer The descriptive name of the Customer account.
updated_at timestamp without time zone Timestamp of when a record was last synced.
is_most_recent_record boolean Boolean representing whether the record is the most recent version of the object.
Column Lineage
%3 97. model.google_ads_source.stg_google_ads__account_history 97. model.google_ads_source.stg_google_ads__account_history source_relation 92. model.google_ads.google_ads__ad_group_report 92. model.google_ads.google_ads__ad_group_report source_relation 97. model.google_ads_source.stg_google_ads__account_history:f0->92. model.google_ads.google_ads__ad_group_report:f0 93. model.google_ads.google_ads__ad_report 93. model.google_ads.google_ads__ad_report source_relation 97. model.google_ads_source.stg_google_ads__account_history:f0->93. model.google_ads.google_ads__ad_report:f0 91. model.google_ads.google_ads__account_report 91. model.google_ads.google_ads__account_report source_relation 97. model.google_ads_source.stg_google_ads__account_history:f0->91. model.google_ads.google_ads__account_report:f0 94. model.google_ads.google_ads__campaign_report 94. model.google_ads.google_ads__campaign_report source_relation 97. model.google_ads_source.stg_google_ads__account_history:f0->94. model.google_ads.google_ads__campaign_report:f0 95. model.google_ads.google_ads__keyword_report 95. model.google_ads.google_ads__keyword_report source_relation 97. model.google_ads_source.stg_google_ads__account_history:f0->95. model.google_ads.google_ads__keyword_report:f0 96. model.google_ads.google_ads__url_report 96. model.google_ads.google_ads__url_report source_relation 97. model.google_ads_source.stg_google_ads__account_history:f0->96. model.google_ads.google_ads__url_report:f0
91. model.google_ads.google_ads__account_report
  • Input Column: 97. model.google_ads_source.stg_google_ads__account_history[source_relation]
    • Direct The column is directly copied without transformation
    • Integration Used as part of the join condition with stats table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to output
92. model.google_ads.google_ads__ad_group_report
  • Input Column: 97. model.google_ads_source.stg_google_ads__account_history[source_relation]
    • Integration Used as part of the JOIN condition to link accounts with other tables
    • Direct Directly copied to the output
    • Output Columns:
      • source_relation: Directly copied
93. model.google_ads.google_ads__ad_report
  • Input Column: 97. model.google_ads_source.stg_google_ads__account_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
94. model.google_ads.google_ads__campaign_report
  • Input Column: 97. model.google_ads_source.stg_google_ads__account_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
95. model.google_ads.google_ads__keyword_report
  • Input Column: 97. model.google_ads_source.stg_google_ads__account_history[source_relation]
    • Integration used as a key to join with other tables
    • Direct copied directly to the output
    • Output Columns:
      • source_relation: directly copied
96. model.google_ads.google_ads__url_report
  • Input Column: 97. model.google_ads_source.stg_google_ads__account_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
Column Lineage
%3 98. model.google_ads_source.stg_google_ads__account_history_tmp 98. model.google_ads_source.stg_google_ads__account_history_tmp id 97. model.google_ads_source.stg_google_ads__account_history 97. model.google_ads_source.stg_google_ads__account_history account_id 98. model.google_ads_source.stg_google_ads__account_history_tmp:f0->97. model.google_ads_source.stg_google_ads__account_history:f0 92. model.google_ads.google_ads__ad_group_report 92. model.google_ads.google_ads__ad_group_report account_id 97. model.google_ads_source.stg_google_ads__account_history:f0->92. model.google_ads.google_ads__ad_group_report:f0 93. model.google_ads.google_ads__ad_report 93. model.google_ads.google_ads__ad_report account_id 97. model.google_ads_source.stg_google_ads__account_history:f0->93. model.google_ads.google_ads__ad_report:f0 91. model.google_ads.google_ads__account_report 91. model.google_ads.google_ads__account_report account_id 97. model.google_ads_source.stg_google_ads__account_history:f0->91. model.google_ads.google_ads__account_report:f0 94. model.google_ads.google_ads__campaign_report 94. model.google_ads.google_ads__campaign_report account_id 97. model.google_ads_source.stg_google_ads__account_history:f0->94. model.google_ads.google_ads__campaign_report:f0 95. model.google_ads.google_ads__keyword_report 95. model.google_ads.google_ads__keyword_report account_id 97. model.google_ads_source.stg_google_ads__account_history:f0->95. model.google_ads.google_ads__keyword_report:f0 96. model.google_ads.google_ads__url_report 96. model.google_ads.google_ads__url_report account_id 97. model.google_ads_source.stg_google_ads__account_history:f0->96. model.google_ads.google_ads__url_report:f0
97. model.google_ads_source.stg_google_ads__account_history
  • Input Column: 98. model.google_ads_source.stg_google_ads__account_history_tmp[id]
    • Direct The column is directly copied without transformation
    • Deduplication Used in ROW_NUMBER() function to determine the most recent record
    • Output Columns:
      • account_id: Directly mapped
91. model.google_ads.google_ads__account_report
  • Input Column: 97. model.google_ads_source.stg_google_ads__account_history[account_id]
    • Direct The column is directly copied without transformation
    • Integration Used as the key to join with stats table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • account_id: Directly copied to output
92. model.google_ads.google_ads__ad_group_report
  • Input Column: 97. model.google_ads_source.stg_google_ads__account_history[account_id]
    • Integration Used as part of the JOIN condition to link accounts with other tables
    • Direct Directly copied to the output
    • Output Columns:
      • account_id: Directly copied
93. model.google_ads.google_ads__ad_report
  • Input Column: 97. model.google_ads_source.stg_google_ads__account_history[account_id]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • account_id: directly copied
94. model.google_ads.google_ads__campaign_report
  • Input Column: 97. model.google_ads_source.stg_google_ads__account_history[account_id]
    • Integration used as the key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • account_id: directly copied
95. model.google_ads.google_ads__keyword_report
  • Input Column: 97. model.google_ads_source.stg_google_ads__account_history[account_id]
    • Integration used as a key to join with other tables
    • Direct copied directly to the output
    • Output Columns:
      • account_id: directly copied
96. model.google_ads.google_ads__url_report
  • Input Column: 97. model.google_ads_source.stg_google_ads__account_history[account_id]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • account_id: directly copied
Column Lineage
%3 98. model.google_ads_source.stg_google_ads__account_history_tmp 98. model.google_ads_source.stg_google_ads__account_history_tmp currency_code 97. model.google_ads_source.stg_google_ads__account_history 97. model.google_ads_source.stg_google_ads__account_history currency_code 98. model.google_ads_source.stg_google_ads__account_history_tmp:f0->97. model.google_ads_source.stg_google_ads__account_history:f0 92. model.google_ads.google_ads__ad_group_report 92. model.google_ads.google_ads__ad_group_report currency_code 97. model.google_ads_source.stg_google_ads__account_history:f0->92. model.google_ads.google_ads__ad_group_report:f0 93. model.google_ads.google_ads__ad_report 93. model.google_ads.google_ads__ad_report currency_code 97. model.google_ads_source.stg_google_ads__account_history:f0->93. model.google_ads.google_ads__ad_report:f0 91. model.google_ads.google_ads__account_report 91. model.google_ads.google_ads__account_report currency_code 97. model.google_ads_source.stg_google_ads__account_history:f0->91. model.google_ads.google_ads__account_report:f0 94. model.google_ads.google_ads__campaign_report 94. model.google_ads.google_ads__campaign_report currency_code 97. model.google_ads_source.stg_google_ads__account_history:f0->94. model.google_ads.google_ads__campaign_report:f0 95. model.google_ads.google_ads__keyword_report 95. model.google_ads.google_ads__keyword_report currency_code 97. model.google_ads_source.stg_google_ads__account_history:f0->95. model.google_ads.google_ads__keyword_report:f0 96. model.google_ads.google_ads__url_report 96. model.google_ads.google_ads__url_report currency_code 97. model.google_ads_source.stg_google_ads__account_history:f0->96. model.google_ads.google_ads__url_report:f0
97. model.google_ads_source.stg_google_ads__account_history
  • Input Column: 98. model.google_ads_source.stg_google_ads__account_history_tmp[currency_code]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • currency_code: Directly mapped
91. model.google_ads.google_ads__account_report
  • Input Column: 97. model.google_ads_source.stg_google_ads__account_history[currency_code]
    • Direct The column is directly copied without transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • currency_code: Directly copied to output
92. model.google_ads.google_ads__ad_group_report
  • Input Column: 97. model.google_ads_source.stg_google_ads__account_history[currency_code]
    • Direct Directly copied to the output
    • Output Columns:
      • currency_code: Directly copied
93. model.google_ads.google_ads__ad_report
  • Input Column: 97. model.google_ads_source.stg_google_ads__account_history[currency_code]
    • Direct directly copied to the output
    • Output Columns:
      • currency_code: directly copied
94. model.google_ads.google_ads__campaign_report
  • Input Column: 97. model.google_ads_source.stg_google_ads__account_history[currency_code]
    • Direct directly copied to the output
    • Output Columns:
      • currency_code: directly copied
95. model.google_ads.google_ads__keyword_report
  • Input Column: 97. model.google_ads_source.stg_google_ads__account_history[currency_code]
    • Direct copied directly to the output
    • Output Columns:
      • currency_code: directly copied
96. model.google_ads.google_ads__url_report
  • Input Column: 97. model.google_ads_source.stg_google_ads__account_history[currency_code]
    • Direct directly copied to the output
    • Output Columns:
      • currency_code: directly copied
Column Lineage
%3 98. model.google_ads_source.stg_google_ads__account_history_tmp 98. model.google_ads_source.stg_google_ads__account_history_tmp auto_tagging_enabled 97. model.google_ads_source.stg_google_ads__account_history 97. model.google_ads_source.stg_google_ads__account_history auto_tagging_enabled 98. model.google_ads_source.stg_google_ads__account_history_tmp:f0->97. model.google_ads_source.stg_google_ads__account_history:f0 91. model.google_ads.google_ads__account_report 91. model.google_ads.google_ads__account_report auto_tagging_enabled 97. model.google_ads_source.stg_google_ads__account_history:f0->91. model.google_ads.google_ads__account_report:f0
97. model.google_ads_source.stg_google_ads__account_history
  • Input Column: 98. model.google_ads_source.stg_google_ads__account_history_tmp[auto_tagging_enabled]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • auto_tagging_enabled: Directly mapped
91. model.google_ads.google_ads__account_report
  • Input Column: 97. model.google_ads_source.stg_google_ads__account_history[auto_tagging_enabled]
    • Direct The column is directly copied without transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • auto_tagging_enabled: Directly copied to output
Column Lineage
%3 98. model.google_ads_source.stg_google_ads__account_history_tmp 98. model.google_ads_source.stg_google_ads__account_history_tmp time_zone 97. model.google_ads_source.stg_google_ads__account_history 97. model.google_ads_source.stg_google_ads__account_history time_zone 98. model.google_ads_source.stg_google_ads__account_history_tmp:f0->97. model.google_ads_source.stg_google_ads__account_history:f0 91. model.google_ads.google_ads__account_report 91. model.google_ads.google_ads__account_report time_zone 97. model.google_ads_source.stg_google_ads__account_history:f0->91. model.google_ads.google_ads__account_report:f0
97. model.google_ads_source.stg_google_ads__account_history
  • Input Column: 98. model.google_ads_source.stg_google_ads__account_history_tmp[time_zone]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • time_zone: Directly mapped to the output 'time_zone' column
91. model.google_ads.google_ads__account_report
  • Input Column: 97. model.google_ads_source.stg_google_ads__account_history[time_zone]
    • Direct The column is directly copied without transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • time_zone: Directly copied to output
Column Lineage
%3 98. model.google_ads_source.stg_google_ads__account_history_tmp 98. model.google_ads_source.stg_google_ads__account_history_tmp descriptive_name 97. model.google_ads_source.stg_google_ads__account_history 97. model.google_ads_source.stg_google_ads__account_history account_name 98. model.google_ads_source.stg_google_ads__account_history_tmp:f0->97. model.google_ads_source.stg_google_ads__account_history:f0 92. model.google_ads.google_ads__ad_group_report 92. model.google_ads.google_ads__ad_group_report account_name 97. model.google_ads_source.stg_google_ads__account_history:f0->92. model.google_ads.google_ads__ad_group_report:f0 93. model.google_ads.google_ads__ad_report 93. model.google_ads.google_ads__ad_report account_name 97. model.google_ads_source.stg_google_ads__account_history:f0->93. model.google_ads.google_ads__ad_report:f0 91. model.google_ads.google_ads__account_report 91. model.google_ads.google_ads__account_report account_name 97. model.google_ads_source.stg_google_ads__account_history:f0->91. model.google_ads.google_ads__account_report:f0 94. model.google_ads.google_ads__campaign_report 94. model.google_ads.google_ads__campaign_report account_name 97. model.google_ads_source.stg_google_ads__account_history:f0->94. model.google_ads.google_ads__campaign_report:f0 95. model.google_ads.google_ads__keyword_report 95. model.google_ads.google_ads__keyword_report account_name 97. model.google_ads_source.stg_google_ads__account_history:f0->95. model.google_ads.google_ads__keyword_report:f0 96. model.google_ads.google_ads__url_report 96. model.google_ads.google_ads__url_report account_name 97. model.google_ads_source.stg_google_ads__account_history:f0->96. model.google_ads.google_ads__url_report:f0
97. model.google_ads_source.stg_google_ads__account_history
  • Input Column: 98. model.google_ads_source.stg_google_ads__account_history_tmp[descriptive_name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • account_name: Directly mapped
91. model.google_ads.google_ads__account_report
  • Input Column: 97. model.google_ads_source.stg_google_ads__account_history[account_name]
    • Direct The column is directly copied without transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • account_name: Directly copied to output
92. model.google_ads.google_ads__ad_group_report
  • Input Column: 97. model.google_ads_source.stg_google_ads__account_history[account_name]
    • Direct Directly copied to the output
    • Output Columns:
      • account_name: Directly copied
93. model.google_ads.google_ads__ad_report
  • Input Column: 97. model.google_ads_source.stg_google_ads__account_history[account_name]
    • Direct directly copied to the output
    • Output Columns:
      • account_name: directly copied
94. model.google_ads.google_ads__campaign_report
  • Input Column: 97. model.google_ads_source.stg_google_ads__account_history[account_name]
    • Direct directly copied to the output
    • Output Columns:
      • account_name: directly copied
95. model.google_ads.google_ads__keyword_report
  • Input Column: 97. model.google_ads_source.stg_google_ads__account_history[account_name]
    • Direct copied directly to the output
    • Output Columns:
      • account_name: directly copied
96. model.google_ads.google_ads__url_report
  • Input Column: 97. model.google_ads_source.stg_google_ads__account_history[account_name]
    • Direct directly copied to the output
    • Output Columns:
      • account_name: directly copied
Column Lineage
%3 98. model.google_ads_source.stg_google_ads__account_history_tmp 98. model.google_ads_source.stg_google_ads__account_history_tmp updated_at 97. model.google_ads_source.stg_google_ads__account_history 97. model.google_ads_source.stg_google_ads__account_history updated_at 98. model.google_ads_source.stg_google_ads__account_history_tmp:f0->97. model.google_ads_source.stg_google_ads__account_history:f0
97. model.google_ads_source.stg_google_ads__account_history
  • Input Column: 98. model.google_ads_source.stg_google_ads__account_history_tmp[updated_at]
    • Direct The column is directly copied without transformation
    • Deduplication Used in ROW_NUMBER() function to order and determine the most recent record
    • Output Columns:
      • updated_at: Directly mapped
98. model.google_ads_source.stg_google_ads__account_history_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of TEXT data type, initialized as NULL. The query is likely used as a placeholder or template for further development, or to establish a schema structure without populating data.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 98. model.google_ads_source.stg_google_ads__account_history_tmp 98. model.google_ads_source.stg_google_ads__account_history_tmp id updated_at _fivetran_synced auto_tagging_enabled currency_code descriptive_name final_url_suffix hidden manager manager_customer_id optimization_score pay_per_conversion_eligibility_failure_reasons test_account time_zone tracking_url_template 306. source.google_ads_source.google_ads.account_history 306. source.google_ads_source.google_ads.account_history
Name Type Comment
id integer None
updated_at timestamp without time zone None
_fivetran_synced timestamp without time zone None
auto_tagging_enabled boolean None
currency_code text None
descriptive_name integer None
final_url_suffix boolean None
hidden boolean None
manager integer None
manager_customer_id double precision None
optimization_score text None
pay_per_conversion_eligibility_failure_reasons boolean None
test_account text None
time_zone integer None
tracking_url_template integer None
Column Lineage
%3 98. model.google_ads_source.stg_google_ads__account_history_tmp 98. model.google_ads_source.stg_google_ads__account_history_tmp id 97. model.google_ads_source.stg_google_ads__account_history 97. model.google_ads_source.stg_google_ads__account_history account_id 98. model.google_ads_source.stg_google_ads__account_history_tmp:f0->97. model.google_ads_source.stg_google_ads__account_history:f0 92. model.google_ads.google_ads__ad_group_report 92. model.google_ads.google_ads__ad_group_report account_id 97. model.google_ads_source.stg_google_ads__account_history:f0->92. model.google_ads.google_ads__ad_group_report:f0 93. model.google_ads.google_ads__ad_report 93. model.google_ads.google_ads__ad_report account_id 97. model.google_ads_source.stg_google_ads__account_history:f0->93. model.google_ads.google_ads__ad_report:f0 91. model.google_ads.google_ads__account_report 91. model.google_ads.google_ads__account_report account_id 97. model.google_ads_source.stg_google_ads__account_history:f0->91. model.google_ads.google_ads__account_report:f0 94. model.google_ads.google_ads__campaign_report 94. model.google_ads.google_ads__campaign_report account_id 97. model.google_ads_source.stg_google_ads__account_history:f0->94. model.google_ads.google_ads__campaign_report:f0 95. model.google_ads.google_ads__keyword_report 95. model.google_ads.google_ads__keyword_report account_id 97. model.google_ads_source.stg_google_ads__account_history:f0->95. model.google_ads.google_ads__keyword_report:f0 96. model.google_ads.google_ads__url_report 96. model.google_ads.google_ads__url_report account_id 97. model.google_ads_source.stg_google_ads__account_history:f0->96. model.google_ads.google_ads__url_report:f0
97. model.google_ads_source.stg_google_ads__account_history
  • Input Column: 98. model.google_ads_source.stg_google_ads__account_history_tmp[id]
    • Direct The column is directly copied without transformation
    • Deduplication Used in ROW_NUMBER() function to determine the most recent record
    • Output Columns:
      • account_id: Directly mapped
91. model.google_ads.google_ads__account_report
  • Input Column: 97. model.google_ads_source.stg_google_ads__account_history[account_id]
    • Direct The column is directly copied without transformation
    • Integration Used as the key to join with stats table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • account_id: Directly copied to output
92. model.google_ads.google_ads__ad_group_report
  • Input Column: 97. model.google_ads_source.stg_google_ads__account_history[account_id]
    • Integration Used as part of the JOIN condition to link accounts with other tables
    • Direct Directly copied to the output
    • Output Columns:
      • account_id: Directly copied
93. model.google_ads.google_ads__ad_report
  • Input Column: 97. model.google_ads_source.stg_google_ads__account_history[account_id]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • account_id: directly copied
94. model.google_ads.google_ads__campaign_report
  • Input Column: 97. model.google_ads_source.stg_google_ads__account_history[account_id]
    • Integration used as the key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • account_id: directly copied
95. model.google_ads.google_ads__keyword_report
  • Input Column: 97. model.google_ads_source.stg_google_ads__account_history[account_id]
    • Integration used as a key to join with other tables
    • Direct copied directly to the output
    • Output Columns:
      • account_id: directly copied
96. model.google_ads.google_ads__url_report
  • Input Column: 97. model.google_ads_source.stg_google_ads__account_history[account_id]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • account_id: directly copied
Column Lineage
%3 98. model.google_ads_source.stg_google_ads__account_history_tmp 98. model.google_ads_source.stg_google_ads__account_history_tmp updated_at 97. model.google_ads_source.stg_google_ads__account_history 97. model.google_ads_source.stg_google_ads__account_history updated_at 98. model.google_ads_source.stg_google_ads__account_history_tmp:f0->97. model.google_ads_source.stg_google_ads__account_history:f0
97. model.google_ads_source.stg_google_ads__account_history
  • Input Column: 98. model.google_ads_source.stg_google_ads__account_history_tmp[updated_at]
    • Direct The column is directly copied without transformation
    • Deduplication Used in ROW_NUMBER() function to order and determine the most recent record
    • Output Columns:
      • updated_at: Directly mapped
Column Lineage
%3 98. model.google_ads_source.stg_google_ads__account_history_tmp 98. model.google_ads_source.stg_google_ads__account_history_tmp auto_tagging_enabled 97. model.google_ads_source.stg_google_ads__account_history 97. model.google_ads_source.stg_google_ads__account_history auto_tagging_enabled 98. model.google_ads_source.stg_google_ads__account_history_tmp:f0->97. model.google_ads_source.stg_google_ads__account_history:f0 91. model.google_ads.google_ads__account_report 91. model.google_ads.google_ads__account_report auto_tagging_enabled 97. model.google_ads_source.stg_google_ads__account_history:f0->91. model.google_ads.google_ads__account_report:f0
97. model.google_ads_source.stg_google_ads__account_history
  • Input Column: 98. model.google_ads_source.stg_google_ads__account_history_tmp[auto_tagging_enabled]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • auto_tagging_enabled: Directly mapped
91. model.google_ads.google_ads__account_report
  • Input Column: 97. model.google_ads_source.stg_google_ads__account_history[auto_tagging_enabled]
    • Direct The column is directly copied without transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • auto_tagging_enabled: Directly copied to output
Column Lineage
%3 98. model.google_ads_source.stg_google_ads__account_history_tmp 98. model.google_ads_source.stg_google_ads__account_history_tmp currency_code 97. model.google_ads_source.stg_google_ads__account_history 97. model.google_ads_source.stg_google_ads__account_history currency_code 98. model.google_ads_source.stg_google_ads__account_history_tmp:f0->97. model.google_ads_source.stg_google_ads__account_history:f0 92. model.google_ads.google_ads__ad_group_report 92. model.google_ads.google_ads__ad_group_report currency_code 97. model.google_ads_source.stg_google_ads__account_history:f0->92. model.google_ads.google_ads__ad_group_report:f0 93. model.google_ads.google_ads__ad_report 93. model.google_ads.google_ads__ad_report currency_code 97. model.google_ads_source.stg_google_ads__account_history:f0->93. model.google_ads.google_ads__ad_report:f0 91. model.google_ads.google_ads__account_report 91. model.google_ads.google_ads__account_report currency_code 97. model.google_ads_source.stg_google_ads__account_history:f0->91. model.google_ads.google_ads__account_report:f0 94. model.google_ads.google_ads__campaign_report 94. model.google_ads.google_ads__campaign_report currency_code 97. model.google_ads_source.stg_google_ads__account_history:f0->94. model.google_ads.google_ads__campaign_report:f0 95. model.google_ads.google_ads__keyword_report 95. model.google_ads.google_ads__keyword_report currency_code 97. model.google_ads_source.stg_google_ads__account_history:f0->95. model.google_ads.google_ads__keyword_report:f0 96. model.google_ads.google_ads__url_report 96. model.google_ads.google_ads__url_report currency_code 97. model.google_ads_source.stg_google_ads__account_history:f0->96. model.google_ads.google_ads__url_report:f0
97. model.google_ads_source.stg_google_ads__account_history
  • Input Column: 98. model.google_ads_source.stg_google_ads__account_history_tmp[currency_code]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • currency_code: Directly mapped
91. model.google_ads.google_ads__account_report
  • Input Column: 97. model.google_ads_source.stg_google_ads__account_history[currency_code]
    • Direct The column is directly copied without transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • currency_code: Directly copied to output
92. model.google_ads.google_ads__ad_group_report
  • Input Column: 97. model.google_ads_source.stg_google_ads__account_history[currency_code]
    • Direct Directly copied to the output
    • Output Columns:
      • currency_code: Directly copied
93. model.google_ads.google_ads__ad_report
  • Input Column: 97. model.google_ads_source.stg_google_ads__account_history[currency_code]
    • Direct directly copied to the output
    • Output Columns:
      • currency_code: directly copied
94. model.google_ads.google_ads__campaign_report
  • Input Column: 97. model.google_ads_source.stg_google_ads__account_history[currency_code]
    • Direct directly copied to the output
    • Output Columns:
      • currency_code: directly copied
95. model.google_ads.google_ads__keyword_report
  • Input Column: 97. model.google_ads_source.stg_google_ads__account_history[currency_code]
    • Direct copied directly to the output
    • Output Columns:
      • currency_code: directly copied
96. model.google_ads.google_ads__url_report
  • Input Column: 97. model.google_ads_source.stg_google_ads__account_history[currency_code]
    • Direct directly copied to the output
    • Output Columns:
      • currency_code: directly copied
Column Lineage
%3 98. model.google_ads_source.stg_google_ads__account_history_tmp 98. model.google_ads_source.stg_google_ads__account_history_tmp descriptive_name 97. model.google_ads_source.stg_google_ads__account_history 97. model.google_ads_source.stg_google_ads__account_history account_name 98. model.google_ads_source.stg_google_ads__account_history_tmp:f0->97. model.google_ads_source.stg_google_ads__account_history:f0 92. model.google_ads.google_ads__ad_group_report 92. model.google_ads.google_ads__ad_group_report account_name 97. model.google_ads_source.stg_google_ads__account_history:f0->92. model.google_ads.google_ads__ad_group_report:f0 93. model.google_ads.google_ads__ad_report 93. model.google_ads.google_ads__ad_report account_name 97. model.google_ads_source.stg_google_ads__account_history:f0->93. model.google_ads.google_ads__ad_report:f0 91. model.google_ads.google_ads__account_report 91. model.google_ads.google_ads__account_report account_name 97. model.google_ads_source.stg_google_ads__account_history:f0->91. model.google_ads.google_ads__account_report:f0 94. model.google_ads.google_ads__campaign_report 94. model.google_ads.google_ads__campaign_report account_name 97. model.google_ads_source.stg_google_ads__account_history:f0->94. model.google_ads.google_ads__campaign_report:f0 95. model.google_ads.google_ads__keyword_report 95. model.google_ads.google_ads__keyword_report account_name 97. model.google_ads_source.stg_google_ads__account_history:f0->95. model.google_ads.google_ads__keyword_report:f0 96. model.google_ads.google_ads__url_report 96. model.google_ads.google_ads__url_report account_name 97. model.google_ads_source.stg_google_ads__account_history:f0->96. model.google_ads.google_ads__url_report:f0
97. model.google_ads_source.stg_google_ads__account_history
  • Input Column: 98. model.google_ads_source.stg_google_ads__account_history_tmp[descriptive_name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • account_name: Directly mapped
91. model.google_ads.google_ads__account_report
  • Input Column: 97. model.google_ads_source.stg_google_ads__account_history[account_name]
    • Direct The column is directly copied without transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • account_name: Directly copied to output
92. model.google_ads.google_ads__ad_group_report
  • Input Column: 97. model.google_ads_source.stg_google_ads__account_history[account_name]
    • Direct Directly copied to the output
    • Output Columns:
      • account_name: Directly copied
93. model.google_ads.google_ads__ad_report
  • Input Column: 97. model.google_ads_source.stg_google_ads__account_history[account_name]
    • Direct directly copied to the output
    • Output Columns:
      • account_name: directly copied
94. model.google_ads.google_ads__campaign_report
  • Input Column: 97. model.google_ads_source.stg_google_ads__account_history[account_name]
    • Direct directly copied to the output
    • Output Columns:
      • account_name: directly copied
95. model.google_ads.google_ads__keyword_report
  • Input Column: 97. model.google_ads_source.stg_google_ads__account_history[account_name]
    • Direct copied directly to the output
    • Output Columns:
      • account_name: directly copied
96. model.google_ads.google_ads__url_report
  • Input Column: 97. model.google_ads_source.stg_google_ads__account_history[account_name]
    • Direct directly copied to the output
    • Output Columns:
      • account_name: directly copied
Column Lineage
%3 98. model.google_ads_source.stg_google_ads__account_history_tmp 98. model.google_ads_source.stg_google_ads__account_history_tmp time_zone 97. model.google_ads_source.stg_google_ads__account_history 97. model.google_ads_source.stg_google_ads__account_history time_zone 98. model.google_ads_source.stg_google_ads__account_history_tmp:f0->97. model.google_ads_source.stg_google_ads__account_history:f0 91. model.google_ads.google_ads__account_report 91. model.google_ads.google_ads__account_report time_zone 97. model.google_ads_source.stg_google_ads__account_history:f0->91. model.google_ads.google_ads__account_report:f0
97. model.google_ads_source.stg_google_ads__account_history
  • Input Column: 98. model.google_ads_source.stg_google_ads__account_history_tmp[time_zone]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • time_zone: Directly mapped to the output 'time_zone' column
91. model.google_ads.google_ads__account_report
  • Input Column: 97. model.google_ads_source.stg_google_ads__account_history[time_zone]
    • Direct The column is directly copied without transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • time_zone: Directly copied to output
99. model.google_ads_source.stg_google_ads__account_stats

This SQL query stages and transforms data from a Google Ads account statistics source table. It casts columns to specific data types, renames some columns, and performs basic data cleaning operations such as coalescing null values to zeros or default values. The query also converts the cost from micros to a decimal value. The final output includes selected and transformed columns from the source data.

CleaningFeaturization
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_google_ads_source.stg_google_ads__account_stats_tmp
), fields AS (
  SELECT
    CAST(NULL AS TEXT) AS _fivetran_id,
    CAST(NULL AS TIMESTAMP) AS _fivetran_synced,
    CAST(NULL AS TEXT) AS ad_network_type,
    CAST(NULL AS INT) AS clicks,
    CAST(NULL AS INT) AS cost_micros,
    CAST(NULL AS INT) AS customer_id,
    CAST(NULL AS DATE) AS date,
    CAST(NULL AS TEXT) AS device,
    CAST(NULL AS INT) AS impressions,
    CAST(NULL AS INT) AS conversions,
    CAST(NULL AS INT) AS conversions_value,
    CAST(NULL AS INT) AS view_through_conversions,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    customer_id AS account_id,
    date AS date_day,
    ad_network_type,
    device,
    COALESCE(clicks, 0) AS clicks,
    COALESCE(cost_micros, 0) / 1000000.0 AS spend,
    COALESCE(impressions, 0) AS impressions,
    COALESCE(conversions, 0) AS conversions,
    COALESCE(conversions_value, 0) AS conversions_value,
    COALESCE(view_through_conversions, 0) AS view_through_conversions
  FROM fields
)
SELECT
  *
FROM final
%3 99. model.google_ads_source.stg_google_ads__account_stats 99. model.google_ads_source.stg_google_ads__account_stats source_relation account_id date_day ad_network_type device clicks spend impressions conversions conversions_value view_through_conversions 100. model.google_ads_source.stg_google_ads__account_stats_tmp 100. model.google_ads_source.stg_google_ads__account_stats_tmp customer_id date ad_network_type clicks conversions conversions_value cost_micros device impressions view_through_conversions 100. model.google_ads_source.stg_google_ads__account_stats_tmp:f0->99. model.google_ads_source.stg_google_ads__account_stats:f1 100. model.google_ads_source.stg_google_ads__account_stats_tmp:f1->99. model.google_ads_source.stg_google_ads__account_stats:f2 100. model.google_ads_source.stg_google_ads__account_stats_tmp:f2->99. model.google_ads_source.stg_google_ads__account_stats:f3 100. model.google_ads_source.stg_google_ads__account_stats_tmp:f3->99. model.google_ads_source.stg_google_ads__account_stats:f5 100. model.google_ads_source.stg_google_ads__account_stats_tmp:f4->99. model.google_ads_source.stg_google_ads__account_stats:f8 100. model.google_ads_source.stg_google_ads__account_stats_tmp:f5->99. model.google_ads_source.stg_google_ads__account_stats:f9 100. model.google_ads_source.stg_google_ads__account_stats_tmp:f6->99. model.google_ads_source.stg_google_ads__account_stats:f6 100. model.google_ads_source.stg_google_ads__account_stats_tmp:f7->99. model.google_ads_source.stg_google_ads__account_stats:f4 100. model.google_ads_source.stg_google_ads__account_stats_tmp:f8->99. model.google_ads_source.stg_google_ads__account_stats:f7 100. model.google_ads_source.stg_google_ads__account_stats_tmp:f9->99. model.google_ads_source.stg_google_ads__account_stats:f10
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
account_id integer The Customer ID.
date_day date The date being reported on.
ad_network_type text The Google Ad network type used across the account.
device text Account ad performance per unique device where the ads were served.
clicks integer The count of clicks.
spend numeric The sum of your cost-per-click (CPC) and cost-per-thousand impressions (CPM) costs during this period.
impressions integer The count of impressions.
conversions integer The number of conversions you've received, across your conversion actions. Conversions are measured with conversion tracking and may include [modeled](https://support.google.com/google-ads/answer/10081327?sjid=12862894247631803415-NC) conversions in cases where you are not able to observe all conversions that took place. You can use this column to see how often your ads led customers to actions that you’ve defined as valuable for your business.
conversions_value integer The sum of monetary values for your `conversions`. You have to enter a value in the Google Ads UI for your conversion actions to make this metric useful.
view_through_conversions integer For video campaigns, view-through conversions tell you when an _impression_ of your video ad leads to a conversion on your site. The last impression of a video ad will get credit for the view-through conversion. Keep in mind: An impression is different than a “view” of a video ad. A “view” is counted when someone watches 30 seconds (or the whole ad if it’s shorter than 30 seconds) or clicks on a part of the ad. A “view” that leads to a conversion is counted in the `conversions` column.
Column Lineage
%3 99. model.google_ads_source.stg_google_ads__account_stats 99. model.google_ads_source.stg_google_ads__account_stats source_relation 91. model.google_ads.google_ads__account_report 91. model.google_ads.google_ads__account_report source_relation 99. model.google_ads_source.stg_google_ads__account_stats:f0->91. model.google_ads.google_ads__account_report:f0
91. model.google_ads.google_ads__account_report
  • Input Column: 99. model.google_ads_source.stg_google_ads__account_stats[source_relation]
    • Direct The column is directly copied without transformation
    • Integration Used as part of the join condition with accounts table
    • Aggregation Used in GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to output
Column Lineage
%3 100. model.google_ads_source.stg_google_ads__account_stats_tmp 100. model.google_ads_source.stg_google_ads__account_stats_tmp customer_id 99. model.google_ads_source.stg_google_ads__account_stats 99. model.google_ads_source.stg_google_ads__account_stats account_id 100. model.google_ads_source.stg_google_ads__account_stats_tmp:f0->99. model.google_ads_source.stg_google_ads__account_stats:f0 91. model.google_ads.google_ads__account_report 91. model.google_ads.google_ads__account_report account_id 99. model.google_ads_source.stg_google_ads__account_stats:f0->91. model.google_ads.google_ads__account_report:f0
99. model.google_ads_source.stg_google_ads__account_stats
  • Input Column: 100. model.google_ads_source.stg_google_ads__account_stats_tmp[customer_id]
    • Cleaning The column is cast to INT data type
    • Direct The column is directly copied to the output
    • Output Columns:
      • account_id: Directly mapped and renamed
91. model.google_ads.google_ads__account_report
  • Input Column: 99. model.google_ads_source.stg_google_ads__account_stats[account_id]
    • Direct The column is directly copied without transformation
    • Integration Used as the key to join with accounts table
    • Aggregation Used in GROUP BY clause
    • Output Columns:
      • account_id: Directly copied to output
Column Lineage
%3 100. model.google_ads_source.stg_google_ads__account_stats_tmp 100. model.google_ads_source.stg_google_ads__account_stats_tmp date 99. model.google_ads_source.stg_google_ads__account_stats 99. model.google_ads_source.stg_google_ads__account_stats date_day 100. model.google_ads_source.stg_google_ads__account_stats_tmp:f0->99. model.google_ads_source.stg_google_ads__account_stats:f0 91. model.google_ads.google_ads__account_report 91. model.google_ads.google_ads__account_report date_day 99. model.google_ads_source.stg_google_ads__account_stats:f0->91. model.google_ads.google_ads__account_report:f0
99. model.google_ads_source.stg_google_ads__account_stats
  • Input Column: 100. model.google_ads_source.stg_google_ads__account_stats_tmp[date]
    • Cleaning The column is cast to DATE data type
    • Direct The column is directly copied to the output
    • Output Columns:
      • date_day: Directly mapped and renamed
91. model.google_ads.google_ads__account_report
  • Input Column: 99. model.google_ads_source.stg_google_ads__account_stats[date_day]
    • Direct The column is directly copied without transformation
    • Aggregation Used in GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to output
Column Lineage
%3 100. model.google_ads_source.stg_google_ads__account_stats_tmp 100. model.google_ads_source.stg_google_ads__account_stats_tmp ad_network_type 99. model.google_ads_source.stg_google_ads__account_stats 99. model.google_ads_source.stg_google_ads__account_stats ad_network_type 100. model.google_ads_source.stg_google_ads__account_stats_tmp:f0->99. model.google_ads_source.stg_google_ads__account_stats:f0
99. model.google_ads_source.stg_google_ads__account_stats
  • Input Column: 100. model.google_ads_source.stg_google_ads__account_stats_tmp[ad_network_type]
    • Cleaning The column is cast to TEXT data type
    • Direct The column is directly copied to the output
    • Output Columns:
      • ad_network_type: Directly mapped
Column Lineage
%3 100. model.google_ads_source.stg_google_ads__account_stats_tmp 100. model.google_ads_source.stg_google_ads__account_stats_tmp device 99. model.google_ads_source.stg_google_ads__account_stats 99. model.google_ads_source.stg_google_ads__account_stats device 100. model.google_ads_source.stg_google_ads__account_stats_tmp:f0->99. model.google_ads_source.stg_google_ads__account_stats:f0
99. model.google_ads_source.stg_google_ads__account_stats
  • Input Column: 100. model.google_ads_source.stg_google_ads__account_stats_tmp[device]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • device: Directly mapped
Column Lineage
%3 100. model.google_ads_source.stg_google_ads__account_stats_tmp 100. model.google_ads_source.stg_google_ads__account_stats_tmp clicks 99. model.google_ads_source.stg_google_ads__account_stats 99. model.google_ads_source.stg_google_ads__account_stats clicks 100. model.google_ads_source.stg_google_ads__account_stats_tmp:f0->99. model.google_ads_source.stg_google_ads__account_stats:f0 91. model.google_ads.google_ads__account_report 91. model.google_ads.google_ads__account_report clicks 99. model.google_ads_source.stg_google_ads__account_stats:f0->91. model.google_ads.google_ads__account_report:f0
99. model.google_ads_source.stg_google_ads__account_stats
  • Input Column: 100. model.google_ads_source.stg_google_ads__account_stats_tmp[clicks]
    • Cleaning The column is coalesced with 0 to handle null values
    • Output Columns:
      • clicks: Directly mapped after cleaning
91. model.google_ads.google_ads__account_report
  • Input Column: 99. model.google_ads_source.stg_google_ads__account_stats[clicks]
    • Aggregation The column is summed up in the SELECT clause
    • Output Columns:
      • clicks: Aggregated sum in output
Column Lineage
%3 100. model.google_ads_source.stg_google_ads__account_stats_tmp 100. model.google_ads_source.stg_google_ads__account_stats_tmp cost_micros 99. model.google_ads_source.stg_google_ads__account_stats 99. model.google_ads_source.stg_google_ads__account_stats spend 100. model.google_ads_source.stg_google_ads__account_stats_tmp:f0->99. model.google_ads_source.stg_google_ads__account_stats:f0 91. model.google_ads.google_ads__account_report 91. model.google_ads.google_ads__account_report spend 99. model.google_ads_source.stg_google_ads__account_stats:f0->91. model.google_ads.google_ads__account_report:f0
99. model.google_ads_source.stg_google_ads__account_stats
  • Input Column: 100. model.google_ads_source.stg_google_ads__account_stats_tmp[cost_micros]
    • Cleaning The column is coalesced with 0 to handle null values
    • Other The value is divided by 1,000,000 to convert from micros to a decimal value
    • Output Columns:
      • spend: Transformed and mapped to this output column
91. model.google_ads.google_ads__account_report
  • Input Column: 99. model.google_ads_source.stg_google_ads__account_stats[spend]
    • Aggregation The column is summed up in the SELECT clause
    • Output Columns:
      • spend: Aggregated sum in output
Column Lineage
%3 100. model.google_ads_source.stg_google_ads__account_stats_tmp 100. model.google_ads_source.stg_google_ads__account_stats_tmp impressions 99. model.google_ads_source.stg_google_ads__account_stats 99. model.google_ads_source.stg_google_ads__account_stats impressions 100. model.google_ads_source.stg_google_ads__account_stats_tmp:f0->99. model.google_ads_source.stg_google_ads__account_stats:f0 91. model.google_ads.google_ads__account_report 91. model.google_ads.google_ads__account_report impressions 99. model.google_ads_source.stg_google_ads__account_stats:f0->91. model.google_ads.google_ads__account_report:f0
99. model.google_ads_source.stg_google_ads__account_stats
  • Input Column: 100. model.google_ads_source.stg_google_ads__account_stats_tmp[impressions]
    • Cleaning The column is coalesced with 0 to handle null values
    • Output Columns:
      • impressions: Directly mapped after cleaning
91. model.google_ads.google_ads__account_report
  • Input Column: 99. model.google_ads_source.stg_google_ads__account_stats[impressions]
    • Aggregation The column is summed up in the SELECT clause
    • Output Columns:
      • impressions: Aggregated sum in output
Column Lineage
%3 100. model.google_ads_source.stg_google_ads__account_stats_tmp 100. model.google_ads_source.stg_google_ads__account_stats_tmp conversions 99. model.google_ads_source.stg_google_ads__account_stats 99. model.google_ads_source.stg_google_ads__account_stats conversions 100. model.google_ads_source.stg_google_ads__account_stats_tmp:f0->99. model.google_ads_source.stg_google_ads__account_stats:f0 91. model.google_ads.google_ads__account_report 91. model.google_ads.google_ads__account_report conversions 99. model.google_ads_source.stg_google_ads__account_stats:f0->91. model.google_ads.google_ads__account_report:f0
99. model.google_ads_source.stg_google_ads__account_stats
  • Input Column: 100. model.google_ads_source.stg_google_ads__account_stats_tmp[conversions]
    • Cleaning The column is coalesced with 0 to handle null values
    • Output Columns:
      • conversions: Directly mapped after cleaning
91. model.google_ads.google_ads__account_report
  • Input Column: 99. model.google_ads_source.stg_google_ads__account_stats[conversions]
    • Aggregation The column is summed up in the SELECT clause
    • Output Columns:
      • conversions: Aggregated sum in output
Column Lineage
%3 100. model.google_ads_source.stg_google_ads__account_stats_tmp 100. model.google_ads_source.stg_google_ads__account_stats_tmp conversions_value 99. model.google_ads_source.stg_google_ads__account_stats 99. model.google_ads_source.stg_google_ads__account_stats conversions_value 100. model.google_ads_source.stg_google_ads__account_stats_tmp:f0->99. model.google_ads_source.stg_google_ads__account_stats:f0 91. model.google_ads.google_ads__account_report 91. model.google_ads.google_ads__account_report conversions_value 99. model.google_ads_source.stg_google_ads__account_stats:f0->91. model.google_ads.google_ads__account_report:f0
99. model.google_ads_source.stg_google_ads__account_stats
  • Input Column: 100. model.google_ads_source.stg_google_ads__account_stats_tmp[conversions_value]
    • Cleaning The column is coalesced with 0 to handle null values
    • Output Columns:
      • conversions_value: Directly mapped after cleaning
91. model.google_ads.google_ads__account_report
  • Input Column: 99. model.google_ads_source.stg_google_ads__account_stats[conversions_value]
    • Aggregation The column is summed up in the SELECT clause
    • Output Columns:
      • conversions_value: Aggregated sum in output
Column Lineage
%3 100. model.google_ads_source.stg_google_ads__account_stats_tmp 100. model.google_ads_source.stg_google_ads__account_stats_tmp view_through_conversions 99. model.google_ads_source.stg_google_ads__account_stats 99. model.google_ads_source.stg_google_ads__account_stats view_through_conversions 100. model.google_ads_source.stg_google_ads__account_stats_tmp:f0->99. model.google_ads_source.stg_google_ads__account_stats:f0 91. model.google_ads.google_ads__account_report 91. model.google_ads.google_ads__account_report view_through_conversions 99. model.google_ads_source.stg_google_ads__account_stats:f0->91. model.google_ads.google_ads__account_report:f0
99. model.google_ads_source.stg_google_ads__account_stats
  • Input Column: 100. model.google_ads_source.stg_google_ads__account_stats_tmp[view_through_conversions]
    • Cleaning The column is coalesced with 0 to handle null values
    • Output Columns:
      • view_through_conversions: Directly mapped after cleaning
91. model.google_ads.google_ads__account_report
  • Input Column: 99. model.google_ads_source.stg_google_ads__account_stats[view_through_conversions]
    • Aggregation This column is summed up in the GROUP BY clause
    • Output Columns:
      • view_through_conversions: The column is aggregated using SUM() function and mapped directly to the output column of the same name
100. model.google_ads_source.stg_google_ads__account_stats_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of TEXT data type, initialized to NULL. The LIMIT 0 clause ensures no rows are returned. This query is likely used as a placeholder or template for generating a schema without data.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 100. model.google_ads_source.stg_google_ads__account_stats_tmp 100. model.google_ads_source.stg_google_ads__account_stats_tmp _fivetran_id customer_id date _fivetran_synced active_view_impressions active_view_measurability active_view_measurable_cost_micros active_view_measurable_impressions active_view_viewability ad_network_type clicks conversions conversions_value cost_micros device impressions interaction_event_types interactions view_through_conversions 307. source.google_ads_source.google_ads.account_stats 307. source.google_ads_source.google_ads.account_stats
Name Type Comment
_fivetran_id text None
customer_id integer None
date date None
_fivetran_synced timestamp without time zone None
active_view_impressions integer None
active_view_measurability integer None
active_view_measurable_cost_micros integer None
active_view_measurable_impressions integer None
active_view_viewability integer None
ad_network_type text None
clicks integer None
conversions integer None
conversions_value integer None
cost_micros integer None
device text None
impressions integer None
interaction_event_types text None
interactions integer None
view_through_conversions integer None
Column Lineage
%3 100. model.google_ads_source.stg_google_ads__account_stats_tmp 100. model.google_ads_source.stg_google_ads__account_stats_tmp customer_id 99. model.google_ads_source.stg_google_ads__account_stats 99. model.google_ads_source.stg_google_ads__account_stats account_id 100. model.google_ads_source.stg_google_ads__account_stats_tmp:f0->99. model.google_ads_source.stg_google_ads__account_stats:f0 91. model.google_ads.google_ads__account_report 91. model.google_ads.google_ads__account_report account_id 99. model.google_ads_source.stg_google_ads__account_stats:f0->91. model.google_ads.google_ads__account_report:f0
99. model.google_ads_source.stg_google_ads__account_stats
  • Input Column: 100. model.google_ads_source.stg_google_ads__account_stats_tmp[customer_id]
    • Cleaning The column is cast to INT data type
    • Direct The column is directly copied to the output
    • Output Columns:
      • account_id: Directly mapped and renamed
91. model.google_ads.google_ads__account_report
  • Input Column: 99. model.google_ads_source.stg_google_ads__account_stats[account_id]
    • Direct The column is directly copied without transformation
    • Integration Used as the key to join with accounts table
    • Aggregation Used in GROUP BY clause
    • Output Columns:
      • account_id: Directly copied to output
Column Lineage
%3 100. model.google_ads_source.stg_google_ads__account_stats_tmp 100. model.google_ads_source.stg_google_ads__account_stats_tmp date 99. model.google_ads_source.stg_google_ads__account_stats 99. model.google_ads_source.stg_google_ads__account_stats date_day 100. model.google_ads_source.stg_google_ads__account_stats_tmp:f0->99. model.google_ads_source.stg_google_ads__account_stats:f0 91. model.google_ads.google_ads__account_report 91. model.google_ads.google_ads__account_report date_day 99. model.google_ads_source.stg_google_ads__account_stats:f0->91. model.google_ads.google_ads__account_report:f0
99. model.google_ads_source.stg_google_ads__account_stats
  • Input Column: 100. model.google_ads_source.stg_google_ads__account_stats_tmp[date]
    • Cleaning The column is cast to DATE data type
    • Direct The column is directly copied to the output
    • Output Columns:
      • date_day: Directly mapped and renamed
91. model.google_ads.google_ads__account_report
  • Input Column: 99. model.google_ads_source.stg_google_ads__account_stats[date_day]
    • Direct The column is directly copied without transformation
    • Aggregation Used in GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to output
Column Lineage
%3 100. model.google_ads_source.stg_google_ads__account_stats_tmp 100. model.google_ads_source.stg_google_ads__account_stats_tmp ad_network_type 99. model.google_ads_source.stg_google_ads__account_stats 99. model.google_ads_source.stg_google_ads__account_stats ad_network_type 100. model.google_ads_source.stg_google_ads__account_stats_tmp:f0->99. model.google_ads_source.stg_google_ads__account_stats:f0
99. model.google_ads_source.stg_google_ads__account_stats
  • Input Column: 100. model.google_ads_source.stg_google_ads__account_stats_tmp[ad_network_type]
    • Cleaning The column is cast to TEXT data type
    • Direct The column is directly copied to the output
    • Output Columns:
      • ad_network_type: Directly mapped
Column Lineage
%3 100. model.google_ads_source.stg_google_ads__account_stats_tmp 100. model.google_ads_source.stg_google_ads__account_stats_tmp clicks 99. model.google_ads_source.stg_google_ads__account_stats 99. model.google_ads_source.stg_google_ads__account_stats clicks 100. model.google_ads_source.stg_google_ads__account_stats_tmp:f0->99. model.google_ads_source.stg_google_ads__account_stats:f0 91. model.google_ads.google_ads__account_report 91. model.google_ads.google_ads__account_report clicks 99. model.google_ads_source.stg_google_ads__account_stats:f0->91. model.google_ads.google_ads__account_report:f0
99. model.google_ads_source.stg_google_ads__account_stats
  • Input Column: 100. model.google_ads_source.stg_google_ads__account_stats_tmp[clicks]
    • Cleaning The column is coalesced with 0 to handle null values
    • Output Columns:
      • clicks: Directly mapped after cleaning
91. model.google_ads.google_ads__account_report
  • Input Column: 99. model.google_ads_source.stg_google_ads__account_stats[clicks]
    • Aggregation The column is summed up in the SELECT clause
    • Output Columns:
      • clicks: Aggregated sum in output
Column Lineage
%3 100. model.google_ads_source.stg_google_ads__account_stats_tmp 100. model.google_ads_source.stg_google_ads__account_stats_tmp conversions 99. model.google_ads_source.stg_google_ads__account_stats 99. model.google_ads_source.stg_google_ads__account_stats conversions 100. model.google_ads_source.stg_google_ads__account_stats_tmp:f0->99. model.google_ads_source.stg_google_ads__account_stats:f0 91. model.google_ads.google_ads__account_report 91. model.google_ads.google_ads__account_report conversions 99. model.google_ads_source.stg_google_ads__account_stats:f0->91. model.google_ads.google_ads__account_report:f0
99. model.google_ads_source.stg_google_ads__account_stats
  • Input Column: 100. model.google_ads_source.stg_google_ads__account_stats_tmp[conversions]
    • Cleaning The column is coalesced with 0 to handle null values
    • Output Columns:
      • conversions: Directly mapped after cleaning
91. model.google_ads.google_ads__account_report
  • Input Column: 99. model.google_ads_source.stg_google_ads__account_stats[conversions]
    • Aggregation The column is summed up in the SELECT clause
    • Output Columns:
      • conversions: Aggregated sum in output
Column Lineage
%3 100. model.google_ads_source.stg_google_ads__account_stats_tmp 100. model.google_ads_source.stg_google_ads__account_stats_tmp conversions_value 99. model.google_ads_source.stg_google_ads__account_stats 99. model.google_ads_source.stg_google_ads__account_stats conversions_value 100. model.google_ads_source.stg_google_ads__account_stats_tmp:f0->99. model.google_ads_source.stg_google_ads__account_stats:f0 91. model.google_ads.google_ads__account_report 91. model.google_ads.google_ads__account_report conversions_value 99. model.google_ads_source.stg_google_ads__account_stats:f0->91. model.google_ads.google_ads__account_report:f0
99. model.google_ads_source.stg_google_ads__account_stats
  • Input Column: 100. model.google_ads_source.stg_google_ads__account_stats_tmp[conversions_value]
    • Cleaning The column is coalesced with 0 to handle null values
    • Output Columns:
      • conversions_value: Directly mapped after cleaning
91. model.google_ads.google_ads__account_report
  • Input Column: 99. model.google_ads_source.stg_google_ads__account_stats[conversions_value]
    • Aggregation The column is summed up in the SELECT clause
    • Output Columns:
      • conversions_value: Aggregated sum in output
Column Lineage
%3 100. model.google_ads_source.stg_google_ads__account_stats_tmp 100. model.google_ads_source.stg_google_ads__account_stats_tmp cost_micros 99. model.google_ads_source.stg_google_ads__account_stats 99. model.google_ads_source.stg_google_ads__account_stats spend 100. model.google_ads_source.stg_google_ads__account_stats_tmp:f0->99. model.google_ads_source.stg_google_ads__account_stats:f0 91. model.google_ads.google_ads__account_report 91. model.google_ads.google_ads__account_report spend 99. model.google_ads_source.stg_google_ads__account_stats:f0->91. model.google_ads.google_ads__account_report:f0
99. model.google_ads_source.stg_google_ads__account_stats
  • Input Column: 100. model.google_ads_source.stg_google_ads__account_stats_tmp[cost_micros]
    • Cleaning The column is coalesced with 0 to handle null values
    • Other The value is divided by 1,000,000 to convert from micros to a decimal value
    • Output Columns:
      • spend: Transformed and mapped to this output column
91. model.google_ads.google_ads__account_report
  • Input Column: 99. model.google_ads_source.stg_google_ads__account_stats[spend]
    • Aggregation The column is summed up in the SELECT clause
    • Output Columns:
      • spend: Aggregated sum in output
Column Lineage
%3 100. model.google_ads_source.stg_google_ads__account_stats_tmp 100. model.google_ads_source.stg_google_ads__account_stats_tmp device 99. model.google_ads_source.stg_google_ads__account_stats 99. model.google_ads_source.stg_google_ads__account_stats device 100. model.google_ads_source.stg_google_ads__account_stats_tmp:f0->99. model.google_ads_source.stg_google_ads__account_stats:f0
99. model.google_ads_source.stg_google_ads__account_stats
  • Input Column: 100. model.google_ads_source.stg_google_ads__account_stats_tmp[device]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • device: Directly mapped
Column Lineage
%3 100. model.google_ads_source.stg_google_ads__account_stats_tmp 100. model.google_ads_source.stg_google_ads__account_stats_tmp impressions 99. model.google_ads_source.stg_google_ads__account_stats 99. model.google_ads_source.stg_google_ads__account_stats impressions 100. model.google_ads_source.stg_google_ads__account_stats_tmp:f0->99. model.google_ads_source.stg_google_ads__account_stats:f0 91. model.google_ads.google_ads__account_report 91. model.google_ads.google_ads__account_report impressions 99. model.google_ads_source.stg_google_ads__account_stats:f0->91. model.google_ads.google_ads__account_report:f0
99. model.google_ads_source.stg_google_ads__account_stats
  • Input Column: 100. model.google_ads_source.stg_google_ads__account_stats_tmp[impressions]
    • Cleaning The column is coalesced with 0 to handle null values
    • Output Columns:
      • impressions: Directly mapped after cleaning
91. model.google_ads.google_ads__account_report
  • Input Column: 99. model.google_ads_source.stg_google_ads__account_stats[impressions]
    • Aggregation The column is summed up in the SELECT clause
    • Output Columns:
      • impressions: Aggregated sum in output
Column Lineage
%3 100. model.google_ads_source.stg_google_ads__account_stats_tmp 100. model.google_ads_source.stg_google_ads__account_stats_tmp view_through_conversions 99. model.google_ads_source.stg_google_ads__account_stats 99. model.google_ads_source.stg_google_ads__account_stats view_through_conversions 100. model.google_ads_source.stg_google_ads__account_stats_tmp:f0->99. model.google_ads_source.stg_google_ads__account_stats:f0 91. model.google_ads.google_ads__account_report 91. model.google_ads.google_ads__account_report view_through_conversions 99. model.google_ads_source.stg_google_ads__account_stats:f0->91. model.google_ads.google_ads__account_report:f0
99. model.google_ads_source.stg_google_ads__account_stats
  • Input Column: 100. model.google_ads_source.stg_google_ads__account_stats_tmp[view_through_conversions]
    • Cleaning The column is coalesced with 0 to handle null values
    • Output Columns:
      • view_through_conversions: Directly mapped after cleaning
91. model.google_ads.google_ads__account_report
  • Input Column: 99. model.google_ads_source.stg_google_ads__account_stats[view_through_conversions]
    • Aggregation This column is summed up in the GROUP BY clause
    • Output Columns:
      • view_through_conversions: The column is aggregated using SUM() function and mapped directly to the output column of the same name
101. model.google_ads_source.stg_google_ads__ad_group_criterion_history

This SQL query stages data from a Google Ads source table, casting various fields to specific data types, and then selects and transforms these fields. It adds a 'source_relation' field, renames 'id' to 'criterion_id', and adds an 'is_most_recent_record' flag based on the most recent 'updated_at' timestamp for each unique combination of 'source_relation' and 'id'. The query also filters out records where '_fivetran_active' is false.

CleaningDeduplicationFiltering
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_google_ads_source.stg_google_ads__ad_group_criterion_history_tmp
), fields AS (
  SELECT
    CAST(NULL AS INT) AS id,
    CAST(NULL AS INT) AS ad_group_id,
    CAST(NULL AS INT) AS base_campaign_id,
    CAST(NULL AS TIMESTAMP) AS _fivetran_synced,
    CAST(NULL AS TIMESTAMP) AS updated_at,
    CAST(NULL AS TEXT) AS type,
    CAST(NULL AS TEXT) AS status,
    CAST(NULL AS TEXT) AS keyword_match_type,
    CAST(NULL AS TEXT) AS keyword_text,
    CAST(NULL AS BOOLEAN) AS _fivetran_active,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    id AS criterion_id,
    CAST(ad_group_id AS TEXT) AS ad_group_id,
    base_campaign_id,
    updated_at,
    type,
    status,
    keyword_match_type,
    keyword_text,
    ROW_NUMBER() OVER (PARTITION BY source_relation, id ORDER BY updated_at DESC) = 1 AS is_most_recent_record
  FROM fields
  WHERE
    COALESCE(_fivetran_active, TRUE)
)
SELECT
  *
FROM final
%3 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history source_relation criterion_id ad_group_id base_campaign_id updated_at type status keyword_match_type keyword_text is_most_recent_record 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp id ad_group_id base_campaign_id updated_at type status keyword_match_type keyword_text 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp:f0->101. model.google_ads_source.stg_google_ads__ad_group_criterion_history:f1 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp:f1->101. model.google_ads_source.stg_google_ads__ad_group_criterion_history:f2 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp:f2->101. model.google_ads_source.stg_google_ads__ad_group_criterion_history:f3 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp:f3->101. model.google_ads_source.stg_google_ads__ad_group_criterion_history:f4 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp:f3->101. model.google_ads_source.stg_google_ads__ad_group_criterion_history:f9 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp:f4->101. model.google_ads_source.stg_google_ads__ad_group_criterion_history:f5 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp:f5->101. model.google_ads_source.stg_google_ads__ad_group_criterion_history:f6 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp:f6->101. model.google_ads_source.stg_google_ads__ad_group_criterion_history:f7 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp:f7->101. model.google_ads_source.stg_google_ads__ad_group_criterion_history:f8
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
criterion_id bigint Unique identifier of the ad group criterion.
ad_group_id text The ID representing the ad group, if present in the source data.
base_campaign_id bigint The ID representing the campaign, if present in the source data.
updated_at timestamp without time zone Timestamp of when the record was last updated in Google Ads.
type text The type of ad group criterion.
status text The current status of the ad group criterion.
keyword_match_type text The match type which dictate how closely the keyword needs to match with the user’s search query so that the ad can be considered for the auction.
keyword_text text The text used within the keyword criterion that is being matched against.
is_most_recent_record boolean Boolean representing whether the record is the most recent version of the object.
Column Lineage
%3 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history source_relation 95. model.google_ads.google_ads__keyword_report 95. model.google_ads.google_ads__keyword_report source_relation 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history:f0->95. model.google_ads.google_ads__keyword_report:f0
95. model.google_ads.google_ads__keyword_report
  • Input Column: 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history[source_relation]
    • Integration used as a key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
Column Lineage
%3 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp id 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history criterion_id 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp:f0->101. model.google_ads_source.stg_google_ads__ad_group_criterion_history:f0 95. model.google_ads.google_ads__keyword_report 95. model.google_ads.google_ads__keyword_report criterion_id 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history:f0->95. model.google_ads.google_ads__keyword_report:f0
101. model.google_ads_source.stg_google_ads__ad_group_criterion_history
  • Input Column: 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp[id]
    • Cleaning The column is cast to INT type
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • criterion_id: Directly mapped and renamed
95. model.google_ads.google_ads__keyword_report
  • Input Column: 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history[criterion_id]
    • Integration used as a key to join with the stats table
    • Direct directly copied to the output
    • Output Columns:
      • criterion_id: directly copied
Column Lineage
%3 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp ad_group_id 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history ad_group_id 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp:f0->101. model.google_ads_source.stg_google_ads__ad_group_criterion_history:f0
101. model.google_ads_source.stg_google_ads__ad_group_criterion_history
  • Input Column: 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp[ad_group_id]
    • Cleaning The column is cast to INT type, then to TEXT type
    • Output Columns:
      • ad_group_id: Directly mapped after casting
Column Lineage
%3 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp base_campaign_id 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history base_campaign_id 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp:f0->101. model.google_ads_source.stg_google_ads__ad_group_criterion_history:f0
101. model.google_ads_source.stg_google_ads__ad_group_criterion_history
  • Input Column: 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp[base_campaign_id]
    • Cleaning The column is cast to INT type
    • Output Columns:
      • base_campaign_id: Directly mapped
Column Lineage
%3 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp updated_at 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history is_most_recent_record updated_at 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp:f0->101. model.google_ads_source.stg_google_ads__ad_group_criterion_history:f1 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp:f0->101. model.google_ads_source.stg_google_ads__ad_group_criterion_history:f0
101. model.google_ads_source.stg_google_ads__ad_group_criterion_history
  • Input Column: 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp[updated_at]
    • Cleaning The column is cast to TIMESTAMP type
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • updated_at: Directly mapped
      • is_most_recent_record: Used to determine if the record is the most recent
Column Lineage
%3 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp type 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history type 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp:f0->101. model.google_ads_source.stg_google_ads__ad_group_criterion_history:f0 95. model.google_ads.google_ads__keyword_report 95. model.google_ads.google_ads__keyword_report type 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history:f0->95. model.google_ads.google_ads__keyword_report:f0
101. model.google_ads_source.stg_google_ads__ad_group_criterion_history
  • Input Column: 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp[type]
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • type: Directly mapped
95. model.google_ads.google_ads__keyword_report
  • Input Column: 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history[type]
    • Direct directly copied to the output
    • Output Columns:
      • type: directly copied
Column Lineage
%3 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp status 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history status 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp:f0->101. model.google_ads_source.stg_google_ads__ad_group_criterion_history:f0 95. model.google_ads.google_ads__keyword_report 95. model.google_ads.google_ads__keyword_report status 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history:f0->95. model.google_ads.google_ads__keyword_report:f0
101. model.google_ads_source.stg_google_ads__ad_group_criterion_history
  • Input Column: 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp[status]
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • status: Directly mapped
95. model.google_ads.google_ads__keyword_report
  • Input Column: 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history[status]
    • Direct directly copied to the output
    • Output Columns:
      • status: directly copied
Column Lineage
%3 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp keyword_match_type 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history keyword_match_type 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp:f0->101. model.google_ads_source.stg_google_ads__ad_group_criterion_history:f0 95. model.google_ads.google_ads__keyword_report 95. model.google_ads.google_ads__keyword_report keyword_match_type 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history:f0->95. model.google_ads.google_ads__keyword_report:f0
101. model.google_ads_source.stg_google_ads__ad_group_criterion_history
  • Input Column: 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp[keyword_match_type]
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • keyword_match_type: Directly mapped
95. model.google_ads.google_ads__keyword_report
  • Input Column: 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history[keyword_match_type]
    • Direct directly copied to the output
    • Output Columns:
      • keyword_match_type: directly copied
Column Lineage
%3 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp keyword_text 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history keyword_text 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp:f0->101. model.google_ads_source.stg_google_ads__ad_group_criterion_history:f0 95. model.google_ads.google_ads__keyword_report 95. model.google_ads.google_ads__keyword_report keyword_text 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history:f0->95. model.google_ads.google_ads__keyword_report:f0
101. model.google_ads_source.stg_google_ads__ad_group_criterion_history
  • Input Column: 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp[keyword_text]
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • keyword_text: Directly mapped
95. model.google_ads.google_ads__keyword_report
  • Input Column: 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history[keyword_text]
    • Direct directly copied to the output
    • Output Columns:
      • keyword_text: directly copied
Column Lineage
%3 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp updated_at 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history is_most_recent_record updated_at 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp:f0->101. model.google_ads_source.stg_google_ads__ad_group_criterion_history:f1 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp:f0->101. model.google_ads_source.stg_google_ads__ad_group_criterion_history:f0
101. model.google_ads_source.stg_google_ads__ad_group_criterion_history
  • Input Column: 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp[updated_at]
    • Cleaning The column is cast to TIMESTAMP type
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • updated_at: Directly mapped
      • is_most_recent_record: Used to determine if the record is the most recent
102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of type TEXT, which is set to NULL. The query is limited to 0 rows, effectively returning no data. This type of query is often used as a placeholder or template in data modeling tools like dbt.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp id ad_group_id base_campaign_id updated_at _fivetran_synced type status keyword_match_type keyword_text 308. source.google_ads_source.google_ads.ad_group_criterion_history 308. source.google_ads_source.google_ads.ad_group_criterion_history
Name Type Comment
id bigint None
ad_group_id bigint None
base_campaign_id bigint None
updated_at timestamp without time zone None
_fivetran_synced timestamp without time zone None
type text None
status text None
keyword_match_type text None
keyword_text text None
Column Lineage
%3 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp id 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history criterion_id 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp:f0->101. model.google_ads_source.stg_google_ads__ad_group_criterion_history:f0 95. model.google_ads.google_ads__keyword_report 95. model.google_ads.google_ads__keyword_report criterion_id 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history:f0->95. model.google_ads.google_ads__keyword_report:f0
101. model.google_ads_source.stg_google_ads__ad_group_criterion_history
  • Input Column: 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp[id]
    • Cleaning The column is cast to INT type
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • criterion_id: Directly mapped and renamed
95. model.google_ads.google_ads__keyword_report
  • Input Column: 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history[criterion_id]
    • Integration used as a key to join with the stats table
    • Direct directly copied to the output
    • Output Columns:
      • criterion_id: directly copied
Column Lineage
%3 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp ad_group_id 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history ad_group_id 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp:f0->101. model.google_ads_source.stg_google_ads__ad_group_criterion_history:f0
101. model.google_ads_source.stg_google_ads__ad_group_criterion_history
  • Input Column: 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp[ad_group_id]
    • Cleaning The column is cast to INT type, then to TEXT type
    • Output Columns:
      • ad_group_id: Directly mapped after casting
Column Lineage
%3 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp base_campaign_id 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history base_campaign_id 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp:f0->101. model.google_ads_source.stg_google_ads__ad_group_criterion_history:f0
101. model.google_ads_source.stg_google_ads__ad_group_criterion_history
  • Input Column: 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp[base_campaign_id]
    • Cleaning The column is cast to INT type
    • Output Columns:
      • base_campaign_id: Directly mapped
Column Lineage
%3 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp updated_at 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history is_most_recent_record updated_at 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp:f0->101. model.google_ads_source.stg_google_ads__ad_group_criterion_history:f1 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp:f0->101. model.google_ads_source.stg_google_ads__ad_group_criterion_history:f0
101. model.google_ads_source.stg_google_ads__ad_group_criterion_history
  • Input Column: 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp[updated_at]
    • Cleaning The column is cast to TIMESTAMP type
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • updated_at: Directly mapped
      • is_most_recent_record: Used to determine if the record is the most recent
Column Lineage
%3 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp type 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history type 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp:f0->101. model.google_ads_source.stg_google_ads__ad_group_criterion_history:f0 95. model.google_ads.google_ads__keyword_report 95. model.google_ads.google_ads__keyword_report type 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history:f0->95. model.google_ads.google_ads__keyword_report:f0
101. model.google_ads_source.stg_google_ads__ad_group_criterion_history
  • Input Column: 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp[type]
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • type: Directly mapped
95. model.google_ads.google_ads__keyword_report
  • Input Column: 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history[type]
    • Direct directly copied to the output
    • Output Columns:
      • type: directly copied
Column Lineage
%3 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp status 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history status 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp:f0->101. model.google_ads_source.stg_google_ads__ad_group_criterion_history:f0 95. model.google_ads.google_ads__keyword_report 95. model.google_ads.google_ads__keyword_report status 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history:f0->95. model.google_ads.google_ads__keyword_report:f0
101. model.google_ads_source.stg_google_ads__ad_group_criterion_history
  • Input Column: 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp[status]
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • status: Directly mapped
95. model.google_ads.google_ads__keyword_report
  • Input Column: 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history[status]
    • Direct directly copied to the output
    • Output Columns:
      • status: directly copied
Column Lineage
%3 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp keyword_match_type 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history keyword_match_type 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp:f0->101. model.google_ads_source.stg_google_ads__ad_group_criterion_history:f0 95. model.google_ads.google_ads__keyword_report 95. model.google_ads.google_ads__keyword_report keyword_match_type 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history:f0->95. model.google_ads.google_ads__keyword_report:f0
101. model.google_ads_source.stg_google_ads__ad_group_criterion_history
  • Input Column: 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp[keyword_match_type]
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • keyword_match_type: Directly mapped
95. model.google_ads.google_ads__keyword_report
  • Input Column: 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history[keyword_match_type]
    • Direct directly copied to the output
    • Output Columns:
      • keyword_match_type: directly copied
Column Lineage
%3 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp keyword_text 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history keyword_text 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp:f0->101. model.google_ads_source.stg_google_ads__ad_group_criterion_history:f0 95. model.google_ads.google_ads__keyword_report 95. model.google_ads.google_ads__keyword_report keyword_text 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history:f0->95. model.google_ads.google_ads__keyword_report:f0
101. model.google_ads_source.stg_google_ads__ad_group_criterion_history
  • Input Column: 102. model.google_ads_source.stg_google_ads__ad_group_criterion_history_tmp[keyword_text]
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • keyword_text: Directly mapped
95. model.google_ads.google_ads__keyword_report
  • Input Column: 101. model.google_ads_source.stg_google_ads__ad_group_criterion_history[keyword_text]
    • Direct directly copied to the output
    • Output Columns:
      • keyword_text: directly copied
103. model.google_ads_source.stg_google_ads__ad_group_history

This SQL query processes data from a Google Ads ad group history table. It casts fields to specific data types, renames some columns, and adds a flag to identify the most recent record for each ad group. The query also filters out inactive records and selects specific columns for the final output.

CleaningDeduplicationFiltering
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_google_ads_source.stg_google_ads__ad_group_history_tmp
), fields AS (
  SELECT
    CAST(NULL AS INT) AS campaign_id,
    CAST(NULL AS TEXT) AS campaign_name,
    CAST(NULL AS INT) AS id,
    CAST(NULL AS TEXT) AS name,
    CAST(NULL AS TEXT) AS status,
    CAST(NULL AS TEXT) AS type,
    CAST(NULL AS TIMESTAMP) AS updated_at,
    CAST(NULL AS BOOLEAN) AS _fivetran_active,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    CAST(id AS TEXT) AS ad_group_id,
    updated_at,
    type AS ad_group_type,
    campaign_id,
    campaign_name,
    name AS ad_group_name,
    status AS ad_group_status,
    ROW_NUMBER() OVER (PARTITION BY source_relation, id ORDER BY updated_at DESC) = 1 AS is_most_recent_record
  FROM fields
  WHERE
    COALESCE(_fivetran_active, TRUE)
)
SELECT
  *
FROM final
%3 103. model.google_ads_source.stg_google_ads__ad_group_history 103. model.google_ads_source.stg_google_ads__ad_group_history source_relation ad_group_id updated_at ad_group_type campaign_id campaign_name ad_group_name ad_group_status is_most_recent_record 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp id updated_at type campaign_id campaign_name name status 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp:f0->103. model.google_ads_source.stg_google_ads__ad_group_history:f1 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp:f1->103. model.google_ads_source.stg_google_ads__ad_group_history:f2 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp:f2->103. model.google_ads_source.stg_google_ads__ad_group_history:f3 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp:f3->103. model.google_ads_source.stg_google_ads__ad_group_history:f4 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp:f4->103. model.google_ads_source.stg_google_ads__ad_group_history:f5 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp:f5->103. model.google_ads_source.stg_google_ads__ad_group_history:f6 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp:f6->103. model.google_ads_source.stg_google_ads__ad_group_history:f7
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
ad_group_id text The ID representing the ad group, if present in the source data.
updated_at timestamp without time zone Timestamp of when the record was last updated in Google Ads.
ad_group_type text The type of the ad group in Google Ads.
campaign_id bigint The ID representing the campaign, if present in the source data.
campaign_name text The name of the campaign, if present in the source data.
ad_group_name text The name of the ad group, if present in the source data.
ad_group_status text Status of the ad group.
is_most_recent_record boolean Boolean representing whether the record is the most recent version of the object.
Column Lineage
%3 103. model.google_ads_source.stg_google_ads__ad_group_history 103. model.google_ads_source.stg_google_ads__ad_group_history source_relation 92. model.google_ads.google_ads__ad_group_report 92. model.google_ads.google_ads__ad_group_report source_relation 103. model.google_ads_source.stg_google_ads__ad_group_history:f0->92. model.google_ads.google_ads__ad_group_report:f0 93. model.google_ads.google_ads__ad_report 93. model.google_ads.google_ads__ad_report source_relation 103. model.google_ads_source.stg_google_ads__ad_group_history:f0->93. model.google_ads.google_ads__ad_report:f0 95. model.google_ads.google_ads__keyword_report 95. model.google_ads.google_ads__keyword_report source_relation 103. model.google_ads_source.stg_google_ads__ad_group_history:f0->95. model.google_ads.google_ads__keyword_report:f0 96. model.google_ads.google_ads__url_report 96. model.google_ads.google_ads__url_report source_relation 103. model.google_ads_source.stg_google_ads__ad_group_history:f0->96. model.google_ads.google_ads__url_report:f0
92. model.google_ads.google_ads__ad_group_report
  • Input Column: 103. model.google_ads_source.stg_google_ads__ad_group_history[source_relation]
    • Direct The column is directly copied without transformation
    • Integration Used as part of the JOIN condition
    • Output Columns:
      • source_relation: Directly copied to the output
93. model.google_ads.google_ads__ad_report
  • Input Column: 103. model.google_ads_source.stg_google_ads__ad_group_history[source_relation]
    • Integration used as a key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
95. model.google_ads.google_ads__keyword_report
  • Input Column: 103. model.google_ads_source.stg_google_ads__ad_group_history[source_relation]
    • Integration used as a key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
96. model.google_ads.google_ads__url_report
  • Input Column: 103. model.google_ads_source.stg_google_ads__ad_group_history[source_relation]
    • Integration used as a key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
Column Lineage
%3 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp id 103. model.google_ads_source.stg_google_ads__ad_group_history 103. model.google_ads_source.stg_google_ads__ad_group_history ad_group_id 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp:f0->103. model.google_ads_source.stg_google_ads__ad_group_history:f0 92. model.google_ads.google_ads__ad_group_report 92. model.google_ads.google_ads__ad_group_report ad_group_id 103. model.google_ads_source.stg_google_ads__ad_group_history:f0->92. model.google_ads.google_ads__ad_group_report:f0 93. model.google_ads.google_ads__ad_report 93. model.google_ads.google_ads__ad_report ad_group_id 103. model.google_ads_source.stg_google_ads__ad_group_history:f0->93. model.google_ads.google_ads__ad_report:f0 95. model.google_ads.google_ads__keyword_report 95. model.google_ads.google_ads__keyword_report ad_group_id 103. model.google_ads_source.stg_google_ads__ad_group_history:f0->95. model.google_ads.google_ads__keyword_report:f0 96. model.google_ads.google_ads__url_report 96. model.google_ads.google_ads__url_report ad_group_id 103. model.google_ads_source.stg_google_ads__ad_group_history:f0->96. model.google_ads.google_ads__url_report:f0
103. model.google_ads_source.stg_google_ads__ad_group_history
  • Input Column: 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp[id]
    • Cleaning The column is cast to TEXT type
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • ad_group_id: Directly mapped after casting to TEXT
92. model.google_ads.google_ads__ad_group_report
  • Input Column: 103. model.google_ads_source.stg_google_ads__ad_group_history[ad_group_id]
    • Direct The column is directly copied without transformation
    • Integration Used as part of the JOIN condition
    • Output Columns:
      • ad_group_id: Directly copied to the output
93. model.google_ads.google_ads__ad_report
  • Input Column: 103. model.google_ads_source.stg_google_ads__ad_group_history[ad_group_id]
    • Integration used as a key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_id: directly copied
95. model.google_ads.google_ads__keyword_report
  • Input Column: 103. model.google_ads_source.stg_google_ads__ad_group_history[ad_group_id]
    • Integration used as a key to join with the stats table
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_id: directly copied
96. model.google_ads.google_ads__url_report
  • Input Column: 103. model.google_ads_source.stg_google_ads__ad_group_history[ad_group_id]
    • Integration used as a key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_id: directly copied
Column Lineage
%3 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp updated_at 103. model.google_ads_source.stg_google_ads__ad_group_history 103. model.google_ads_source.stg_google_ads__ad_group_history updated_at 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp:f0->103. model.google_ads_source.stg_google_ads__ad_group_history:f0
103. model.google_ads_source.stg_google_ads__ad_group_history
  • Input Column: 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp[updated_at]
    • Direct Copied without transformation
    • Deduplication Used in the ROW_NUMBER() function to order and identify the most recent record
    • Output Columns:
      • updated_at: Directly mapped
Column Lineage
%3 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp type 103. model.google_ads_source.stg_google_ads__ad_group_history 103. model.google_ads_source.stg_google_ads__ad_group_history ad_group_type 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp:f0->103. model.google_ads_source.stg_google_ads__ad_group_history:f0 92. model.google_ads.google_ads__ad_group_report 92. model.google_ads.google_ads__ad_group_report ad_group_type 103. model.google_ads_source.stg_google_ads__ad_group_history:f0->92. model.google_ads.google_ads__ad_group_report:f0
103. model.google_ads_source.stg_google_ads__ad_group_history
  • Input Column: 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp[type]
    • Direct Copied without transformation
    • Output Columns:
      • ad_group_type: Directly mapped and renamed
92. model.google_ads.google_ads__ad_group_report
  • Input Column: 103. model.google_ads_source.stg_google_ads__ad_group_history[ad_group_type]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • ad_group_type: Directly copied to the output
Column Lineage
%3 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp campaign_id 103. model.google_ads_source.stg_google_ads__ad_group_history 103. model.google_ads_source.stg_google_ads__ad_group_history campaign_id 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp:f0->103. model.google_ads_source.stg_google_ads__ad_group_history:f0
103. model.google_ads_source.stg_google_ads__ad_group_history
  • Input Column: 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp[campaign_id]
    • Direct Copied without transformation
    • Output Columns:
      • campaign_id: Directly mapped
Column Lineage
%3 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp campaign_name 103. model.google_ads_source.stg_google_ads__ad_group_history 103. model.google_ads_source.stg_google_ads__ad_group_history campaign_name 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp:f0->103. model.google_ads_source.stg_google_ads__ad_group_history:f0
103. model.google_ads_source.stg_google_ads__ad_group_history
  • Input Column: 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp[campaign_name]
    • Direct Copied without transformation
    • Output Columns:
      • campaign_name: Directly mapped
Column Lineage
%3 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp name 103. model.google_ads_source.stg_google_ads__ad_group_history 103. model.google_ads_source.stg_google_ads__ad_group_history ad_group_name 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp:f0->103. model.google_ads_source.stg_google_ads__ad_group_history:f0 92. model.google_ads.google_ads__ad_group_report 92. model.google_ads.google_ads__ad_group_report ad_group_name 103. model.google_ads_source.stg_google_ads__ad_group_history:f0->92. model.google_ads.google_ads__ad_group_report:f0 93. model.google_ads.google_ads__ad_report 93. model.google_ads.google_ads__ad_report ad_group_name 103. model.google_ads_source.stg_google_ads__ad_group_history:f0->93. model.google_ads.google_ads__ad_report:f0 95. model.google_ads.google_ads__keyword_report 95. model.google_ads.google_ads__keyword_report ad_group_name 103. model.google_ads_source.stg_google_ads__ad_group_history:f0->95. model.google_ads.google_ads__keyword_report:f0 96. model.google_ads.google_ads__url_report 96. model.google_ads.google_ads__url_report ad_group_name 103. model.google_ads_source.stg_google_ads__ad_group_history:f0->96. model.google_ads.google_ads__url_report:f0
103. model.google_ads_source.stg_google_ads__ad_group_history
  • Input Column: 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp[name]
    • Direct Copied without transformation
    • Output Columns:
      • ad_group_name: Directly mapped and renamed
92. model.google_ads.google_ads__ad_group_report
  • Input Column: 103. model.google_ads_source.stg_google_ads__ad_group_history[ad_group_name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • ad_group_name: Directly copied to the output
93. model.google_ads.google_ads__ad_report
  • Input Column: 103. model.google_ads_source.stg_google_ads__ad_group_history[ad_group_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_name: directly copied
95. model.google_ads.google_ads__keyword_report
  • Input Column: 103. model.google_ads_source.stg_google_ads__ad_group_history[ad_group_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_name: directly copied
96. model.google_ads.google_ads__url_report
  • Input Column: 103. model.google_ads_source.stg_google_ads__ad_group_history[ad_group_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_name: directly copied
Column Lineage
%3 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp status 103. model.google_ads_source.stg_google_ads__ad_group_history 103. model.google_ads_source.stg_google_ads__ad_group_history ad_group_status 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp:f0->103. model.google_ads_source.stg_google_ads__ad_group_history:f0 92. model.google_ads.google_ads__ad_group_report 92. model.google_ads.google_ads__ad_group_report ad_group_status 103. model.google_ads_source.stg_google_ads__ad_group_history:f0->92. model.google_ads.google_ads__ad_group_report:f0
103. model.google_ads_source.stg_google_ads__ad_group_history
  • Input Column: 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp[status]
    • Direct Copied without transformation
    • Output Columns:
      • ad_group_status: Directly mapped and renamed
92. model.google_ads.google_ads__ad_group_report
  • Input Column: 103. model.google_ads_source.stg_google_ads__ad_group_history[ad_group_status]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • ad_group_status: Directly copied to the output
104. model.google_ads_source.stg_google_ads__ad_group_history_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of type TEXT. It's likely used as a placeholder or template for further operations in a dbt (data build tool) model.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp id updated_at type campaign_id campaign_name name status 309. source.google_ads_source.google_ads.ad_group_history 309. source.google_ads_source.google_ads.ad_group_history
Name Type Comment
id bigint None
updated_at timestamp without time zone None
type text None
campaign_id bigint None
campaign_name text None
name text None
status text None
Column Lineage
%3 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp id 103. model.google_ads_source.stg_google_ads__ad_group_history 103. model.google_ads_source.stg_google_ads__ad_group_history ad_group_id 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp:f0->103. model.google_ads_source.stg_google_ads__ad_group_history:f0 92. model.google_ads.google_ads__ad_group_report 92. model.google_ads.google_ads__ad_group_report ad_group_id 103. model.google_ads_source.stg_google_ads__ad_group_history:f0->92. model.google_ads.google_ads__ad_group_report:f0 93. model.google_ads.google_ads__ad_report 93. model.google_ads.google_ads__ad_report ad_group_id 103. model.google_ads_source.stg_google_ads__ad_group_history:f0->93. model.google_ads.google_ads__ad_report:f0 95. model.google_ads.google_ads__keyword_report 95. model.google_ads.google_ads__keyword_report ad_group_id 103. model.google_ads_source.stg_google_ads__ad_group_history:f0->95. model.google_ads.google_ads__keyword_report:f0 96. model.google_ads.google_ads__url_report 96. model.google_ads.google_ads__url_report ad_group_id 103. model.google_ads_source.stg_google_ads__ad_group_history:f0->96. model.google_ads.google_ads__url_report:f0
103. model.google_ads_source.stg_google_ads__ad_group_history
  • Input Column: 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp[id]
    • Cleaning The column is cast to TEXT type
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • ad_group_id: Directly mapped after casting to TEXT
92. model.google_ads.google_ads__ad_group_report
  • Input Column: 103. model.google_ads_source.stg_google_ads__ad_group_history[ad_group_id]
    • Direct The column is directly copied without transformation
    • Integration Used as part of the JOIN condition
    • Output Columns:
      • ad_group_id: Directly copied to the output
93. model.google_ads.google_ads__ad_report
  • Input Column: 103. model.google_ads_source.stg_google_ads__ad_group_history[ad_group_id]
    • Integration used as a key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_id: directly copied
95. model.google_ads.google_ads__keyword_report
  • Input Column: 103. model.google_ads_source.stg_google_ads__ad_group_history[ad_group_id]
    • Integration used as a key to join with the stats table
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_id: directly copied
96. model.google_ads.google_ads__url_report
  • Input Column: 103. model.google_ads_source.stg_google_ads__ad_group_history[ad_group_id]
    • Integration used as a key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_id: directly copied
Column Lineage
%3 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp updated_at 103. model.google_ads_source.stg_google_ads__ad_group_history 103. model.google_ads_source.stg_google_ads__ad_group_history updated_at 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp:f0->103. model.google_ads_source.stg_google_ads__ad_group_history:f0
103. model.google_ads_source.stg_google_ads__ad_group_history
  • Input Column: 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp[updated_at]
    • Direct Copied without transformation
    • Deduplication Used in the ROW_NUMBER() function to order and identify the most recent record
    • Output Columns:
      • updated_at: Directly mapped
Column Lineage
%3 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp type 103. model.google_ads_source.stg_google_ads__ad_group_history 103. model.google_ads_source.stg_google_ads__ad_group_history ad_group_type 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp:f0->103. model.google_ads_source.stg_google_ads__ad_group_history:f0 92. model.google_ads.google_ads__ad_group_report 92. model.google_ads.google_ads__ad_group_report ad_group_type 103. model.google_ads_source.stg_google_ads__ad_group_history:f0->92. model.google_ads.google_ads__ad_group_report:f0
103. model.google_ads_source.stg_google_ads__ad_group_history
  • Input Column: 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp[type]
    • Direct Copied without transformation
    • Output Columns:
      • ad_group_type: Directly mapped and renamed
92. model.google_ads.google_ads__ad_group_report
  • Input Column: 103. model.google_ads_source.stg_google_ads__ad_group_history[ad_group_type]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • ad_group_type: Directly copied to the output
Column Lineage
%3 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp campaign_id 103. model.google_ads_source.stg_google_ads__ad_group_history 103. model.google_ads_source.stg_google_ads__ad_group_history campaign_id 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp:f0->103. model.google_ads_source.stg_google_ads__ad_group_history:f0
103. model.google_ads_source.stg_google_ads__ad_group_history
  • Input Column: 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp[campaign_id]
    • Direct Copied without transformation
    • Output Columns:
      • campaign_id: Directly mapped
Column Lineage
%3 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp campaign_name 103. model.google_ads_source.stg_google_ads__ad_group_history 103. model.google_ads_source.stg_google_ads__ad_group_history campaign_name 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp:f0->103. model.google_ads_source.stg_google_ads__ad_group_history:f0
103. model.google_ads_source.stg_google_ads__ad_group_history
  • Input Column: 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp[campaign_name]
    • Direct Copied without transformation
    • Output Columns:
      • campaign_name: Directly mapped
Column Lineage
%3 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp name 103. model.google_ads_source.stg_google_ads__ad_group_history 103. model.google_ads_source.stg_google_ads__ad_group_history ad_group_name 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp:f0->103. model.google_ads_source.stg_google_ads__ad_group_history:f0 92. model.google_ads.google_ads__ad_group_report 92. model.google_ads.google_ads__ad_group_report ad_group_name 103. model.google_ads_source.stg_google_ads__ad_group_history:f0->92. model.google_ads.google_ads__ad_group_report:f0 93. model.google_ads.google_ads__ad_report 93. model.google_ads.google_ads__ad_report ad_group_name 103. model.google_ads_source.stg_google_ads__ad_group_history:f0->93. model.google_ads.google_ads__ad_report:f0 95. model.google_ads.google_ads__keyword_report 95. model.google_ads.google_ads__keyword_report ad_group_name 103. model.google_ads_source.stg_google_ads__ad_group_history:f0->95. model.google_ads.google_ads__keyword_report:f0 96. model.google_ads.google_ads__url_report 96. model.google_ads.google_ads__url_report ad_group_name 103. model.google_ads_source.stg_google_ads__ad_group_history:f0->96. model.google_ads.google_ads__url_report:f0
103. model.google_ads_source.stg_google_ads__ad_group_history
  • Input Column: 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp[name]
    • Direct Copied without transformation
    • Output Columns:
      • ad_group_name: Directly mapped and renamed
92. model.google_ads.google_ads__ad_group_report
  • Input Column: 103. model.google_ads_source.stg_google_ads__ad_group_history[ad_group_name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • ad_group_name: Directly copied to the output
93. model.google_ads.google_ads__ad_report
  • Input Column: 103. model.google_ads_source.stg_google_ads__ad_group_history[ad_group_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_name: directly copied
95. model.google_ads.google_ads__keyword_report
  • Input Column: 103. model.google_ads_source.stg_google_ads__ad_group_history[ad_group_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_name: directly copied
96. model.google_ads.google_ads__url_report
  • Input Column: 103. model.google_ads_source.stg_google_ads__ad_group_history[ad_group_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_name: directly copied
Column Lineage
%3 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp status 103. model.google_ads_source.stg_google_ads__ad_group_history 103. model.google_ads_source.stg_google_ads__ad_group_history ad_group_status 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp:f0->103. model.google_ads_source.stg_google_ads__ad_group_history:f0 92. model.google_ads.google_ads__ad_group_report 92. model.google_ads.google_ads__ad_group_report ad_group_status 103. model.google_ads_source.stg_google_ads__ad_group_history:f0->92. model.google_ads.google_ads__ad_group_report:f0
103. model.google_ads_source.stg_google_ads__ad_group_history
  • Input Column: 104. model.google_ads_source.stg_google_ads__ad_group_history_tmp[status]
    • Direct Copied without transformation
    • Output Columns:
      • ad_group_status: Directly mapped and renamed
92. model.google_ads.google_ads__ad_group_report
  • Input Column: 103. model.google_ads_source.stg_google_ads__ad_group_history[ad_group_status]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • ad_group_status: Directly copied to the output
105. model.google_ads_source.stg_google_ads__ad_group_stats

This SQL query stages and transforms data from a Google Ads source table. It casts columns to specific data types, renames some columns, and performs simple calculations. The query also applies COALESCE to replace NULL values with zeros for numeric columns and divides the cost_micros by 1,000,000 to convert it to a standard currency unit.

CleaningFeaturization
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_google_ads_source.stg_google_ads__ad_group_stats_tmp
), fields AS (
  SELECT
    CAST(NULL AS TEXT) AS _fivetran_id,
    CAST(NULL AS TIMESTAMP) AS _fivetran_synced,
    CAST(NULL AS TEXT) AS ad_network_type,
    CAST(NULL AS INT) AS campaign_id,
    CAST(NULL AS INT) AS clicks,
    CAST(NULL AS INT) AS cost_micros,
    CAST(NULL AS INT) AS customer_id,
    CAST(NULL AS DATE) AS date,
    CAST(NULL AS TEXT) AS device,
    CAST(NULL AS INT) AS id,
    CAST(NULL AS INT) AS impressions,
    CAST(NULL AS INT) AS conversions,
    CAST(NULL AS INT) AS conversions_value,
    CAST(NULL AS INT) AS view_through_conversions,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    customer_id AS account_id,
    date AS date_day,
    CAST(id AS TEXT) AS ad_group_id,
    campaign_id,
    device,
    ad_network_type,
    COALESCE(clicks, 0) AS clicks,
    COALESCE(cost_micros, 0) / 1000000.0 AS spend,
    COALESCE(impressions, 0) AS impressions,
    COALESCE(conversions, 0) AS conversions,
    COALESCE(conversions_value, 0) AS conversions_value,
    COALESCE(view_through_conversions, 0) AS view_through_conversions
  FROM fields
)
SELECT
  *
FROM final
%3 105. model.google_ads_source.stg_google_ads__ad_group_stats 105. model.google_ads_source.stg_google_ads__ad_group_stats source_relation account_id date_day ad_group_id campaign_id ad_network_type device clicks spend impressions conversions conversions_value view_through_conversions 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp customer_id date ad_network_type campaign_id clicks conversions conversions_value cost_micros device id impressions view_through_conversions 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp:f0->105. model.google_ads_source.stg_google_ads__ad_group_stats:f1 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp:f1->105. model.google_ads_source.stg_google_ads__ad_group_stats:f2 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp:f2->105. model.google_ads_source.stg_google_ads__ad_group_stats:f5 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp:f3->105. model.google_ads_source.stg_google_ads__ad_group_stats:f4 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp:f4->105. model.google_ads_source.stg_google_ads__ad_group_stats:f7 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp:f5->105. model.google_ads_source.stg_google_ads__ad_group_stats:f10 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp:f6->105. model.google_ads_source.stg_google_ads__ad_group_stats:f11 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp:f7->105. model.google_ads_source.stg_google_ads__ad_group_stats:f8 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp:f8->105. model.google_ads_source.stg_google_ads__ad_group_stats:f6 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp:f9->105. model.google_ads_source.stg_google_ads__ad_group_stats:f3 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp:f10->105. model.google_ads_source.stg_google_ads__ad_group_stats:f9 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp:f11->105. model.google_ads_source.stg_google_ads__ad_group_stats:f12
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
account_id bigint The Customer ID.
date_day date The date being reported on.
ad_group_id text The ID representing the ad group, if present in the source data.
campaign_id bigint The ID representing the campaign, if present in the source data.
ad_network_type text The Google Ad network type used across the account.
device text Account ad performance per unique device where the ads were served.
clicks integer The count of clicks.
spend numeric The sum of your cost-per-click (CPC) and cost-per-thousand impressions (CPM) costs during this period.
impressions integer The count of impressions.
conversions double precision The number of conversions you've received, across your conversion actions. Conversions are measured with conversion tracking and may include [modeled](https://support.google.com/google-ads/answer/10081327?sjid=12862894247631803415-NC) conversions in cases where you are not able to observe all conversions that took place. You can use this column to see how often your ads led customers to actions that you’ve defined as valuable for your business.
conversions_value integer The sum of monetary values for your `conversions`. You have to enter a value in the Google Ads UI for your conversion actions to make this metric useful.
view_through_conversions integer For video campaigns, view-through conversions tell you when an _impression_ of your video ad leads to a conversion on your site. The last impression of a video ad will get credit for the view-through conversion. Keep in mind: An impression is different than a “view” of a video ad. A “view” is counted when someone watches 30 seconds (or the whole ad if it’s shorter than 30 seconds) or clicks on a part of the ad. A “view” that leads to a conversion is counted in the `conversions` column.
Column Lineage
%3 105. model.google_ads_source.stg_google_ads__ad_group_stats 105. model.google_ads_source.stg_google_ads__ad_group_stats source_relation 92. model.google_ads.google_ads__ad_group_report 92. model.google_ads.google_ads__ad_group_report source_relation 105. model.google_ads_source.stg_google_ads__ad_group_stats:f0->92. model.google_ads.google_ads__ad_group_report:f0
92. model.google_ads.google_ads__ad_group_report
  • Input Column: 105. model.google_ads_source.stg_google_ads__ad_group_stats[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with other tables
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
Column Lineage
%3 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp customer_id 105. model.google_ads_source.stg_google_ads__ad_group_stats 105. model.google_ads_source.stg_google_ads__ad_group_stats account_id 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp:f0->105. model.google_ads_source.stg_google_ads__ad_group_stats:f0
105. model.google_ads_source.stg_google_ads__ad_group_stats
  • Input Column: 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp[customer_id]
    • Cleaning The column is cast to INT type
    • Direct The column is directly copied to the output
    • Output Columns:
      • account_id: Directly mapped after casting
Column Lineage
%3 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp date 105. model.google_ads_source.stg_google_ads__ad_group_stats 105. model.google_ads_source.stg_google_ads__ad_group_stats date_day 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp:f0->105. model.google_ads_source.stg_google_ads__ad_group_stats:f0 92. model.google_ads.google_ads__ad_group_report 92. model.google_ads.google_ads__ad_group_report date_day 105. model.google_ads_source.stg_google_ads__ad_group_stats:f0->92. model.google_ads.google_ads__ad_group_report:f0
105. model.google_ads_source.stg_google_ads__ad_group_stats
  • Input Column: 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp[date]
    • Cleaning The column is cast to DATE type
    • Direct The column is directly copied to the output
    • Output Columns:
      • date_day: Directly mapped after casting
92. model.google_ads.google_ads__ad_group_report
  • Input Column: 105. model.google_ads_source.stg_google_ads__ad_group_stats[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp id 105. model.google_ads_source.stg_google_ads__ad_group_stats 105. model.google_ads_source.stg_google_ads__ad_group_stats ad_group_id 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp:f0->105. model.google_ads_source.stg_google_ads__ad_group_stats:f0 92. model.google_ads.google_ads__ad_group_report 92. model.google_ads.google_ads__ad_group_report ad_group_id 105. model.google_ads_source.stg_google_ads__ad_group_stats:f0->92. model.google_ads.google_ads__ad_group_report:f0
105. model.google_ads_source.stg_google_ads__ad_group_stats
  • Input Column: 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp[id]
    • Cleaning The column is cast as INT in the fields CTE and then cast as TEXT in the final CTE
    • Output Columns:
      • ad_group_id: Mapped after casting to TEXT
92. model.google_ads.google_ads__ad_group_report
  • Input Column: 105. model.google_ads_source.stg_google_ads__ad_group_stats[ad_group_id]
    • Direct The column is directly copied without any transformation
    • Integration Used to join with the ad_groups table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • ad_group_id: Directly copied to the output
Column Lineage
%3 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp campaign_id 105. model.google_ads_source.stg_google_ads__ad_group_stats 105. model.google_ads_source.stg_google_ads__ad_group_stats campaign_id 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp:f0->105. model.google_ads_source.stg_google_ads__ad_group_stats:f0
105. model.google_ads_source.stg_google_ads__ad_group_stats
  • Input Column: 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp[campaign_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT in the fields CTE
    • Output Columns:
      • campaign_id: Directly mapped to the output column
Column Lineage
%3 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp ad_network_type 105. model.google_ads_source.stg_google_ads__ad_group_stats 105. model.google_ads_source.stg_google_ads__ad_group_stats ad_network_type 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp:f0->105. model.google_ads_source.stg_google_ads__ad_group_stats:f0
105. model.google_ads_source.stg_google_ads__ad_group_stats
  • Input Column: 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp[ad_network_type]
    • Cleaning The column is cast to TEXT type
    • Direct The column is directly copied to the output
    • Output Columns:
      • ad_network_type: Directly mapped after casting
Column Lineage
%3 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp device 105. model.google_ads_source.stg_google_ads__ad_group_stats 105. model.google_ads_source.stg_google_ads__ad_group_stats device 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp:f0->105. model.google_ads_source.stg_google_ads__ad_group_stats:f0
105. model.google_ads_source.stg_google_ads__ad_group_stats
  • Input Column: 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp[device]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • device: Directly mapped to the output column
Column Lineage
%3 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp clicks 105. model.google_ads_source.stg_google_ads__ad_group_stats 105. model.google_ads_source.stg_google_ads__ad_group_stats clicks 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp:f0->105. model.google_ads_source.stg_google_ads__ad_group_stats:f0 92. model.google_ads.google_ads__ad_group_report 92. model.google_ads.google_ads__ad_group_report clicks 105. model.google_ads_source.stg_google_ads__ad_group_stats:f0->92. model.google_ads.google_ads__ad_group_report:f0
105. model.google_ads_source.stg_google_ads__ad_group_stats
  • Input Column: 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp[clicks]
    • Cleaning The column is cast as INT in the fields CTE and COALESCE is applied to replace NULL with 0
    • Output Columns:
      • clicks: Mapped after COALESCE is applied
92. model.google_ads.google_ads__ad_group_report
  • Input Column: 105. model.google_ads_source.stg_google_ads__ad_group_stats[clicks]
    • Aggregation Summed up in the SELECT clause
    • Output Columns:
      • clicks: Aggregated sum in the output
Column Lineage
%3 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp cost_micros 105. model.google_ads_source.stg_google_ads__ad_group_stats 105. model.google_ads_source.stg_google_ads__ad_group_stats spend 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp:f0->105. model.google_ads_source.stg_google_ads__ad_group_stats:f0 92. model.google_ads.google_ads__ad_group_report 92. model.google_ads.google_ads__ad_group_report spend 105. model.google_ads_source.stg_google_ads__ad_group_stats:f0->92. model.google_ads.google_ads__ad_group_report:f0
105. model.google_ads_source.stg_google_ads__ad_group_stats
  • Input Column: 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp[cost_micros]
    • Cleaning The column is cast as INT in the fields CTE, COALESCE is applied to replace NULL with 0, and then divided by 1,000,000
    • Output Columns:
      • spend: Mapped after cleaning and calculation
92. model.google_ads.google_ads__ad_group_report
  • Input Column: 105. model.google_ads_source.stg_google_ads__ad_group_stats[spend]
    • Aggregation Summed up in the SELECT clause
    • Output Columns:
      • spend: Aggregated sum in the output
Column Lineage
%3 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp impressions 105. model.google_ads_source.stg_google_ads__ad_group_stats 105. model.google_ads_source.stg_google_ads__ad_group_stats impressions 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp:f0->105. model.google_ads_source.stg_google_ads__ad_group_stats:f0 92. model.google_ads.google_ads__ad_group_report 92. model.google_ads.google_ads__ad_group_report impressions 105. model.google_ads_source.stg_google_ads__ad_group_stats:f0->92. model.google_ads.google_ads__ad_group_report:f0
105. model.google_ads_source.stg_google_ads__ad_group_stats
  • Input Column: 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp[impressions]
    • Cleaning The column is cast as INT in the fields CTE and COALESCE is applied to replace NULL with 0
    • Output Columns:
      • impressions: Mapped after COALESCE is applied
92. model.google_ads.google_ads__ad_group_report
  • Input Column: 105. model.google_ads_source.stg_google_ads__ad_group_stats[impressions]
    • Aggregation Summed up in the SELECT clause
    • Output Columns:
      • impressions: Aggregated sum in the output
Column Lineage
%3 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp conversions 105. model.google_ads_source.stg_google_ads__ad_group_stats 105. model.google_ads_source.stg_google_ads__ad_group_stats conversions 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp:f0->105. model.google_ads_source.stg_google_ads__ad_group_stats:f0 92. model.google_ads.google_ads__ad_group_report 92. model.google_ads.google_ads__ad_group_report conversions 105. model.google_ads_source.stg_google_ads__ad_group_stats:f0->92. model.google_ads.google_ads__ad_group_report:f0
105. model.google_ads_source.stg_google_ads__ad_group_stats
  • Input Column: 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp[conversions]
    • Cleaning The column is cast as INT in the fields CTE and COALESCE is applied to replace NULL with 0
    • Output Columns:
      • conversions: Mapped after COALESCE is applied
92. model.google_ads.google_ads__ad_group_report
  • Input Column: 105. model.google_ads_source.stg_google_ads__ad_group_stats[conversions]
    • Aggregation This column is summed up in the GROUP BY clause
    • Output Columns:
      • conversions: The sum of conversions is mapped to the output 'conversions' column
Column Lineage
%3 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp conversions_value 105. model.google_ads_source.stg_google_ads__ad_group_stats 105. model.google_ads_source.stg_google_ads__ad_group_stats conversions_value 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp:f0->105. model.google_ads_source.stg_google_ads__ad_group_stats:f0 92. model.google_ads.google_ads__ad_group_report 92. model.google_ads.google_ads__ad_group_report conversions_value 105. model.google_ads_source.stg_google_ads__ad_group_stats:f0->92. model.google_ads.google_ads__ad_group_report:f0
105. model.google_ads_source.stg_google_ads__ad_group_stats
  • Input Column: 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp[conversions_value]
    • Cleaning The column is cast as INT in the fields CTE and COALESCE is applied to replace NULL with 0
    • Output Columns:
      • conversions_value: Mapped after COALESCE is applied
92. model.google_ads.google_ads__ad_group_report
  • Input Column: 105. model.google_ads_source.stg_google_ads__ad_group_stats[conversions_value]
    • Aggregation This column is summed up in the GROUP BY clause
    • Output Columns:
      • conversions_value: The sum of conversions_value is mapped to the output 'conversions_value' column
Column Lineage
%3 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp view_through_conversions 105. model.google_ads_source.stg_google_ads__ad_group_stats 105. model.google_ads_source.stg_google_ads__ad_group_stats view_through_conversions 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp:f0->105. model.google_ads_source.stg_google_ads__ad_group_stats:f0 92. model.google_ads.google_ads__ad_group_report 92. model.google_ads.google_ads__ad_group_report view_through_conversions 105. model.google_ads_source.stg_google_ads__ad_group_stats:f0->92. model.google_ads.google_ads__ad_group_report:f0
105. model.google_ads_source.stg_google_ads__ad_group_stats
  • Input Column: 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp[view_through_conversions]
    • Cleaning The column is cast to INT in the 'fields' CTE
    • Direct The column is directly copied in the 'final' CTE
    • Output Columns:
      • view_through_conversions: It is directly copied and wrapped in a COALESCE function to replace NULL values with 0
92. model.google_ads.google_ads__ad_group_report
  • Input Column: 105. model.google_ads_source.stg_google_ads__ad_group_stats[view_through_conversions]
    • Aggregation This column is summed up in the GROUP BY clause
    • Output Columns:
      • view_through_conversions: The sum of view_through_conversions is mapped to the output 'view_through_conversions' column
106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of type TEXT, which is set to NULL. The LIMIT 0 ensures no rows are returned. This query appears to be a placeholder or template for generating a schema without actual data.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp _fivetran_id customer_id date _fivetran_synced active_view_impressions active_view_measurability active_view_measurable_cost_micros active_view_measurable_impressions active_view_viewability ad_network_type base_ad_group campaign_base_campaign campaign_id clicks conversions conversions_value cost_micros device id impressions interaction_event_types interactions view_through_conversions 310. source.google_ads_source.google_ads.ad_group_stats 310. source.google_ads_source.google_ads.ad_group_stats
Name Type Comment
_fivetran_id text None
customer_id bigint None
date date None
_fivetran_synced timestamp without time zone None
active_view_impressions integer None
active_view_measurability integer None
active_view_measurable_cost_micros integer None
active_view_measurable_impressions integer None
active_view_viewability integer None
ad_network_type text None
base_ad_group text None
campaign_base_campaign text None
campaign_id bigint None
clicks integer None
conversions double precision None
conversions_value integer None
cost_micros integer None
device text None
id bigint None
impressions integer None
interaction_event_types text None
interactions integer None
view_through_conversions integer None
Column Lineage
%3 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp customer_id 105. model.google_ads_source.stg_google_ads__ad_group_stats 105. model.google_ads_source.stg_google_ads__ad_group_stats account_id 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp:f0->105. model.google_ads_source.stg_google_ads__ad_group_stats:f0
105. model.google_ads_source.stg_google_ads__ad_group_stats
  • Input Column: 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp[customer_id]
    • Cleaning The column is cast to INT type
    • Direct The column is directly copied to the output
    • Output Columns:
      • account_id: Directly mapped after casting
Column Lineage
%3 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp date 105. model.google_ads_source.stg_google_ads__ad_group_stats 105. model.google_ads_source.stg_google_ads__ad_group_stats date_day 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp:f0->105. model.google_ads_source.stg_google_ads__ad_group_stats:f0 92. model.google_ads.google_ads__ad_group_report 92. model.google_ads.google_ads__ad_group_report date_day 105. model.google_ads_source.stg_google_ads__ad_group_stats:f0->92. model.google_ads.google_ads__ad_group_report:f0
105. model.google_ads_source.stg_google_ads__ad_group_stats
  • Input Column: 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp[date]
    • Cleaning The column is cast to DATE type
    • Direct The column is directly copied to the output
    • Output Columns:
      • date_day: Directly mapped after casting
92. model.google_ads.google_ads__ad_group_report
  • Input Column: 105. model.google_ads_source.stg_google_ads__ad_group_stats[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp ad_network_type 105. model.google_ads_source.stg_google_ads__ad_group_stats 105. model.google_ads_source.stg_google_ads__ad_group_stats ad_network_type 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp:f0->105. model.google_ads_source.stg_google_ads__ad_group_stats:f0
105. model.google_ads_source.stg_google_ads__ad_group_stats
  • Input Column: 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp[ad_network_type]
    • Cleaning The column is cast to TEXT type
    • Direct The column is directly copied to the output
    • Output Columns:
      • ad_network_type: Directly mapped after casting
Column Lineage
%3 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp campaign_id 105. model.google_ads_source.stg_google_ads__ad_group_stats 105. model.google_ads_source.stg_google_ads__ad_group_stats campaign_id 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp:f0->105. model.google_ads_source.stg_google_ads__ad_group_stats:f0
105. model.google_ads_source.stg_google_ads__ad_group_stats
  • Input Column: 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp[campaign_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT in the fields CTE
    • Output Columns:
      • campaign_id: Directly mapped to the output column
Column Lineage
%3 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp clicks 105. model.google_ads_source.stg_google_ads__ad_group_stats 105. model.google_ads_source.stg_google_ads__ad_group_stats clicks 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp:f0->105. model.google_ads_source.stg_google_ads__ad_group_stats:f0 92. model.google_ads.google_ads__ad_group_report 92. model.google_ads.google_ads__ad_group_report clicks 105. model.google_ads_source.stg_google_ads__ad_group_stats:f0->92. model.google_ads.google_ads__ad_group_report:f0
105. model.google_ads_source.stg_google_ads__ad_group_stats
  • Input Column: 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp[clicks]
    • Cleaning The column is cast as INT in the fields CTE and COALESCE is applied to replace NULL with 0
    • Output Columns:
      • clicks: Mapped after COALESCE is applied
92. model.google_ads.google_ads__ad_group_report
  • Input Column: 105. model.google_ads_source.stg_google_ads__ad_group_stats[clicks]
    • Aggregation Summed up in the SELECT clause
    • Output Columns:
      • clicks: Aggregated sum in the output
Column Lineage
%3 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp conversions 105. model.google_ads_source.stg_google_ads__ad_group_stats 105. model.google_ads_source.stg_google_ads__ad_group_stats conversions 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp:f0->105. model.google_ads_source.stg_google_ads__ad_group_stats:f0 92. model.google_ads.google_ads__ad_group_report 92. model.google_ads.google_ads__ad_group_report conversions 105. model.google_ads_source.stg_google_ads__ad_group_stats:f0->92. model.google_ads.google_ads__ad_group_report:f0
105. model.google_ads_source.stg_google_ads__ad_group_stats
  • Input Column: 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp[conversions]
    • Cleaning The column is cast as INT in the fields CTE and COALESCE is applied to replace NULL with 0
    • Output Columns:
      • conversions: Mapped after COALESCE is applied
92. model.google_ads.google_ads__ad_group_report
  • Input Column: 105. model.google_ads_source.stg_google_ads__ad_group_stats[conversions]
    • Aggregation This column is summed up in the GROUP BY clause
    • Output Columns:
      • conversions: The sum of conversions is mapped to the output 'conversions' column
Column Lineage
%3 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp conversions_value 105. model.google_ads_source.stg_google_ads__ad_group_stats 105. model.google_ads_source.stg_google_ads__ad_group_stats conversions_value 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp:f0->105. model.google_ads_source.stg_google_ads__ad_group_stats:f0 92. model.google_ads.google_ads__ad_group_report 92. model.google_ads.google_ads__ad_group_report conversions_value 105. model.google_ads_source.stg_google_ads__ad_group_stats:f0->92. model.google_ads.google_ads__ad_group_report:f0
105. model.google_ads_source.stg_google_ads__ad_group_stats
  • Input Column: 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp[conversions_value]
    • Cleaning The column is cast as INT in the fields CTE and COALESCE is applied to replace NULL with 0
    • Output Columns:
      • conversions_value: Mapped after COALESCE is applied
92. model.google_ads.google_ads__ad_group_report
  • Input Column: 105. model.google_ads_source.stg_google_ads__ad_group_stats[conversions_value]
    • Aggregation This column is summed up in the GROUP BY clause
    • Output Columns:
      • conversions_value: The sum of conversions_value is mapped to the output 'conversions_value' column
Column Lineage
%3 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp cost_micros 105. model.google_ads_source.stg_google_ads__ad_group_stats 105. model.google_ads_source.stg_google_ads__ad_group_stats spend 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp:f0->105. model.google_ads_source.stg_google_ads__ad_group_stats:f0 92. model.google_ads.google_ads__ad_group_report 92. model.google_ads.google_ads__ad_group_report spend 105. model.google_ads_source.stg_google_ads__ad_group_stats:f0->92. model.google_ads.google_ads__ad_group_report:f0
105. model.google_ads_source.stg_google_ads__ad_group_stats
  • Input Column: 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp[cost_micros]
    • Cleaning The column is cast as INT in the fields CTE, COALESCE is applied to replace NULL with 0, and then divided by 1,000,000
    • Output Columns:
      • spend: Mapped after cleaning and calculation
92. model.google_ads.google_ads__ad_group_report
  • Input Column: 105. model.google_ads_source.stg_google_ads__ad_group_stats[spend]
    • Aggregation Summed up in the SELECT clause
    • Output Columns:
      • spend: Aggregated sum in the output
Column Lineage
%3 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp device 105. model.google_ads_source.stg_google_ads__ad_group_stats 105. model.google_ads_source.stg_google_ads__ad_group_stats device 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp:f0->105. model.google_ads_source.stg_google_ads__ad_group_stats:f0
105. model.google_ads_source.stg_google_ads__ad_group_stats
  • Input Column: 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp[device]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • device: Directly mapped to the output column
Column Lineage
%3 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp id 105. model.google_ads_source.stg_google_ads__ad_group_stats 105. model.google_ads_source.stg_google_ads__ad_group_stats ad_group_id 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp:f0->105. model.google_ads_source.stg_google_ads__ad_group_stats:f0 92. model.google_ads.google_ads__ad_group_report 92. model.google_ads.google_ads__ad_group_report ad_group_id 105. model.google_ads_source.stg_google_ads__ad_group_stats:f0->92. model.google_ads.google_ads__ad_group_report:f0
105. model.google_ads_source.stg_google_ads__ad_group_stats
  • Input Column: 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp[id]
    • Cleaning The column is cast as INT in the fields CTE and then cast as TEXT in the final CTE
    • Output Columns:
      • ad_group_id: Mapped after casting to TEXT
92. model.google_ads.google_ads__ad_group_report
  • Input Column: 105. model.google_ads_source.stg_google_ads__ad_group_stats[ad_group_id]
    • Direct The column is directly copied without any transformation
    • Integration Used to join with the ad_groups table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • ad_group_id: Directly copied to the output
Column Lineage
%3 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp impressions 105. model.google_ads_source.stg_google_ads__ad_group_stats 105. model.google_ads_source.stg_google_ads__ad_group_stats impressions 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp:f0->105. model.google_ads_source.stg_google_ads__ad_group_stats:f0 92. model.google_ads.google_ads__ad_group_report 92. model.google_ads.google_ads__ad_group_report impressions 105. model.google_ads_source.stg_google_ads__ad_group_stats:f0->92. model.google_ads.google_ads__ad_group_report:f0
105. model.google_ads_source.stg_google_ads__ad_group_stats
  • Input Column: 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp[impressions]
    • Cleaning The column is cast as INT in the fields CTE and COALESCE is applied to replace NULL with 0
    • Output Columns:
      • impressions: Mapped after COALESCE is applied
92. model.google_ads.google_ads__ad_group_report
  • Input Column: 105. model.google_ads_source.stg_google_ads__ad_group_stats[impressions]
    • Aggregation Summed up in the SELECT clause
    • Output Columns:
      • impressions: Aggregated sum in the output
Column Lineage
%3 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp view_through_conversions 105. model.google_ads_source.stg_google_ads__ad_group_stats 105. model.google_ads_source.stg_google_ads__ad_group_stats view_through_conversions 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp:f0->105. model.google_ads_source.stg_google_ads__ad_group_stats:f0 92. model.google_ads.google_ads__ad_group_report 92. model.google_ads.google_ads__ad_group_report view_through_conversions 105. model.google_ads_source.stg_google_ads__ad_group_stats:f0->92. model.google_ads.google_ads__ad_group_report:f0
105. model.google_ads_source.stg_google_ads__ad_group_stats
  • Input Column: 106. model.google_ads_source.stg_google_ads__ad_group_stats_tmp[view_through_conversions]
    • Cleaning The column is cast to INT in the 'fields' CTE
    • Direct The column is directly copied in the 'final' CTE
    • Output Columns:
      • view_through_conversions: It is directly copied and wrapped in a COALESCE function to replace NULL values with 0
92. model.google_ads.google_ads__ad_group_report
  • Input Column: 105. model.google_ads_source.stg_google_ads__ad_group_stats[view_through_conversions]
    • Aggregation This column is summed up in the GROUP BY clause
    • Output Columns:
      • view_through_conversions: The sum of view_through_conversions is mapped to the output 'view_through_conversions' column
107. model.google_ads_source.stg_google_ads__ad_history

This SQL query processes and transforms data from a Google Ads source table. It casts columns to specific data types, filters for active records, deduplicates to keep the most recent record for each ad, and extracts various URL components and UTM parameters from the final_urls field. The query also cleans and standardizes the final_urls data by removing brackets and splitting it into individual URLs.

CleaningDeduplicationFeaturization
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_google_ads_source.stg_google_ads__ad_history_tmp
), fields AS (
  SELECT
    CAST(NULL AS INT) AS ad_group_id,
    CAST(NULL AS TEXT) AS display_url,
    CAST(NULL AS TEXT) AS final_urls,
    CAST(NULL AS INT) AS id,
    CAST(NULL AS TEXT) AS name,
    CAST(NULL AS TEXT) AS status,
    CAST(NULL AS TEXT) AS type,
    CAST(NULL AS TIMESTAMP) AS updated_at,
    CAST(NULL AS BOOLEAN) AS _fivetran_active,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    CAST(ad_group_id AS TEXT) AS ad_group_id,
    id AS ad_id,
    name AS ad_name,
    updated_at,
    type AS ad_type,
    status AS ad_status,
    display_url,
    final_urls AS source_final_urls,
    REPLACE(REPLACE(final_urls, '[', ''), ']', '') AS final_urls,
    ROW_NUMBER() OVER (PARTITION BY source_relation, id, ad_group_id ORDER BY updated_at DESC) = 1 AS is_most_recent_record
  FROM fields
  WHERE
    COALESCE(_fivetran_active, TRUE)
), final_urls AS (
  SELECT
    *,
    SPLIT_PART(final_urls, ',', 1) AS final_url /* Extract the first url within the list of urls provided within the final_urls field */
  FROM final
), url_fields AS (
  SELECT
    *,
    SPLIT_PART(final_url, '?', 1) AS base_url,
    TRY_CAST(SPLIT_PART(
      SPLIT_PART(
        REPLACE(REPLACE(REPLACE(final_url, 'android-app://', ''), 'http://', ''), 'https://', ''),
        '/',
        1
      ),
      '?',
      1
    ) AS TEXT) AS url_host,
    '/' || TRY_CAST(SPLIT_PART(
      CASE
        WHEN LENGTH(REPLACE(REPLACE(final_url, 'http://', ''), 'https://', '')) - COALESCE(
          NULLIF(STR_POSITION(REPLACE(REPLACE(final_url, 'http://', ''), 'https://', ''), '/'), 0),
          STR_POSITION(REPLACE(REPLACE(final_url, 'http://', ''), 'https://', ''), '?') - 1
        ) = 0
        THEN ''
        ELSE RIGHT(
          REPLACE(REPLACE(final_url, 'http://', ''), 'https://', ''),
          LENGTH(REPLACE(REPLACE(final_url, 'http://', ''), 'https://', '')) - COALESCE(
            NULLIF(STR_POSITION(REPLACE(REPLACE(final_url, 'http://', ''), 'https://', ''), '/'), 0),
            STR_POSITION(REPLACE(REPLACE(final_url, 'http://', ''), 'https://', ''), '?') - 1
          )
        )
      END,
      '?',
      1
    ) AS TEXT) AS url_path,
    NULLIF(SPLIT_PART(SPLIT_PART(final_url, 'utm_source=', 2), '&', 1), '') AS utm_source,
    NULLIF(SPLIT_PART(SPLIT_PART(final_url, 'utm_medium=', 2), '&', 1), '') AS utm_medium,
    NULLIF(SPLIT_PART(SPLIT_PART(final_url, 'utm_campaign=', 2), '&', 1), '') AS utm_campaign,
    NULLIF(SPLIT_PART(SPLIT_PART(final_url, 'utm_content=', 2), '&', 1), '') AS utm_content,
    NULLIF(SPLIT_PART(SPLIT_PART(final_url, 'utm_term=', 2), '&', 1), '') AS utm_term
  FROM final_urls
)
SELECT
  *
FROM url_fields
%3 107. model.google_ads_source.stg_google_ads__ad_history 107. model.google_ads_source.stg_google_ads__ad_history source_relation ad_group_id ad_id updated_at display_url ad_type ad_status is_most_recent_record source_final_urls final_url base_url url_host url_path utm_source utm_medium utm_campaign utm_content utm_term ad_name final_urls 108. model.google_ads_source.stg_google_ads__ad_history_tmp 108. model.google_ads_source.stg_google_ads__ad_history_tmp ad_group_id id name updated_at type status display_url final_urls 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f1 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f1->107. model.google_ads_source.stg_google_ads__ad_history:f2 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f2->107. model.google_ads_source.stg_google_ads__ad_history:f18 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f3->107. model.google_ads_source.stg_google_ads__ad_history:f3 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f4->107. model.google_ads_source.stg_google_ads__ad_history:f5 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f5->107. model.google_ads_source.stg_google_ads__ad_history:f6 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f6->107. model.google_ads_source.stg_google_ads__ad_history:f4 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f7->107. model.google_ads_source.stg_google_ads__ad_history:f8 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f7->107. model.google_ads_source.stg_google_ads__ad_history:f19 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f7->107. model.google_ads_source.stg_google_ads__ad_history:f9 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f7->107. model.google_ads_source.stg_google_ads__ad_history:f10 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f7->107. model.google_ads_source.stg_google_ads__ad_history:f11 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f7->107. model.google_ads_source.stg_google_ads__ad_history:f12 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f7->107. model.google_ads_source.stg_google_ads__ad_history:f13 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f7->107. model.google_ads_source.stg_google_ads__ad_history:f14 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f7->107. model.google_ads_source.stg_google_ads__ad_history:f15 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f7->107. model.google_ads_source.stg_google_ads__ad_history:f16 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f7->107. model.google_ads_source.stg_google_ads__ad_history:f17
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
ad_group_id text The ID representing the ad group, if present in the source data.
ad_id bigint The ID representing the ad, if present in the source data.
updated_at timestamp without time zone Timestamp of when the record was last updated in Google Ads.
display_url integer The display url of the ad that is being served.
ad_type integer The type of the ad in Google Ads.
ad_status text Status of the Ad.
is_most_recent_record boolean Boolean representing whether the record is the most recent version of the object.
source_final_urls text The original list of final urls expressed as an array. Please be aware the test used on this field is intended to warn you if you have fields with multiple urls. If you do, the `final_url` field will filter down the urls within the array to just the first. Therefore, this package will only leverage one of possibly many urls within this field array.
final_url text The first url in the list of the urls within the `final_urls` source field.
base_url text The base url of the ad.
url_host text The URL host of the ad.
url_path text The URL path of the ad.
utm_source text The utm_source parameter of the ad.
utm_medium text The utm_medium parameter of the ad.
utm_campaign text The utm_campaign parameter of the ad.
utm_content text The utm_content parameter of the ad.
utm_term text The utm_term parameter of the ad.
ad_name integer None
final_urls text None
Column Lineage
%3 107. model.google_ads_source.stg_google_ads__ad_history 107. model.google_ads_source.stg_google_ads__ad_history source_relation 93. model.google_ads.google_ads__ad_report 93. model.google_ads.google_ads__ad_report source_relation 107. model.google_ads_source.stg_google_ads__ad_history:f0->93. model.google_ads.google_ads__ad_report:f0 96. model.google_ads.google_ads__url_report 96. model.google_ads.google_ads__url_report source_relation 107. model.google_ads_source.stg_google_ads__ad_history:f0->96. model.google_ads.google_ads__url_report:f0
93. model.google_ads.google_ads__ad_report
  • Input Column: 107. model.google_ads_source.stg_google_ads__ad_history[source_relation]
    • Integration used to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
96. model.google_ads.google_ads__url_report
  • Input Column: 107. model.google_ads_source.stg_google_ads__ad_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
Column Lineage
%3 108. model.google_ads_source.stg_google_ads__ad_history_tmp 108. model.google_ads_source.stg_google_ads__ad_history_tmp ad_group_id 107. model.google_ads_source.stg_google_ads__ad_history 107. model.google_ads_source.stg_google_ads__ad_history ad_group_id 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f0 93. model.google_ads.google_ads__ad_report 93. model.google_ads.google_ads__ad_report ad_group_id 107. model.google_ads_source.stg_google_ads__ad_history:f0->93. model.google_ads.google_ads__ad_report:f0 96. model.google_ads.google_ads__url_report 96. model.google_ads.google_ads__url_report ad_group_id 107. model.google_ads_source.stg_google_ads__ad_history:f0->96. model.google_ads.google_ads__url_report:f0
107. model.google_ads_source.stg_google_ads__ad_history
  • Input Column: 108. model.google_ads_source.stg_google_ads__ad_history_tmp[ad_group_id]
    • Cleaning Cast to TEXT type
    • Deduplication Used in ROW_NUMBER() OVER (PARTITION BY ...) for deduplication
    • Output Columns:
      • ad_group_id: Directly mapped after casting to TEXT
93. model.google_ads.google_ads__ad_report
  • Input Column: 107. model.google_ads_source.stg_google_ads__ad_history[ad_group_id]
    • Integration used to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_id: directly copied
96. model.google_ads.google_ads__url_report
  • Input Column: 107. model.google_ads_source.stg_google_ads__ad_history[ad_group_id]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_id: directly copied
Column Lineage
%3 108. model.google_ads_source.stg_google_ads__ad_history_tmp 108. model.google_ads_source.stg_google_ads__ad_history_tmp id 107. model.google_ads_source.stg_google_ads__ad_history 107. model.google_ads_source.stg_google_ads__ad_history ad_id 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f0 93. model.google_ads.google_ads__ad_report 93. model.google_ads.google_ads__ad_report ad_id 107. model.google_ads_source.stg_google_ads__ad_history:f0->93. model.google_ads.google_ads__ad_report:f0 96. model.google_ads.google_ads__url_report 96. model.google_ads.google_ads__url_report ad_id 107. model.google_ads_source.stg_google_ads__ad_history:f0->96. model.google_ads.google_ads__url_report:f0
107. model.google_ads_source.stg_google_ads__ad_history
  • Input Column: 108. model.google_ads_source.stg_google_ads__ad_history_tmp[id]
    • Cleaning Used as is (implicitly cast to INT)
    • Deduplication Used in ROW_NUMBER() OVER (PARTITION BY ...) for deduplication
    • Output Columns:
      • ad_id: Directly mapped
93. model.google_ads.google_ads__ad_report
  • Input Column: 107. model.google_ads_source.stg_google_ads__ad_history[ad_id]
    • Integration used to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • ad_id: directly copied
96. model.google_ads.google_ads__url_report
  • Input Column: 107. model.google_ads_source.stg_google_ads__ad_history[ad_id]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • ad_id: directly copied
Column Lineage
%3 108. model.google_ads_source.stg_google_ads__ad_history_tmp 108. model.google_ads_source.stg_google_ads__ad_history_tmp updated_at 107. model.google_ads_source.stg_google_ads__ad_history 107. model.google_ads_source.stg_google_ads__ad_history updated_at 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f0
107. model.google_ads_source.stg_google_ads__ad_history
  • Input Column: 108. model.google_ads_source.stg_google_ads__ad_history_tmp[updated_at]
    • Cleaning Cast to TIMESTAMP type
    • Deduplication Used in ROW_NUMBER() OVER (... ORDER BY updated_at DESC) for deduplication
    • Output Columns:
      • updated_at: Directly mapped after casting
Column Lineage
%3 108. model.google_ads_source.stg_google_ads__ad_history_tmp 108. model.google_ads_source.stg_google_ads__ad_history_tmp display_url 107. model.google_ads_source.stg_google_ads__ad_history 107. model.google_ads_source.stg_google_ads__ad_history display_url 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f0 93. model.google_ads.google_ads__ad_report 93. model.google_ads.google_ads__ad_report display_url 107. model.google_ads_source.stg_google_ads__ad_history:f0->93. model.google_ads.google_ads__ad_report:f0
107. model.google_ads_source.stg_google_ads__ad_history
  • Input Column: 108. model.google_ads_source.stg_google_ads__ad_history_tmp[display_url]
    • Direct Copied without transformation
    • Output Columns:
      • display_url: Directly mapped
93. model.google_ads.google_ads__ad_report
  • Input Column: 107. model.google_ads_source.stg_google_ads__ad_history[display_url]
    • Direct directly copied to the output
    • Output Columns:
      • display_url: directly copied
Column Lineage
%3 108. model.google_ads_source.stg_google_ads__ad_history_tmp 108. model.google_ads_source.stg_google_ads__ad_history_tmp type 107. model.google_ads_source.stg_google_ads__ad_history 107. model.google_ads_source.stg_google_ads__ad_history ad_type 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f0 93. model.google_ads.google_ads__ad_report 93. model.google_ads.google_ads__ad_report ad_type 107. model.google_ads_source.stg_google_ads__ad_history:f0->93. model.google_ads.google_ads__ad_report:f0
107. model.google_ads_source.stg_google_ads__ad_history
  • Input Column: 108. model.google_ads_source.stg_google_ads__ad_history_tmp[type]
    • Direct Copied without transformation
    • Output Columns:
      • ad_type: Directly mapped
93. model.google_ads.google_ads__ad_report
  • Input Column: 107. model.google_ads_source.stg_google_ads__ad_history[ad_type]
    • Direct directly copied to the output
    • Output Columns:
      • ad_type: directly copied
Column Lineage
%3 108. model.google_ads_source.stg_google_ads__ad_history_tmp 108. model.google_ads_source.stg_google_ads__ad_history_tmp status 107. model.google_ads_source.stg_google_ads__ad_history 107. model.google_ads_source.stg_google_ads__ad_history ad_status 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f0 93. model.google_ads.google_ads__ad_report 93. model.google_ads.google_ads__ad_report ad_status 107. model.google_ads_source.stg_google_ads__ad_history:f0->93. model.google_ads.google_ads__ad_report:f0
107. model.google_ads_source.stg_google_ads__ad_history
  • Input Column: 108. model.google_ads_source.stg_google_ads__ad_history_tmp[status]
    • Direct Copied without transformation
    • Output Columns:
      • ad_status: Directly mapped
93. model.google_ads.google_ads__ad_report
  • Input Column: 107. model.google_ads_source.stg_google_ads__ad_history[ad_status]
    • Direct directly copied to the output
    • Output Columns:
      • ad_status: directly copied
Column Lineage
%3 108. model.google_ads_source.stg_google_ads__ad_history_tmp 108. model.google_ads_source.stg_google_ads__ad_history_tmp final_urls 107. model.google_ads_source.stg_google_ads__ad_history 107. model.google_ads_source.stg_google_ads__ad_history base_url final_url final_urls source_final_urls url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f3 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f2 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f1 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f0 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f4 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f5 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f9 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f8 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f6 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f7 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f10 93. model.google_ads.google_ads__ad_report 93. model.google_ads.google_ads__ad_report source_final_urls 107. model.google_ads_source.stg_google_ads__ad_history:f3->93. model.google_ads.google_ads__ad_report:f0
107. model.google_ads_source.stg_google_ads__ad_history
  • Input Column: 108. model.google_ads_source.stg_google_ads__ad_history_tmp[final_urls]
    • Cleaning Brackets removed, cast to TEXT
    • Featurization Used to extract various URL components and UTM parameters
    • Output Columns:
      • source_final_urls: Directly mapped before cleaning
      • final_urls: Mapped after cleaning (removing brackets)
      • final_url: First URL extracted from the cleaned list
      • base_url: Extracted from final_url
      • url_host: Extracted from final_url
      • url_path: Extracted from final_url
      • utm_source: Extracted from final_url
      • utm_medium: Extracted from final_url
      • utm_campaign: Extracted from final_url
      • utm_content: Extracted from final_url
      • utm_term: Extracted from final_url
93. model.google_ads.google_ads__ad_report
  • Input Column: 107. model.google_ads_source.stg_google_ads__ad_history[source_final_urls]
    • Direct directly copied to the output
    • Output Columns:
      • source_final_urls: directly copied
Column Lineage
%3 108. model.google_ads_source.stg_google_ads__ad_history_tmp 108. model.google_ads_source.stg_google_ads__ad_history_tmp final_urls 107. model.google_ads_source.stg_google_ads__ad_history 107. model.google_ads_source.stg_google_ads__ad_history base_url final_url final_urls source_final_urls url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f3 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f2 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f1 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f0 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f4 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f5 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f9 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f8 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f6 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f7 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f10 96. model.google_ads.google_ads__url_report 96. model.google_ads.google_ads__url_report base_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 107. model.google_ads_source.stg_google_ads__ad_history:f1->96. model.google_ads.google_ads__url_report:f0 107. model.google_ads_source.stg_google_ads__ad_history:f1->96. model.google_ads.google_ads__url_report:f1 107. model.google_ads_source.stg_google_ads__ad_history:f1->96. model.google_ads.google_ads__url_report:f2 107. model.google_ads_source.stg_google_ads__ad_history:f1->96. model.google_ads.google_ads__url_report:f6 107. model.google_ads_source.stg_google_ads__ad_history:f1->96. model.google_ads.google_ads__url_report:f5 107. model.google_ads_source.stg_google_ads__ad_history:f1->96. model.google_ads.google_ads__url_report:f3 107. model.google_ads_source.stg_google_ads__ad_history:f1->96. model.google_ads.google_ads__url_report:f4 107. model.google_ads_source.stg_google_ads__ad_history:f1->96. model.google_ads.google_ads__url_report:f7
107. model.google_ads_source.stg_google_ads__ad_history
  • Input Column: 108. model.google_ads_source.stg_google_ads__ad_history_tmp[final_urls]
    • Cleaning Brackets removed, cast to TEXT
    • Featurization Used to extract various URL components and UTM parameters
    • Output Columns:
      • source_final_urls: Directly mapped before cleaning
      • final_urls: Mapped after cleaning (removing brackets)
      • final_url: First URL extracted from the cleaned list
      • base_url: Extracted from final_url
      • url_host: Extracted from final_url
      • url_path: Extracted from final_url
      • utm_source: Extracted from final_url
      • utm_medium: Extracted from final_url
      • utm_campaign: Extracted from final_url
      • utm_content: Extracted from final_url
      • utm_term: Extracted from final_url
96. model.google_ads.google_ads__url_report
  • Input Column: 107. model.google_ads_source.stg_google_ads__ad_history[final_url]
    • Featurization used to extract various URL components
    • Output Columns:
      • base_url: extracted from this column
      • url_host: extracted from this column
      • url_path: extracted from this column
      • utm_source: extracted from this column
      • utm_medium: extracted from this column
      • utm_campaign: extracted from this column
      • utm_content: extracted from this column
      • utm_term: extracted from this column
Column Lineage
%3 108. model.google_ads_source.stg_google_ads__ad_history_tmp 108. model.google_ads_source.stg_google_ads__ad_history_tmp final_urls 107. model.google_ads_source.stg_google_ads__ad_history 107. model.google_ads_source.stg_google_ads__ad_history base_url final_url final_urls source_final_urls url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f3 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f2 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f1 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f0 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f4 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f5 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f9 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f8 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f6 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f7 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f10 96. model.google_ads.google_ads__url_report 96. model.google_ads.google_ads__url_report base_url 107. model.google_ads_source.stg_google_ads__ad_history:f0->96. model.google_ads.google_ads__url_report:f0
107. model.google_ads_source.stg_google_ads__ad_history
  • Input Column: 108. model.google_ads_source.stg_google_ads__ad_history_tmp[final_urls]
    • Cleaning Brackets removed, cast to TEXT
    • Featurization Used to extract various URL components and UTM parameters
    • Output Columns:
      • source_final_urls: Directly mapped before cleaning
      • final_urls: Mapped after cleaning (removing brackets)
      • final_url: First URL extracted from the cleaned list
      • base_url: Extracted from final_url
      • url_host: Extracted from final_url
      • url_path: Extracted from final_url
      • utm_source: Extracted from final_url
      • utm_medium: Extracted from final_url
      • utm_campaign: Extracted from final_url
      • utm_content: Extracted from final_url
      • utm_term: Extracted from final_url
96. model.google_ads.google_ads__url_report
  • Input Column: 107. model.google_ads_source.stg_google_ads__ad_history[base_url]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • base_url: Directly copied to the output
Column Lineage
%3 108. model.google_ads_source.stg_google_ads__ad_history_tmp 108. model.google_ads_source.stg_google_ads__ad_history_tmp final_urls 107. model.google_ads_source.stg_google_ads__ad_history 107. model.google_ads_source.stg_google_ads__ad_history base_url final_url final_urls source_final_urls url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f3 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f2 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f1 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f0 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f4 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f5 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f9 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f8 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f6 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f7 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f10 96. model.google_ads.google_ads__url_report 96. model.google_ads.google_ads__url_report url_host 107. model.google_ads_source.stg_google_ads__ad_history:f4->96. model.google_ads.google_ads__url_report:f0
107. model.google_ads_source.stg_google_ads__ad_history
  • Input Column: 108. model.google_ads_source.stg_google_ads__ad_history_tmp[final_urls]
    • Cleaning Brackets removed, cast to TEXT
    • Featurization Used to extract various URL components and UTM parameters
    • Output Columns:
      • source_final_urls: Directly mapped before cleaning
      • final_urls: Mapped after cleaning (removing brackets)
      • final_url: First URL extracted from the cleaned list
      • base_url: Extracted from final_url
      • url_host: Extracted from final_url
      • url_path: Extracted from final_url
      • utm_source: Extracted from final_url
      • utm_medium: Extracted from final_url
      • utm_campaign: Extracted from final_url
      • utm_content: Extracted from final_url
      • utm_term: Extracted from final_url
96. model.google_ads.google_ads__url_report
  • Input Column: 107. model.google_ads_source.stg_google_ads__ad_history[url_host]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • url_host: Directly copied to the output
Column Lineage
%3 108. model.google_ads_source.stg_google_ads__ad_history_tmp 108. model.google_ads_source.stg_google_ads__ad_history_tmp final_urls 107. model.google_ads_source.stg_google_ads__ad_history 107. model.google_ads_source.stg_google_ads__ad_history base_url final_url final_urls source_final_urls url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f3 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f2 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f1 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f0 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f4 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f5 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f9 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f8 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f6 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f7 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f10 96. model.google_ads.google_ads__url_report 96. model.google_ads.google_ads__url_report url_path 107. model.google_ads_source.stg_google_ads__ad_history:f5->96. model.google_ads.google_ads__url_report:f0
107. model.google_ads_source.stg_google_ads__ad_history
  • Input Column: 108. model.google_ads_source.stg_google_ads__ad_history_tmp[final_urls]
    • Cleaning Brackets removed, cast to TEXT
    • Featurization Used to extract various URL components and UTM parameters
    • Output Columns:
      • source_final_urls: Directly mapped before cleaning
      • final_urls: Mapped after cleaning (removing brackets)
      • final_url: First URL extracted from the cleaned list
      • base_url: Extracted from final_url
      • url_host: Extracted from final_url
      • url_path: Extracted from final_url
      • utm_source: Extracted from final_url
      • utm_medium: Extracted from final_url
      • utm_campaign: Extracted from final_url
      • utm_content: Extracted from final_url
      • utm_term: Extracted from final_url
96. model.google_ads.google_ads__url_report
  • Input Column: 107. model.google_ads_source.stg_google_ads__ad_history[url_path]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • url_path: Directly copied to the output
Column Lineage
%3 108. model.google_ads_source.stg_google_ads__ad_history_tmp 108. model.google_ads_source.stg_google_ads__ad_history_tmp final_urls 107. model.google_ads_source.stg_google_ads__ad_history 107. model.google_ads_source.stg_google_ads__ad_history base_url final_url final_urls source_final_urls url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f3 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f2 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f1 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f0 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f4 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f5 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f9 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f8 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f6 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f7 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f10 96. model.google_ads.google_ads__url_report 96. model.google_ads.google_ads__url_report utm_source 107. model.google_ads_source.stg_google_ads__ad_history:f9->96. model.google_ads.google_ads__url_report:f0
107. model.google_ads_source.stg_google_ads__ad_history
  • Input Column: 108. model.google_ads_source.stg_google_ads__ad_history_tmp[final_urls]
    • Cleaning Brackets removed, cast to TEXT
    • Featurization Used to extract various URL components and UTM parameters
    • Output Columns:
      • source_final_urls: Directly mapped before cleaning
      • final_urls: Mapped after cleaning (removing brackets)
      • final_url: First URL extracted from the cleaned list
      • base_url: Extracted from final_url
      • url_host: Extracted from final_url
      • url_path: Extracted from final_url
      • utm_source: Extracted from final_url
      • utm_medium: Extracted from final_url
      • utm_campaign: Extracted from final_url
      • utm_content: Extracted from final_url
      • utm_term: Extracted from final_url
96. model.google_ads.google_ads__url_report
  • Input Column: 107. model.google_ads_source.stg_google_ads__ad_history[utm_source]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • utm_source: Directly copied to the output
Column Lineage
%3 108. model.google_ads_source.stg_google_ads__ad_history_tmp 108. model.google_ads_source.stg_google_ads__ad_history_tmp final_urls 107. model.google_ads_source.stg_google_ads__ad_history 107. model.google_ads_source.stg_google_ads__ad_history base_url final_url final_urls source_final_urls url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f3 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f2 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f1 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f0 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f4 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f5 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f9 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f8 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f6 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f7 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f10 96. model.google_ads.google_ads__url_report 96. model.google_ads.google_ads__url_report utm_medium 107. model.google_ads_source.stg_google_ads__ad_history:f8->96. model.google_ads.google_ads__url_report:f0
107. model.google_ads_source.stg_google_ads__ad_history
  • Input Column: 108. model.google_ads_source.stg_google_ads__ad_history_tmp[final_urls]
    • Cleaning Brackets removed, cast to TEXT
    • Featurization Used to extract various URL components and UTM parameters
    • Output Columns:
      • source_final_urls: Directly mapped before cleaning
      • final_urls: Mapped after cleaning (removing brackets)
      • final_url: First URL extracted from the cleaned list
      • base_url: Extracted from final_url
      • url_host: Extracted from final_url
      • url_path: Extracted from final_url
      • utm_source: Extracted from final_url
      • utm_medium: Extracted from final_url
      • utm_campaign: Extracted from final_url
      • utm_content: Extracted from final_url
      • utm_term: Extracted from final_url
96. model.google_ads.google_ads__url_report
  • Input Column: 107. model.google_ads_source.stg_google_ads__ad_history[utm_medium]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • utm_medium: Directly copied to the output
Column Lineage
%3 108. model.google_ads_source.stg_google_ads__ad_history_tmp 108. model.google_ads_source.stg_google_ads__ad_history_tmp final_urls 107. model.google_ads_source.stg_google_ads__ad_history 107. model.google_ads_source.stg_google_ads__ad_history base_url final_url final_urls source_final_urls url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f3 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f2 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f1 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f0 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f4 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f5 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f9 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f8 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f6 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f7 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f10 96. model.google_ads.google_ads__url_report 96. model.google_ads.google_ads__url_report utm_campaign 107. model.google_ads_source.stg_google_ads__ad_history:f6->96. model.google_ads.google_ads__url_report:f0
107. model.google_ads_source.stg_google_ads__ad_history
  • Input Column: 108. model.google_ads_source.stg_google_ads__ad_history_tmp[final_urls]
    • Cleaning Brackets removed, cast to TEXT
    • Featurization Used to extract various URL components and UTM parameters
    • Output Columns:
      • source_final_urls: Directly mapped before cleaning
      • final_urls: Mapped after cleaning (removing brackets)
      • final_url: First URL extracted from the cleaned list
      • base_url: Extracted from final_url
      • url_host: Extracted from final_url
      • url_path: Extracted from final_url
      • utm_source: Extracted from final_url
      • utm_medium: Extracted from final_url
      • utm_campaign: Extracted from final_url
      • utm_content: Extracted from final_url
      • utm_term: Extracted from final_url
96. model.google_ads.google_ads__url_report
  • Input Column: 107. model.google_ads_source.stg_google_ads__ad_history[utm_campaign]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • utm_campaign: Directly copied to the output
Column Lineage
%3 108. model.google_ads_source.stg_google_ads__ad_history_tmp 108. model.google_ads_source.stg_google_ads__ad_history_tmp final_urls 107. model.google_ads_source.stg_google_ads__ad_history 107. model.google_ads_source.stg_google_ads__ad_history base_url final_url final_urls source_final_urls url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f3 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f2 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f1 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f0 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f4 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f5 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f9 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f8 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f6 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f7 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f10 96. model.google_ads.google_ads__url_report 96. model.google_ads.google_ads__url_report utm_content 107. model.google_ads_source.stg_google_ads__ad_history:f7->96. model.google_ads.google_ads__url_report:f0
107. model.google_ads_source.stg_google_ads__ad_history
  • Input Column: 108. model.google_ads_source.stg_google_ads__ad_history_tmp[final_urls]
    • Cleaning Brackets removed, cast to TEXT
    • Featurization Used to extract various URL components and UTM parameters
    • Output Columns:
      • source_final_urls: Directly mapped before cleaning
      • final_urls: Mapped after cleaning (removing brackets)
      • final_url: First URL extracted from the cleaned list
      • base_url: Extracted from final_url
      • url_host: Extracted from final_url
      • url_path: Extracted from final_url
      • utm_source: Extracted from final_url
      • utm_medium: Extracted from final_url
      • utm_campaign: Extracted from final_url
      • utm_content: Extracted from final_url
      • utm_term: Extracted from final_url
96. model.google_ads.google_ads__url_report
  • Input Column: 107. model.google_ads_source.stg_google_ads__ad_history[utm_content]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • utm_content: Directly copied to the output
Column Lineage
%3 108. model.google_ads_source.stg_google_ads__ad_history_tmp 108. model.google_ads_source.stg_google_ads__ad_history_tmp final_urls 107. model.google_ads_source.stg_google_ads__ad_history 107. model.google_ads_source.stg_google_ads__ad_history base_url final_url final_urls source_final_urls url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f3 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f2 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f1 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f0 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f4 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f5 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f9 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f8 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f6 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f7 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f10 96. model.google_ads.google_ads__url_report 96. model.google_ads.google_ads__url_report utm_term 107. model.google_ads_source.stg_google_ads__ad_history:f10->96. model.google_ads.google_ads__url_report:f0
107. model.google_ads_source.stg_google_ads__ad_history
  • Input Column: 108. model.google_ads_source.stg_google_ads__ad_history_tmp[final_urls]
    • Cleaning Brackets removed, cast to TEXT
    • Featurization Used to extract various URL components and UTM parameters
    • Output Columns:
      • source_final_urls: Directly mapped before cleaning
      • final_urls: Mapped after cleaning (removing brackets)
      • final_url: First URL extracted from the cleaned list
      • base_url: Extracted from final_url
      • url_host: Extracted from final_url
      • url_path: Extracted from final_url
      • utm_source: Extracted from final_url
      • utm_medium: Extracted from final_url
      • utm_campaign: Extracted from final_url
      • utm_content: Extracted from final_url
      • utm_term: Extracted from final_url
96. model.google_ads.google_ads__url_report
  • Input Column: 107. model.google_ads_source.stg_google_ads__ad_history[utm_term]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • utm_term: Directly copied to the output
Column Lineage
%3 108. model.google_ads_source.stg_google_ads__ad_history_tmp 108. model.google_ads_source.stg_google_ads__ad_history_tmp name 107. model.google_ads_source.stg_google_ads__ad_history 107. model.google_ads_source.stg_google_ads__ad_history ad_name 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f0 93. model.google_ads.google_ads__ad_report 93. model.google_ads.google_ads__ad_report ad_name 107. model.google_ads_source.stg_google_ads__ad_history:f0->93. model.google_ads.google_ads__ad_report:f0
107. model.google_ads_source.stg_google_ads__ad_history
  • Input Column: 108. model.google_ads_source.stg_google_ads__ad_history_tmp[name]
    • Direct Copied without transformation
    • Output Columns:
      • ad_name: Directly mapped
93. model.google_ads.google_ads__ad_report
  • Input Column: 107. model.google_ads_source.stg_google_ads__ad_history[ad_name]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition
    • Output Columns:
      • ad_name: Directly mapped to the output column
Column Lineage
%3 108. model.google_ads_source.stg_google_ads__ad_history_tmp 108. model.google_ads_source.stg_google_ads__ad_history_tmp final_urls 107. model.google_ads_source.stg_google_ads__ad_history 107. model.google_ads_source.stg_google_ads__ad_history base_url final_url final_urls source_final_urls url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f3 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f2 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f1 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f0 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f4 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f5 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f9 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f8 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f6 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f7 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f10 93. model.google_ads.google_ads__ad_report 93. model.google_ads.google_ads__ad_report source_final_urls 107. model.google_ads_source.stg_google_ads__ad_history:f2->93. model.google_ads.google_ads__ad_report:f0
107. model.google_ads_source.stg_google_ads__ad_history
  • Input Column: 108. model.google_ads_source.stg_google_ads__ad_history_tmp[final_urls]
    • Cleaning Brackets removed, cast to TEXT
    • Featurization Used to extract various URL components and UTM parameters
    • Output Columns:
      • source_final_urls: Directly mapped before cleaning
      • final_urls: Mapped after cleaning (removing brackets)
      • final_url: First URL extracted from the cleaned list
      • base_url: Extracted from final_url
      • url_host: Extracted from final_url
      • url_path: Extracted from final_url
      • utm_source: Extracted from final_url
      • utm_medium: Extracted from final_url
      • utm_campaign: Extracted from final_url
      • utm_content: Extracted from final_url
      • utm_term: Extracted from final_url
93. model.google_ads.google_ads__ad_report
  • Input Column: 107. model.google_ads_source.stg_google_ads__ad_history[final_urls]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition
    • Output Columns:
      • source_final_urls: Directly mapped to the output column
108. model.google_ads_source.stg_google_ads__ad_history_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of type TEXT, which is set to NULL. The query is limited to 0 rows, effectively creating a schema-only representation of the table without any data.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 108. model.google_ads_source.stg_google_ads__ad_history_tmp 108. model.google_ads_source.stg_google_ads__ad_history_tmp ad_group_id id name updated_at type status display_url final_urls 311. source.google_ads_source.google_ads.ad_history 311. source.google_ads_source.google_ads.ad_history
Name Type Comment
ad_group_id bigint None
id bigint None
name integer None
updated_at timestamp without time zone None
type integer None
status text None
display_url integer None
final_urls text None
Column Lineage
%3 108. model.google_ads_source.stg_google_ads__ad_history_tmp 108. model.google_ads_source.stg_google_ads__ad_history_tmp ad_group_id 107. model.google_ads_source.stg_google_ads__ad_history 107. model.google_ads_source.stg_google_ads__ad_history ad_group_id 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f0 93. model.google_ads.google_ads__ad_report 93. model.google_ads.google_ads__ad_report ad_group_id 107. model.google_ads_source.stg_google_ads__ad_history:f0->93. model.google_ads.google_ads__ad_report:f0 96. model.google_ads.google_ads__url_report 96. model.google_ads.google_ads__url_report ad_group_id 107. model.google_ads_source.stg_google_ads__ad_history:f0->96. model.google_ads.google_ads__url_report:f0
107. model.google_ads_source.stg_google_ads__ad_history
  • Input Column: 108. model.google_ads_source.stg_google_ads__ad_history_tmp[ad_group_id]
    • Cleaning Cast to TEXT type
    • Deduplication Used in ROW_NUMBER() OVER (PARTITION BY ...) for deduplication
    • Output Columns:
      • ad_group_id: Directly mapped after casting to TEXT
93. model.google_ads.google_ads__ad_report
  • Input Column: 107. model.google_ads_source.stg_google_ads__ad_history[ad_group_id]
    • Integration used to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_id: directly copied
96. model.google_ads.google_ads__url_report
  • Input Column: 107. model.google_ads_source.stg_google_ads__ad_history[ad_group_id]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_id: directly copied
Column Lineage
%3 108. model.google_ads_source.stg_google_ads__ad_history_tmp 108. model.google_ads_source.stg_google_ads__ad_history_tmp id 107. model.google_ads_source.stg_google_ads__ad_history 107. model.google_ads_source.stg_google_ads__ad_history ad_id 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f0 93. model.google_ads.google_ads__ad_report 93. model.google_ads.google_ads__ad_report ad_id 107. model.google_ads_source.stg_google_ads__ad_history:f0->93. model.google_ads.google_ads__ad_report:f0 96. model.google_ads.google_ads__url_report 96. model.google_ads.google_ads__url_report ad_id 107. model.google_ads_source.stg_google_ads__ad_history:f0->96. model.google_ads.google_ads__url_report:f0
107. model.google_ads_source.stg_google_ads__ad_history
  • Input Column: 108. model.google_ads_source.stg_google_ads__ad_history_tmp[id]
    • Cleaning Used as is (implicitly cast to INT)
    • Deduplication Used in ROW_NUMBER() OVER (PARTITION BY ...) for deduplication
    • Output Columns:
      • ad_id: Directly mapped
93. model.google_ads.google_ads__ad_report
  • Input Column: 107. model.google_ads_source.stg_google_ads__ad_history[ad_id]
    • Integration used to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • ad_id: directly copied
96. model.google_ads.google_ads__url_report
  • Input Column: 107. model.google_ads_source.stg_google_ads__ad_history[ad_id]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • ad_id: directly copied
Column Lineage
%3 108. model.google_ads_source.stg_google_ads__ad_history_tmp 108. model.google_ads_source.stg_google_ads__ad_history_tmp name 107. model.google_ads_source.stg_google_ads__ad_history 107. model.google_ads_source.stg_google_ads__ad_history ad_name 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f0 93. model.google_ads.google_ads__ad_report 93. model.google_ads.google_ads__ad_report ad_name 107. model.google_ads_source.stg_google_ads__ad_history:f0->93. model.google_ads.google_ads__ad_report:f0
107. model.google_ads_source.stg_google_ads__ad_history
  • Input Column: 108. model.google_ads_source.stg_google_ads__ad_history_tmp[name]
    • Direct Copied without transformation
    • Output Columns:
      • ad_name: Directly mapped
93. model.google_ads.google_ads__ad_report
  • Input Column: 107. model.google_ads_source.stg_google_ads__ad_history[ad_name]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition
    • Output Columns:
      • ad_name: Directly mapped to the output column
Column Lineage
%3 108. model.google_ads_source.stg_google_ads__ad_history_tmp 108. model.google_ads_source.stg_google_ads__ad_history_tmp updated_at 107. model.google_ads_source.stg_google_ads__ad_history 107. model.google_ads_source.stg_google_ads__ad_history updated_at 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f0
107. model.google_ads_source.stg_google_ads__ad_history
  • Input Column: 108. model.google_ads_source.stg_google_ads__ad_history_tmp[updated_at]
    • Cleaning Cast to TIMESTAMP type
    • Deduplication Used in ROW_NUMBER() OVER (... ORDER BY updated_at DESC) for deduplication
    • Output Columns:
      • updated_at: Directly mapped after casting
Column Lineage
%3 108. model.google_ads_source.stg_google_ads__ad_history_tmp 108. model.google_ads_source.stg_google_ads__ad_history_tmp type 107. model.google_ads_source.stg_google_ads__ad_history 107. model.google_ads_source.stg_google_ads__ad_history ad_type 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f0 93. model.google_ads.google_ads__ad_report 93. model.google_ads.google_ads__ad_report ad_type 107. model.google_ads_source.stg_google_ads__ad_history:f0->93. model.google_ads.google_ads__ad_report:f0
107. model.google_ads_source.stg_google_ads__ad_history
  • Input Column: 108. model.google_ads_source.stg_google_ads__ad_history_tmp[type]
    • Direct Copied without transformation
    • Output Columns:
      • ad_type: Directly mapped
93. model.google_ads.google_ads__ad_report
  • Input Column: 107. model.google_ads_source.stg_google_ads__ad_history[ad_type]
    • Direct directly copied to the output
    • Output Columns:
      • ad_type: directly copied
Column Lineage
%3 108. model.google_ads_source.stg_google_ads__ad_history_tmp 108. model.google_ads_source.stg_google_ads__ad_history_tmp status 107. model.google_ads_source.stg_google_ads__ad_history 107. model.google_ads_source.stg_google_ads__ad_history ad_status 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f0 93. model.google_ads.google_ads__ad_report 93. model.google_ads.google_ads__ad_report ad_status 107. model.google_ads_source.stg_google_ads__ad_history:f0->93. model.google_ads.google_ads__ad_report:f0
107. model.google_ads_source.stg_google_ads__ad_history
  • Input Column: 108. model.google_ads_source.stg_google_ads__ad_history_tmp[status]
    • Direct Copied without transformation
    • Output Columns:
      • ad_status: Directly mapped
93. model.google_ads.google_ads__ad_report
  • Input Column: 107. model.google_ads_source.stg_google_ads__ad_history[ad_status]
    • Direct directly copied to the output
    • Output Columns:
      • ad_status: directly copied
Column Lineage
%3 108. model.google_ads_source.stg_google_ads__ad_history_tmp 108. model.google_ads_source.stg_google_ads__ad_history_tmp display_url 107. model.google_ads_source.stg_google_ads__ad_history 107. model.google_ads_source.stg_google_ads__ad_history display_url 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f0 93. model.google_ads.google_ads__ad_report 93. model.google_ads.google_ads__ad_report display_url 107. model.google_ads_source.stg_google_ads__ad_history:f0->93. model.google_ads.google_ads__ad_report:f0
107. model.google_ads_source.stg_google_ads__ad_history
  • Input Column: 108. model.google_ads_source.stg_google_ads__ad_history_tmp[display_url]
    • Direct Copied without transformation
    • Output Columns:
      • display_url: Directly mapped
93. model.google_ads.google_ads__ad_report
  • Input Column: 107. model.google_ads_source.stg_google_ads__ad_history[display_url]
    • Direct directly copied to the output
    • Output Columns:
      • display_url: directly copied
Column Lineage
%3 108. model.google_ads_source.stg_google_ads__ad_history_tmp 108. model.google_ads_source.stg_google_ads__ad_history_tmp final_urls 107. model.google_ads_source.stg_google_ads__ad_history 107. model.google_ads_source.stg_google_ads__ad_history base_url final_url final_urls source_final_urls url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f3 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f2 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f1 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f0 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f4 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f5 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f9 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f8 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f6 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f7 108. model.google_ads_source.stg_google_ads__ad_history_tmp:f0->107. model.google_ads_source.stg_google_ads__ad_history:f10 93. model.google_ads.google_ads__ad_report 93. model.google_ads.google_ads__ad_report source_final_urls 107. model.google_ads_source.stg_google_ads__ad_history:f3->93. model.google_ads.google_ads__ad_report:f0 107. model.google_ads_source.stg_google_ads__ad_history:f2->93. model.google_ads.google_ads__ad_report:f0 96. model.google_ads.google_ads__url_report 96. model.google_ads.google_ads__url_report base_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 107. model.google_ads_source.stg_google_ads__ad_history:f1->96. model.google_ads.google_ads__url_report:f0 107. model.google_ads_source.stg_google_ads__ad_history:f1->96. model.google_ads.google_ads__url_report:f1 107. model.google_ads_source.stg_google_ads__ad_history:f1->96. model.google_ads.google_ads__url_report:f2 107. model.google_ads_source.stg_google_ads__ad_history:f1->96. model.google_ads.google_ads__url_report:f6 107. model.google_ads_source.stg_google_ads__ad_history:f1->96. model.google_ads.google_ads__url_report:f5 107. model.google_ads_source.stg_google_ads__ad_history:f1->96. model.google_ads.google_ads__url_report:f3 107. model.google_ads_source.stg_google_ads__ad_history:f1->96. model.google_ads.google_ads__url_report:f4 107. model.google_ads_source.stg_google_ads__ad_history:f1->96. model.google_ads.google_ads__url_report:f7 107. model.google_ads_source.stg_google_ads__ad_history:f0->96. model.google_ads.google_ads__url_report:f0 107. model.google_ads_source.stg_google_ads__ad_history:f4->96. model.google_ads.google_ads__url_report:f1 107. model.google_ads_source.stg_google_ads__ad_history:f5->96. model.google_ads.google_ads__url_report:f2 107. model.google_ads_source.stg_google_ads__ad_history:f9->96. model.google_ads.google_ads__url_report:f6 107. model.google_ads_source.stg_google_ads__ad_history:f8->96. model.google_ads.google_ads__url_report:f5 107. model.google_ads_source.stg_google_ads__ad_history:f6->96. model.google_ads.google_ads__url_report:f3 107. model.google_ads_source.stg_google_ads__ad_history:f7->96. model.google_ads.google_ads__url_report:f4 107. model.google_ads_source.stg_google_ads__ad_history:f10->96. model.google_ads.google_ads__url_report:f7
107. model.google_ads_source.stg_google_ads__ad_history
  • Input Column: 108. model.google_ads_source.stg_google_ads__ad_history_tmp[final_urls]
    • Cleaning Brackets removed, cast to TEXT
    • Featurization Used to extract various URL components and UTM parameters
    • Output Columns:
      • source_final_urls: Directly mapped before cleaning
      • final_urls: Mapped after cleaning (removing brackets)
      • final_url: First URL extracted from the cleaned list
      • base_url: Extracted from final_url
      • url_host: Extracted from final_url
      • url_path: Extracted from final_url
      • utm_source: Extracted from final_url
      • utm_medium: Extracted from final_url
      • utm_campaign: Extracted from final_url
      • utm_content: Extracted from final_url
      • utm_term: Extracted from final_url
93. model.google_ads.google_ads__ad_report
  • Input Column: 107. model.google_ads_source.stg_google_ads__ad_history[source_final_urls]
    • Direct directly copied to the output
    • Output Columns:
      • source_final_urls: directly copied
  • Input Column: 107. model.google_ads_source.stg_google_ads__ad_history[final_urls]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition
    • Output Columns:
      • source_final_urls: Directly mapped to the output column
96. model.google_ads.google_ads__url_report
  • Input Column: 107. model.google_ads_source.stg_google_ads__ad_history[final_url]
    • Featurization used to extract various URL components
    • Output Columns:
      • base_url: extracted from this column
      • url_host: extracted from this column
      • url_path: extracted from this column
      • utm_source: extracted from this column
      • utm_medium: extracted from this column
      • utm_campaign: extracted from this column
      • utm_content: extracted from this column
      • utm_term: extracted from this column
  • Input Column: 107. model.google_ads_source.stg_google_ads__ad_history[base_url]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • base_url: Directly copied to the output
  • Input Column: 107. model.google_ads_source.stg_google_ads__ad_history[url_host]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • url_host: Directly copied to the output
  • Input Column: 107. model.google_ads_source.stg_google_ads__ad_history[url_path]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • url_path: Directly copied to the output
  • Input Column: 107. model.google_ads_source.stg_google_ads__ad_history[utm_source]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • utm_source: Directly copied to the output
  • Input Column: 107. model.google_ads_source.stg_google_ads__ad_history[utm_medium]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • utm_medium: Directly copied to the output
  • Input Column: 107. model.google_ads_source.stg_google_ads__ad_history[utm_campaign]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • utm_campaign: Directly copied to the output
  • Input Column: 107. model.google_ads_source.stg_google_ads__ad_history[utm_content]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • utm_content: Directly copied to the output
  • Input Column: 107. model.google_ads_source.stg_google_ads__ad_history[utm_term]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • utm_term: Directly copied to the output
109. model.google_ads_source.stg_google_ads__ad_stats

This SQL query stages data from a Google Ads source table. It casts fields to specific data types, applies some data transformations (like converting cost_micros to dollars), and renames some columns. The query also includes logic to handle potentially null values and extracts ad_group_id from a string when necessary.

CleaningFeaturization
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_google_ads_source.stg_google_ads__ad_stats_tmp
), fields AS (
  SELECT
    CAST(NULL AS TEXT) AS ad_group,
    CAST(NULL AS TEXT) AS ad_group_id,
    CAST(NULL AS INT) AS ad_id,
    CAST(NULL AS TEXT) AS ad_network_type,
    CAST(NULL AS INT) AS campaign_id,
    CAST(NULL AS INT) AS clicks,
    CAST(NULL AS INT) AS cost_micros,
    CAST(NULL AS INT) AS customer_id,
    CAST(NULL AS DATE) AS date,
    CAST(NULL AS TEXT) AS device,
    CAST(NULL AS INT) AS impressions,
    CAST(NULL AS TEXT) AS keyword_ad_group_criterion,
    CAST(NULL AS INT) AS conversions,
    CAST(NULL AS INT) AS conversions_value,
    CAST(NULL AS INT) AS view_through_conversions,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    customer_id AS account_id,
    date AS date_day,
    COALESCE(CAST(ad_group_id AS TEXT), SPLIT_PART(ad_group, 'adGroups/', 2)) AS ad_group_id,
    keyword_ad_group_criterion,
    ad_network_type,
    device,
    ad_id,
    campaign_id,
    COALESCE(clicks, 0) AS clicks,
    COALESCE(cost_micros, 0) / 1000000.0 AS spend,
    COALESCE(impressions, 0) AS impressions,
    COALESCE(conversions, 0) AS conversions,
    COALESCE(conversions_value, 0) AS conversions_value,
    COALESCE(view_through_conversions, 0) AS view_through_conversions
  FROM fields
)
SELECT
  *
FROM final
%3 109. model.google_ads_source.stg_google_ads__ad_stats 109. model.google_ads_source.stg_google_ads__ad_stats source_relation account_id date_day ad_group_id ad_id campaign_id ad_network_type keyword_ad_group_criterion device clicks spend impressions conversions conversions_value view_through_conversions 110. model.google_ads_source.stg_google_ads__ad_stats_tmp 110. model.google_ads_source.stg_google_ads__ad_stats_tmp customer_id date ad_group_id ad_group keyword_ad_group_criterion ad_network_type device ad_id campaign_id clicks cost_micros impressions 110. model.google_ads_source.stg_google_ads__ad_stats_tmp:f0->109. model.google_ads_source.stg_google_ads__ad_stats:f1 110. model.google_ads_source.stg_google_ads__ad_stats_tmp:f1->109. model.google_ads_source.stg_google_ads__ad_stats:f2 110. model.google_ads_source.stg_google_ads__ad_stats_tmp:f2->109. model.google_ads_source.stg_google_ads__ad_stats:f3 110. model.google_ads_source.stg_google_ads__ad_stats_tmp:f3->109. model.google_ads_source.stg_google_ads__ad_stats:f3 110. model.google_ads_source.stg_google_ads__ad_stats_tmp:f4->109. model.google_ads_source.stg_google_ads__ad_stats:f7 110. model.google_ads_source.stg_google_ads__ad_stats_tmp:f5->109. model.google_ads_source.stg_google_ads__ad_stats:f6 110. model.google_ads_source.stg_google_ads__ad_stats_tmp:f6->109. model.google_ads_source.stg_google_ads__ad_stats:f8 110. model.google_ads_source.stg_google_ads__ad_stats_tmp:f7->109. model.google_ads_source.stg_google_ads__ad_stats:f4 110. model.google_ads_source.stg_google_ads__ad_stats_tmp:f8->109. model.google_ads_source.stg_google_ads__ad_stats:f5 110. model.google_ads_source.stg_google_ads__ad_stats_tmp:f9->109. model.google_ads_source.stg_google_ads__ad_stats:f9 110. model.google_ads_source.stg_google_ads__ad_stats_tmp:f10->109. model.google_ads_source.stg_google_ads__ad_stats:f10 110. model.google_ads_source.stg_google_ads__ad_stats_tmp:f11->109. model.google_ads_source.stg_google_ads__ad_stats:f11
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
account_id bigint The Customer ID.
date_day date The date being reported on.
ad_group_id text The ID representing the ad group, if present in the source data.
ad_id bigint The ID representing the ad, if present in the source data.
campaign_id bigint The ID representing the campaign, if present in the source data.
ad_network_type text The Google Ad network type used across the account.
keyword_ad_group_criterion text The ad group which the keyword criterion resides.
device text Account ad performance per unique device where the ads were served.
clicks integer The count of clicks.
spend numeric The sum of your cost-per-click (CPC) and cost-per-thousand impressions (CPM) costs during this period.
impressions integer The count of impressions.
conversions integer The number of conversions you've received, across your conversion actions. Conversions are measured with conversion tracking and may include [modeled](https://support.google.com/google-ads/answer/10081327?sjid=12862894247631803415-NC) conversions in cases where you are not able to observe all conversions that took place. You can use this column to see how often your ads led customers to actions that you’ve defined as valuable for your business.
conversions_value integer The sum of monetary values for your `conversions`. You have to enter a value in the Google Ads UI for your conversion actions to make this metric useful.
view_through_conversions integer For video campaigns, view-through conversions tell you when an _impression_ of your video ad leads to a conversion on your site. The last impression of a video ad will get credit for the view-through conversion. Keep in mind: An impression is different than a “view” of a video ad. A “view” is counted when someone watches 30 seconds (or the whole ad if it’s shorter than 30 seconds) or clicks on a part of the ad. A “view” that leads to a conversion is counted in the `conversions` column.
Column Lineage
%3 109. model.google_ads_source.stg_google_ads__ad_stats 109. model.google_ads_source.stg_google_ads__ad_stats source_relation 93. model.google_ads.google_ads__ad_report 93. model.google_ads.google_ads__ad_report source_relation 109. model.google_ads_source.stg_google_ads__ad_stats:f0->93. model.google_ads.google_ads__ad_report:f0 96. model.google_ads.google_ads__url_report 96. model.google_ads.google_ads__url_report source_relation 109. model.google_ads_source.stg_google_ads__ad_stats:f0->96. model.google_ads.google_ads__url_report:f0
93. model.google_ads.google_ads__ad_report
  • Input Column: 109. model.google_ads_source.stg_google_ads__ad_stats[source_relation]
    • Direct The column is directly copied without transformation
    • Integration Used as a key to join with other tables
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to output
96. model.google_ads.google_ads__url_report
  • Input Column: 109. model.google_ads_source.stg_google_ads__ad_stats[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with other tables
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
Column Lineage
%3 110. model.google_ads_source.stg_google_ads__ad_stats_tmp 110. model.google_ads_source.stg_google_ads__ad_stats_tmp customer_id 109. model.google_ads_source.stg_google_ads__ad_stats 109. model.google_ads_source.stg_google_ads__ad_stats account_id 110. model.google_ads_source.stg_google_ads__ad_stats_tmp:f0->109. model.google_ads_source.stg_google_ads__ad_stats:f0 93. model.google_ads.google_ads__ad_report 93. model.google_ads.google_ads__ad_report account_id 109. model.google_ads_source.stg_google_ads__ad_stats:f0->93. model.google_ads.google_ads__ad_report:f0
109. model.google_ads_source.stg_google_ads__ad_stats
  • Input Column: 110. model.google_ads_source.stg_google_ads__ad_stats_tmp[customer_id]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as INT in the fields CTE
    • Output Columns:
      • account_id: Directly mapped and renamed
93. model.google_ads.google_ads__ad_report
  • Input Column: 109. model.google_ads_source.stg_google_ads__ad_stats[account_id]
    • Integration Used as a key to join with the accounts table
    • Output Columns:
      • account_id: Indirectly mapped through the join with accounts table
Column Lineage
%3 110. model.google_ads_source.stg_google_ads__ad_stats_tmp 110. model.google_ads_source.stg_google_ads__ad_stats_tmp date 109. model.google_ads_source.stg_google_ads__ad_stats 109. model.google_ads_source.stg_google_ads__ad_stats date_day 110. model.google_ads_source.stg_google_ads__ad_stats_tmp:f0->109. model.google_ads_source.stg_google_ads__ad_stats:f0 93. model.google_ads.google_ads__ad_report 93. model.google_ads.google_ads__ad_report date_day 109. model.google_ads_source.stg_google_ads__ad_stats:f0->93. model.google_ads.google_ads__ad_report:f0 96. model.google_ads.google_ads__url_report 96. model.google_ads.google_ads__url_report date_day 109. model.google_ads_source.stg_google_ads__ad_stats:f0->96. model.google_ads.google_ads__url_report:f0
109. model.google_ads_source.stg_google_ads__ad_stats
  • Input Column: 110. model.google_ads_source.stg_google_ads__ad_stats_tmp[date]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as DATE in the fields CTE
    • Output Columns:
      • date_day: Directly mapped and renamed
93. model.google_ads.google_ads__ad_report
  • Input Column: 109. model.google_ads_source.stg_google_ads__ad_stats[date_day]
    • Direct The column is directly copied without transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to output
96. model.google_ads.google_ads__url_report
  • Input Column: 109. model.google_ads_source.stg_google_ads__ad_stats[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 110. model.google_ads_source.stg_google_ads__ad_stats_tmp 110. model.google_ads_source.stg_google_ads__ad_stats_tmp ad_group ad_group_id 109. model.google_ads_source.stg_google_ads__ad_stats 109. model.google_ads_source.stg_google_ads__ad_stats ad_group_id 110. model.google_ads_source.stg_google_ads__ad_stats_tmp:f1->109. model.google_ads_source.stg_google_ads__ad_stats:f0 110. model.google_ads_source.stg_google_ads__ad_stats_tmp:f0->109. model.google_ads_source.stg_google_ads__ad_stats:f0 93. model.google_ads.google_ads__ad_report 93. model.google_ads.google_ads__ad_report ad_group_id 109. model.google_ads_source.stg_google_ads__ad_stats:f0->93. model.google_ads.google_ads__ad_report:f0 96. model.google_ads.google_ads__url_report 96. model.google_ads.google_ads__url_report ad_group_id 109. model.google_ads_source.stg_google_ads__ad_stats:f0->96. model.google_ads.google_ads__url_report:f0
109. model.google_ads_source.stg_google_ads__ad_stats
  • Input Column: 110. model.google_ads_source.stg_google_ads__ad_stats_tmp[ad_group_id]
    • Cleaning The column is cast as TEXT in the fields CTE
    • Other Used in a COALESCE function with ad_group
    • Output Columns:
      • ad_group_id: Mapped through COALESCE with ad_group
  • Input Column: 110. model.google_ads_source.stg_google_ads__ad_stats_tmp[ad_group]
    • Cleaning The column is cast as TEXT in the fields CTE
    • Featurization The ad_group_id is extracted from this column using SPLIT_PART
    • Output Columns:
      • ad_group_id: Used as fallback in COALESCE if ad_group_id is null
93. model.google_ads.google_ads__ad_report
  • Input Column: 109. model.google_ads_source.stg_google_ads__ad_stats[ad_group_id]
    • Direct The column is directly copied without transformation
    • Integration Used as a key to join with other tables
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • ad_group_id: Directly copied to output
96. model.google_ads.google_ads__url_report
  • Input Column: 109. model.google_ads_source.stg_google_ads__ad_stats[ad_group_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with other tables
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • ad_group_id: Directly copied to the output
Column Lineage
%3 110. model.google_ads_source.stg_google_ads__ad_stats_tmp 110. model.google_ads_source.stg_google_ads__ad_stats_tmp ad_id 109. model.google_ads_source.stg_google_ads__ad_stats 109. model.google_ads_source.stg_google_ads__ad_stats ad_id 110. model.google_ads_source.stg_google_ads__ad_stats_tmp:f0->109. model.google_ads_source.stg_google_ads__ad_stats:f0 93. model.google_ads.google_ads__ad_report 93. model.google_ads.google_ads__ad_report ad_id 109. model.google_ads_source.stg_google_ads__ad_stats:f0->93. model.google_ads.google_ads__ad_report:f0 96. model.google_ads.google_ads__url_report 96. model.google_ads.google_ads__url_report ad_id 109. model.google_ads_source.stg_google_ads__ad_stats:f0->96. model.google_ads.google_ads__url_report:f0
109. model.google_ads_source.stg_google_ads__ad_stats
  • Input Column: 110. model.google_ads_source.stg_google_ads__ad_stats_tmp[ad_id]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as INT in the fields CTE
    • Output Columns:
      • ad_id: Directly mapped
93. model.google_ads.google_ads__ad_report
  • Input Column: 109. model.google_ads_source.stg_google_ads__ad_stats[ad_id]
    • Direct The column is directly copied without transformation
    • Integration Used as a key to join with the ads table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • ad_id: Directly copied to output
96. model.google_ads.google_ads__url_report
  • Input Column: 109. model.google_ads_source.stg_google_ads__ad_stats[ad_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with the ads table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • ad_id: Directly copied to the output
Column Lineage
%3 110. model.google_ads_source.stg_google_ads__ad_stats_tmp 110. model.google_ads_source.stg_google_ads__ad_stats_tmp campaign_id 109. model.google_ads_source.stg_google_ads__ad_stats 109. model.google_ads_source.stg_google_ads__ad_stats campaign_id 110. model.google_ads_source.stg_google_ads__ad_stats_tmp:f0->109. model.google_ads_source.stg_google_ads__ad_stats:f0
109. model.google_ads_source.stg_google_ads__ad_stats
  • Input Column: 110. model.google_ads_source.stg_google_ads__ad_stats_tmp[campaign_id]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as INT in the fields CTE
    • Output Columns:
      • campaign_id: Directly mapped
Column Lineage
%3 110. model.google_ads_source.stg_google_ads__ad_stats_tmp 110. model.google_ads_source.stg_google_ads__ad_stats_tmp ad_network_type 109. model.google_ads_source.stg_google_ads__ad_stats 109. model.google_ads_source.stg_google_ads__ad_stats ad_network_type 110. model.google_ads_source.stg_google_ads__ad_stats_tmp:f0->109. model.google_ads_source.stg_google_ads__ad_stats:f0
109. model.google_ads_source.stg_google_ads__ad_stats
  • Input Column: 110. model.google_ads_source.stg_google_ads__ad_stats_tmp[ad_network_type]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • ad_network_type: Directly mapped
Column Lineage
%3 110. model.google_ads_source.stg_google_ads__ad_stats_tmp 110. model.google_ads_source.stg_google_ads__ad_stats_tmp keyword_ad_group_criterion 109. model.google_ads_source.stg_google_ads__ad_stats 109. model.google_ads_source.stg_google_ads__ad_stats keyword_ad_group_criterion 110. model.google_ads_source.stg_google_ads__ad_stats_tmp:f0->109. model.google_ads_source.stg_google_ads__ad_stats:f0
109. model.google_ads_source.stg_google_ads__ad_stats
  • Input Column: 110. model.google_ads_source.stg_google_ads__ad_stats_tmp[keyword_ad_group_criterion]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • keyword_ad_group_criterion: Directly mapped
Column Lineage
%3 110. model.google_ads_source.stg_google_ads__ad_stats_tmp 110. model.google_ads_source.stg_google_ads__ad_stats_tmp device 109. model.google_ads_source.stg_google_ads__ad_stats 109. model.google_ads_source.stg_google_ads__ad_stats device 110. model.google_ads_source.stg_google_ads__ad_stats_tmp:f0->109. model.google_ads_source.stg_google_ads__ad_stats:f0
109. model.google_ads_source.stg_google_ads__ad_stats
  • Input Column: 110. model.google_ads_source.stg_google_ads__ad_stats_tmp[device]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • device: Directly mapped
Column Lineage
%3 110. model.google_ads_source.stg_google_ads__ad_stats_tmp 110. model.google_ads_source.stg_google_ads__ad_stats_tmp clicks 109. model.google_ads_source.stg_google_ads__ad_stats 109. model.google_ads_source.stg_google_ads__ad_stats clicks 110. model.google_ads_source.stg_google_ads__ad_stats_tmp:f0->109. model.google_ads_source.stg_google_ads__ad_stats:f0 93. model.google_ads.google_ads__ad_report 93. model.google_ads.google_ads__ad_report clicks 109. model.google_ads_source.stg_google_ads__ad_stats:f0->93. model.google_ads.google_ads__ad_report:f0 96. model.google_ads.google_ads__url_report 96. model.google_ads.google_ads__url_report clicks 109. model.google_ads_source.stg_google_ads__ad_stats:f0->96. model.google_ads.google_ads__url_report:f0
109. model.google_ads_source.stg_google_ads__ad_stats
  • Input Column: 110. model.google_ads_source.stg_google_ads__ad_stats_tmp[clicks]
    • Cleaning The column is cast as INT in the fields CTE
    • Other COALESCE is used to replace NULL values with 0
    • Output Columns:
      • clicks: Mapped with COALESCE to handle NULL values
93. model.google_ads.google_ads__ad_report
  • Input Column: 109. model.google_ads_source.stg_google_ads__ad_stats[clicks]
    • Aggregation Summed up in the SELECT clause
    • Output Columns:
      • clicks: Aggregated into the total clicks
96. model.google_ads.google_ads__url_report
  • Input Column: 109. model.google_ads_source.stg_google_ads__ad_stats[clicks]
    • Aggregation The column is summed up in the SELECT clause
    • Output Columns:
      • clicks: Aggregated sum in the output
Column Lineage
%3 110. model.google_ads_source.stg_google_ads__ad_stats_tmp 110. model.google_ads_source.stg_google_ads__ad_stats_tmp cost_micros 109. model.google_ads_source.stg_google_ads__ad_stats 109. model.google_ads_source.stg_google_ads__ad_stats spend 110. model.google_ads_source.stg_google_ads__ad_stats_tmp:f0->109. model.google_ads_source.stg_google_ads__ad_stats:f0 93. model.google_ads.google_ads__ad_report 93. model.google_ads.google_ads__ad_report spend 109. model.google_ads_source.stg_google_ads__ad_stats:f0->93. model.google_ads.google_ads__ad_report:f0 96. model.google_ads.google_ads__url_report 96. model.google_ads.google_ads__url_report spend 109. model.google_ads_source.stg_google_ads__ad_stats:f0->96. model.google_ads.google_ads__url_report:f0
109. model.google_ads_source.stg_google_ads__ad_stats
  • Input Column: 110. model.google_ads_source.stg_google_ads__ad_stats_tmp[cost_micros]
    • Cleaning The column is cleaned by casting to INT and then divided by 1,000,000 to convert from micros to dollars.
    • Output Columns:
      • spend: The cost_micros is divided by 1,000,000 and mapped to the 'spend' column in the output.
93. model.google_ads.google_ads__ad_report
  • Input Column: 109. model.google_ads_source.stg_google_ads__ad_stats[spend]
    • Aggregation The spend is summed up in the GROUP BY clause
    • Output Columns:
      • spend: Directly mapped after aggregation
96. model.google_ads.google_ads__url_report
  • Input Column: 109. model.google_ads_source.stg_google_ads__ad_stats[spend]
    • Aggregation The spend is summed up in the GROUP BY clause
    • Output Columns:
      • spend: It is directly mapped to the output 'spend' column after aggregation
Column Lineage
%3 110. model.google_ads_source.stg_google_ads__ad_stats_tmp 110. model.google_ads_source.stg_google_ads__ad_stats_tmp impressions 109. model.google_ads_source.stg_google_ads__ad_stats 109. model.google_ads_source.stg_google_ads__ad_stats impressions 110. model.google_ads_source.stg_google_ads__ad_stats_tmp:f0->109. model.google_ads_source.stg_google_ads__ad_stats:f0 93. model.google_ads.google_ads__ad_report 93. model.google_ads.google_ads__ad_report impressions 109. model.google_ads_source.stg_google_ads__ad_stats:f0->93. model.google_ads.google_ads__ad_report:f0 96. model.google_ads.google_ads__url_report 96. model.google_ads.google_ads__url_report impressions 109. model.google_ads_source.stg_google_ads__ad_stats:f0->96. model.google_ads.google_ads__url_report:f0
109. model.google_ads_source.stg_google_ads__ad_stats
  • Input Column: 110. model.google_ads_source.stg_google_ads__ad_stats_tmp[impressions]
    • Cleaning The column is cleaned by casting to INT and using COALESCE to handle null values.
    • Output Columns:
      • impressions: The impressions column is directly mapped to the 'impressions' column in the output, with null values replaced by 0.
93. model.google_ads.google_ads__ad_report
  • Input Column: 109. model.google_ads_source.stg_google_ads__ad_stats[impressions]
    • Aggregation The impressions are summed up in the GROUP BY clause
    • Output Columns:
      • impressions: Directly mapped after aggregation
96. model.google_ads.google_ads__url_report
  • Input Column: 109. model.google_ads_source.stg_google_ads__ad_stats[impressions]
    • Aggregation The impressions are summed up in the GROUP BY clause
    • Output Columns:
      • impressions: It is directly mapped to the output 'impressions' column after aggregation
Column Lineage
%3 109. model.google_ads_source.stg_google_ads__ad_stats 109. model.google_ads_source.stg_google_ads__ad_stats conversions 93. model.google_ads.google_ads__ad_report 93. model.google_ads.google_ads__ad_report conversions 109. model.google_ads_source.stg_google_ads__ad_stats:f0->93. model.google_ads.google_ads__ad_report:f0 96. model.google_ads.google_ads__url_report 96. model.google_ads.google_ads__url_report conversions 109. model.google_ads_source.stg_google_ads__ad_stats:f0->96. model.google_ads.google_ads__url_report:f0
93. model.google_ads.google_ads__ad_report
  • Input Column: 109. model.google_ads_source.stg_google_ads__ad_stats[conversions]
    • Aggregation The conversions are summed up in the GROUP BY clause
    • Output Columns:
      • conversions: Directly mapped after aggregation
96. model.google_ads.google_ads__url_report
  • Input Column: 109. model.google_ads_source.stg_google_ads__ad_stats[conversions]
    • Aggregation The conversions are summed up in the GROUP BY clause
    • Output Columns:
      • conversions: It is directly mapped to the output 'conversions' column after aggregation
Column Lineage
%3 109. model.google_ads_source.stg_google_ads__ad_stats 109. model.google_ads_source.stg_google_ads__ad_stats conversions_value 93. model.google_ads.google_ads__ad_report 93. model.google_ads.google_ads__ad_report conversions_value 109. model.google_ads_source.stg_google_ads__ad_stats:f0->93. model.google_ads.google_ads__ad_report:f0 96. model.google_ads.google_ads__url_report 96. model.google_ads.google_ads__url_report conversions_value 109. model.google_ads_source.stg_google_ads__ad_stats:f0->96. model.google_ads.google_ads__url_report:f0
93. model.google_ads.google_ads__ad_report
  • Input Column: 109. model.google_ads_source.stg_google_ads__ad_stats[conversions_value]
    • Aggregation The conversions_value is summed up in the GROUP BY clause
    • Output Columns:
      • conversions_value: Directly mapped after aggregation
96. model.google_ads.google_ads__url_report
  • Input Column: 109. model.google_ads_source.stg_google_ads__ad_stats[conversions_value]
    • Aggregation The conversions_value is summed up in the GROUP BY clause
    • Output Columns:
      • conversions_value: It is directly mapped to the output 'conversions_value' column after aggregation
Column Lineage
%3 109. model.google_ads_source.stg_google_ads__ad_stats 109. model.google_ads_source.stg_google_ads__ad_stats view_through_conversions 93. model.google_ads.google_ads__ad_report 93. model.google_ads.google_ads__ad_report view_through_conversions 109. model.google_ads_source.stg_google_ads__ad_stats:f0->93. model.google_ads.google_ads__ad_report:f0 96. model.google_ads.google_ads__url_report 96. model.google_ads.google_ads__url_report view_through_conversions 109. model.google_ads_source.stg_google_ads__ad_stats:f0->96. model.google_ads.google_ads__url_report:f0
93. model.google_ads.google_ads__ad_report
  • Input Column: 109. model.google_ads_source.stg_google_ads__ad_stats[view_through_conversions]
    • Aggregation The view_through_conversions are summed up in the GROUP BY clause
    • Output Columns:
      • view_through_conversions: Directly mapped after aggregation
96. model.google_ads.google_ads__url_report
  • Input Column: 109. model.google_ads_source.stg_google_ads__ad_stats[view_through_conversions]
    • Aggregation The view_through_conversions are summed up in the GROUP BY clause
    • Output Columns:
      • view_through_conversions: It is directly mapped to the output 'view_through_conversions' column after aggregation
110. model.google_ads_source.stg_google_ads__ad_stats_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of type TEXT. It's likely used as a placeholder or template for further operations in a dbt (data build tool) project, specifically for the 'model.google_ads_source.stg_google_ads__ad_stats_tmp' model.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 110. model.google_ads_source.stg_google_ads__ad_stats_tmp 110. model.google_ads_source.stg_google_ads__ad_stats_tmp customer_id date ad_group_id ad_group keyword_ad_group_criterion ad_network_type device ad_id campaign_id clicks cost_micros impressions 312. source.google_ads_source.google_ads.ad_stats 312. source.google_ads_source.google_ads.ad_stats
Name Type Comment
customer_id bigint None
date date None
ad_group_id bigint None
ad_group text None
keyword_ad_group_criterion text None
ad_network_type text None
device text None
ad_id bigint None
campaign_id bigint None
clicks integer None
cost_micros integer None
impressions integer None
Column Lineage
%3 110. model.google_ads_source.stg_google_ads__ad_stats_tmp 110. model.google_ads_source.stg_google_ads__ad_stats_tmp customer_id 109. model.google_ads_source.stg_google_ads__ad_stats 109. model.google_ads_source.stg_google_ads__ad_stats account_id 110. model.google_ads_source.stg_google_ads__ad_stats_tmp:f0->109. model.google_ads_source.stg_google_ads__ad_stats:f0 93. model.google_ads.google_ads__ad_report 93. model.google_ads.google_ads__ad_report account_id 109. model.google_ads_source.stg_google_ads__ad_stats:f0->93. model.google_ads.google_ads__ad_report:f0
109. model.google_ads_source.stg_google_ads__ad_stats
  • Input Column: 110. model.google_ads_source.stg_google_ads__ad_stats_tmp[customer_id]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as INT in the fields CTE
    • Output Columns:
      • account_id: Directly mapped and renamed
93. model.google_ads.google_ads__ad_report
  • Input Column: 109. model.google_ads_source.stg_google_ads__ad_stats[account_id]
    • Integration Used as a key to join with the accounts table
    • Output Columns:
      • account_id: Indirectly mapped through the join with accounts table
Column Lineage
%3 110. model.google_ads_source.stg_google_ads__ad_stats_tmp 110. model.google_ads_source.stg_google_ads__ad_stats_tmp date 109. model.google_ads_source.stg_google_ads__ad_stats 109. model.google_ads_source.stg_google_ads__ad_stats date_day 110. model.google_ads_source.stg_google_ads__ad_stats_tmp:f0->109. model.google_ads_source.stg_google_ads__ad_stats:f0 93. model.google_ads.google_ads__ad_report 93. model.google_ads.google_ads__ad_report date_day 109. model.google_ads_source.stg_google_ads__ad_stats:f0->93. model.google_ads.google_ads__ad_report:f0 96. model.google_ads.google_ads__url_report 96. model.google_ads.google_ads__url_report date_day 109. model.google_ads_source.stg_google_ads__ad_stats:f0->96. model.google_ads.google_ads__url_report:f0
109. model.google_ads_source.stg_google_ads__ad_stats
  • Input Column: 110. model.google_ads_source.stg_google_ads__ad_stats_tmp[date]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as DATE in the fields CTE
    • Output Columns:
      • date_day: Directly mapped and renamed
93. model.google_ads.google_ads__ad_report
  • Input Column: 109. model.google_ads_source.stg_google_ads__ad_stats[date_day]
    • Direct The column is directly copied without transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to output
96. model.google_ads.google_ads__url_report
  • Input Column: 109. model.google_ads_source.stg_google_ads__ad_stats[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 110. model.google_ads_source.stg_google_ads__ad_stats_tmp 110. model.google_ads_source.stg_google_ads__ad_stats_tmp ad_group_id 109. model.google_ads_source.stg_google_ads__ad_stats 109. model.google_ads_source.stg_google_ads__ad_stats ad_group_id 110. model.google_ads_source.stg_google_ads__ad_stats_tmp:f0->109. model.google_ads_source.stg_google_ads__ad_stats:f0 93. model.google_ads.google_ads__ad_report 93. model.google_ads.google_ads__ad_report ad_group_id 109. model.google_ads_source.stg_google_ads__ad_stats:f0->93. model.google_ads.google_ads__ad_report:f0 96. model.google_ads.google_ads__url_report 96. model.google_ads.google_ads__url_report ad_group_id 109. model.google_ads_source.stg_google_ads__ad_stats:f0->96. model.google_ads.google_ads__url_report:f0
109. model.google_ads_source.stg_google_ads__ad_stats
  • Input Column: 110. model.google_ads_source.stg_google_ads__ad_stats_tmp[ad_group_id]
    • Cleaning The column is cast as TEXT in the fields CTE
    • Other Used in a COALESCE function with ad_group
    • Output Columns:
      • ad_group_id: Mapped through COALESCE with ad_group
93. model.google_ads.google_ads__ad_report
  • Input Column: 109. model.google_ads_source.stg_google_ads__ad_stats[ad_group_id]
    • Direct The column is directly copied without transformation
    • Integration Used as a key to join with other tables
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • ad_group_id: Directly copied to output
96. model.google_ads.google_ads__url_report
  • Input Column: 109. model.google_ads_source.stg_google_ads__ad_stats[ad_group_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with other tables
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • ad_group_id: Directly copied to the output
Column Lineage
%3 110. model.google_ads_source.stg_google_ads__ad_stats_tmp 110. model.google_ads_source.stg_google_ads__ad_stats_tmp ad_group 109. model.google_ads_source.stg_google_ads__ad_stats 109. model.google_ads_source.stg_google_ads__ad_stats ad_group_id 110. model.google_ads_source.stg_google_ads__ad_stats_tmp:f0->109. model.google_ads_source.stg_google_ads__ad_stats:f0 93. model.google_ads.google_ads__ad_report 93. model.google_ads.google_ads__ad_report ad_group_id 109. model.google_ads_source.stg_google_ads__ad_stats:f0->93. model.google_ads.google_ads__ad_report:f0 96. model.google_ads.google_ads__url_report 96. model.google_ads.google_ads__url_report ad_group_id 109. model.google_ads_source.stg_google_ads__ad_stats:f0->96. model.google_ads.google_ads__url_report:f0
109. model.google_ads_source.stg_google_ads__ad_stats
  • Input Column: 110. model.google_ads_source.stg_google_ads__ad_stats_tmp[ad_group]
    • Cleaning The column is cast as TEXT in the fields CTE
    • Featurization The ad_group_id is extracted from this column using SPLIT_PART
    • Output Columns:
      • ad_group_id: Used as fallback in COALESCE if ad_group_id is null
93. model.google_ads.google_ads__ad_report
  • Input Column: 109. model.google_ads_source.stg_google_ads__ad_stats[ad_group_id]
    • Direct The column is directly copied without transformation
    • Integration Used as a key to join with other tables
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • ad_group_id: Directly copied to output
96. model.google_ads.google_ads__url_report
  • Input Column: 109. model.google_ads_source.stg_google_ads__ad_stats[ad_group_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with other tables
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • ad_group_id: Directly copied to the output
Column Lineage
%3 110. model.google_ads_source.stg_google_ads__ad_stats_tmp 110. model.google_ads_source.stg_google_ads__ad_stats_tmp keyword_ad_group_criterion 109. model.google_ads_source.stg_google_ads__ad_stats 109. model.google_ads_source.stg_google_ads__ad_stats keyword_ad_group_criterion 110. model.google_ads_source.stg_google_ads__ad_stats_tmp:f0->109. model.google_ads_source.stg_google_ads__ad_stats:f0
109. model.google_ads_source.stg_google_ads__ad_stats
  • Input Column: 110. model.google_ads_source.stg_google_ads__ad_stats_tmp[keyword_ad_group_criterion]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • keyword_ad_group_criterion: Directly mapped
Column Lineage
%3 110. model.google_ads_source.stg_google_ads__ad_stats_tmp 110. model.google_ads_source.stg_google_ads__ad_stats_tmp ad_network_type 109. model.google_ads_source.stg_google_ads__ad_stats 109. model.google_ads_source.stg_google_ads__ad_stats ad_network_type 110. model.google_ads_source.stg_google_ads__ad_stats_tmp:f0->109. model.google_ads_source.stg_google_ads__ad_stats:f0
109. model.google_ads_source.stg_google_ads__ad_stats
  • Input Column: 110. model.google_ads_source.stg_google_ads__ad_stats_tmp[ad_network_type]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • ad_network_type: Directly mapped
Column Lineage
%3 110. model.google_ads_source.stg_google_ads__ad_stats_tmp 110. model.google_ads_source.stg_google_ads__ad_stats_tmp device 109. model.google_ads_source.stg_google_ads__ad_stats 109. model.google_ads_source.stg_google_ads__ad_stats device 110. model.google_ads_source.stg_google_ads__ad_stats_tmp:f0->109. model.google_ads_source.stg_google_ads__ad_stats:f0
109. model.google_ads_source.stg_google_ads__ad_stats
  • Input Column: 110. model.google_ads_source.stg_google_ads__ad_stats_tmp[device]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • device: Directly mapped
Column Lineage
%3 110. model.google_ads_source.stg_google_ads__ad_stats_tmp 110. model.google_ads_source.stg_google_ads__ad_stats_tmp ad_id 109. model.google_ads_source.stg_google_ads__ad_stats 109. model.google_ads_source.stg_google_ads__ad_stats ad_id 110. model.google_ads_source.stg_google_ads__ad_stats_tmp:f0->109. model.google_ads_source.stg_google_ads__ad_stats:f0 93. model.google_ads.google_ads__ad_report 93. model.google_ads.google_ads__ad_report ad_id 109. model.google_ads_source.stg_google_ads__ad_stats:f0->93. model.google_ads.google_ads__ad_report:f0 96. model.google_ads.google_ads__url_report 96. model.google_ads.google_ads__url_report ad_id 109. model.google_ads_source.stg_google_ads__ad_stats:f0->96. model.google_ads.google_ads__url_report:f0
109. model.google_ads_source.stg_google_ads__ad_stats
  • Input Column: 110. model.google_ads_source.stg_google_ads__ad_stats_tmp[ad_id]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as INT in the fields CTE
    • Output Columns:
      • ad_id: Directly mapped
93. model.google_ads.google_ads__ad_report
  • Input Column: 109. model.google_ads_source.stg_google_ads__ad_stats[ad_id]
    • Direct The column is directly copied without transformation
    • Integration Used as a key to join with the ads table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • ad_id: Directly copied to output
96. model.google_ads.google_ads__url_report
  • Input Column: 109. model.google_ads_source.stg_google_ads__ad_stats[ad_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with the ads table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • ad_id: Directly copied to the output
Column Lineage
%3 110. model.google_ads_source.stg_google_ads__ad_stats_tmp 110. model.google_ads_source.stg_google_ads__ad_stats_tmp campaign_id 109. model.google_ads_source.stg_google_ads__ad_stats 109. model.google_ads_source.stg_google_ads__ad_stats campaign_id 110. model.google_ads_source.stg_google_ads__ad_stats_tmp:f0->109. model.google_ads_source.stg_google_ads__ad_stats:f0
109. model.google_ads_source.stg_google_ads__ad_stats
  • Input Column: 110. model.google_ads_source.stg_google_ads__ad_stats_tmp[campaign_id]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as INT in the fields CTE
    • Output Columns:
      • campaign_id: Directly mapped
Column Lineage
%3 110. model.google_ads_source.stg_google_ads__ad_stats_tmp 110. model.google_ads_source.stg_google_ads__ad_stats_tmp clicks 109. model.google_ads_source.stg_google_ads__ad_stats 109. model.google_ads_source.stg_google_ads__ad_stats clicks 110. model.google_ads_source.stg_google_ads__ad_stats_tmp:f0->109. model.google_ads_source.stg_google_ads__ad_stats:f0 93. model.google_ads.google_ads__ad_report 93. model.google_ads.google_ads__ad_report clicks 109. model.google_ads_source.stg_google_ads__ad_stats:f0->93. model.google_ads.google_ads__ad_report:f0 96. model.google_ads.google_ads__url_report 96. model.google_ads.google_ads__url_report clicks 109. model.google_ads_source.stg_google_ads__ad_stats:f0->96. model.google_ads.google_ads__url_report:f0
109. model.google_ads_source.stg_google_ads__ad_stats
  • Input Column: 110. model.google_ads_source.stg_google_ads__ad_stats_tmp[clicks]
    • Cleaning The column is cast as INT in the fields CTE
    • Other COALESCE is used to replace NULL values with 0
    • Output Columns:
      • clicks: Mapped with COALESCE to handle NULL values
93. model.google_ads.google_ads__ad_report
  • Input Column: 109. model.google_ads_source.stg_google_ads__ad_stats[clicks]
    • Aggregation Summed up in the SELECT clause
    • Output Columns:
      • clicks: Aggregated into the total clicks
96. model.google_ads.google_ads__url_report
  • Input Column: 109. model.google_ads_source.stg_google_ads__ad_stats[clicks]
    • Aggregation The column is summed up in the SELECT clause
    • Output Columns:
      • clicks: Aggregated sum in the output
Column Lineage
%3 110. model.google_ads_source.stg_google_ads__ad_stats_tmp 110. model.google_ads_source.stg_google_ads__ad_stats_tmp cost_micros 109. model.google_ads_source.stg_google_ads__ad_stats 109. model.google_ads_source.stg_google_ads__ad_stats spend 110. model.google_ads_source.stg_google_ads__ad_stats_tmp:f0->109. model.google_ads_source.stg_google_ads__ad_stats:f0 93. model.google_ads.google_ads__ad_report 93. model.google_ads.google_ads__ad_report spend 109. model.google_ads_source.stg_google_ads__ad_stats:f0->93. model.google_ads.google_ads__ad_report:f0 96. model.google_ads.google_ads__url_report 96. model.google_ads.google_ads__url_report spend 109. model.google_ads_source.stg_google_ads__ad_stats:f0->96. model.google_ads.google_ads__url_report:f0
109. model.google_ads_source.stg_google_ads__ad_stats
  • Input Column: 110. model.google_ads_source.stg_google_ads__ad_stats_tmp[cost_micros]
    • Cleaning The column is cleaned by casting to INT and then divided by 1,000,000 to convert from micros to dollars.
    • Output Columns:
      • spend: The cost_micros is divided by 1,000,000 and mapped to the 'spend' column in the output.
93. model.google_ads.google_ads__ad_report
  • Input Column: 109. model.google_ads_source.stg_google_ads__ad_stats[spend]
    • Aggregation The spend is summed up in the GROUP BY clause
    • Output Columns:
      • spend: Directly mapped after aggregation
96. model.google_ads.google_ads__url_report
  • Input Column: 109. model.google_ads_source.stg_google_ads__ad_stats[spend]
    • Aggregation The spend is summed up in the GROUP BY clause
    • Output Columns:
      • spend: It is directly mapped to the output 'spend' column after aggregation
Column Lineage
%3 110. model.google_ads_source.stg_google_ads__ad_stats_tmp 110. model.google_ads_source.stg_google_ads__ad_stats_tmp impressions 109. model.google_ads_source.stg_google_ads__ad_stats 109. model.google_ads_source.stg_google_ads__ad_stats impressions 110. model.google_ads_source.stg_google_ads__ad_stats_tmp:f0->109. model.google_ads_source.stg_google_ads__ad_stats:f0 93. model.google_ads.google_ads__ad_report 93. model.google_ads.google_ads__ad_report impressions 109. model.google_ads_source.stg_google_ads__ad_stats:f0->93. model.google_ads.google_ads__ad_report:f0 96. model.google_ads.google_ads__url_report 96. model.google_ads.google_ads__url_report impressions 109. model.google_ads_source.stg_google_ads__ad_stats:f0->96. model.google_ads.google_ads__url_report:f0
109. model.google_ads_source.stg_google_ads__ad_stats
  • Input Column: 110. model.google_ads_source.stg_google_ads__ad_stats_tmp[impressions]
    • Cleaning The column is cleaned by casting to INT and using COALESCE to handle null values.
    • Output Columns:
      • impressions: The impressions column is directly mapped to the 'impressions' column in the output, with null values replaced by 0.
93. model.google_ads.google_ads__ad_report
  • Input Column: 109. model.google_ads_source.stg_google_ads__ad_stats[impressions]
    • Aggregation The impressions are summed up in the GROUP BY clause
    • Output Columns:
      • impressions: Directly mapped after aggregation
96. model.google_ads.google_ads__url_report
  • Input Column: 109. model.google_ads_source.stg_google_ads__ad_stats[impressions]
    • Aggregation The impressions are summed up in the GROUP BY clause
    • Output Columns:
      • impressions: It is directly mapped to the output 'impressions' column after aggregation
111. model.google_ads_source.stg_google_ads__campaign_history

This SQL query stages data for a Google Ads campaign history model. It starts by selecting all columns from a temporary table, then defines a set of fields with specific data types. The query then selects and renames certain columns, adds a source relation column, and creates an 'is_most_recent_record' flag using a window function. Finally, it filters for active records.

CleaningDeduplicationFiltering
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_google_ads_source.stg_google_ads__campaign_history_tmp
), fields AS (
  SELECT
    CAST(NULL AS TEXT) AS advertising_channel_subtype,
    CAST(NULL AS TEXT) AS advertising_channel_type,
    CAST(NULL AS INT) AS customer_id,
    CAST(NULL AS TEXT) AS end_date,
    CAST(NULL AS INT) AS id,
    CAST(NULL AS TEXT) AS name,
    CAST(NULL AS TEXT) AS serving_status,
    CAST(NULL AS TEXT) AS start_date,
    CAST(NULL AS TEXT) AS status,
    CAST(NULL AS TEXT) AS tracking_url_template,
    CAST(NULL AS TIMESTAMP) AS updated_at,
    CAST(NULL AS BOOLEAN) AS _fivetran_active,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    id AS campaign_id,
    updated_at,
    name AS campaign_name,
    customer_id AS account_id,
    advertising_channel_type,
    advertising_channel_subtype,
    start_date,
    end_date,
    serving_status,
    status,
    tracking_url_template,
    ROW_NUMBER() OVER (PARTITION BY source_relation, id ORDER BY updated_at DESC) = 1 AS is_most_recent_record
  FROM fields
  WHERE
    COALESCE(_fivetran_active, TRUE)
)
SELECT
  *
FROM final
%3 111. model.google_ads_source.stg_google_ads__campaign_history 111. model.google_ads_source.stg_google_ads__campaign_history source_relation campaign_id updated_at advertising_channel_type advertising_channel_subtype start_date end_date serving_status status tracking_url_template campaign_name account_id is_most_recent_record 112. model.google_ads_source.stg_google_ads__campaign_history_tmp 112. model.google_ads_source.stg_google_ads__campaign_history_tmp id updated_at name customer_id advertising_channel_type advertising_channel_subtype start_date end_date serving_status status tracking_url_template 112. model.google_ads_source.stg_google_ads__campaign_history_tmp:f0->111. model.google_ads_source.stg_google_ads__campaign_history:f1 112. model.google_ads_source.stg_google_ads__campaign_history_tmp:f1->111. model.google_ads_source.stg_google_ads__campaign_history:f2 112. model.google_ads_source.stg_google_ads__campaign_history_tmp:f2->111. model.google_ads_source.stg_google_ads__campaign_history:f10 112. model.google_ads_source.stg_google_ads__campaign_history_tmp:f3->111. model.google_ads_source.stg_google_ads__campaign_history:f11 112. model.google_ads_source.stg_google_ads__campaign_history_tmp:f4->111. model.google_ads_source.stg_google_ads__campaign_history:f3 112. model.google_ads_source.stg_google_ads__campaign_history_tmp:f5->111. model.google_ads_source.stg_google_ads__campaign_history:f4 112. model.google_ads_source.stg_google_ads__campaign_history_tmp:f6->111. model.google_ads_source.stg_google_ads__campaign_history:f5 112. model.google_ads_source.stg_google_ads__campaign_history_tmp:f7->111. model.google_ads_source.stg_google_ads__campaign_history:f6 112. model.google_ads_source.stg_google_ads__campaign_history_tmp:f8->111. model.google_ads_source.stg_google_ads__campaign_history:f7 112. model.google_ads_source.stg_google_ads__campaign_history_tmp:f9->111. model.google_ads_source.stg_google_ads__campaign_history:f8 112. model.google_ads_source.stg_google_ads__campaign_history_tmp:f10->111. model.google_ads_source.stg_google_ads__campaign_history:f9
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
campaign_id bigint The ID representing the campaign, if present in the source data.
updated_at timestamp without time zone Timestamp of when the record was last updated in Google Ads.
advertising_channel_type text The type of advertising channel being used by the campaign.
advertising_channel_subtype text The advertising channel subtype that is being used by the campaign.
start_date date The start date of the campaign.
end_date date The end date of the campaign.
serving_status text Status of the ads and how they are currently being served.
status text General status of the campaign.
tracking_url_template integer The tracking url template being used throughout the campaign ads.
campaign_name text The name of the campaign, if present in the source data.
account_id bigint The Customer ID.
is_most_recent_record boolean Boolean representing whether the record is the most recent version of the object.
Column Lineage
%3 111. model.google_ads_source.stg_google_ads__campaign_history 111. model.google_ads_source.stg_google_ads__campaign_history source_relation 92. model.google_ads.google_ads__ad_group_report 92. model.google_ads.google_ads__ad_group_report source_relation 111. model.google_ads_source.stg_google_ads__campaign_history:f0->92. model.google_ads.google_ads__ad_group_report:f0 93. model.google_ads.google_ads__ad_report 93. model.google_ads.google_ads__ad_report source_relation 111. model.google_ads_source.stg_google_ads__campaign_history:f0->93. model.google_ads.google_ads__ad_report:f0 94. model.google_ads.google_ads__campaign_report 94. model.google_ads.google_ads__campaign_report source_relation 111. model.google_ads_source.stg_google_ads__campaign_history:f0->94. model.google_ads.google_ads__campaign_report:f0 95. model.google_ads.google_ads__keyword_report 95. model.google_ads.google_ads__keyword_report source_relation 111. model.google_ads_source.stg_google_ads__campaign_history:f0->95. model.google_ads.google_ads__keyword_report:f0 96. model.google_ads.google_ads__url_report 96. model.google_ads.google_ads__url_report source_relation 111. model.google_ads_source.stg_google_ads__campaign_history:f0->96. model.google_ads.google_ads__url_report:f0
92. model.google_ads.google_ads__ad_group_report
  • Input Column: 111. model.google_ads_source.stg_google_ads__campaign_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly selected in the final output
    • Output Columns:
      • source_relation: directly copied to the output
93. model.google_ads.google_ads__ad_report
  • Input Column: 111. model.google_ads_source.stg_google_ads__campaign_history[source_relation]
    • Integration used as a key to join with other tables
    • Direct copied directly to the output
    • Output Columns:
      • source_relation: directly copied
94. model.google_ads.google_ads__campaign_report
  • Input Column: 111. model.google_ads_source.stg_google_ads__campaign_history[source_relation]
    • Direct The column is directly used in the SELECT statement
    • Integration Used to join with other tables
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
95. model.google_ads.google_ads__keyword_report
  • Input Column: 111. model.google_ads_source.stg_google_ads__campaign_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
96. model.google_ads.google_ads__url_report
  • Input Column: 111. model.google_ads_source.stg_google_ads__campaign_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
Column Lineage
%3 112. model.google_ads_source.stg_google_ads__campaign_history_tmp 112. model.google_ads_source.stg_google_ads__campaign_history_tmp id 111. model.google_ads_source.stg_google_ads__campaign_history 111. model.google_ads_source.stg_google_ads__campaign_history campaign_id 112. model.google_ads_source.stg_google_ads__campaign_history_tmp:f0->111. model.google_ads_source.stg_google_ads__campaign_history:f0 92. model.google_ads.google_ads__ad_group_report 92. model.google_ads.google_ads__ad_group_report campaign_id 111. model.google_ads_source.stg_google_ads__campaign_history:f0->92. model.google_ads.google_ads__ad_group_report:f0 93. model.google_ads.google_ads__ad_report 93. model.google_ads.google_ads__ad_report campaign_id 111. model.google_ads_source.stg_google_ads__campaign_history:f0->93. model.google_ads.google_ads__ad_report:f0 94. model.google_ads.google_ads__campaign_report 94. model.google_ads.google_ads__campaign_report campaign_id 111. model.google_ads_source.stg_google_ads__campaign_history:f0->94. model.google_ads.google_ads__campaign_report:f0 95. model.google_ads.google_ads__keyword_report 95. model.google_ads.google_ads__keyword_report campaign_id 111. model.google_ads_source.stg_google_ads__campaign_history:f0->95. model.google_ads.google_ads__keyword_report:f0 96. model.google_ads.google_ads__url_report 96. model.google_ads.google_ads__url_report campaign_id 111. model.google_ads_source.stg_google_ads__campaign_history:f0->96. model.google_ads.google_ads__url_report:f0
111. model.google_ads_source.stg_google_ads__campaign_history
  • Input Column: 112. model.google_ads_source.stg_google_ads__campaign_history_tmp[id]
    • Direct The column is directly copied without any transformation
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • campaign_id: Directly mapped to this output column
92. model.google_ads.google_ads__ad_group_report
  • Input Column: 111. model.google_ads_source.stg_google_ads__campaign_history[campaign_id]
    • Integration used as the join key between campaigns and ad_groups tables
    • Direct directly selected in the final output
    • Output Columns:
      • campaign_id: directly copied to the output
93. model.google_ads.google_ads__ad_report
  • Input Column: 111. model.google_ads_source.stg_google_ads__campaign_history[campaign_id]
    • Integration used as a key to join with other tables
    • Direct copied directly to the output
    • Output Columns:
      • campaign_id: directly copied
94. model.google_ads.google_ads__campaign_report
  • Input Column: 111. model.google_ads_source.stg_google_ads__campaign_history[campaign_id]
    • Direct The column is directly used in the SELECT statement
    • Integration Used to join with other tables
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • campaign_id: Directly copied to the output
95. model.google_ads.google_ads__keyword_report
  • Input Column: 111. model.google_ads_source.stg_google_ads__campaign_history[campaign_id]
    • Integration used as the key to join with the stats table
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
96. model.google_ads.google_ads__url_report
  • Input Column: 111. model.google_ads_source.stg_google_ads__campaign_history[campaign_id]
    • Integration used as the key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
Column Lineage
%3 112. model.google_ads_source.stg_google_ads__campaign_history_tmp 112. model.google_ads_source.stg_google_ads__campaign_history_tmp updated_at 111. model.google_ads_source.stg_google_ads__campaign_history 111. model.google_ads_source.stg_google_ads__campaign_history updated_at 112. model.google_ads_source.stg_google_ads__campaign_history_tmp:f0->111. model.google_ads_source.stg_google_ads__campaign_history:f0
111. model.google_ads_source.stg_google_ads__campaign_history
  • Input Column: 112. model.google_ads_source.stg_google_ads__campaign_history_tmp[updated_at]
    • Direct The column is directly copied without any transformation
    • Deduplication Used in the ROW_NUMBER() function to order and identify the most recent record
    • Output Columns:
      • updated_at: Directly mapped to this output column
Column Lineage
%3 112. model.google_ads_source.stg_google_ads__campaign_history_tmp 112. model.google_ads_source.stg_google_ads__campaign_history_tmp advertising_channel_type 111. model.google_ads_source.stg_google_ads__campaign_history 111. model.google_ads_source.stg_google_ads__campaign_history advertising_channel_type 112. model.google_ads_source.stg_google_ads__campaign_history_tmp:f0->111. model.google_ads_source.stg_google_ads__campaign_history:f0 94. model.google_ads.google_ads__campaign_report 94. model.google_ads.google_ads__campaign_report advertising_channel_type 111. model.google_ads_source.stg_google_ads__campaign_history:f0->94. model.google_ads.google_ads__campaign_report:f0
111. model.google_ads_source.stg_google_ads__campaign_history
  • Input Column: 112. model.google_ads_source.stg_google_ads__campaign_history_tmp[advertising_channel_type]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • advertising_channel_type: Directly mapped to this output column
94. model.google_ads.google_ads__campaign_report
  • Input Column: 111. model.google_ads_source.stg_google_ads__campaign_history[advertising_channel_type]
    • Direct The column is directly used in the SELECT statement
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • advertising_channel_type: Directly copied to the output
Column Lineage
%3 112. model.google_ads_source.stg_google_ads__campaign_history_tmp 112. model.google_ads_source.stg_google_ads__campaign_history_tmp advertising_channel_subtype 111. model.google_ads_source.stg_google_ads__campaign_history 111. model.google_ads_source.stg_google_ads__campaign_history advertising_channel_subtype 112. model.google_ads_source.stg_google_ads__campaign_history_tmp:f0->111. model.google_ads_source.stg_google_ads__campaign_history:f0 94. model.google_ads.google_ads__campaign_report 94. model.google_ads.google_ads__campaign_report advertising_channel_subtype 111. model.google_ads_source.stg_google_ads__campaign_history:f0->94. model.google_ads.google_ads__campaign_report:f0
111. model.google_ads_source.stg_google_ads__campaign_history
  • Input Column: 112. model.google_ads_source.stg_google_ads__campaign_history_tmp[advertising_channel_subtype]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • advertising_channel_subtype: Directly mapped to this output column
94. model.google_ads.google_ads__campaign_report
  • Input Column: 111. model.google_ads_source.stg_google_ads__campaign_history[advertising_channel_subtype]
    • Direct The column is directly used in the SELECT statement
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • advertising_channel_subtype: Directly copied to the output
Column Lineage
%3 112. model.google_ads_source.stg_google_ads__campaign_history_tmp 112. model.google_ads_source.stg_google_ads__campaign_history_tmp start_date 111. model.google_ads_source.stg_google_ads__campaign_history 111. model.google_ads_source.stg_google_ads__campaign_history start_date 112. model.google_ads_source.stg_google_ads__campaign_history_tmp:f0->111. model.google_ads_source.stg_google_ads__campaign_history:f0
111. model.google_ads_source.stg_google_ads__campaign_history
  • Input Column: 112. model.google_ads_source.stg_google_ads__campaign_history_tmp[start_date]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • start_date: Directly mapped to this output column
Column Lineage
%3 112. model.google_ads_source.stg_google_ads__campaign_history_tmp 112. model.google_ads_source.stg_google_ads__campaign_history_tmp end_date 111. model.google_ads_source.stg_google_ads__campaign_history 111. model.google_ads_source.stg_google_ads__campaign_history end_date 112. model.google_ads_source.stg_google_ads__campaign_history_tmp:f0->111. model.google_ads_source.stg_google_ads__campaign_history:f0
111. model.google_ads_source.stg_google_ads__campaign_history
  • Input Column: 112. model.google_ads_source.stg_google_ads__campaign_history_tmp[end_date]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • end_date: Directly mapped to this output column
Column Lineage
%3 112. model.google_ads_source.stg_google_ads__campaign_history_tmp 112. model.google_ads_source.stg_google_ads__campaign_history_tmp serving_status 111. model.google_ads_source.stg_google_ads__campaign_history 111. model.google_ads_source.stg_google_ads__campaign_history serving_status 112. model.google_ads_source.stg_google_ads__campaign_history_tmp:f0->111. model.google_ads_source.stg_google_ads__campaign_history:f0
111. model.google_ads_source.stg_google_ads__campaign_history
  • Input Column: 112. model.google_ads_source.stg_google_ads__campaign_history_tmp[serving_status]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • serving_status: Directly mapped to this output column
Column Lineage
%3 112. model.google_ads_source.stg_google_ads__campaign_history_tmp 112. model.google_ads_source.stg_google_ads__campaign_history_tmp status 111. model.google_ads_source.stg_google_ads__campaign_history 111. model.google_ads_source.stg_google_ads__campaign_history status 112. model.google_ads_source.stg_google_ads__campaign_history_tmp:f0->111. model.google_ads_source.stg_google_ads__campaign_history:f0 94. model.google_ads.google_ads__campaign_report 94. model.google_ads.google_ads__campaign_report status 111. model.google_ads_source.stg_google_ads__campaign_history:f0->94. model.google_ads.google_ads__campaign_report:f0
111. model.google_ads_source.stg_google_ads__campaign_history
  • Input Column: 112. model.google_ads_source.stg_google_ads__campaign_history_tmp[status]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • status: Directly mapped to this output column
94. model.google_ads.google_ads__campaign_report
  • Input Column: 111. model.google_ads_source.stg_google_ads__campaign_history[status]
    • Direct The column is directly used in the SELECT statement
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • status: Directly copied to the output
Column Lineage
%3 112. model.google_ads_source.stg_google_ads__campaign_history_tmp 112. model.google_ads_source.stg_google_ads__campaign_history_tmp tracking_url_template 111. model.google_ads_source.stg_google_ads__campaign_history 111. model.google_ads_source.stg_google_ads__campaign_history tracking_url_template 112. model.google_ads_source.stg_google_ads__campaign_history_tmp:f0->111. model.google_ads_source.stg_google_ads__campaign_history:f0
111. model.google_ads_source.stg_google_ads__campaign_history
  • Input Column: 112. model.google_ads_source.stg_google_ads__campaign_history_tmp[tracking_url_template]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the 'fields' CTE
    • Output Columns:
      • tracking_url_template: It is directly mapped to the output column of the same name
Column Lineage
%3 112. model.google_ads_source.stg_google_ads__campaign_history_tmp 112. model.google_ads_source.stg_google_ads__campaign_history_tmp name 111. model.google_ads_source.stg_google_ads__campaign_history 111. model.google_ads_source.stg_google_ads__campaign_history campaign_name 112. model.google_ads_source.stg_google_ads__campaign_history_tmp:f0->111. model.google_ads_source.stg_google_ads__campaign_history:f0 92. model.google_ads.google_ads__ad_group_report 92. model.google_ads.google_ads__ad_group_report campaign_name 111. model.google_ads_source.stg_google_ads__campaign_history:f0->92. model.google_ads.google_ads__ad_group_report:f0 93. model.google_ads.google_ads__ad_report 93. model.google_ads.google_ads__ad_report campaign_name 111. model.google_ads_source.stg_google_ads__campaign_history:f0->93. model.google_ads.google_ads__ad_report:f0 94. model.google_ads.google_ads__campaign_report 94. model.google_ads.google_ads__campaign_report campaign_name 111. model.google_ads_source.stg_google_ads__campaign_history:f0->94. model.google_ads.google_ads__campaign_report:f0 95. model.google_ads.google_ads__keyword_report 95. model.google_ads.google_ads__keyword_report campaign_name 111. model.google_ads_source.stg_google_ads__campaign_history:f0->95. model.google_ads.google_ads__keyword_report:f0 96. model.google_ads.google_ads__url_report 96. model.google_ads.google_ads__url_report campaign_name 111. model.google_ads_source.stg_google_ads__campaign_history:f0->96. model.google_ads.google_ads__url_report:f0
111. model.google_ads_source.stg_google_ads__campaign_history
  • Input Column: 112. model.google_ads_source.stg_google_ads__campaign_history_tmp[name]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • campaign_name: Directly mapped to this output column
92. model.google_ads.google_ads__ad_group_report
  • Input Column: 111. model.google_ads_source.stg_google_ads__campaign_history[campaign_name]
    • Direct The campaign_name is directly copied to the output without transformation
    • Integration Used as part of the join condition with the ad_groups table
    • Output Columns:
      • campaign_name: Directly mapped to the output column
93. model.google_ads.google_ads__ad_report
  • Input Column: 111. model.google_ads_source.stg_google_ads__campaign_history[campaign_name]
    • Direct The campaign_name is directly copied to the output without transformation
    • Integration Used as part of the JOIN condition to link campaign data with other tables
    • Output Columns:
      • campaign_name: Directly copied to the output column
94. model.google_ads.google_ads__campaign_report
  • Input Column: 111. model.google_ads_source.stg_google_ads__campaign_history[campaign_name]
    • Direct The campaign_name is directly copied to the output without transformation
    • Integration Used as part of the join condition with the stats table
    • Output Columns:
      • campaign_name: Directly mapped to the output column
95. model.google_ads.google_ads__keyword_report
  • Input Column: 111. model.google_ads_source.stg_google_ads__campaign_history[campaign_name]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the stats table
    • Output Columns:
      • campaign_name: Directly copied to the output
96. model.google_ads.google_ads__url_report
  • Input Column: 111. model.google_ads_source.stg_google_ads__campaign_history[campaign_name]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition between campaigns and ad_groups tables
    • Output Columns:
      • campaign_name: Directly copied to the output
Column Lineage
%3 112. model.google_ads_source.stg_google_ads__campaign_history_tmp 112. model.google_ads_source.stg_google_ads__campaign_history_tmp customer_id 111. model.google_ads_source.stg_google_ads__campaign_history 111. model.google_ads_source.stg_google_ads__campaign_history account_id 112. model.google_ads_source.stg_google_ads__campaign_history_tmp:f0->111. model.google_ads_source.stg_google_ads__campaign_history:f0
111. model.google_ads_source.stg_google_ads__campaign_history
  • Input Column: 112. model.google_ads_source.stg_google_ads__campaign_history_tmp[customer_id]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • account_id: Directly mapped to this output column
112. model.google_ads_source.stg_google_ads__campaign_history_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of type TEXT, initialized to NULL. The LIMIT 0 clause ensures no rows are returned. This query appears to be a placeholder or template, possibly used to define the structure of a temporary staging table in a dbt (data build tool) project for Google Ads data.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 112. model.google_ads_source.stg_google_ads__campaign_history_tmp 112. model.google_ads_source.stg_google_ads__campaign_history_tmp id updated_at name customer_id advertising_channel_type advertising_channel_subtype start_date end_date serving_status status tracking_url_template 313. source.google_ads_source.google_ads.campaign_history 313. source.google_ads_source.google_ads.campaign_history
Name Type Comment
id bigint None
updated_at timestamp without time zone None
name text None
customer_id bigint None
advertising_channel_type text None
advertising_channel_subtype text None
start_date date None
end_date date None
serving_status text None
status text None
tracking_url_template integer None
Column Lineage
%3 112. model.google_ads_source.stg_google_ads__campaign_history_tmp 112. model.google_ads_source.stg_google_ads__campaign_history_tmp id 111. model.google_ads_source.stg_google_ads__campaign_history 111. model.google_ads_source.stg_google_ads__campaign_history campaign_id 112. model.google_ads_source.stg_google_ads__campaign_history_tmp:f0->111. model.google_ads_source.stg_google_ads__campaign_history:f0 92. model.google_ads.google_ads__ad_group_report 92. model.google_ads.google_ads__ad_group_report campaign_id 111. model.google_ads_source.stg_google_ads__campaign_history:f0->92. model.google_ads.google_ads__ad_group_report:f0 93. model.google_ads.google_ads__ad_report 93. model.google_ads.google_ads__ad_report campaign_id 111. model.google_ads_source.stg_google_ads__campaign_history:f0->93. model.google_ads.google_ads__ad_report:f0 94. model.google_ads.google_ads__campaign_report 94. model.google_ads.google_ads__campaign_report campaign_id 111. model.google_ads_source.stg_google_ads__campaign_history:f0->94. model.google_ads.google_ads__campaign_report:f0 95. model.google_ads.google_ads__keyword_report 95. model.google_ads.google_ads__keyword_report campaign_id 111. model.google_ads_source.stg_google_ads__campaign_history:f0->95. model.google_ads.google_ads__keyword_report:f0 96. model.google_ads.google_ads__url_report 96. model.google_ads.google_ads__url_report campaign_id 111. model.google_ads_source.stg_google_ads__campaign_history:f0->96. model.google_ads.google_ads__url_report:f0
111. model.google_ads_source.stg_google_ads__campaign_history
  • Input Column: 112. model.google_ads_source.stg_google_ads__campaign_history_tmp[id]
    • Direct The column is directly copied without any transformation
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • campaign_id: Directly mapped to this output column
92. model.google_ads.google_ads__ad_group_report
  • Input Column: 111. model.google_ads_source.stg_google_ads__campaign_history[campaign_id]
    • Integration used as the join key between campaigns and ad_groups tables
    • Direct directly selected in the final output
    • Output Columns:
      • campaign_id: directly copied to the output
93. model.google_ads.google_ads__ad_report
  • Input Column: 111. model.google_ads_source.stg_google_ads__campaign_history[campaign_id]
    • Integration used as a key to join with other tables
    • Direct copied directly to the output
    • Output Columns:
      • campaign_id: directly copied
94. model.google_ads.google_ads__campaign_report
  • Input Column: 111. model.google_ads_source.stg_google_ads__campaign_history[campaign_id]
    • Direct The column is directly used in the SELECT statement
    • Integration Used to join with other tables
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • campaign_id: Directly copied to the output
95. model.google_ads.google_ads__keyword_report
  • Input Column: 111. model.google_ads_source.stg_google_ads__campaign_history[campaign_id]
    • Integration used as the key to join with the stats table
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
96. model.google_ads.google_ads__url_report
  • Input Column: 111. model.google_ads_source.stg_google_ads__campaign_history[campaign_id]
    • Integration used as the key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
Column Lineage
%3 112. model.google_ads_source.stg_google_ads__campaign_history_tmp 112. model.google_ads_source.stg_google_ads__campaign_history_tmp updated_at 111. model.google_ads_source.stg_google_ads__campaign_history 111. model.google_ads_source.stg_google_ads__campaign_history updated_at 112. model.google_ads_source.stg_google_ads__campaign_history_tmp:f0->111. model.google_ads_source.stg_google_ads__campaign_history:f0
111. model.google_ads_source.stg_google_ads__campaign_history
  • Input Column: 112. model.google_ads_source.stg_google_ads__campaign_history_tmp[updated_at]
    • Direct The column is directly copied without any transformation
    • Deduplication Used in the ROW_NUMBER() function to order and identify the most recent record
    • Output Columns:
      • updated_at: Directly mapped to this output column
Column Lineage
%3 112. model.google_ads_source.stg_google_ads__campaign_history_tmp 112. model.google_ads_source.stg_google_ads__campaign_history_tmp name 111. model.google_ads_source.stg_google_ads__campaign_history 111. model.google_ads_source.stg_google_ads__campaign_history campaign_name 112. model.google_ads_source.stg_google_ads__campaign_history_tmp:f0->111. model.google_ads_source.stg_google_ads__campaign_history:f0 92. model.google_ads.google_ads__ad_group_report 92. model.google_ads.google_ads__ad_group_report campaign_name 111. model.google_ads_source.stg_google_ads__campaign_history:f0->92. model.google_ads.google_ads__ad_group_report:f0 93. model.google_ads.google_ads__ad_report 93. model.google_ads.google_ads__ad_report campaign_name 111. model.google_ads_source.stg_google_ads__campaign_history:f0->93. model.google_ads.google_ads__ad_report:f0 94. model.google_ads.google_ads__campaign_report 94. model.google_ads.google_ads__campaign_report campaign_name 111. model.google_ads_source.stg_google_ads__campaign_history:f0->94. model.google_ads.google_ads__campaign_report:f0 95. model.google_ads.google_ads__keyword_report 95. model.google_ads.google_ads__keyword_report campaign_name 111. model.google_ads_source.stg_google_ads__campaign_history:f0->95. model.google_ads.google_ads__keyword_report:f0 96. model.google_ads.google_ads__url_report 96. model.google_ads.google_ads__url_report campaign_name 111. model.google_ads_source.stg_google_ads__campaign_history:f0->96. model.google_ads.google_ads__url_report:f0
111. model.google_ads_source.stg_google_ads__campaign_history
  • Input Column: 112. model.google_ads_source.stg_google_ads__campaign_history_tmp[name]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • campaign_name: Directly mapped to this output column
92. model.google_ads.google_ads__ad_group_report
  • Input Column: 111. model.google_ads_source.stg_google_ads__campaign_history[campaign_name]
    • Direct The campaign_name is directly copied to the output without transformation
    • Integration Used as part of the join condition with the ad_groups table
    • Output Columns:
      • campaign_name: Directly mapped to the output column
93. model.google_ads.google_ads__ad_report
  • Input Column: 111. model.google_ads_source.stg_google_ads__campaign_history[campaign_name]
    • Direct The campaign_name is directly copied to the output without transformation
    • Integration Used as part of the JOIN condition to link campaign data with other tables
    • Output Columns:
      • campaign_name: Directly copied to the output column
94. model.google_ads.google_ads__campaign_report
  • Input Column: 111. model.google_ads_source.stg_google_ads__campaign_history[campaign_name]
    • Direct The campaign_name is directly copied to the output without transformation
    • Integration Used as part of the join condition with the stats table
    • Output Columns:
      • campaign_name: Directly mapped to the output column
95. model.google_ads.google_ads__keyword_report
  • Input Column: 111. model.google_ads_source.stg_google_ads__campaign_history[campaign_name]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the stats table
    • Output Columns:
      • campaign_name: Directly copied to the output
96. model.google_ads.google_ads__url_report
  • Input Column: 111. model.google_ads_source.stg_google_ads__campaign_history[campaign_name]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition between campaigns and ad_groups tables
    • Output Columns:
      • campaign_name: Directly copied to the output
Column Lineage
%3 112. model.google_ads_source.stg_google_ads__campaign_history_tmp 112. model.google_ads_source.stg_google_ads__campaign_history_tmp customer_id 111. model.google_ads_source.stg_google_ads__campaign_history 111. model.google_ads_source.stg_google_ads__campaign_history account_id 112. model.google_ads_source.stg_google_ads__campaign_history_tmp:f0->111. model.google_ads_source.stg_google_ads__campaign_history:f0
111. model.google_ads_source.stg_google_ads__campaign_history
  • Input Column: 112. model.google_ads_source.stg_google_ads__campaign_history_tmp[customer_id]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • account_id: Directly mapped to this output column
Column Lineage
%3 112. model.google_ads_source.stg_google_ads__campaign_history_tmp 112. model.google_ads_source.stg_google_ads__campaign_history_tmp advertising_channel_type 111. model.google_ads_source.stg_google_ads__campaign_history 111. model.google_ads_source.stg_google_ads__campaign_history advertising_channel_type 112. model.google_ads_source.stg_google_ads__campaign_history_tmp:f0->111. model.google_ads_source.stg_google_ads__campaign_history:f0 94. model.google_ads.google_ads__campaign_report 94. model.google_ads.google_ads__campaign_report advertising_channel_type 111. model.google_ads_source.stg_google_ads__campaign_history:f0->94. model.google_ads.google_ads__campaign_report:f0
111. model.google_ads_source.stg_google_ads__campaign_history
  • Input Column: 112. model.google_ads_source.stg_google_ads__campaign_history_tmp[advertising_channel_type]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • advertising_channel_type: Directly mapped to this output column
94. model.google_ads.google_ads__campaign_report
  • Input Column: 111. model.google_ads_source.stg_google_ads__campaign_history[advertising_channel_type]
    • Direct The column is directly used in the SELECT statement
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • advertising_channel_type: Directly copied to the output
Column Lineage
%3 112. model.google_ads_source.stg_google_ads__campaign_history_tmp 112. model.google_ads_source.stg_google_ads__campaign_history_tmp advertising_channel_subtype 111. model.google_ads_source.stg_google_ads__campaign_history 111. model.google_ads_source.stg_google_ads__campaign_history advertising_channel_subtype 112. model.google_ads_source.stg_google_ads__campaign_history_tmp:f0->111. model.google_ads_source.stg_google_ads__campaign_history:f0 94. model.google_ads.google_ads__campaign_report 94. model.google_ads.google_ads__campaign_report advertising_channel_subtype 111. model.google_ads_source.stg_google_ads__campaign_history:f0->94. model.google_ads.google_ads__campaign_report:f0
111. model.google_ads_source.stg_google_ads__campaign_history
  • Input Column: 112. model.google_ads_source.stg_google_ads__campaign_history_tmp[advertising_channel_subtype]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • advertising_channel_subtype: Directly mapped to this output column
94. model.google_ads.google_ads__campaign_report
  • Input Column: 111. model.google_ads_source.stg_google_ads__campaign_history[advertising_channel_subtype]
    • Direct The column is directly used in the SELECT statement
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • advertising_channel_subtype: Directly copied to the output
Column Lineage
%3 112. model.google_ads_source.stg_google_ads__campaign_history_tmp 112. model.google_ads_source.stg_google_ads__campaign_history_tmp start_date 111. model.google_ads_source.stg_google_ads__campaign_history 111. model.google_ads_source.stg_google_ads__campaign_history start_date 112. model.google_ads_source.stg_google_ads__campaign_history_tmp:f0->111. model.google_ads_source.stg_google_ads__campaign_history:f0
111. model.google_ads_source.stg_google_ads__campaign_history
  • Input Column: 112. model.google_ads_source.stg_google_ads__campaign_history_tmp[start_date]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • start_date: Directly mapped to this output column
Column Lineage
%3 112. model.google_ads_source.stg_google_ads__campaign_history_tmp 112. model.google_ads_source.stg_google_ads__campaign_history_tmp end_date 111. model.google_ads_source.stg_google_ads__campaign_history 111. model.google_ads_source.stg_google_ads__campaign_history end_date 112. model.google_ads_source.stg_google_ads__campaign_history_tmp:f0->111. model.google_ads_source.stg_google_ads__campaign_history:f0
111. model.google_ads_source.stg_google_ads__campaign_history
  • Input Column: 112. model.google_ads_source.stg_google_ads__campaign_history_tmp[end_date]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • end_date: Directly mapped to this output column
Column Lineage
%3 112. model.google_ads_source.stg_google_ads__campaign_history_tmp 112. model.google_ads_source.stg_google_ads__campaign_history_tmp serving_status 111. model.google_ads_source.stg_google_ads__campaign_history 111. model.google_ads_source.stg_google_ads__campaign_history serving_status 112. model.google_ads_source.stg_google_ads__campaign_history_tmp:f0->111. model.google_ads_source.stg_google_ads__campaign_history:f0
111. model.google_ads_source.stg_google_ads__campaign_history
  • Input Column: 112. model.google_ads_source.stg_google_ads__campaign_history_tmp[serving_status]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • serving_status: Directly mapped to this output column
Column Lineage
%3 112. model.google_ads_source.stg_google_ads__campaign_history_tmp 112. model.google_ads_source.stg_google_ads__campaign_history_tmp status 111. model.google_ads_source.stg_google_ads__campaign_history 111. model.google_ads_source.stg_google_ads__campaign_history status 112. model.google_ads_source.stg_google_ads__campaign_history_tmp:f0->111. model.google_ads_source.stg_google_ads__campaign_history:f0 94. model.google_ads.google_ads__campaign_report 94. model.google_ads.google_ads__campaign_report status 111. model.google_ads_source.stg_google_ads__campaign_history:f0->94. model.google_ads.google_ads__campaign_report:f0
111. model.google_ads_source.stg_google_ads__campaign_history
  • Input Column: 112. model.google_ads_source.stg_google_ads__campaign_history_tmp[status]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • status: Directly mapped to this output column
94. model.google_ads.google_ads__campaign_report
  • Input Column: 111. model.google_ads_source.stg_google_ads__campaign_history[status]
    • Direct The column is directly used in the SELECT statement
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • status: Directly copied to the output
Column Lineage
%3 112. model.google_ads_source.stg_google_ads__campaign_history_tmp 112. model.google_ads_source.stg_google_ads__campaign_history_tmp tracking_url_template 111. model.google_ads_source.stg_google_ads__campaign_history 111. model.google_ads_source.stg_google_ads__campaign_history tracking_url_template 112. model.google_ads_source.stg_google_ads__campaign_history_tmp:f0->111. model.google_ads_source.stg_google_ads__campaign_history:f0
111. model.google_ads_source.stg_google_ads__campaign_history
  • Input Column: 112. model.google_ads_source.stg_google_ads__campaign_history_tmp[tracking_url_template]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the 'fields' CTE
    • Output Columns:
      • tracking_url_template: It is directly mapped to the output column of the same name
113. model.google_ads_source.stg_google_ads__campaign_stats

This SQL query stages and transforms data from a Google Ads campaign stats source table. It casts columns to specific data types, renames some columns, and performs basic data cleaning by replacing NULL values with defaults for numeric columns. The query also calculates the spend by dividing cost_micros by 1,000,000. Finally, it selects and restructures the data into a final output format.

CleaningFeaturization
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_google_ads_source.stg_google_ads__campaign_stats_tmp
), fields AS (
  SELECT
    CAST(NULL AS TEXT) AS _fivetran_id,
    CAST(NULL AS TIMESTAMP) AS _fivetran_synced,
    CAST(NULL AS TEXT) AS ad_network_type,
    CAST(NULL AS INT) AS clicks,
    CAST(NULL AS INT) AS cost_micros,
    CAST(NULL AS INT) AS customer_id,
    CAST(NULL AS DATE) AS date,
    CAST(NULL AS TEXT) AS device,
    CAST(NULL AS INT) AS id,
    CAST(NULL AS INT) AS impressions,
    CAST(NULL AS INT) AS conversions,
    CAST(NULL AS INT) AS conversions_value,
    CAST(NULL AS INT) AS view_through_conversions,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    customer_id AS account_id,
    date AS date_day,
    id AS campaign_id,
    ad_network_type,
    device,
    COALESCE(clicks, 0) AS clicks,
    COALESCE(cost_micros, 0) / 1000000.0 AS spend,
    COALESCE(impressions, 0) AS impressions,
    COALESCE(conversions, 0) AS conversions,
    COALESCE(conversions_value, 0) AS conversions_value,
    COALESCE(view_through_conversions, 0) AS view_through_conversions
  FROM fields
)
SELECT
  *
FROM final
%3 113. model.google_ads_source.stg_google_ads__campaign_stats 113. model.google_ads_source.stg_google_ads__campaign_stats source_relation account_id date_day campaign_id ad_network_type device clicks spend impressions conversions conversions_value view_through_conversions 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp customer_id date ad_network_type clicks conversions conversions_value cost_micros device id impressions view_through_conversions 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp:f0->113. model.google_ads_source.stg_google_ads__campaign_stats:f1 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp:f1->113. model.google_ads_source.stg_google_ads__campaign_stats:f2 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp:f2->113. model.google_ads_source.stg_google_ads__campaign_stats:f4 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp:f3->113. model.google_ads_source.stg_google_ads__campaign_stats:f6 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp:f4->113. model.google_ads_source.stg_google_ads__campaign_stats:f9 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp:f5->113. model.google_ads_source.stg_google_ads__campaign_stats:f10 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp:f6->113. model.google_ads_source.stg_google_ads__campaign_stats:f7 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp:f7->113. model.google_ads_source.stg_google_ads__campaign_stats:f5 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp:f8->113. model.google_ads_source.stg_google_ads__campaign_stats:f3 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp:f9->113. model.google_ads_source.stg_google_ads__campaign_stats:f8 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp:f10->113. model.google_ads_source.stg_google_ads__campaign_stats:f11
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
account_id bigint The Customer ID.
date_day date The date being reported on.
campaign_id bigint The ID representing the campaign, if present in the source data.
ad_network_type text The Google Ad network type used across the account.
device text Account ad performance per unique device where the ads were served.
clicks integer The count of clicks.
spend numeric The sum of your cost-per-click (CPC) and cost-per-thousand impressions (CPM) costs during this period.
impressions integer The count of impressions.
conversions integer The number of conversions you've received, across your conversion actions. Conversions are measured with conversion tracking and may include [modeled](https://support.google.com/google-ads/answer/10081327?sjid=12862894247631803415-NC) conversions in cases where you are not able to observe all conversions that took place. You can use this column to see how often your ads led customers to actions that you’ve defined as valuable for your business.
conversions_value integer The sum of monetary values for your `conversions`. You have to enter a value in the Google Ads UI for your conversion actions to make this metric useful.
view_through_conversions integer For video campaigns, view-through conversions tell you when an _impression_ of your video ad leads to a conversion on your site. The last impression of a video ad will get credit for the view-through conversion. Keep in mind: An impression is different than a “view” of a video ad. A “view” is counted when someone watches 30 seconds (or the whole ad if it’s shorter than 30 seconds) or clicks on a part of the ad. A “view” that leads to a conversion is counted in the `conversions` column.
Column Lineage
%3 113. model.google_ads_source.stg_google_ads__campaign_stats 113. model.google_ads_source.stg_google_ads__campaign_stats source_relation 94. model.google_ads.google_ads__campaign_report 94. model.google_ads.google_ads__campaign_report source_relation 113. model.google_ads_source.stg_google_ads__campaign_stats:f0->94. model.google_ads.google_ads__campaign_report:f0
94. model.google_ads.google_ads__campaign_report
  • Input Column: 113. model.google_ads_source.stg_google_ads__campaign_stats[source_relation]
    • Direct The column is directly copied without transformation
    • Integration Used as part of the join condition with other tables
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly mapped to output column
Column Lineage
%3 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp customer_id 113. model.google_ads_source.stg_google_ads__campaign_stats 113. model.google_ads_source.stg_google_ads__campaign_stats account_id 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp:f0->113. model.google_ads_source.stg_google_ads__campaign_stats:f0
113. model.google_ads_source.stg_google_ads__campaign_stats
  • Input Column: 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp[customer_id]
    • Cleaning The column is cast to INT type in the fields CTE
    • Direct The column is directly copied to the final output
    • Output Columns:
      • account_id: Directly mapped and renamed
Column Lineage
%3 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp date 113. model.google_ads_source.stg_google_ads__campaign_stats 113. model.google_ads_source.stg_google_ads__campaign_stats date_day 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp:f0->113. model.google_ads_source.stg_google_ads__campaign_stats:f0 94. model.google_ads.google_ads__campaign_report 94. model.google_ads.google_ads__campaign_report date_day 113. model.google_ads_source.stg_google_ads__campaign_stats:f0->94. model.google_ads.google_ads__campaign_report:f0
113. model.google_ads_source.stg_google_ads__campaign_stats
  • Input Column: 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp[date]
    • Cleaning The column is cast to DATE type in the fields CTE
    • Direct The column is directly copied to the final output
    • Output Columns:
      • date_day: Directly mapped and renamed
94. model.google_ads.google_ads__campaign_report
  • Input Column: 113. model.google_ads_source.stg_google_ads__campaign_stats[date_day]
    • Direct The column is directly copied without transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly mapped to output column
Column Lineage
%3 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp id 113. model.google_ads_source.stg_google_ads__campaign_stats 113. model.google_ads_source.stg_google_ads__campaign_stats campaign_id 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp:f0->113. model.google_ads_source.stg_google_ads__campaign_stats:f0 94. model.google_ads.google_ads__campaign_report 94. model.google_ads.google_ads__campaign_report campaign_id 113. model.google_ads_source.stg_google_ads__campaign_stats:f0->94. model.google_ads.google_ads__campaign_report:f0
113. model.google_ads_source.stg_google_ads__campaign_stats
  • Input Column: 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp[id]
    • Cleaning The column is cleaned by casting to INT
    • Direct The cleaned value is directly copied to the output
    • Output Columns:
      • campaign_id: Directly mapped after cleaning
94. model.google_ads.google_ads__campaign_report
  • Input Column: 113. model.google_ads_source.stg_google_ads__campaign_stats[campaign_id]
    • Direct The column is directly copied without transformation
    • Integration Used as a join key to connect with the campaigns table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • campaign_id: Directly mapped to output column
Column Lineage
%3 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp ad_network_type 113. model.google_ads_source.stg_google_ads__campaign_stats 113. model.google_ads_source.stg_google_ads__campaign_stats ad_network_type 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp:f0->113. model.google_ads_source.stg_google_ads__campaign_stats:f0
113. model.google_ads_source.stg_google_ads__campaign_stats
  • Input Column: 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp[ad_network_type]
    • Cleaning The column is cast to TEXT type in the fields CTE
    • Direct The column is directly copied to the final output
    • Output Columns:
      • ad_network_type: Directly mapped
Column Lineage
%3 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp device 113. model.google_ads_source.stg_google_ads__campaign_stats 113. model.google_ads_source.stg_google_ads__campaign_stats device 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp:f0->113. model.google_ads_source.stg_google_ads__campaign_stats:f0
113. model.google_ads_source.stg_google_ads__campaign_stats
  • Input Column: 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp[device]
    • Cleaning The column is cleaned by casting to TEXT
    • Direct The cleaned value is directly copied to the output
    • Output Columns:
      • device: Directly mapped after cleaning
Column Lineage
%3 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp clicks 113. model.google_ads_source.stg_google_ads__campaign_stats 113. model.google_ads_source.stg_google_ads__campaign_stats clicks 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp:f0->113. model.google_ads_source.stg_google_ads__campaign_stats:f0 94. model.google_ads.google_ads__campaign_report 94. model.google_ads.google_ads__campaign_report clicks 113. model.google_ads_source.stg_google_ads__campaign_stats:f0->94. model.google_ads.google_ads__campaign_report:f0
113. model.google_ads_source.stg_google_ads__campaign_stats
  • Input Column: 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp[clicks]
    • Cleaning The column is cleaned by casting to INT and replacing NULL with 0
    • Direct The cleaned value is directly copied to the output
    • Output Columns:
      • clicks: Directly mapped after cleaning
94. model.google_ads.google_ads__campaign_report
  • Input Column: 113. model.google_ads_source.stg_google_ads__campaign_stats[clicks]
    • Aggregation The column is summed up in the SELECT clause
    • Output Columns:
      • clicks: Aggregated sum is mapped to output column
Column Lineage
%3 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp cost_micros 113. model.google_ads_source.stg_google_ads__campaign_stats 113. model.google_ads_source.stg_google_ads__campaign_stats spend 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp:f0->113. model.google_ads_source.stg_google_ads__campaign_stats:f0 94. model.google_ads.google_ads__campaign_report 94. model.google_ads.google_ads__campaign_report spend 113. model.google_ads_source.stg_google_ads__campaign_stats:f0->94. model.google_ads.google_ads__campaign_report:f0
113. model.google_ads_source.stg_google_ads__campaign_stats
  • Input Column: 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp[cost_micros]
    • Cleaning The column is cleaned by casting to INT and replacing NULL with 0
    • Other The value is divided by 1,000,000 to convert micros to regular currency units
    • Output Columns:
      • spend: Transformed (divided by 1,000,000) and mapped
94. model.google_ads.google_ads__campaign_report
  • Input Column: 113. model.google_ads_source.stg_google_ads__campaign_stats[spend]
    • Aggregation The column is summed up in the SELECT clause
    • Output Columns:
      • spend: Aggregated sum is mapped to output column
Column Lineage
%3 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp impressions 113. model.google_ads_source.stg_google_ads__campaign_stats 113. model.google_ads_source.stg_google_ads__campaign_stats impressions 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp:f0->113. model.google_ads_source.stg_google_ads__campaign_stats:f0 94. model.google_ads.google_ads__campaign_report 94. model.google_ads.google_ads__campaign_report impressions 113. model.google_ads_source.stg_google_ads__campaign_stats:f0->94. model.google_ads.google_ads__campaign_report:f0
113. model.google_ads_source.stg_google_ads__campaign_stats
  • Input Column: 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp[impressions]
    • Cleaning The column is cleaned by casting to INT and replacing NULL with 0
    • Direct The cleaned value is directly copied to the output
    • Output Columns:
      • impressions: Directly mapped after cleaning
94. model.google_ads.google_ads__campaign_report
  • Input Column: 113. model.google_ads_source.stg_google_ads__campaign_stats[impressions]
    • Aggregation The column is summed up in the SELECT clause
    • Output Columns:
      • impressions: Aggregated sum is mapped to output column
Column Lineage
%3 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp conversions 113. model.google_ads_source.stg_google_ads__campaign_stats 113. model.google_ads_source.stg_google_ads__campaign_stats conversions 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp:f0->113. model.google_ads_source.stg_google_ads__campaign_stats:f0 94. model.google_ads.google_ads__campaign_report 94. model.google_ads.google_ads__campaign_report conversions 113. model.google_ads_source.stg_google_ads__campaign_stats:f0->94. model.google_ads.google_ads__campaign_report:f0
113. model.google_ads_source.stg_google_ads__campaign_stats
  • Input Column: 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp[conversions]
    • Cleaning The column is cleaned by casting to INT and replacing NULL with 0
    • Direct The cleaned value is directly copied to the output
    • Output Columns:
      • conversions: Directly mapped after cleaning
94. model.google_ads.google_ads__campaign_report
  • Input Column: 113. model.google_ads_source.stg_google_ads__campaign_stats[conversions]
    • Aggregation The column is summed up in the SELECT clause
    • Output Columns:
      • conversions: Aggregated sum is mapped to output column
Column Lineage
%3 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp conversions_value 113. model.google_ads_source.stg_google_ads__campaign_stats 113. model.google_ads_source.stg_google_ads__campaign_stats conversions_value 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp:f0->113. model.google_ads_source.stg_google_ads__campaign_stats:f0 94. model.google_ads.google_ads__campaign_report 94. model.google_ads.google_ads__campaign_report conversions_value 113. model.google_ads_source.stg_google_ads__campaign_stats:f0->94. model.google_ads.google_ads__campaign_report:f0
113. model.google_ads_source.stg_google_ads__campaign_stats
  • Input Column: 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp[conversions_value]
    • Cleaning The column is cleaned by casting to INT and replacing NULL with 0
    • Direct The cleaned value is directly copied to the output
    • Output Columns:
      • conversions_value: Directly mapped after cleaning
94. model.google_ads.google_ads__campaign_report
  • Input Column: 113. model.google_ads_source.stg_google_ads__campaign_stats[conversions_value]
    • Aggregation This column is summed up in the GROUP BY clause
    • Output Columns:
      • conversions_value: It is directly mapped to the output column 'conversions_value' after being aggregated
Column Lineage
%3 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp view_through_conversions 113. model.google_ads_source.stg_google_ads__campaign_stats 113. model.google_ads_source.stg_google_ads__campaign_stats view_through_conversions 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp:f0->113. model.google_ads_source.stg_google_ads__campaign_stats:f0 94. model.google_ads.google_ads__campaign_report 94. model.google_ads.google_ads__campaign_report view_through_conversions 113. model.google_ads_source.stg_google_ads__campaign_stats:f0->94. model.google_ads.google_ads__campaign_report:f0
113. model.google_ads_source.stg_google_ads__campaign_stats
  • Input Column: 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp[view_through_conversions]
    • Cleaning The column is cleaned by replacing NULL values with 0 using the COALESCE function.
    • Direct After cleaning, the column is directly copied to the output.
    • Output Columns:
      • view_through_conversions: The input column is cleaned (NULL replaced with 0) and then directly mapped to the output column of the same name.
94. model.google_ads.google_ads__campaign_report
  • Input Column: 113. model.google_ads_source.stg_google_ads__campaign_stats[view_through_conversions]
    • Aggregation This column is summed up in the GROUP BY clause
    • Output Columns:
      • view_through_conversions: It is directly mapped to the output column 'view_through_conversions' after being aggregated
114. model.google_ads_source.stg_google_ads__campaign_stats_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of type TEXT, which is set to NULL. The query is limited to 0 rows, effectively creating a schema-only output without any actual data.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp _fivetran_id customer_id date _fivetran_synced active_view_impressions active_view_measurability active_view_measurable_cost_micros active_view_measurable_impressions active_view_viewability ad_network_type base_campaign clicks conversions conversions_value cost_micros device id impressions interaction_event_types interactions view_through_conversions 314. source.google_ads_source.google_ads.campaign_stats 314. source.google_ads_source.google_ads.campaign_stats
Name Type Comment
_fivetran_id text None
customer_id bigint None
date date None
_fivetran_synced timestamp without time zone None
active_view_impressions integer None
active_view_measurability integer None
active_view_measurable_cost_micros integer None
active_view_measurable_impressions integer None
active_view_viewability integer None
ad_network_type text None
base_campaign text None
clicks integer None
conversions integer None
conversions_value integer None
cost_micros integer None
device text None
id bigint None
impressions integer None
interaction_event_types text None
interactions integer None
view_through_conversions integer None
Column Lineage
%3 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp customer_id 113. model.google_ads_source.stg_google_ads__campaign_stats 113. model.google_ads_source.stg_google_ads__campaign_stats account_id 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp:f0->113. model.google_ads_source.stg_google_ads__campaign_stats:f0
113. model.google_ads_source.stg_google_ads__campaign_stats
  • Input Column: 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp[customer_id]
    • Cleaning The column is cast to INT type in the fields CTE
    • Direct The column is directly copied to the final output
    • Output Columns:
      • account_id: Directly mapped and renamed
Column Lineage
%3 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp date 113. model.google_ads_source.stg_google_ads__campaign_stats 113. model.google_ads_source.stg_google_ads__campaign_stats date_day 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp:f0->113. model.google_ads_source.stg_google_ads__campaign_stats:f0 94. model.google_ads.google_ads__campaign_report 94. model.google_ads.google_ads__campaign_report date_day 113. model.google_ads_source.stg_google_ads__campaign_stats:f0->94. model.google_ads.google_ads__campaign_report:f0
113. model.google_ads_source.stg_google_ads__campaign_stats
  • Input Column: 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp[date]
    • Cleaning The column is cast to DATE type in the fields CTE
    • Direct The column is directly copied to the final output
    • Output Columns:
      • date_day: Directly mapped and renamed
94. model.google_ads.google_ads__campaign_report
  • Input Column: 113. model.google_ads_source.stg_google_ads__campaign_stats[date_day]
    • Direct The column is directly copied without transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly mapped to output column
Column Lineage
%3 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp ad_network_type 113. model.google_ads_source.stg_google_ads__campaign_stats 113. model.google_ads_source.stg_google_ads__campaign_stats ad_network_type 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp:f0->113. model.google_ads_source.stg_google_ads__campaign_stats:f0
113. model.google_ads_source.stg_google_ads__campaign_stats
  • Input Column: 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp[ad_network_type]
    • Cleaning The column is cast to TEXT type in the fields CTE
    • Direct The column is directly copied to the final output
    • Output Columns:
      • ad_network_type: Directly mapped
Column Lineage
%3 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp clicks 113. model.google_ads_source.stg_google_ads__campaign_stats 113. model.google_ads_source.stg_google_ads__campaign_stats clicks 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp:f0->113. model.google_ads_source.stg_google_ads__campaign_stats:f0 94. model.google_ads.google_ads__campaign_report 94. model.google_ads.google_ads__campaign_report clicks 113. model.google_ads_source.stg_google_ads__campaign_stats:f0->94. model.google_ads.google_ads__campaign_report:f0
113. model.google_ads_source.stg_google_ads__campaign_stats
  • Input Column: 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp[clicks]
    • Cleaning The column is cleaned by casting to INT and replacing NULL with 0
    • Direct The cleaned value is directly copied to the output
    • Output Columns:
      • clicks: Directly mapped after cleaning
94. model.google_ads.google_ads__campaign_report
  • Input Column: 113. model.google_ads_source.stg_google_ads__campaign_stats[clicks]
    • Aggregation The column is summed up in the SELECT clause
    • Output Columns:
      • clicks: Aggregated sum is mapped to output column
Column Lineage
%3 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp conversions 113. model.google_ads_source.stg_google_ads__campaign_stats 113. model.google_ads_source.stg_google_ads__campaign_stats conversions 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp:f0->113. model.google_ads_source.stg_google_ads__campaign_stats:f0 94. model.google_ads.google_ads__campaign_report 94. model.google_ads.google_ads__campaign_report conversions 113. model.google_ads_source.stg_google_ads__campaign_stats:f0->94. model.google_ads.google_ads__campaign_report:f0
113. model.google_ads_source.stg_google_ads__campaign_stats
  • Input Column: 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp[conversions]
    • Cleaning The column is cleaned by casting to INT and replacing NULL with 0
    • Direct The cleaned value is directly copied to the output
    • Output Columns:
      • conversions: Directly mapped after cleaning
94. model.google_ads.google_ads__campaign_report
  • Input Column: 113. model.google_ads_source.stg_google_ads__campaign_stats[conversions]
    • Aggregation The column is summed up in the SELECT clause
    • Output Columns:
      • conversions: Aggregated sum is mapped to output column
Column Lineage
%3 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp conversions_value 113. model.google_ads_source.stg_google_ads__campaign_stats 113. model.google_ads_source.stg_google_ads__campaign_stats conversions_value 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp:f0->113. model.google_ads_source.stg_google_ads__campaign_stats:f0 94. model.google_ads.google_ads__campaign_report 94. model.google_ads.google_ads__campaign_report conversions_value 113. model.google_ads_source.stg_google_ads__campaign_stats:f0->94. model.google_ads.google_ads__campaign_report:f0
113. model.google_ads_source.stg_google_ads__campaign_stats
  • Input Column: 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp[conversions_value]
    • Cleaning The column is cleaned by casting to INT and replacing NULL with 0
    • Direct The cleaned value is directly copied to the output
    • Output Columns:
      • conversions_value: Directly mapped after cleaning
94. model.google_ads.google_ads__campaign_report
  • Input Column: 113. model.google_ads_source.stg_google_ads__campaign_stats[conversions_value]
    • Aggregation This column is summed up in the GROUP BY clause
    • Output Columns:
      • conversions_value: It is directly mapped to the output column 'conversions_value' after being aggregated
Column Lineage
%3 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp cost_micros 113. model.google_ads_source.stg_google_ads__campaign_stats 113. model.google_ads_source.stg_google_ads__campaign_stats spend 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp:f0->113. model.google_ads_source.stg_google_ads__campaign_stats:f0 94. model.google_ads.google_ads__campaign_report 94. model.google_ads.google_ads__campaign_report spend 113. model.google_ads_source.stg_google_ads__campaign_stats:f0->94. model.google_ads.google_ads__campaign_report:f0
113. model.google_ads_source.stg_google_ads__campaign_stats
  • Input Column: 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp[cost_micros]
    • Cleaning The column is cleaned by casting to INT and replacing NULL with 0
    • Other The value is divided by 1,000,000 to convert micros to regular currency units
    • Output Columns:
      • spend: Transformed (divided by 1,000,000) and mapped
94. model.google_ads.google_ads__campaign_report
  • Input Column: 113. model.google_ads_source.stg_google_ads__campaign_stats[spend]
    • Aggregation The column is summed up in the SELECT clause
    • Output Columns:
      • spend: Aggregated sum is mapped to output column
Column Lineage
%3 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp device 113. model.google_ads_source.stg_google_ads__campaign_stats 113. model.google_ads_source.stg_google_ads__campaign_stats device 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp:f0->113. model.google_ads_source.stg_google_ads__campaign_stats:f0
113. model.google_ads_source.stg_google_ads__campaign_stats
  • Input Column: 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp[device]
    • Cleaning The column is cleaned by casting to TEXT
    • Direct The cleaned value is directly copied to the output
    • Output Columns:
      • device: Directly mapped after cleaning
Column Lineage
%3 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp id 113. model.google_ads_source.stg_google_ads__campaign_stats 113. model.google_ads_source.stg_google_ads__campaign_stats campaign_id 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp:f0->113. model.google_ads_source.stg_google_ads__campaign_stats:f0 94. model.google_ads.google_ads__campaign_report 94. model.google_ads.google_ads__campaign_report campaign_id 113. model.google_ads_source.stg_google_ads__campaign_stats:f0->94. model.google_ads.google_ads__campaign_report:f0
113. model.google_ads_source.stg_google_ads__campaign_stats
  • Input Column: 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp[id]
    • Cleaning The column is cleaned by casting to INT
    • Direct The cleaned value is directly copied to the output
    • Output Columns:
      • campaign_id: Directly mapped after cleaning
94. model.google_ads.google_ads__campaign_report
  • Input Column: 113. model.google_ads_source.stg_google_ads__campaign_stats[campaign_id]
    • Direct The column is directly copied without transformation
    • Integration Used as a join key to connect with the campaigns table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • campaign_id: Directly mapped to output column
Column Lineage
%3 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp impressions 113. model.google_ads_source.stg_google_ads__campaign_stats 113. model.google_ads_source.stg_google_ads__campaign_stats impressions 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp:f0->113. model.google_ads_source.stg_google_ads__campaign_stats:f0 94. model.google_ads.google_ads__campaign_report 94. model.google_ads.google_ads__campaign_report impressions 113. model.google_ads_source.stg_google_ads__campaign_stats:f0->94. model.google_ads.google_ads__campaign_report:f0
113. model.google_ads_source.stg_google_ads__campaign_stats
  • Input Column: 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp[impressions]
    • Cleaning The column is cleaned by casting to INT and replacing NULL with 0
    • Direct The cleaned value is directly copied to the output
    • Output Columns:
      • impressions: Directly mapped after cleaning
94. model.google_ads.google_ads__campaign_report
  • Input Column: 113. model.google_ads_source.stg_google_ads__campaign_stats[impressions]
    • Aggregation The column is summed up in the SELECT clause
    • Output Columns:
      • impressions: Aggregated sum is mapped to output column
Column Lineage
%3 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp view_through_conversions 113. model.google_ads_source.stg_google_ads__campaign_stats 113. model.google_ads_source.stg_google_ads__campaign_stats view_through_conversions 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp:f0->113. model.google_ads_source.stg_google_ads__campaign_stats:f0 94. model.google_ads.google_ads__campaign_report 94. model.google_ads.google_ads__campaign_report view_through_conversions 113. model.google_ads_source.stg_google_ads__campaign_stats:f0->94. model.google_ads.google_ads__campaign_report:f0
113. model.google_ads_source.stg_google_ads__campaign_stats
  • Input Column: 114. model.google_ads_source.stg_google_ads__campaign_stats_tmp[view_through_conversions]
    • Cleaning The column is cleaned by replacing NULL values with 0 using the COALESCE function.
    • Direct After cleaning, the column is directly copied to the output.
    • Output Columns:
      • view_through_conversions: The input column is cleaned (NULL replaced with 0) and then directly mapped to the output column of the same name.
94. model.google_ads.google_ads__campaign_report
  • Input Column: 113. model.google_ads_source.stg_google_ads__campaign_stats[view_through_conversions]
    • Aggregation This column is summed up in the GROUP BY clause
    • Output Columns:
      • view_through_conversions: It is directly mapped to the output column 'view_through_conversions' after being aggregated
115. model.google_ads_source.stg_google_ads__keyword_stats

This SQL query performs data transformation and cleaning on the Google Ads keyword stats data. It casts various fields to specific data types, renames some columns, and performs basic calculations such as converting cost from micros to regular units. The query also applies COALESCE to replace NULL values with zeros for numeric fields.

CleaningFeaturization
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_google_ads_source.stg_google_ads__keyword_stats_tmp
), fields AS (
  SELECT
    CAST(NULL AS TEXT) AS _fivetran_id,
    CAST(NULL AS TIMESTAMP) AS _fivetran_synced,
    CAST(NULL AS INT) AS ad_group_criterion_criterion_id,
    CAST(NULL AS INT) AS ad_group_id,
    CAST(NULL AS TEXT) AS ad_network_type,
    CAST(NULL AS INT) AS campaign_id,
    CAST(NULL AS INT) AS clicks,
    CAST(NULL AS INT) AS cost_micros,
    CAST(NULL AS INT) AS customer_id,
    CAST(NULL AS DATE) AS date,
    CAST(NULL AS TEXT) AS device,
    CAST(NULL AS INT) AS impressions,
    CAST(NULL AS INT) AS conversions,
    CAST(NULL AS INT) AS conversions_value,
    CAST(NULL AS INT) AS view_through_conversions,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    _fivetran_id AS keyword_id,
    customer_id AS account_id,
    date AS date_day,
    CAST(ad_group_id AS TEXT) AS ad_group_id,
    ad_group_criterion_criterion_id AS criterion_id,
    campaign_id,
    COALESCE(clicks, 0) AS clicks,
    COALESCE(cost_micros, 0) / 1000000.0 AS spend,
    COALESCE(impressions, 0) AS impressions,
    COALESCE(conversions, 0) AS conversions,
    COALESCE(conversions_value, 0) AS conversions_value,
    COALESCE(view_through_conversions, 0) AS view_through_conversions
  FROM fields
)
SELECT
  *
FROM final
%3 115. model.google_ads_source.stg_google_ads__keyword_stats 115. model.google_ads_source.stg_google_ads__keyword_stats source_relation account_id date_day ad_group_id keyword_id campaign_id criterion_id clicks spend impressions conversions conversions_value view_through_conversions 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp _fivetran_id customer_id date ad_group_criterion_criterion_id ad_group_id campaign_id clicks conversions conversions_value cost_micros impressions view_through_conversions 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp:f0->115. model.google_ads_source.stg_google_ads__keyword_stats:f4 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp:f1->115. model.google_ads_source.stg_google_ads__keyword_stats:f1 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp:f2->115. model.google_ads_source.stg_google_ads__keyword_stats:f2 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp:f3->115. model.google_ads_source.stg_google_ads__keyword_stats:f6 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp:f4->115. model.google_ads_source.stg_google_ads__keyword_stats:f3 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp:f5->115. model.google_ads_source.stg_google_ads__keyword_stats:f5 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp:f6->115. model.google_ads_source.stg_google_ads__keyword_stats:f7 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp:f7->115. model.google_ads_source.stg_google_ads__keyword_stats:f10 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp:f8->115. model.google_ads_source.stg_google_ads__keyword_stats:f11 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp:f9->115. model.google_ads_source.stg_google_ads__keyword_stats:f8 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp:f10->115. model.google_ads_source.stg_google_ads__keyword_stats:f9 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp:f11->115. model.google_ads_source.stg_google_ads__keyword_stats:f12
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
account_id bigint The Customer ID.
date_day date The date being reported on.
ad_group_id text The ID representing the ad group, if present in the source data.
keyword_id text The unique ID of the keyword record.
campaign_id bigint The ID representing the campaign, if present in the source data.
criterion_id bigint Reference to the ad group criterion used for the keyword.
clicks integer The count of clicks.
spend numeric The sum of your cost-per-click (CPC) and cost-per-thousand impressions (CPM) costs during this period.
impressions integer The count of impressions.
conversions integer The number of conversions you've received, across your conversion actions. Conversions are measured with conversion tracking and may include [modeled](https://support.google.com/google-ads/answer/10081327?sjid=12862894247631803415-NC) conversions in cases where you are not able to observe all conversions that took place. You can use this column to see how often your ads led customers to actions that you’ve defined as valuable for your business.
conversions_value integer The sum of monetary values for your `conversions`. You have to enter a value in the Google Ads UI for your conversion actions to make this metric useful.
view_through_conversions integer For video campaigns, view-through conversions tell you when an _impression_ of your video ad leads to a conversion on your site. The last impression of a video ad will get credit for the view-through conversion. Keep in mind: An impression is different than a “view” of a video ad. A “view” is counted when someone watches 30 seconds (or the whole ad if it’s shorter than 30 seconds) or clicks on a part of the ad. A “view” that leads to a conversion is counted in the `conversions` column.
Column Lineage
%3 115. model.google_ads_source.stg_google_ads__keyword_stats 115. model.google_ads_source.stg_google_ads__keyword_stats source_relation 95. model.google_ads.google_ads__keyword_report 95. model.google_ads.google_ads__keyword_report source_relation 115. model.google_ads_source.stg_google_ads__keyword_stats:f0->95. model.google_ads.google_ads__keyword_report:f0
95. model.google_ads.google_ads__keyword_report
  • Input Column: 115. model.google_ads_source.stg_google_ads__keyword_stats[source_relation]
    • Direct The column is directly copied without transformation
    • Integration Used as part of the join condition with other tables
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to output
Column Lineage
%3 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp customer_id 115. model.google_ads_source.stg_google_ads__keyword_stats 115. model.google_ads_source.stg_google_ads__keyword_stats account_id 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp:f0->115. model.google_ads_source.stg_google_ads__keyword_stats:f0 95. model.google_ads.google_ads__keyword_report 95. model.google_ads.google_ads__keyword_report account_id 115. model.google_ads_source.stg_google_ads__keyword_stats:f0->95. model.google_ads.google_ads__keyword_report:f0
115. model.google_ads_source.stg_google_ads__keyword_stats
  • Input Column: 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp[customer_id]
    • Cleaning The column is cast to INT type
    • Direct The column is directly copied to account_id
    • Output Columns:
      • account_id: Directly mapped after casting to INT
95. model.google_ads.google_ads__keyword_report
  • Input Column: 115. model.google_ads_source.stg_google_ads__keyword_stats[account_id]
    • Direct The column is directly copied without transformation
    • Integration Used as part of the join condition with the accounts table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • account_id: Directly copied to output
Column Lineage
%3 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp date 115. model.google_ads_source.stg_google_ads__keyword_stats 115. model.google_ads_source.stg_google_ads__keyword_stats date_day 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp:f0->115. model.google_ads_source.stg_google_ads__keyword_stats:f0 95. model.google_ads.google_ads__keyword_report 95. model.google_ads.google_ads__keyword_report date_day 115. model.google_ads_source.stg_google_ads__keyword_stats:f0->95. model.google_ads.google_ads__keyword_report:f0
115. model.google_ads_source.stg_google_ads__keyword_stats
  • Input Column: 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp[date]
    • Cleaning The column is cast to DATE type
    • Direct The column is directly copied to date_day
    • Output Columns:
      • date_day: Directly mapped after casting to DATE
95. model.google_ads.google_ads__keyword_report
  • Input Column: 115. model.google_ads_source.stg_google_ads__keyword_stats[date_day]
    • Direct The column is directly copied without transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to output
Column Lineage
%3 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp ad_group_id 115. model.google_ads_source.stg_google_ads__keyword_stats 115. model.google_ads_source.stg_google_ads__keyword_stats ad_group_id 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp:f0->115. model.google_ads_source.stg_google_ads__keyword_stats:f0 95. model.google_ads.google_ads__keyword_report 95. model.google_ads.google_ads__keyword_report ad_group_id 115. model.google_ads_source.stg_google_ads__keyword_stats:f0->95. model.google_ads.google_ads__keyword_report:f0
115. model.google_ads_source.stg_google_ads__keyword_stats
  • Input Column: 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp[ad_group_id]
    • Direct The column is directly copied
    • Cleaning The column is cast to INT type, then to TEXT type
    • Output Columns:
      • ad_group_id: Mapped after casting to TEXT
95. model.google_ads.google_ads__keyword_report
  • Input Column: 115. model.google_ads_source.stg_google_ads__keyword_stats[ad_group_id]
    • Direct The column is directly copied without transformation
    • Integration Used as part of the join condition with the ad_groups table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • ad_group_id: Directly copied to output
Column Lineage
%3 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp _fivetran_id 115. model.google_ads_source.stg_google_ads__keyword_stats 115. model.google_ads_source.stg_google_ads__keyword_stats keyword_id 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp:f0->115. model.google_ads_source.stg_google_ads__keyword_stats:f0
115. model.google_ads_source.stg_google_ads__keyword_stats
  • Input Column: 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp[_fivetran_id]
    • Cleaning The column is cast to TEXT type and then used as keyword_id
    • Output Columns:
      • keyword_id: Directly mapped after casting to TEXT
Column Lineage
%3 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp campaign_id 115. model.google_ads_source.stg_google_ads__keyword_stats 115. model.google_ads_source.stg_google_ads__keyword_stats campaign_id 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp:f0->115. model.google_ads_source.stg_google_ads__keyword_stats:f0 95. model.google_ads.google_ads__keyword_report 95. model.google_ads.google_ads__keyword_report campaign_id 115. model.google_ads_source.stg_google_ads__keyword_stats:f0->95. model.google_ads.google_ads__keyword_report:f0
115. model.google_ads_source.stg_google_ads__keyword_stats
  • Input Column: 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp[campaign_id]
    • Direct The column is directly copied
    • Cleaning The column is cast to INT type
    • Output Columns:
      • campaign_id: Directly mapped after casting
95. model.google_ads.google_ads__keyword_report
  • Input Column: 115. model.google_ads_source.stg_google_ads__keyword_stats[campaign_id]
    • Direct The column is directly copied without transformation
    • Integration Used as part of the join condition with the campaigns table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • campaign_id: Directly copied to output
Column Lineage
%3 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp ad_group_criterion_criterion_id 115. model.google_ads_source.stg_google_ads__keyword_stats 115. model.google_ads_source.stg_google_ads__keyword_stats criterion_id 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp:f0->115. model.google_ads_source.stg_google_ads__keyword_stats:f0 95. model.google_ads.google_ads__keyword_report 95. model.google_ads.google_ads__keyword_report criterion_id 115. model.google_ads_source.stg_google_ads__keyword_stats:f0->95. model.google_ads.google_ads__keyword_report:f0
115. model.google_ads_source.stg_google_ads__keyword_stats
  • Input Column: 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp[ad_group_criterion_criterion_id]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast to INT type
    • Output Columns:
      • criterion_id: Directly mapped after casting
95. model.google_ads.google_ads__keyword_report
  • Input Column: 115. model.google_ads_source.stg_google_ads__keyword_stats[criterion_id]
    • Direct The column is directly copied without transformation
    • Integration Used as part of the join condition with the criterions table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • criterion_id: Directly copied to output
Column Lineage
%3 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp clicks 115. model.google_ads_source.stg_google_ads__keyword_stats 115. model.google_ads_source.stg_google_ads__keyword_stats clicks 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp:f0->115. model.google_ads_source.stg_google_ads__keyword_stats:f0 95. model.google_ads.google_ads__keyword_report 95. model.google_ads.google_ads__keyword_report clicks 115. model.google_ads_source.stg_google_ads__keyword_stats:f0->95. model.google_ads.google_ads__keyword_report:f0
115. model.google_ads_source.stg_google_ads__keyword_stats
  • Input Column: 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp[clicks]
    • Direct The column is directly copied
    • Cleaning The column is cast to INT type and NULL values are replaced with 0
    • Output Columns:
      • clicks: Mapped after cleaning
95. model.google_ads.google_ads__keyword_report
  • Input Column: 115. model.google_ads_source.stg_google_ads__keyword_stats[clicks]
    • Aggregation The column is summed up in the SELECT clause
    • Output Columns:
      • clicks: Aggregated sum in the output
Column Lineage
%3 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp cost_micros 115. model.google_ads_source.stg_google_ads__keyword_stats 115. model.google_ads_source.stg_google_ads__keyword_stats spend 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp:f0->115. model.google_ads_source.stg_google_ads__keyword_stats:f0 95. model.google_ads.google_ads__keyword_report 95. model.google_ads.google_ads__keyword_report spend 115. model.google_ads_source.stg_google_ads__keyword_stats:f0->95. model.google_ads.google_ads__keyword_report:f0
115. model.google_ads_source.stg_google_ads__keyword_stats
  • Input Column: 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp[cost_micros]
    • Direct The column is used in calculation
    • Cleaning The column is cast to INT type, NULL values are replaced with 0, and divided by 1,000,000
    • Output Columns:
      • spend: Mapped after cleaning and calculation
95. model.google_ads.google_ads__keyword_report
  • Input Column: 115. model.google_ads_source.stg_google_ads__keyword_stats[spend]
    • Aggregation The column is summed up in the SELECT clause
    • Output Columns:
      • spend: Aggregated sum in the output
Column Lineage
%3 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp impressions 115. model.google_ads_source.stg_google_ads__keyword_stats 115. model.google_ads_source.stg_google_ads__keyword_stats impressions 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp:f0->115. model.google_ads_source.stg_google_ads__keyword_stats:f0 95. model.google_ads.google_ads__keyword_report 95. model.google_ads.google_ads__keyword_report impressions 115. model.google_ads_source.stg_google_ads__keyword_stats:f0->95. model.google_ads.google_ads__keyword_report:f0
115. model.google_ads_source.stg_google_ads__keyword_stats
  • Input Column: 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp[impressions]
    • Cleaning The column is cast to INT and then COALESCE is applied to replace NULL values with 0.
    • Direct After cleaning, the column is directly copied to the output.
    • Output Columns:
      • impressions: Directly mapped after cleaning.
95. model.google_ads.google_ads__keyword_report
  • Input Column: 115. model.google_ads_source.stg_google_ads__keyword_stats[impressions]
    • Aggregation The column is summed up in the SELECT clause
    • Output Columns:
      • impressions: Aggregated sum in the output
Column Lineage
%3 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp conversions 115. model.google_ads_source.stg_google_ads__keyword_stats 115. model.google_ads_source.stg_google_ads__keyword_stats conversions 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp:f0->115. model.google_ads_source.stg_google_ads__keyword_stats:f0 95. model.google_ads.google_ads__keyword_report 95. model.google_ads.google_ads__keyword_report conversions 115. model.google_ads_source.stg_google_ads__keyword_stats:f0->95. model.google_ads.google_ads__keyword_report:f0
115. model.google_ads_source.stg_google_ads__keyword_stats
  • Input Column: 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp[conversions]
    • Direct The column is directly copied
    • Cleaning The column is cast to INT type and NULL values are replaced with 0
    • Output Columns:
      • conversions: Mapped after cleaning
95. model.google_ads.google_ads__keyword_report
  • Input Column: 115. model.google_ads_source.stg_google_ads__keyword_stats[conversions]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • conversions: It is directly mapped to the output 'conversions' column after aggregation
Column Lineage
%3 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp conversions_value 115. model.google_ads_source.stg_google_ads__keyword_stats 115. model.google_ads_source.stg_google_ads__keyword_stats conversions_value 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp:f0->115. model.google_ads_source.stg_google_ads__keyword_stats:f0 95. model.google_ads.google_ads__keyword_report 95. model.google_ads.google_ads__keyword_report conversions_value 115. model.google_ads_source.stg_google_ads__keyword_stats:f0->95. model.google_ads.google_ads__keyword_report:f0
115. model.google_ads_source.stg_google_ads__keyword_stats
  • Input Column: 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp[conversions_value]
    • Direct The column is directly copied
    • Cleaning The column is cast to INT type and NULL values are replaced with 0
    • Output Columns:
      • conversions_value: Mapped after cleaning
95. model.google_ads.google_ads__keyword_report
  • Input Column: 115. model.google_ads_source.stg_google_ads__keyword_stats[conversions_value]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • conversions_value: It is directly mapped to the output 'conversions_value' column after aggregation
Column Lineage
%3 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp view_through_conversions 115. model.google_ads_source.stg_google_ads__keyword_stats 115. model.google_ads_source.stg_google_ads__keyword_stats view_through_conversions 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp:f0->115. model.google_ads_source.stg_google_ads__keyword_stats:f0 95. model.google_ads.google_ads__keyword_report 95. model.google_ads.google_ads__keyword_report view_through_conversions 115. model.google_ads_source.stg_google_ads__keyword_stats:f0->95. model.google_ads.google_ads__keyword_report:f0
115. model.google_ads_source.stg_google_ads__keyword_stats
  • Input Column: 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp[view_through_conversions]
    • Cleaning The column is cast to INT and then COALESCE is applied to replace NULL values with 0.
    • Direct After cleaning, the column is directly copied to the output.
    • Output Columns:
      • view_through_conversions: Directly mapped after cleaning.
95. model.google_ads.google_ads__keyword_report
  • Input Column: 115. model.google_ads_source.stg_google_ads__keyword_stats[view_through_conversions]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • view_through_conversions: It is directly mapped to the output 'view_through_conversions' column after aggregation
116. model.google_ads_source.stg_google_ads__keyword_stats_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of type TEXT, which is set to NULL. The LIMIT 0 clause ensures no rows are returned. This query is likely used as a template or placeholder in a dbt model.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp _fivetran_id customer_id date _fivetran_synced active_view_impressions active_view_measurability active_view_measurable_cost_micros active_view_measurable_impressions active_view_viewability ad_group_base_ad_group ad_group_criterion_criterion_id ad_group_id ad_network_type campaign_base_campaign campaign_id clicks conversions conversions_value cost_micros device impressions interaction_event_types interactions view_through_conversions 315. source.google_ads_source.google_ads.keyword_stats 315. source.google_ads_source.google_ads.keyword_stats
Name Type Comment
_fivetran_id text None
customer_id bigint None
date date None
_fivetran_synced timestamp without time zone None
active_view_impressions integer None
active_view_measurability integer None
active_view_measurable_cost_micros integer None
active_view_measurable_impressions integer None
active_view_viewability integer None
ad_group_base_ad_group text None
ad_group_criterion_criterion_id bigint None
ad_group_id bigint None
ad_network_type text None
campaign_base_campaign text None
campaign_id bigint None
clicks integer None
conversions integer None
conversions_value integer None
cost_micros integer None
device text None
impressions integer None
interaction_event_types text None
interactions integer None
view_through_conversions integer None
Column Lineage
%3 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp _fivetran_id 115. model.google_ads_source.stg_google_ads__keyword_stats 115. model.google_ads_source.stg_google_ads__keyword_stats keyword_id 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp:f0->115. model.google_ads_source.stg_google_ads__keyword_stats:f0
115. model.google_ads_source.stg_google_ads__keyword_stats
  • Input Column: 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp[_fivetran_id]
    • Cleaning The column is cast to TEXT type and then used as keyword_id
    • Output Columns:
      • keyword_id: Directly mapped after casting to TEXT
Column Lineage
%3 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp customer_id 115. model.google_ads_source.stg_google_ads__keyword_stats 115. model.google_ads_source.stg_google_ads__keyword_stats account_id 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp:f0->115. model.google_ads_source.stg_google_ads__keyword_stats:f0 95. model.google_ads.google_ads__keyword_report 95. model.google_ads.google_ads__keyword_report account_id 115. model.google_ads_source.stg_google_ads__keyword_stats:f0->95. model.google_ads.google_ads__keyword_report:f0
115. model.google_ads_source.stg_google_ads__keyword_stats
  • Input Column: 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp[customer_id]
    • Cleaning The column is cast to INT type
    • Direct The column is directly copied to account_id
    • Output Columns:
      • account_id: Directly mapped after casting to INT
95. model.google_ads.google_ads__keyword_report
  • Input Column: 115. model.google_ads_source.stg_google_ads__keyword_stats[account_id]
    • Direct The column is directly copied without transformation
    • Integration Used as part of the join condition with the accounts table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • account_id: Directly copied to output
Column Lineage
%3 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp date 115. model.google_ads_source.stg_google_ads__keyword_stats 115. model.google_ads_source.stg_google_ads__keyword_stats date_day 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp:f0->115. model.google_ads_source.stg_google_ads__keyword_stats:f0 95. model.google_ads.google_ads__keyword_report 95. model.google_ads.google_ads__keyword_report date_day 115. model.google_ads_source.stg_google_ads__keyword_stats:f0->95. model.google_ads.google_ads__keyword_report:f0
115. model.google_ads_source.stg_google_ads__keyword_stats
  • Input Column: 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp[date]
    • Cleaning The column is cast to DATE type
    • Direct The column is directly copied to date_day
    • Output Columns:
      • date_day: Directly mapped after casting to DATE
95. model.google_ads.google_ads__keyword_report
  • Input Column: 115. model.google_ads_source.stg_google_ads__keyword_stats[date_day]
    • Direct The column is directly copied without transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to output
Column Lineage
%3 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp ad_group_criterion_criterion_id 115. model.google_ads_source.stg_google_ads__keyword_stats 115. model.google_ads_source.stg_google_ads__keyword_stats criterion_id 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp:f0->115. model.google_ads_source.stg_google_ads__keyword_stats:f0 95. model.google_ads.google_ads__keyword_report 95. model.google_ads.google_ads__keyword_report criterion_id 115. model.google_ads_source.stg_google_ads__keyword_stats:f0->95. model.google_ads.google_ads__keyword_report:f0
115. model.google_ads_source.stg_google_ads__keyword_stats
  • Input Column: 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp[ad_group_criterion_criterion_id]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast to INT type
    • Output Columns:
      • criterion_id: Directly mapped after casting
95. model.google_ads.google_ads__keyword_report
  • Input Column: 115. model.google_ads_source.stg_google_ads__keyword_stats[criterion_id]
    • Direct The column is directly copied without transformation
    • Integration Used as part of the join condition with the criterions table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • criterion_id: Directly copied to output
Column Lineage
%3 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp ad_group_id 115. model.google_ads_source.stg_google_ads__keyword_stats 115. model.google_ads_source.stg_google_ads__keyword_stats ad_group_id 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp:f0->115. model.google_ads_source.stg_google_ads__keyword_stats:f0 95. model.google_ads.google_ads__keyword_report 95. model.google_ads.google_ads__keyword_report ad_group_id 115. model.google_ads_source.stg_google_ads__keyword_stats:f0->95. model.google_ads.google_ads__keyword_report:f0
115. model.google_ads_source.stg_google_ads__keyword_stats
  • Input Column: 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp[ad_group_id]
    • Direct The column is directly copied
    • Cleaning The column is cast to INT type, then to TEXT type
    • Output Columns:
      • ad_group_id: Mapped after casting to TEXT
95. model.google_ads.google_ads__keyword_report
  • Input Column: 115. model.google_ads_source.stg_google_ads__keyword_stats[ad_group_id]
    • Direct The column is directly copied without transformation
    • Integration Used as part of the join condition with the ad_groups table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • ad_group_id: Directly copied to output
Column Lineage
%3 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp campaign_id 115. model.google_ads_source.stg_google_ads__keyword_stats 115. model.google_ads_source.stg_google_ads__keyword_stats campaign_id 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp:f0->115. model.google_ads_source.stg_google_ads__keyword_stats:f0 95. model.google_ads.google_ads__keyword_report 95. model.google_ads.google_ads__keyword_report campaign_id 115. model.google_ads_source.stg_google_ads__keyword_stats:f0->95. model.google_ads.google_ads__keyword_report:f0
115. model.google_ads_source.stg_google_ads__keyword_stats
  • Input Column: 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp[campaign_id]
    • Direct The column is directly copied
    • Cleaning The column is cast to INT type
    • Output Columns:
      • campaign_id: Directly mapped after casting
95. model.google_ads.google_ads__keyword_report
  • Input Column: 115. model.google_ads_source.stg_google_ads__keyword_stats[campaign_id]
    • Direct The column is directly copied without transformation
    • Integration Used as part of the join condition with the campaigns table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • campaign_id: Directly copied to output
Column Lineage
%3 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp clicks 115. model.google_ads_source.stg_google_ads__keyword_stats 115. model.google_ads_source.stg_google_ads__keyword_stats clicks 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp:f0->115. model.google_ads_source.stg_google_ads__keyword_stats:f0 95. model.google_ads.google_ads__keyword_report 95. model.google_ads.google_ads__keyword_report clicks 115. model.google_ads_source.stg_google_ads__keyword_stats:f0->95. model.google_ads.google_ads__keyword_report:f0
115. model.google_ads_source.stg_google_ads__keyword_stats
  • Input Column: 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp[clicks]
    • Direct The column is directly copied
    • Cleaning The column is cast to INT type and NULL values are replaced with 0
    • Output Columns:
      • clicks: Mapped after cleaning
95. model.google_ads.google_ads__keyword_report
  • Input Column: 115. model.google_ads_source.stg_google_ads__keyword_stats[clicks]
    • Aggregation The column is summed up in the SELECT clause
    • Output Columns:
      • clicks: Aggregated sum in the output
Column Lineage
%3 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp conversions 115. model.google_ads_source.stg_google_ads__keyword_stats 115. model.google_ads_source.stg_google_ads__keyword_stats conversions 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp:f0->115. model.google_ads_source.stg_google_ads__keyword_stats:f0 95. model.google_ads.google_ads__keyword_report 95. model.google_ads.google_ads__keyword_report conversions 115. model.google_ads_source.stg_google_ads__keyword_stats:f0->95. model.google_ads.google_ads__keyword_report:f0
115. model.google_ads_source.stg_google_ads__keyword_stats
  • Input Column: 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp[conversions]
    • Direct The column is directly copied
    • Cleaning The column is cast to INT type and NULL values are replaced with 0
    • Output Columns:
      • conversions: Mapped after cleaning
95. model.google_ads.google_ads__keyword_report
  • Input Column: 115. model.google_ads_source.stg_google_ads__keyword_stats[conversions]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • conversions: It is directly mapped to the output 'conversions' column after aggregation
Column Lineage
%3 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp conversions_value 115. model.google_ads_source.stg_google_ads__keyword_stats 115. model.google_ads_source.stg_google_ads__keyword_stats conversions_value 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp:f0->115. model.google_ads_source.stg_google_ads__keyword_stats:f0 95. model.google_ads.google_ads__keyword_report 95. model.google_ads.google_ads__keyword_report conversions_value 115. model.google_ads_source.stg_google_ads__keyword_stats:f0->95. model.google_ads.google_ads__keyword_report:f0
115. model.google_ads_source.stg_google_ads__keyword_stats
  • Input Column: 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp[conversions_value]
    • Direct The column is directly copied
    • Cleaning The column is cast to INT type and NULL values are replaced with 0
    • Output Columns:
      • conversions_value: Mapped after cleaning
95. model.google_ads.google_ads__keyword_report
  • Input Column: 115. model.google_ads_source.stg_google_ads__keyword_stats[conversions_value]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • conversions_value: It is directly mapped to the output 'conversions_value' column after aggregation
Column Lineage
%3 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp cost_micros 115. model.google_ads_source.stg_google_ads__keyword_stats 115. model.google_ads_source.stg_google_ads__keyword_stats spend 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp:f0->115. model.google_ads_source.stg_google_ads__keyword_stats:f0 95. model.google_ads.google_ads__keyword_report 95. model.google_ads.google_ads__keyword_report spend 115. model.google_ads_source.stg_google_ads__keyword_stats:f0->95. model.google_ads.google_ads__keyword_report:f0
115. model.google_ads_source.stg_google_ads__keyword_stats
  • Input Column: 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp[cost_micros]
    • Direct The column is used in calculation
    • Cleaning The column is cast to INT type, NULL values are replaced with 0, and divided by 1,000,000
    • Output Columns:
      • spend: Mapped after cleaning and calculation
95. model.google_ads.google_ads__keyword_report
  • Input Column: 115. model.google_ads_source.stg_google_ads__keyword_stats[spend]
    • Aggregation The column is summed up in the SELECT clause
    • Output Columns:
      • spend: Aggregated sum in the output
Column Lineage
%3 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp impressions 115. model.google_ads_source.stg_google_ads__keyword_stats 115. model.google_ads_source.stg_google_ads__keyword_stats impressions 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp:f0->115. model.google_ads_source.stg_google_ads__keyword_stats:f0 95. model.google_ads.google_ads__keyword_report 95. model.google_ads.google_ads__keyword_report impressions 115. model.google_ads_source.stg_google_ads__keyword_stats:f0->95. model.google_ads.google_ads__keyword_report:f0
115. model.google_ads_source.stg_google_ads__keyword_stats
  • Input Column: 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp[impressions]
    • Cleaning The column is cast to INT and then COALESCE is applied to replace NULL values with 0.
    • Direct After cleaning, the column is directly copied to the output.
    • Output Columns:
      • impressions: Directly mapped after cleaning.
95. model.google_ads.google_ads__keyword_report
  • Input Column: 115. model.google_ads_source.stg_google_ads__keyword_stats[impressions]
    • Aggregation The column is summed up in the SELECT clause
    • Output Columns:
      • impressions: Aggregated sum in the output
Column Lineage
%3 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp view_through_conversions 115. model.google_ads_source.stg_google_ads__keyword_stats 115. model.google_ads_source.stg_google_ads__keyword_stats view_through_conversions 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp:f0->115. model.google_ads_source.stg_google_ads__keyword_stats:f0 95. model.google_ads.google_ads__keyword_report 95. model.google_ads.google_ads__keyword_report view_through_conversions 115. model.google_ads_source.stg_google_ads__keyword_stats:f0->95. model.google_ads.google_ads__keyword_report:f0
115. model.google_ads_source.stg_google_ads__keyword_stats
  • Input Column: 116. model.google_ads_source.stg_google_ads__keyword_stats_tmp[view_through_conversions]
    • Cleaning The column is cast to INT and then COALESCE is applied to replace NULL values with 0.
    • Direct After cleaning, the column is directly copied to the output.
    • Output Columns:
      • view_through_conversions: Directly mapped after cleaning.
95. model.google_ads.google_ads__keyword_report
  • Input Column: 115. model.google_ads_source.stg_google_ads__keyword_stats[view_through_conversions]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • view_through_conversions: It is directly mapped to the output 'view_through_conversions' column after aggregation
117. model.linkedin.linkedin_ads__account_report

This SQL query creates a comprehensive account report for LinkedIn Ads. It combines data from account history, campaign history, and ad analytics. The query filters for the latest versions of accounts and campaigns, calculates total conversions, and then aggregates various metrics (conversions, clicks, impressions, cost, etc.) at the account level. It joins the analytics data with account and campaign information to provide a detailed view of ad performance for each account on a daily basis.

FilteringIntegrationFeaturizationAggregation
SQL Query
WITH account AS (
  SELECT
    *
  FROM TEST.PUBLIC_linkedin_ads_source.stg_linkedin_ads__account_history
  WHERE
    is_latest_version
), campaign AS (
  SELECT
    *
  FROM TEST.PUBLIC_linkedin_ads_source.stg_linkedin_ads__campaign_history
  WHERE
    is_latest_version
), report AS (
  SELECT
    *,
    external_website_conversions + one_click_leads AS total_conversions
  FROM TEST.PUBLIC_linkedin_ads_source.stg_linkedin_ads__ad_analytics_by_campaign
), final AS (
  SELECT
    report.source_relation,
    report.date_day,
    account.account_id,
    account.account_name,
    account.version_tag,
    account.currency,
    account.status,
    account.type,
    account.last_modified_at,
    account.created_at,
    SUM(report.total_conversions) AS total_conversions,
    SUM(report.clicks) AS clicks,
    SUM(report.impressions) AS impressions,
    SUM(report.cost) AS cost,
    SUM(COALESCE(report.conversion_value_in_local_currency, 0)) AS conversion_value_in_local_currency,
    SUM(COALESCE(external_website_conversions, 0)) AS external_website_conversions,
    SUM(COALESCE(one_click_leads, 0)) AS one_click_leads
  FROM report
  LEFT JOIN campaign
    ON report.campaign_id = campaign.campaign_id
    AND report.source_relation = campaign.source_relation
  LEFT JOIN account
    ON campaign.account_id = account.account_id
    AND campaign.source_relation = account.source_relation
  GROUP BY
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10
)
SELECT
  *
FROM final
%3 117. model.linkedin.linkedin_ads__account_report 117. model.linkedin.linkedin_ads__account_report source_relation account_name account_id date_day clicks impressions cost last_modified_at created_at currency version_tag status type conversion_value_in_local_currency total_conversions external_website_conversions one_click_leads 122. model.linkedin_source.stg_linkedin_ads__account_history 122. model.linkedin_source.stg_linkedin_ads__account_history source_relation account_id last_modified_at created_at account_name currency version_tag status type 122. model.linkedin_source.stg_linkedin_ads__account_history:f0->117. model.linkedin.linkedin_ads__account_report:f0 122. model.linkedin_source.stg_linkedin_ads__account_history:f1->117. model.linkedin.linkedin_ads__account_report:f2 122. model.linkedin_source.stg_linkedin_ads__account_history:f2->117. model.linkedin.linkedin_ads__account_report:f7 122. model.linkedin_source.stg_linkedin_ads__account_history:f3->117. model.linkedin.linkedin_ads__account_report:f8 122. model.linkedin_source.stg_linkedin_ads__account_history:f4->117. model.linkedin.linkedin_ads__account_report:f1 122. model.linkedin_source.stg_linkedin_ads__account_history:f5->117. model.linkedin.linkedin_ads__account_report:f9 122. model.linkedin_source.stg_linkedin_ads__account_history:f6->117. model.linkedin.linkedin_ads__account_report:f10 122. model.linkedin_source.stg_linkedin_ads__account_history:f7->117. model.linkedin.linkedin_ads__account_report:f11 122. model.linkedin_source.stg_linkedin_ads__account_history:f8->117. model.linkedin.linkedin_ads__account_report:f12 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign source_relation date_day clicks impressions cost conversion_value_in_local_currency external_website_conversions one_click_leads 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->117. model.linkedin.linkedin_ads__account_report:f0 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f1->117. model.linkedin.linkedin_ads__account_report:f3 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f2->117. model.linkedin.linkedin_ads__account_report:f4 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f3->117. model.linkedin.linkedin_ads__account_report:f5 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f4->117. model.linkedin.linkedin_ads__account_report:f6 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f5->117. model.linkedin.linkedin_ads__account_report:f13 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f6->117. model.linkedin.linkedin_ads__account_report:f15 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f6->117. model.linkedin.linkedin_ads__account_report:f14 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f7->117. model.linkedin.linkedin_ads__account_report:f16 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f7->117. model.linkedin.linkedin_ads__account_report:f14 130. model.linkedin_source.stg_linkedin_ads__campaign_history 130. model.linkedin_source.stg_linkedin_ads__campaign_history source_relation 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->117. model.linkedin.linkedin_ads__account_report:f0
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
account_name text A label for the account.
account_id integer Unique internal ID representing the account.
date_day timestamp without time zone The day of the activity.
clicks bigint The count of chargeable clicks.
impressions bigint This is the count of "impressions" for Direct Ads and Sponsored Updates and "sends" for InMails.
cost double precision The cost of the ads in the local currency or USD.
last_modified_at timestamp without time zone The timestamp of when the version was updated.
created_at timestamp without time zone The timestamp of when the account was created.
currency text The ISO 4217 currency code of the account, such as 'USD' for United States Dollar (default).
version_tag numeric An integer representation of the version of the account.
status text ACTIVE - Account is active; this is the default state CANCELLED - Account has been permanently cancelled DRAFT - Account is in draft status, meaning it's not yet fully set up and it is not serving PENDING_DELETION - Denotes that the account has been requested to be deleted that is currently pending REMOVED - Denotes that the account was deleted, but must remain fetchable due to the existence of performance data.
type text BUSINESS - This is the only value allowed when creating accounts through the API. ENTERPRISE - This value cannot be used to create accounts through the API and is reserved for accounts created by LinkedIn's internal ad operations systems.
conversion_value_in_local_currency double precision The value generated by your conversions, displayed in your LinkedIn account's local currency, on the given day.
total_conversions numeric The total conversions being brought in the conversion fields you select in your `linkedin_ads__conversion_fields`.
external_website_conversions numeric The actions taken on your website that you've defined as valuable to your business after clicking on LinkedIn ads.
one_click_leads numeric Leads submitted after clicking on LinkedIn ads.
Column Lineage
%3 122. model.linkedin_source.stg_linkedin_ads__account_history 122. model.linkedin_source.stg_linkedin_ads__account_history source_relation 117. model.linkedin.linkedin_ads__account_report 117. model.linkedin.linkedin_ads__account_report source_relation 122. model.linkedin_source.stg_linkedin_ads__account_history:f0->117. model.linkedin.linkedin_ads__account_report:f0 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign source_relation 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->117. model.linkedin.linkedin_ads__account_report:f0 130. model.linkedin_source.stg_linkedin_ads__campaign_history 130. model.linkedin_source.stg_linkedin_ads__campaign_history source_relation 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->117. model.linkedin.linkedin_ads__account_report:f0
117. model.linkedin.linkedin_ads__account_report
  • Input Column: 122. model.linkedin_source.stg_linkedin_ads__account_history[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with campaign and report tables
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
  • Input Column: 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with campaign and account tables
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
  • Input Column: 130. model.linkedin_source.stg_linkedin_ads__campaign_history[source_relation]
    • Integration used as part of the join condition with the report and account tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
Column Lineage
%3 122. model.linkedin_source.stg_linkedin_ads__account_history 122. model.linkedin_source.stg_linkedin_ads__account_history account_name 117. model.linkedin.linkedin_ads__account_report 117. model.linkedin.linkedin_ads__account_report account_name 122. model.linkedin_source.stg_linkedin_ads__account_history:f0->117. model.linkedin.linkedin_ads__account_report:f0 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp name 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp:f0->122. model.linkedin_source.stg_linkedin_ads__account_history:f0
122. model.linkedin_source.stg_linkedin_ads__account_history
  • Input Column: 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp[name]
    • Direct The column is directly copied
    • Output Columns:
      • account_name: Directly mapped to account_name
117. model.linkedin.linkedin_ads__account_report
  • Input Column: 122. model.linkedin_source.stg_linkedin_ads__account_history[account_name]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • account_name: Directly copied to the output
Column Lineage
%3 122. model.linkedin_source.stg_linkedin_ads__account_history 122. model.linkedin_source.stg_linkedin_ads__account_history account_id 117. model.linkedin.linkedin_ads__account_report 117. model.linkedin.linkedin_ads__account_report account_id 122. model.linkedin_source.stg_linkedin_ads__account_history:f0->117. model.linkedin.linkedin_ads__account_report:f0 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp id 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp:f0->122. model.linkedin_source.stg_linkedin_ads__account_history:f0
122. model.linkedin_source.stg_linkedin_ads__account_history
  • Input Column: 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp[id]
    • Direct The column is directly copied
    • Deduplication Used in the PARTITION BY clause of the ROW_NUMBER() function
    • Output Columns:
      • account_id: Directly mapped to account_id
117. model.linkedin.linkedin_ads__account_report
  • Input Column: 122. model.linkedin_source.stg_linkedin_ads__account_history[account_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with the campaign table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • account_id: Directly copied to the output
Column Lineage
%3 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign date_day 117. model.linkedin.linkedin_ads__account_report 117. model.linkedin.linkedin_ads__account_report date_day 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->117. model.linkedin.linkedin_ads__account_report:f0 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp day 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp:f0->124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0
124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign
  • Input Column: 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp[day]
    • Cleaning The column is cast to TIMESTAMP type and then truncated to day
    • Featurization The date is extracted from this column
    • Output Columns:
      • date_day: Mapped after casting to TIMESTAMP and truncating to day
117. model.linkedin.linkedin_ads__account_report
  • Input Column: 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign clicks 117. model.linkedin.linkedin_ads__account_report 117. model.linkedin.linkedin_ads__account_report clicks 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->117. model.linkedin.linkedin_ads__account_report:f0 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp clicks 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp:f0->124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0
124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign
  • Input Column: 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp[clicks]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to INT type
    • Output Columns:
      • clicks: Directly mapped after casting to INT
117. model.linkedin.linkedin_ads__account_report
  • Input Column: 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign[clicks]
    • Aggregation Summed up in the final SELECT statement
    • Output Columns:
      • clicks: Aggregated sum of clicks
Column Lineage
%3 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign impressions 117. model.linkedin.linkedin_ads__account_report 117. model.linkedin.linkedin_ads__account_report impressions 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->117. model.linkedin.linkedin_ads__account_report:f0 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp impressions 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp:f0->124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0
124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign
  • Input Column: 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp[impressions]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to INT type
    • Output Columns:
      • impressions: Directly mapped
117. model.linkedin.linkedin_ads__account_report
  • Input Column: 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign[impressions]
    • Aggregation Summed up in the final SELECT statement
    • Output Columns:
      • impressions: Aggregated sum of impressions
Column Lineage
%3 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign cost 117. model.linkedin.linkedin_ads__account_report 117. model.linkedin.linkedin_ads__account_report cost 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->117. model.linkedin.linkedin_ads__account_report:f0 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp cost_in_usd 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp:f0->124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0
124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign
  • Input Column: 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp[cost_in_usd]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • cost: Directly mapped and renamed
117. model.linkedin.linkedin_ads__account_report
  • Input Column: 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign[cost]
    • Aggregation Summed up in the final SELECT statement
    • Output Columns:
      • cost: Aggregated sum of cost
Column Lineage
%3 122. model.linkedin_source.stg_linkedin_ads__account_history 122. model.linkedin_source.stg_linkedin_ads__account_history last_modified_at 117. model.linkedin.linkedin_ads__account_report 117. model.linkedin.linkedin_ads__account_report last_modified_at 122. model.linkedin_source.stg_linkedin_ads__account_history:f0->117. model.linkedin.linkedin_ads__account_report:f0 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp last_modified_time 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp:f0->122. model.linkedin_source.stg_linkedin_ads__account_history:f0
122. model.linkedin_source.stg_linkedin_ads__account_history
  • Input Column: 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp[last_modified_time]
    • Cleaning Cast to TIMESTAMP datatype
    • Deduplication Used in the ORDER BY clause of the ROW_NUMBER() function
    • Output Columns:
      • last_modified_at: Mapped after casting to TIMESTAMP
117. model.linkedin.linkedin_ads__account_report
  • Input Column: 122. model.linkedin_source.stg_linkedin_ads__account_history[last_modified_at]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • last_modified_at: Directly copied to the output
Column Lineage
%3 122. model.linkedin_source.stg_linkedin_ads__account_history 122. model.linkedin_source.stg_linkedin_ads__account_history created_at 117. model.linkedin.linkedin_ads__account_report 117. model.linkedin.linkedin_ads__account_report created_at 122. model.linkedin_source.stg_linkedin_ads__account_history:f0->117. model.linkedin.linkedin_ads__account_report:f0 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp created_time 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp:f0->122. model.linkedin_source.stg_linkedin_ads__account_history:f0
122. model.linkedin_source.stg_linkedin_ads__account_history
  • Input Column: 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp[created_time]
    • Cleaning Cast to TIMESTAMP datatype
    • Output Columns:
      • created_at: Mapped after casting to TIMESTAMP
117. model.linkedin.linkedin_ads__account_report
  • Input Column: 122. model.linkedin_source.stg_linkedin_ads__account_history[created_at]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • created_at: Directly copied to the output
Column Lineage
%3 122. model.linkedin_source.stg_linkedin_ads__account_history 122. model.linkedin_source.stg_linkedin_ads__account_history currency 117. model.linkedin.linkedin_ads__account_report 117. model.linkedin.linkedin_ads__account_report currency 122. model.linkedin_source.stg_linkedin_ads__account_history:f0->117. model.linkedin.linkedin_ads__account_report:f0 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp currency 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp:f0->122. model.linkedin_source.stg_linkedin_ads__account_history:f0
122. model.linkedin_source.stg_linkedin_ads__account_history
  • Input Column: 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp[currency]
    • Direct The column is directly copied
    • Output Columns:
      • currency: Directly mapped to currency
117. model.linkedin.linkedin_ads__account_report
  • Input Column: 122. model.linkedin_source.stg_linkedin_ads__account_history[currency]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • currency: Directly copied to the output
Column Lineage
%3 122. model.linkedin_source.stg_linkedin_ads__account_history 122. model.linkedin_source.stg_linkedin_ads__account_history version_tag 117. model.linkedin.linkedin_ads__account_report 117. model.linkedin.linkedin_ads__account_report version_tag 122. model.linkedin_source.stg_linkedin_ads__account_history:f0->117. model.linkedin.linkedin_ads__account_report:f0 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp version_tag 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp:f0->122. model.linkedin_source.stg_linkedin_ads__account_history:f0
122. model.linkedin_source.stg_linkedin_ads__account_history
  • Input Column: 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp[version_tag]
    • Cleaning Cast to DECIMAL datatype
    • Output Columns:
      • version_tag: Mapped after casting to DECIMAL
117. model.linkedin.linkedin_ads__account_report
  • Input Column: 122. model.linkedin_source.stg_linkedin_ads__account_history[version_tag]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • version_tag: Directly copied to the output
Column Lineage
%3 122. model.linkedin_source.stg_linkedin_ads__account_history 122. model.linkedin_source.stg_linkedin_ads__account_history status 117. model.linkedin.linkedin_ads__account_report 117. model.linkedin.linkedin_ads__account_report status 122. model.linkedin_source.stg_linkedin_ads__account_history:f0->117. model.linkedin.linkedin_ads__account_report:f0
117. model.linkedin.linkedin_ads__account_report
  • Input Column: 122. model.linkedin_source.stg_linkedin_ads__account_history[status]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • status: Directly copied to the output
Column Lineage
%3 122. model.linkedin_source.stg_linkedin_ads__account_history 122. model.linkedin_source.stg_linkedin_ads__account_history type 117. model.linkedin.linkedin_ads__account_report 117. model.linkedin.linkedin_ads__account_report type 122. model.linkedin_source.stg_linkedin_ads__account_history:f0->117. model.linkedin.linkedin_ads__account_report:f0
117. model.linkedin.linkedin_ads__account_report
  • Input Column: 122. model.linkedin_source.stg_linkedin_ads__account_history[type]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • type: Directly copied to the output
Column Lineage
%3 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign conversion_value_in_local_currency 117. model.linkedin.linkedin_ads__account_report 117. model.linkedin.linkedin_ads__account_report conversion_value_in_local_currency 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->117. model.linkedin.linkedin_ads__account_report:f0 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp conversion_value_in_local_currency 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp:f0->124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0
124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign
  • Input Column: 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp[conversion_value_in_local_currency]
    • Cleaning The column is cast to FLOAT and coalesced with 0 if NULL
    • Output Columns:
      • conversion_value_in_local_currency: Directly mapped after cleaning
117. model.linkedin.linkedin_ads__account_report
  • Input Column: 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign[conversion_value_in_local_currency]
    • Cleaning COALESCE is used to replace NULL values with 0
    • Aggregation Summed up in the final SELECT statement
    • Output Columns:
      • conversion_value_in_local_currency: Aggregated sum of conversion value
Column Lineage
%3 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign external_website_conversions one_click_leads 117. model.linkedin.linkedin_ads__account_report 117. model.linkedin.linkedin_ads__account_report external_website_conversions one_click_leads total_conversions 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->117. model.linkedin.linkedin_ads__account_report:f0 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->117. model.linkedin.linkedin_ads__account_report:f2 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f1->117. model.linkedin.linkedin_ads__account_report:f1 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f1->117. model.linkedin.linkedin_ads__account_report:f2 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp external_website_conversions one_click_leads 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp:f0->124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp:f1->124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f1
124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign
  • Input Column: 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp[external_website_conversions]
    • Cleaning The column is cast to BIGINT and coalesced with 0 if NULL
    • Output Columns:
      • external_website_conversions: Directly mapped after cleaning
  • Input Column: 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp[one_click_leads]
    • Cleaning The column is cast to BIGINT type and coalesced with 0
    • Output Columns:
      • one_click_leads: Transformed and mapped
117. model.linkedin.linkedin_ads__account_report
  • Input Column: 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign[external_website_conversions]
    • Cleaning COALESCE is used to replace NULL values with 0
    • Aggregation Summed up in the final SELECT statement
    • Featurization Used to calculate total_conversions
    • Output Columns:
      • external_website_conversions: Aggregated sum of external website conversions
      • total_conversions: Part of the calculation for total conversions
  • Input Column: 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign[one_click_leads]
    • Cleaning COALESCE is used to replace NULL values with 0
    • Aggregation Summed up in the final SELECT statement
    • Featurization Used to calculate total_conversions
    • Output Columns:
      • one_click_leads: Aggregated sum of one-click leads
      • total_conversions: Part of the calculation for total conversions
Column Lineage
%3 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign external_website_conversions 117. model.linkedin.linkedin_ads__account_report 117. model.linkedin.linkedin_ads__account_report external_website_conversions total_conversions 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->117. model.linkedin.linkedin_ads__account_report:f0 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->117. model.linkedin.linkedin_ads__account_report:f1 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp external_website_conversions 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp:f0->124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0
124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign
  • Input Column: 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp[external_website_conversions]
    • Cleaning The column is cast to BIGINT and coalesced with 0 if NULL
    • Output Columns:
      • external_website_conversions: Directly mapped after cleaning
117. model.linkedin.linkedin_ads__account_report
  • Input Column: 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign[external_website_conversions]
    • Cleaning COALESCE is used to replace NULL values with 0
    • Aggregation Summed up in the final SELECT statement
    • Featurization Used to calculate total_conversions
    • Output Columns:
      • external_website_conversions: Aggregated sum of external website conversions
      • total_conversions: Part of the calculation for total conversions
Column Lineage
%3 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign one_click_leads 117. model.linkedin.linkedin_ads__account_report 117. model.linkedin.linkedin_ads__account_report one_click_leads total_conversions 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->117. model.linkedin.linkedin_ads__account_report:f0 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->117. model.linkedin.linkedin_ads__account_report:f1 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp one_click_leads 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp:f0->124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0
124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign
  • Input Column: 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp[one_click_leads]
    • Cleaning The column is cast to BIGINT type and coalesced with 0
    • Output Columns:
      • one_click_leads: Transformed and mapped
117. model.linkedin.linkedin_ads__account_report
  • Input Column: 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign[one_click_leads]
    • Cleaning COALESCE is used to replace NULL values with 0
    • Aggregation Summed up in the final SELECT statement
    • Featurization Used to calculate total_conversions
    • Output Columns:
      • one_click_leads: Aggregated sum of one-click leads
      • total_conversions: Part of the calculation for total conversions
118. model.linkedin.linkedin_ads__campaign_group_report

This SQL query creates a comprehensive report of LinkedIn ad campaign group performance. It combines data from multiple staging tables, including campaign groups, campaigns, accounts, and ad analytics. The query filters for the latest versions of historical data, calculates total conversions, and aggregates various performance metrics (clicks, impressions, cost, conversions) at the campaign group level. The final output includes campaign group details, account information, and aggregated performance metrics for each day.

FilteringIntegrationFeaturizationAggregation
SQL Query
WITH campaign_group AS (
  SELECT
    *
  FROM TEST.PUBLIC_linkedin_ads_source.stg_linkedin_ads__campaign_group_history
  WHERE
    is_latest_version
), campaign AS (
  SELECT
    *
  FROM TEST.PUBLIC_linkedin_ads_source.stg_linkedin_ads__campaign_history
  WHERE
    is_latest_version
), account AS (
  SELECT
    *
  FROM TEST.PUBLIC_linkedin_ads_source.stg_linkedin_ads__account_history
  WHERE
    is_latest_version
), report AS (
  SELECT
    *,
    external_website_conversions + one_click_leads AS total_conversions
  FROM TEST.PUBLIC_linkedin_ads_source.stg_linkedin_ads__ad_analytics_by_campaign
), final AS (
  SELECT
    report.source_relation,
    report.date_day,
    campaign_group.campaign_group_id,
    campaign_group.campaign_group_name,
    account.account_id,
    account.account_name,
    campaign_group.status,
    account.currency,
    campaign_group.is_backfilled,
    campaign_group.run_schedule_start_at,
    campaign_group.run_schedule_end_at,
    campaign_group.last_modified_at,
    campaign_group.created_at,
    SUM(report.total_conversions) AS total_conversions,
    SUM(report.clicks) AS clicks,
    SUM(report.impressions) AS impressions,
    SUM(report.cost) AS cost,
    SUM(COALESCE(report.conversion_value_in_local_currency, 0)) AS conversion_value_in_local_currency,
    SUM(COALESCE(external_website_conversions, 0)) AS external_website_conversions,
    SUM(COALESCE(one_click_leads, 0)) AS one_click_leads
  FROM report
  LEFT JOIN campaign
    ON report.campaign_id = campaign.campaign_id
    AND report.source_relation = campaign.source_relation
  LEFT JOIN campaign_group
    ON campaign.campaign_group_id = campaign_group.campaign_group_id
    AND campaign.source_relation = campaign_group.source_relation
  LEFT JOIN account
    ON campaign.account_id = account.account_id
    AND campaign.source_relation = account.source_relation
  GROUP BY
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10,
    11,
    12,
    13
)
SELECT
  *
FROM final
%3 118. model.linkedin.linkedin_ads__campaign_group_report 118. model.linkedin.linkedin_ads__campaign_group_report source_relation account_name account_id date_day clicks impressions cost campaign_group_name campaign_group_id last_modified_at created_at is_backfilled run_schedule_start_at run_schedule_end_at status currency conversion_value_in_local_currency total_conversions external_website_conversions one_click_leads 122. model.linkedin_source.stg_linkedin_ads__account_history 122. model.linkedin_source.stg_linkedin_ads__account_history source_relation account_id account_name currency 122. model.linkedin_source.stg_linkedin_ads__account_history:f0->118. model.linkedin.linkedin_ads__campaign_group_report:f0 122. model.linkedin_source.stg_linkedin_ads__account_history:f1->118. model.linkedin.linkedin_ads__campaign_group_report:f2 122. model.linkedin_source.stg_linkedin_ads__account_history:f2->118. model.linkedin.linkedin_ads__campaign_group_report:f1 122. model.linkedin_source.stg_linkedin_ads__account_history:f3->118. model.linkedin.linkedin_ads__campaign_group_report:f15 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign source_relation date_day clicks impressions cost conversion_value_in_local_currency external_website_conversions one_click_leads 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->118. model.linkedin.linkedin_ads__campaign_group_report:f0 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f1->118. model.linkedin.linkedin_ads__campaign_group_report:f3 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f2->118. model.linkedin.linkedin_ads__campaign_group_report:f4 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f3->118. model.linkedin.linkedin_ads__campaign_group_report:f5 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f4->118. model.linkedin.linkedin_ads__campaign_group_report:f6 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f5->118. model.linkedin.linkedin_ads__campaign_group_report:f16 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f6->118. model.linkedin.linkedin_ads__campaign_group_report:f18 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f6->118. model.linkedin.linkedin_ads__campaign_group_report:f17 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f7->118. model.linkedin.linkedin_ads__campaign_group_report:f19 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f7->118. model.linkedin.linkedin_ads__campaign_group_report:f17 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history source_relation campaign_group_id last_modified_at created_at campaign_group_name is_backfilled run_schedule_start_at run_schedule_end_at status 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f0->118. model.linkedin.linkedin_ads__campaign_group_report:f0 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f1->118. model.linkedin.linkedin_ads__campaign_group_report:f8 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f2->118. model.linkedin.linkedin_ads__campaign_group_report:f9 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f3->118. model.linkedin.linkedin_ads__campaign_group_report:f10 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f4->118. model.linkedin.linkedin_ads__campaign_group_report:f7 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f5->118. model.linkedin.linkedin_ads__campaign_group_report:f11 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f6->118. model.linkedin.linkedin_ads__campaign_group_report:f12 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f7->118. model.linkedin.linkedin_ads__campaign_group_report:f13 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f8->118. model.linkedin.linkedin_ads__campaign_group_report:f14 130. model.linkedin_source.stg_linkedin_ads__campaign_history 130. model.linkedin_source.stg_linkedin_ads__campaign_history source_relation campaign_group_id run_schedule_start_at 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->118. model.linkedin.linkedin_ads__campaign_group_report:f0 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f1->118. model.linkedin.linkedin_ads__campaign_group_report:f8 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f2->118. model.linkedin.linkedin_ads__campaign_group_report:f12
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
account_name text A label for the account.
account_id integer Unique internal ID representing the account.
date_day timestamp without time zone The day of the activity.
clicks bigint The count of chargeable clicks.
impressions bigint This is the count of "impressions" for Direct Ads and Sponsored Updates and "sends" for InMails.
cost double precision The cost of the ads in the local currency or USD.
campaign_group_name text A label for the campaign group.
campaign_group_id integer Unique internal ID representing the campaign group.
last_modified_at timestamp without time zone The timestamp of when the version was updated.
created_at timestamp without time zone The timestamp of when the campaign group was created.
is_backfilled boolean Flag that denotes whether the campaign group was created organically or to backfill existing campaigns. This is a read-only field set by the system. Default = false.
run_schedule_start_at timestamp without time zone Represents the inclusive (greater than or equal to) date when to start running the associated campaigns under this campaign group. This field is required.
run_schedule_end_at timestamp without time zone Represents the exclusive (strictly less than) date when to stop running the associated campaigns under this campaign group. If this field is unset, it indicates an open range with no end date.
status text Status of campaign group. Possible values are: ACTIVE - Denotes that the campaign group is capable of serving ads, subject to run date and budget limitations (as well as any other limitations at the account or campaign level). ARCHIVED - Denotes that the campaign group is presently inactive, and should mostly be hidden in the UI until un-archived. CANCELLED - Denotes that the campaign group has been permanently canceled and cannot be reactivated. Not a settable status. DRAFT - Denotes that the campaign group is in a preliminary state and should temporarily not be served. PAUSED - Denotes that the campaign group meets all requirements to be served, but temporarily should not be. PENDING_DELETION - Denotes that the campaign group has been requested to be deleted that is currently pending. REMOVED - Denoted that the campaign group was deleted, but must remain fetchable due to the existence of performance data.
currency text The ISO 4217 currency code of the account, such as 'USD' for United States Dollar (default).
conversion_value_in_local_currency double precision The value generated by your conversions, displayed in your LinkedIn account's local currency, on the given day.
total_conversions numeric The total conversions being brought in the conversion fields you select in your `linkedin_ads__conversion_fields`.
external_website_conversions numeric The actions taken on your website that you've defined as valuable to your business after clicking on LinkedIn ads.
one_click_leads numeric Leads submitted after clicking on LinkedIn ads.
Column Lineage
%3 122. model.linkedin_source.stg_linkedin_ads__account_history 122. model.linkedin_source.stg_linkedin_ads__account_history source_relation 118. model.linkedin.linkedin_ads__campaign_group_report 118. model.linkedin.linkedin_ads__campaign_group_report source_relation 122. model.linkedin_source.stg_linkedin_ads__account_history:f0->118. model.linkedin.linkedin_ads__campaign_group_report:f0 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign source_relation 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->118. model.linkedin.linkedin_ads__campaign_group_report:f0 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history source_relation 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f0->118. model.linkedin.linkedin_ads__campaign_group_report:f0 130. model.linkedin_source.stg_linkedin_ads__campaign_history 130. model.linkedin_source.stg_linkedin_ads__campaign_history source_relation 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->118. model.linkedin.linkedin_ads__campaign_group_report:f0
118. model.linkedin.linkedin_ads__campaign_group_report
  • Input Column: 122. model.linkedin_source.stg_linkedin_ads__account_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the JOIN conditions
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
  • Input Column: 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 130. model.linkedin_source.stg_linkedin_ads__campaign_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
Column Lineage
%3 122. model.linkedin_source.stg_linkedin_ads__account_history 122. model.linkedin_source.stg_linkedin_ads__account_history account_name 118. model.linkedin.linkedin_ads__campaign_group_report 118. model.linkedin.linkedin_ads__campaign_group_report account_name 122. model.linkedin_source.stg_linkedin_ads__account_history:f0->118. model.linkedin.linkedin_ads__campaign_group_report:f0 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp name 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp:f0->122. model.linkedin_source.stg_linkedin_ads__account_history:f0
122. model.linkedin_source.stg_linkedin_ads__account_history
  • Input Column: 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp[name]
    • Direct The column is directly copied
    • Output Columns:
      • account_name: Directly mapped to account_name
118. model.linkedin.linkedin_ads__campaign_group_report
  • Input Column: 122. model.linkedin_source.stg_linkedin_ads__account_history[account_name]
    • Direct directly copied to the output
    • Output Columns:
      • account_name: directly copied
Column Lineage
%3 122. model.linkedin_source.stg_linkedin_ads__account_history 122. model.linkedin_source.stg_linkedin_ads__account_history account_id 118. model.linkedin.linkedin_ads__campaign_group_report 118. model.linkedin.linkedin_ads__campaign_group_report account_id 122. model.linkedin_source.stg_linkedin_ads__account_history:f0->118. model.linkedin.linkedin_ads__campaign_group_report:f0 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp id 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp:f0->122. model.linkedin_source.stg_linkedin_ads__account_history:f0
122. model.linkedin_source.stg_linkedin_ads__account_history
  • Input Column: 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp[id]
    • Direct The column is directly copied
    • Deduplication Used in the PARTITION BY clause of the ROW_NUMBER() function
    • Output Columns:
      • account_id: Directly mapped to account_id
118. model.linkedin.linkedin_ads__campaign_group_report
  • Input Column: 122. model.linkedin_source.stg_linkedin_ads__account_history[account_id]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • account_id: directly copied
Column Lineage
%3 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign date_day 118. model.linkedin.linkedin_ads__campaign_group_report 118. model.linkedin.linkedin_ads__campaign_group_report date_day 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->118. model.linkedin.linkedin_ads__campaign_group_report:f0 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp day 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp:f0->124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0
124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign
  • Input Column: 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp[day]
    • Cleaning The column is cast to TIMESTAMP type and then truncated to day
    • Featurization The date is extracted from this column
    • Output Columns:
      • date_day: Mapped after casting to TIMESTAMP and truncating to day
118. model.linkedin.linkedin_ads__campaign_group_report
  • Input Column: 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign clicks 118. model.linkedin.linkedin_ads__campaign_group_report 118. model.linkedin.linkedin_ads__campaign_group_report clicks 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->118. model.linkedin.linkedin_ads__campaign_group_report:f0 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp clicks 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp:f0->124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0
124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign
  • Input Column: 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp[clicks]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to INT type
    • Output Columns:
      • clicks: Directly mapped after casting to INT
118. model.linkedin.linkedin_ads__campaign_group_report
  • Input Column: 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign[clicks]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • clicks: Aggregated sum of clicks
Column Lineage
%3 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign impressions 118. model.linkedin.linkedin_ads__campaign_group_report 118. model.linkedin.linkedin_ads__campaign_group_report impressions 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->118. model.linkedin.linkedin_ads__campaign_group_report:f0 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp impressions 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp:f0->124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0
124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign
  • Input Column: 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp[impressions]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to INT type
    • Output Columns:
      • impressions: Directly mapped
118. model.linkedin.linkedin_ads__campaign_group_report
  • Input Column: 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign[impressions]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • impressions: Aggregated sum of impressions
Column Lineage
%3 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign cost 118. model.linkedin.linkedin_ads__campaign_group_report 118. model.linkedin.linkedin_ads__campaign_group_report cost 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->118. model.linkedin.linkedin_ads__campaign_group_report:f0 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp cost_in_usd 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp:f0->124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0
124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign
  • Input Column: 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp[cost_in_usd]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • cost: Directly mapped and renamed
118. model.linkedin.linkedin_ads__campaign_group_report
  • Input Column: 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign[cost]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • cost: Aggregated sum of cost
Column Lineage
%3 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history campaign_group_name 118. model.linkedin.linkedin_ads__campaign_group_report 118. model.linkedin.linkedin_ads__campaign_group_report campaign_group_name 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f0->118. model.linkedin.linkedin_ads__campaign_group_report:f0 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp name 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp:f0->128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f0
128. model.linkedin_source.stg_linkedin_ads__campaign_group_history
  • Input Column: 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp[name]
    • Direct The column is directly copied to the output
    • Output Columns:
      • campaign_group_name: Directly mapped
118. model.linkedin.linkedin_ads__campaign_group_report
  • Input Column: 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history[campaign_group_name]
    • Direct directly copied to the output
    • Aggregation used in the GROUP BY clause
    • Output Columns:
      • campaign_group_name: directly copied
Column Lineage
%3 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history campaign_group_id 118. model.linkedin.linkedin_ads__campaign_group_report 118. model.linkedin.linkedin_ads__campaign_group_report campaign_group_id 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f0->118. model.linkedin.linkedin_ads__campaign_group_report:f0 130. model.linkedin_source.stg_linkedin_ads__campaign_history 130. model.linkedin_source.stg_linkedin_ads__campaign_history campaign_group_id 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->118. model.linkedin.linkedin_ads__campaign_group_report:f0 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp id 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp:f0->128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f0 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp campaign_group_id 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp:f0->130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0
128. model.linkedin_source.stg_linkedin_ads__campaign_group_history
  • Input Column: 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp[id]
    • Direct The column is directly copied to the output
    • Deduplication Used in the ROW_NUMBER() window function for determining the latest version
    • Output Columns:
      • campaign_group_id: Directly mapped
130. model.linkedin_source.stg_linkedin_ads__campaign_history
  • Input Column: 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp[campaign_group_id]
    • Direct The column is directly copied to the output
    • Output Columns:
      • campaign_group_id: Directly mapped
118. model.linkedin.linkedin_ads__campaign_group_report
  • Input Column: 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history[campaign_group_id]
    • Integration used as part of the join condition with the campaign table
    • Direct directly copied to the output
    • Aggregation used in the GROUP BY clause
    • Output Columns:
      • campaign_group_id: directly copied
  • Input Column: 130. model.linkedin_source.stg_linkedin_ads__campaign_history[campaign_group_id]
    • Integration used to join with the campaign_group table
    • Output Columns:
      • campaign_group_id: directly copied after joining
Column Lineage
%3 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history last_modified_at 118. model.linkedin.linkedin_ads__campaign_group_report 118. model.linkedin.linkedin_ads__campaign_group_report last_modified_at 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f0->118. model.linkedin.linkedin_ads__campaign_group_report:f0 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp last_modified_time 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp:f0->128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f0
128. model.linkedin_source.stg_linkedin_ads__campaign_group_history
  • Input Column: 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp[last_modified_time]
    • Cleaning Cast to TIMESTAMP data type
    • Deduplication Used in the ROW_NUMBER() window function for ordering and determining the latest version
    • Output Columns:
      • last_modified_at: Mapped after casting to TIMESTAMP
118. model.linkedin.linkedin_ads__campaign_group_report
  • Input Column: 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history[last_modified_at]
    • Direct directly copied to the output
    • Aggregation used in the GROUP BY clause
    • Output Columns:
      • last_modified_at: directly copied
Column Lineage
%3 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history created_at 118. model.linkedin.linkedin_ads__campaign_group_report 118. model.linkedin.linkedin_ads__campaign_group_report created_at 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f0->118. model.linkedin.linkedin_ads__campaign_group_report:f0 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp created_time 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp:f0->128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f0
128. model.linkedin_source.stg_linkedin_ads__campaign_group_history
  • Input Column: 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp[created_time]
    • Cleaning Cast to TIMESTAMP data type
    • Output Columns:
      • created_at: Mapped after casting to TIMESTAMP
118. model.linkedin.linkedin_ads__campaign_group_report
  • Input Column: 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history[created_at]
    • Direct directly copied to the output
    • Aggregation used in the GROUP BY clause
    • Output Columns:
      • created_at: directly copied
Column Lineage
%3 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history is_backfilled 118. model.linkedin.linkedin_ads__campaign_group_report 118. model.linkedin.linkedin_ads__campaign_group_report is_backfilled 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f0->118. model.linkedin.linkedin_ads__campaign_group_report:f0
118. model.linkedin.linkedin_ads__campaign_group_report
  • Input Column: 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history[is_backfilled]
    • Direct directly copied to the output
    • Aggregation used in the GROUP BY clause
    • Output Columns:
      • is_backfilled: directly copied
Column Lineage
%3 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history run_schedule_start_at 118. model.linkedin.linkedin_ads__campaign_group_report 118. model.linkedin.linkedin_ads__campaign_group_report run_schedule_start_at 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f0->118. model.linkedin.linkedin_ads__campaign_group_report:f0 130. model.linkedin_source.stg_linkedin_ads__campaign_history 130. model.linkedin_source.stg_linkedin_ads__campaign_history run_schedule_start_at 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->118. model.linkedin.linkedin_ads__campaign_group_report:f0
118. model.linkedin.linkedin_ads__campaign_group_report
  • Input Column: 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history[run_schedule_start_at]
    • Direct directly copied to the output
    • Aggregation used in the GROUP BY clause
    • Output Columns:
      • run_schedule_start_at: directly copied
  • Input Column: 130. model.linkedin_source.stg_linkedin_ads__campaign_history[run_schedule_start_at]
    • Integration This column is used to join the campaign table with the campaign_group table
    • Output Columns:
      • run_schedule_start_at: It is directly copied to the output
Column Lineage
%3 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history run_schedule_end_at 118. model.linkedin.linkedin_ads__campaign_group_report 118. model.linkedin.linkedin_ads__campaign_group_report run_schedule_end_at 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f0->118. model.linkedin.linkedin_ads__campaign_group_report:f0
118. model.linkedin.linkedin_ads__campaign_group_report
  • Input Column: 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history[run_schedule_end_at]
    • Direct directly copied to the output
    • Aggregation used in the GROUP BY clause
    • Output Columns:
      • run_schedule_end_at: directly copied
Column Lineage
%3 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history status 118. model.linkedin.linkedin_ads__campaign_group_report 118. model.linkedin.linkedin_ads__campaign_group_report status 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f0->118. model.linkedin.linkedin_ads__campaign_group_report:f0
118. model.linkedin.linkedin_ads__campaign_group_report
  • Input Column: 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history[status]
    • Direct directly copied to the output
    • Aggregation used in the GROUP BY clause
    • Output Columns:
      • status: directly copied
Column Lineage
%3 122. model.linkedin_source.stg_linkedin_ads__account_history 122. model.linkedin_source.stg_linkedin_ads__account_history currency 118. model.linkedin.linkedin_ads__campaign_group_report 118. model.linkedin.linkedin_ads__campaign_group_report currency 122. model.linkedin_source.stg_linkedin_ads__account_history:f0->118. model.linkedin.linkedin_ads__campaign_group_report:f0 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp currency 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp:f0->122. model.linkedin_source.stg_linkedin_ads__account_history:f0
122. model.linkedin_source.stg_linkedin_ads__account_history
  • Input Column: 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp[currency]
    • Direct The column is directly copied
    • Output Columns:
      • currency: Directly mapped to currency
118. model.linkedin.linkedin_ads__campaign_group_report
  • Input Column: 122. model.linkedin_source.stg_linkedin_ads__account_history[currency]
    • Direct directly copied to the output
    • Output Columns:
      • currency: directly copied
Column Lineage
%3 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign conversion_value_in_local_currency 118. model.linkedin.linkedin_ads__campaign_group_report 118. model.linkedin.linkedin_ads__campaign_group_report conversion_value_in_local_currency 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->118. model.linkedin.linkedin_ads__campaign_group_report:f0 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp conversion_value_in_local_currency 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp:f0->124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0
124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign
  • Input Column: 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp[conversion_value_in_local_currency]
    • Cleaning The column is cast to FLOAT and coalesced with 0 if NULL
    • Output Columns:
      • conversion_value_in_local_currency: Directly mapped after cleaning
118. model.linkedin.linkedin_ads__campaign_group_report
  • Input Column: 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign[conversion_value_in_local_currency]
    • Cleaning COALESCE is used to replace NULL values with 0
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • conversion_value_in_local_currency: Aggregated sum of conversion value
Column Lineage
%3 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign external_website_conversions one_click_leads 118. model.linkedin.linkedin_ads__campaign_group_report 118. model.linkedin.linkedin_ads__campaign_group_report external_website_conversions one_click_leads total_conversions 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->118. model.linkedin.linkedin_ads__campaign_group_report:f0 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->118. model.linkedin.linkedin_ads__campaign_group_report:f2 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f1->118. model.linkedin.linkedin_ads__campaign_group_report:f1 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f1->118. model.linkedin.linkedin_ads__campaign_group_report:f2 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp external_website_conversions one_click_leads 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp:f0->124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp:f1->124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f1
124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign
  • Input Column: 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp[external_website_conversions]
    • Cleaning The column is cast to BIGINT and coalesced with 0 if NULL
    • Output Columns:
      • external_website_conversions: Directly mapped after cleaning
  • Input Column: 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp[one_click_leads]
    • Cleaning The column is cast to BIGINT type and coalesced with 0
    • Output Columns:
      • one_click_leads: Transformed and mapped
118. model.linkedin.linkedin_ads__campaign_group_report
  • Input Column: 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign[external_website_conversions]
    • Featurization Used to calculate total_conversions
    • Cleaning COALESCE is used to replace NULL values with 0
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • external_website_conversions: Aggregated sum of external website conversions
      • total_conversions: Part of the calculation for total_conversions
  • Input Column: 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign[one_click_leads]
    • Featurization Used to calculate total_conversions
    • Cleaning COALESCE is used to replace NULL values with 0
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • one_click_leads: Aggregated sum of one-click leads
      • total_conversions: Part of the calculation for total_conversions
Column Lineage
%3 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign external_website_conversions 118. model.linkedin.linkedin_ads__campaign_group_report 118. model.linkedin.linkedin_ads__campaign_group_report external_website_conversions total_conversions 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->118. model.linkedin.linkedin_ads__campaign_group_report:f0 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->118. model.linkedin.linkedin_ads__campaign_group_report:f1 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp external_website_conversions 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp:f0->124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0
124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign
  • Input Column: 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp[external_website_conversions]
    • Cleaning The column is cast to BIGINT and coalesced with 0 if NULL
    • Output Columns:
      • external_website_conversions: Directly mapped after cleaning
118. model.linkedin.linkedin_ads__campaign_group_report
  • Input Column: 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign[external_website_conversions]
    • Featurization Used to calculate total_conversions
    • Cleaning COALESCE is used to replace NULL values with 0
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • external_website_conversions: Aggregated sum of external website conversions
      • total_conversions: Part of the calculation for total_conversions
Column Lineage
%3 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign one_click_leads 118. model.linkedin.linkedin_ads__campaign_group_report 118. model.linkedin.linkedin_ads__campaign_group_report one_click_leads total_conversions 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->118. model.linkedin.linkedin_ads__campaign_group_report:f0 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->118. model.linkedin.linkedin_ads__campaign_group_report:f1 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp one_click_leads 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp:f0->124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0
124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign
  • Input Column: 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp[one_click_leads]
    • Cleaning The column is cast to BIGINT type and coalesced with 0
    • Output Columns:
      • one_click_leads: Transformed and mapped
118. model.linkedin.linkedin_ads__campaign_group_report
  • Input Column: 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign[one_click_leads]
    • Featurization Used to calculate total_conversions
    • Cleaning COALESCE is used to replace NULL values with 0
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • one_click_leads: Aggregated sum of one-click leads
      • total_conversions: Part of the calculation for total_conversions
119. model.linkedin.linkedin_ads__campaign_report

This SQL query integrates data from multiple LinkedIn Ads related tables (campaign, campaign group, account, and ad analytics) to create a comprehensive campaign report. It filters for the latest versions of historical data, performs joins to combine information from different sources, calculates total conversions, and aggregates various metrics (clicks, impressions, cost, conversions) at the campaign level. The final output includes detailed campaign information along with performance metrics.

FilteringIntegrationFeaturizationAggregation
SQL Query
WITH campaign AS (
  SELECT
    *
  FROM TEST.PUBLIC_linkedin_ads_source.stg_linkedin_ads__campaign_history
  WHERE
    is_latest_version
), campaign_group AS (
  SELECT
    *
  FROM TEST.PUBLIC_linkedin_ads_source.stg_linkedin_ads__campaign_group_history
  WHERE
    is_latest_version
), account AS (
  SELECT
    *
  FROM TEST.PUBLIC_linkedin_ads_source.stg_linkedin_ads__account_history
  WHERE
    is_latest_version
), report AS (
  SELECT
    *,
    external_website_conversions + one_click_leads AS total_conversions
  FROM TEST.PUBLIC_linkedin_ads_source.stg_linkedin_ads__ad_analytics_by_campaign
), final AS (
  SELECT
    report.source_relation,
    report.date_day,
    report.campaign_id,
    campaign.campaign_name,
    campaign.version_tag,
    campaign_group.campaign_group_id,
    campaign_group.campaign_group_name,
    account.account_id,
    account.account_name,
    campaign.status AS campaign_status,
    campaign_group.status AS campaign_group_status,
    campaign.type,
    campaign.cost_type,
    campaign.creative_selection,
    campaign.daily_budget_amount,
    campaign.daily_budget_currency_code,
    campaign.unit_cost_amount,
    campaign.unit_cost_currency_code,
    account.currency,
    campaign.format,
    campaign.locale_country,
    campaign.locale_language,
    campaign.objective_type,
    campaign.optimization_target_type,
    campaign.is_audience_expansion_enabled,
    campaign.is_offsite_delivery_enabled,
    campaign.run_schedule_start_at,
    campaign.run_schedule_end_at,
    campaign.last_modified_at,
    campaign.created_at,
    SUM(report.total_conversions) AS total_conversions,
    SUM(report.clicks) AS clicks,
    SUM(report.impressions) AS impressions,
    SUM(report.cost) AS cost,
    SUM(COALESCE(report.conversion_value_in_local_currency, 0)) AS conversion_value_in_local_currency,
    SUM(COALESCE(external_website_conversions, 0)) AS external_website_conversions,
    SUM(COALESCE(one_click_leads, 0)) AS one_click_leads
  FROM report
  LEFT JOIN campaign
    ON report.campaign_id = campaign.campaign_id
    AND report.source_relation = campaign.source_relation
  LEFT JOIN campaign_group
    ON campaign.campaign_group_id = campaign_group.campaign_group_id
    AND campaign.source_relation = campaign_group.source_relation
  LEFT JOIN account
    ON campaign.account_id = account.account_id
    AND campaign.source_relation = account.source_relation
  GROUP BY
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10,
    11,
    12,
    13,
    14,
    15,
    16,
    17,
    18,
    19,
    20,
    21,
    22,
    23,
    24,
    25,
    26,
    27,
    28,
    29,
    30
)
SELECT
  *
FROM final
%3 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report source_relation account_name account_id date_day clicks impressions cost campaign_group_name campaign_group_id campaign_name campaign_id campaign_group_status last_modified_at created_at version_tag is_audience_expansion_enabled cost_type creative_selection daily_budget_amount daily_budget_currency_code format locale_country locale_language objective_type is_offsite_delivery_enabled optimization_target_type run_schedule_start_at run_schedule_end_at campaign_status type unit_cost_amount unit_cost_currency_code currency conversion_value_in_local_currency total_conversions external_website_conversions one_click_leads 122. model.linkedin_source.stg_linkedin_ads__account_history 122. model.linkedin_source.stg_linkedin_ads__account_history source_relation account_id account_name currency 122. model.linkedin_source.stg_linkedin_ads__account_history:f0->119. model.linkedin.linkedin_ads__campaign_report:f0 122. model.linkedin_source.stg_linkedin_ads__account_history:f1->119. model.linkedin.linkedin_ads__campaign_report:f2 122. model.linkedin_source.stg_linkedin_ads__account_history:f2->119. model.linkedin.linkedin_ads__campaign_report:f1 122. model.linkedin_source.stg_linkedin_ads__account_history:f3->119. model.linkedin.linkedin_ads__campaign_report:f32 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign source_relation campaign_id date_day clicks impressions cost conversion_value_in_local_currency external_website_conversions one_click_leads 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->119. model.linkedin.linkedin_ads__campaign_report:f0 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f1->119. model.linkedin.linkedin_ads__campaign_report:f10 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f2->119. model.linkedin.linkedin_ads__campaign_report:f3 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f3->119. model.linkedin.linkedin_ads__campaign_report:f4 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f4->119. model.linkedin.linkedin_ads__campaign_report:f5 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f5->119. model.linkedin.linkedin_ads__campaign_report:f6 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f6->119. model.linkedin.linkedin_ads__campaign_report:f33 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f7->119. model.linkedin.linkedin_ads__campaign_report:f35 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f7->119. model.linkedin.linkedin_ads__campaign_report:f34 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f8->119. model.linkedin.linkedin_ads__campaign_report:f36 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f8->119. model.linkedin.linkedin_ads__campaign_report:f34 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history source_relation campaign_group_id campaign_group_name status 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f0->119. model.linkedin.linkedin_ads__campaign_report:f0 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f1->119. model.linkedin.linkedin_ads__campaign_report:f8 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f2->119. model.linkedin.linkedin_ads__campaign_report:f7 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f3->119. model.linkedin.linkedin_ads__campaign_report:f11 130. model.linkedin_source.stg_linkedin_ads__campaign_history 130. model.linkedin_source.stg_linkedin_ads__campaign_history source_relation campaign_id last_modified_at created_at campaign_name version_tag is_audience_expansion_enabled cost_type creative_selection daily_budget_amount daily_budget_currency_code format locale_country locale_language objective_type is_offsite_delivery_enabled optimization_target_type run_schedule_start_at run_schedule_end_at status type unit_cost_amount unit_cost_currency_code 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->119. model.linkedin.linkedin_ads__campaign_report:f0 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f1->119. model.linkedin.linkedin_ads__campaign_report:f10 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f2->119. model.linkedin.linkedin_ads__campaign_report:f12 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f3->119. model.linkedin.linkedin_ads__campaign_report:f13 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f4->119. model.linkedin.linkedin_ads__campaign_report:f9 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f5->119. model.linkedin.linkedin_ads__campaign_report:f14 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f6->119. model.linkedin.linkedin_ads__campaign_report:f15 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f7->119. model.linkedin.linkedin_ads__campaign_report:f16 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f8->119. model.linkedin.linkedin_ads__campaign_report:f17 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f9->119. model.linkedin.linkedin_ads__campaign_report:f18 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f10->119. model.linkedin.linkedin_ads__campaign_report:f19 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f11->119. model.linkedin.linkedin_ads__campaign_report:f20 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f12->119. model.linkedin.linkedin_ads__campaign_report:f21 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f13->119. model.linkedin.linkedin_ads__campaign_report:f22 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f14->119. model.linkedin.linkedin_ads__campaign_report:f23 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f15->119. model.linkedin.linkedin_ads__campaign_report:f24 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f16->119. model.linkedin.linkedin_ads__campaign_report:f25 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f17->119. model.linkedin.linkedin_ads__campaign_report:f26 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f18->119. model.linkedin.linkedin_ads__campaign_report:f27 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f19->119. model.linkedin.linkedin_ads__campaign_report:f28 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f20->119. model.linkedin.linkedin_ads__campaign_report:f29 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f21->119. model.linkedin.linkedin_ads__campaign_report:f30 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f22->119. model.linkedin.linkedin_ads__campaign_report:f31
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
account_name text A label for the account.
account_id integer Unique internal ID representing the account.
date_day timestamp without time zone The day of the activity.
clicks bigint The count of chargeable clicks.
impressions bigint This is the count of "impressions" for Direct Ads and Sponsored Updates and "sends" for InMails.
cost double precision The cost of the ads in the local currency or USD.
campaign_group_name text A label for the campaign group.
campaign_group_id integer Unique internal ID representing the campaign group.
campaign_name text A label for the campaign.
campaign_id integer Unique internal ID representing the campaign.
campaign_group_status text Status of campaign's campaign group. Possible values are: ACTIVE - Denotes that the campaign group is capable of serving ads, subject to run date and budget limitations (as well as any other limitations at the account or campaign level). ARCHIVED - Denotes that the campaign group is presently inactive, and should mostly be hidden in the UI until un-archived. CANCELLED - Denotes that the campaign group has been permanently canceled and cannot be reactivated. Not a settable status. DRAFT - Denotes that the campaign group is in a preliminary state and should temporarily not be served. PAUSED - Denotes that the campaign group meets all requirements to be served, but temporarily should not be. PENDING_DELETION - Denotes that the campaign group has been requested to be deleted that is currently pending. REMOVED - Denoted that the campaign group was deleted, but must remain fetchable due to the existence of performance data.
last_modified_at timestamp without time zone The timestamp of when the version was updated.
created_at timestamp without time zone The timestamp of when the campaign was created.
version_tag numeric An integer representation of the version of the campaign.
is_audience_expansion_enabled boolean Boolean (default=false) representing whether Audience Expansion is enabled for the campaign provides query expansion for certain targeting criteria.
cost_type text CPM - Cost per thousand advertising impressions. If type=SPONSORED_INMAILS; cost per send(CPS) is measured as CPM x 1000. CPC- Cost per individual click on the associated link. CPV- Cost per view for video ads.
creative_selection text ROUND_ROBIN - Rotate through available creatives to serve them as evenly as possible. OPTIMIZED (default) - Bias selection taking into account such as expected performance. Not available for Message and Conversation Ads (type=SPONSORED_INMAILS).
daily_budget_amount double precision Maximum amount to spend per day UTC. The amount of money as a real number string.
daily_budget_currency_code text ISO currency code. The currency must match that of the parent account.
format text The ad format on the campaign level. See https://docs.microsoft.com/en-us/linkedin/marketing/integrations/ads/campaign-formats?view=li-lms-2022-07
locale_country text Locale of the campaign. An uppercase two-letter country code as defined by ISO-3166.
locale_language text Locale of the campaign. A lowercase two-letter language code as defined by ISO-639.
objective_type text Campaign Objective type values. Click [here](https://docs.microsoft.com/en-us/linkedin/marketing/integrations/ads-reporting/ad-budget-pricing-type-combinations?view=li-lms-2022-07) for Campaign Objective descriptions. One of: - BRAND_AWARENESS - ENGAGEMENT - JOB_APPLICANTS - LEAD_GENERATION - WEBSITE_CONVERSIONS - WEBSITE_VISITS - VIDEO_VIEWS
is_offsite_delivery_enabled boolean Boolean indicating if this campaign to allowed to be served on the LinkedIn Audience Network to extend the reach of your campaign by delivering ads beyond the LinkedIn feed to members on third-party apps and sites. (default will be "True" from June 30, 2022)
optimization_target_type text Determines how this campaign is optimized for spending. If this is not set, there is no optimization. Refer to the documentation here. Default = 'NONE'.
run_schedule_start_at timestamp without time zone Scheduled date range to run associated creatives. The start date must be non-null. Represents the inclusive (greater than or equal to) value in which to start the range.
run_schedule_end_at timestamp without time zone Scheduled date range to run associated creatives. The start date must be non-null. Represents the exclusive (strictly less than) value in which to end the range, if provided.
campaign_status text ACTIVE - Denotes that the campaign is fully servable. PAUSED - Denotes that the campaign meets all requirements to be served, but temporarily should not be. ARCHIVED - Denotes that the campaign is presently inactive, and should mostly be hidden in the UI until un-archived. COMPLETED - Denotes that the campaign has reached a specified budgetary or chronological limit. CANCELED - Denotes that the campaign has been permanently canceled, such as when an advertising account is permanently closed. DRAFT - Denotes that the campaign is still being edited and not eligible for serving. Some validation will be postponed until the campaign is activated. PENDING_DELETION - Denotes that the campaign has been requested to be deleted that is currently pending. REMOVED - Denotes that the campaign was deleted, but must remain fetchable due to the existence of performance data.
type text TEXT_AD - Text-based ads that show up in the right column or top of the page on LinkedIn. SPONSORED_UPDATES - Native ads that promote a company's content updates in the LinkedIn feed. SPONSORED_INMAILS - Personalized messages with a call-to-action button delivered to a LinkedIn's member inbox. DYNAMIC - Ads that are dynamically personalized.
unit_cost_amount double precision This value is used as one of the following: amount to bid (for manual bidding), amount which is the target cost (for target cost bidding) per click, impression, or other event depending on the pricing model, or cost cap (for cost cap bidding). The amount of money as a real number string. The amount should be non-negative if the bidding strategy is manual, target cost, or cost cap bidding. The default is 0 with the currency code set to match that of the associated account.
unit_cost_currency_code text Amount to bid per click, impression, or other event depending on the pricing model. The default is 0 with the currency code set to match that of the associated account. ISO currency code.
currency text The ISO 4217 currency code of the account, such as 'USD' for United States Dollar (default).
conversion_value_in_local_currency double precision The value generated by your conversions, displayed in your LinkedIn account's local currency, on the given day.
total_conversions numeric The total conversions being brought in the conversion fields you select in your `linkedin_ads__conversion_fields`.
external_website_conversions numeric The actions taken on your website that you've defined as valuable to your business after clicking on LinkedIn ads.
one_click_leads numeric Leads submitted after clicking on LinkedIn ads.
Column Lineage
%3 122. model.linkedin_source.stg_linkedin_ads__account_history 122. model.linkedin_source.stg_linkedin_ads__account_history source_relation 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report source_relation 122. model.linkedin_source.stg_linkedin_ads__account_history:f0->119. model.linkedin.linkedin_ads__campaign_report:f0 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign source_relation 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->119. model.linkedin.linkedin_ads__campaign_report:f0 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history source_relation 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f0->119. model.linkedin.linkedin_ads__campaign_report:f0 130. model.linkedin_source.stg_linkedin_ads__campaign_history 130. model.linkedin_source.stg_linkedin_ads__campaign_history source_relation 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->119. model.linkedin.linkedin_ads__campaign_report:f0
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 122. model.linkedin_source.stg_linkedin_ads__account_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct copied directly to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join conditions with other tables
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
  • Input Column: 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 130. model.linkedin_source.stg_linkedin_ads__campaign_history[source_relation]
    • Direct The column is directly copied without transformation
    • Integration Used as part of the join condition with other tables
    • Output Columns:
      • source_relation: Directly copied to the output
Column Lineage
%3 122. model.linkedin_source.stg_linkedin_ads__account_history 122. model.linkedin_source.stg_linkedin_ads__account_history account_name 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report account_name 122. model.linkedin_source.stg_linkedin_ads__account_history:f0->119. model.linkedin.linkedin_ads__campaign_report:f0 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp name 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp:f0->122. model.linkedin_source.stg_linkedin_ads__account_history:f0
122. model.linkedin_source.stg_linkedin_ads__account_history
  • Input Column: 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp[name]
    • Direct The column is directly copied
    • Output Columns:
      • account_name: Directly mapped to account_name
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 122. model.linkedin_source.stg_linkedin_ads__account_history[account_name]
    • Direct copied directly to the output
    • Output Columns:
      • account_name: directly copied
Column Lineage
%3 122. model.linkedin_source.stg_linkedin_ads__account_history 122. model.linkedin_source.stg_linkedin_ads__account_history account_id 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report account_id 122. model.linkedin_source.stg_linkedin_ads__account_history:f0->119. model.linkedin.linkedin_ads__campaign_report:f0 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp id 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp:f0->122. model.linkedin_source.stg_linkedin_ads__account_history:f0
122. model.linkedin_source.stg_linkedin_ads__account_history
  • Input Column: 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp[id]
    • Direct The column is directly copied
    • Deduplication Used in the PARTITION BY clause of the ROW_NUMBER() function
    • Output Columns:
      • account_id: Directly mapped to account_id
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 122. model.linkedin_source.stg_linkedin_ads__account_history[account_id]
    • Integration used as the key to join with other tables
    • Direct copied directly to the output
    • Output Columns:
      • account_id: directly copied
Column Lineage
%3 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign date_day 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report date_day 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->119. model.linkedin.linkedin_ads__campaign_report:f0 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp day 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp:f0->124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0
124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign
  • Input Column: 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp[day]
    • Cleaning The column is cast to TIMESTAMP type and then truncated to day
    • Featurization The date is extracted from this column
    • Output Columns:
      • date_day: Mapped after casting to TIMESTAMP and truncating to day
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign clicks 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report clicks 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->119. model.linkedin.linkedin_ads__campaign_report:f0 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp clicks 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp:f0->124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0
124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign
  • Input Column: 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp[clicks]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to INT type
    • Output Columns:
      • clicks: Directly mapped after casting to INT
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign[clicks]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • clicks: Aggregated sum in the output
Column Lineage
%3 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign impressions 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report impressions 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->119. model.linkedin.linkedin_ads__campaign_report:f0 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp impressions 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp:f0->124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0
124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign
  • Input Column: 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp[impressions]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to INT type
    • Output Columns:
      • impressions: Directly mapped
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign[impressions]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • impressions: Aggregated sum in the output
Column Lineage
%3 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign cost 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report cost 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->119. model.linkedin.linkedin_ads__campaign_report:f0 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp cost_in_usd 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp:f0->124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0
124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign
  • Input Column: 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp[cost_in_usd]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • cost: Directly mapped and renamed
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign[cost]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • cost: Aggregated sum in the output
Column Lineage
%3 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history campaign_group_name 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report campaign_group_name 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f0->119. model.linkedin.linkedin_ads__campaign_report:f0 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp name 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp:f0->128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f0
128. model.linkedin_source.stg_linkedin_ads__campaign_group_history
  • Input Column: 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp[name]
    • Direct The column is directly copied to the output
    • Output Columns:
      • campaign_group_name: Directly mapped
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history[campaign_group_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_group_name: directly copied
Column Lineage
%3 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history campaign_group_id 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report campaign_group_id 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f0->119. model.linkedin.linkedin_ads__campaign_report:f0 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp id 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp:f0->128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f0
128. model.linkedin_source.stg_linkedin_ads__campaign_group_history
  • Input Column: 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp[id]
    • Direct The column is directly copied to the output
    • Deduplication Used in the ROW_NUMBER() window function for determining the latest version
    • Output Columns:
      • campaign_group_id: Directly mapped
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history[campaign_group_id]
    • Integration used as the key to join with the campaign table
    • Direct directly copied to the output
    • Output Columns:
      • campaign_group_id: directly copied
Column Lineage
%3 130. model.linkedin_source.stg_linkedin_ads__campaign_history 130. model.linkedin_source.stg_linkedin_ads__campaign_history campaign_name 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report campaign_name 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->119. model.linkedin.linkedin_ads__campaign_report:f0 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp name 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp:f0->130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0
130. model.linkedin_source.stg_linkedin_ads__campaign_history
  • Input Column: 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp[name]
    • Direct The column is directly copied to the output
    • Output Columns:
      • campaign_name: Directly mapped
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 130. model.linkedin_source.stg_linkedin_ads__campaign_history[campaign_name]
    • Direct The column is directly copied without transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • campaign_name: Directly copied to the output
Column Lineage
%3 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign campaign_id 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report campaign_id 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->119. model.linkedin.linkedin_ads__campaign_report:f0 130. model.linkedin_source.stg_linkedin_ads__campaign_history 130. model.linkedin_source.stg_linkedin_ads__campaign_history campaign_id 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->119. model.linkedin.linkedin_ads__campaign_report:f0 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp campaign_id 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp:f0->124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp id 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp:f0->130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0
124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign
  • Input Column: 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp[campaign_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to INT type
    • Output Columns:
      • campaign_id: Directly mapped after casting to INT
130. model.linkedin_source.stg_linkedin_ads__campaign_history
  • Input Column: 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp[id]
    • Direct The column is directly copied to the output
    • Deduplication Used in ROW_NUMBER() function to identify the latest version
    • Output Columns:
      • campaign_id: Directly mapped
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign[campaign_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with the campaign table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • campaign_id: Directly copied to the output
  • Input Column: 130. model.linkedin_source.stg_linkedin_ads__campaign_history[campaign_id]
    • Direct The column is directly copied without transformation
    • Integration Used as a key to join with the report table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • campaign_id: Directly copied to the output
Column Lineage
%3 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history status 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report campaign_group_status 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f0->119. model.linkedin.linkedin_ads__campaign_report:f0
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history[status]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_group_status: directly copied
Column Lineage
%3 130. model.linkedin_source.stg_linkedin_ads__campaign_history 130. model.linkedin_source.stg_linkedin_ads__campaign_history last_modified_at 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report last_modified_at 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->119. model.linkedin.linkedin_ads__campaign_report:f0 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp last_modified_time 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp:f0->130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0
130. model.linkedin_source.stg_linkedin_ads__campaign_history
  • Input Column: 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp[last_modified_time]
    • Cleaning Cast to TIMESTAMP data type
    • Deduplication Used in ROW_NUMBER() function to order and identify the latest version
    • Output Columns:
      • last_modified_at: Mapped after casting to TIMESTAMP
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 130. model.linkedin_source.stg_linkedin_ads__campaign_history[last_modified_at]
    • Direct The column is directly copied without transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • last_modified_at: Directly copied to the output
Column Lineage
%3 130. model.linkedin_source.stg_linkedin_ads__campaign_history 130. model.linkedin_source.stg_linkedin_ads__campaign_history created_at 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report created_at 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->119. model.linkedin.linkedin_ads__campaign_report:f0 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp created_time 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp:f0->130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0
130. model.linkedin_source.stg_linkedin_ads__campaign_history
  • Input Column: 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp[created_time]
    • Cleaning Cast to TIMESTAMP data type
    • Output Columns:
      • created_at: Mapped after casting to TIMESTAMP
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 130. model.linkedin_source.stg_linkedin_ads__campaign_history[created_at]
    • Direct The column is directly copied without transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • created_at: Directly copied to the output
Column Lineage
%3 130. model.linkedin_source.stg_linkedin_ads__campaign_history 130. model.linkedin_source.stg_linkedin_ads__campaign_history version_tag 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report version_tag 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->119. model.linkedin.linkedin_ads__campaign_report:f0 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp version_tag 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp:f0->130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0
130. model.linkedin_source.stg_linkedin_ads__campaign_history
  • Input Column: 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp[version_tag]
    • Cleaning Cast to DECIMAL data type
    • Output Columns:
      • version_tag: Mapped after casting to DECIMAL
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 130. model.linkedin_source.stg_linkedin_ads__campaign_history[version_tag]
    • Direct The column is directly copied without transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • version_tag: Directly copied to the output
Column Lineage
%3 130. model.linkedin_source.stg_linkedin_ads__campaign_history 130. model.linkedin_source.stg_linkedin_ads__campaign_history is_audience_expansion_enabled 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report is_audience_expansion_enabled 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->119. model.linkedin.linkedin_ads__campaign_report:f0
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 130. model.linkedin_source.stg_linkedin_ads__campaign_history[is_audience_expansion_enabled]
    • Direct The column is directly copied without transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • is_audience_expansion_enabled: Directly copied to the output
Column Lineage
%3 130. model.linkedin_source.stg_linkedin_ads__campaign_history 130. model.linkedin_source.stg_linkedin_ads__campaign_history cost_type 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report cost_type 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->119. model.linkedin.linkedin_ads__campaign_report:f0
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 130. model.linkedin_source.stg_linkedin_ads__campaign_history[cost_type]
    • Direct The column is directly copied without transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • cost_type: Directly copied to the output
Column Lineage
%3 130. model.linkedin_source.stg_linkedin_ads__campaign_history 130. model.linkedin_source.stg_linkedin_ads__campaign_history creative_selection 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report creative_selection 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->119. model.linkedin.linkedin_ads__campaign_report:f0
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 130. model.linkedin_source.stg_linkedin_ads__campaign_history[creative_selection]
    • Direct This column is directly copied to the output without transformation
    • Output Columns:
      • creative_selection: Directly copied
Column Lineage
%3 130. model.linkedin_source.stg_linkedin_ads__campaign_history 130. model.linkedin_source.stg_linkedin_ads__campaign_history daily_budget_amount 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report daily_budget_amount 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->119. model.linkedin.linkedin_ads__campaign_report:f0
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 130. model.linkedin_source.stg_linkedin_ads__campaign_history[daily_budget_amount]
    • Direct This column is directly copied to the output without transformation
    • Output Columns:
      • daily_budget_amount: Directly copied
Column Lineage
%3 130. model.linkedin_source.stg_linkedin_ads__campaign_history 130. model.linkedin_source.stg_linkedin_ads__campaign_history daily_budget_currency_code 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report daily_budget_currency_code 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->119. model.linkedin.linkedin_ads__campaign_report:f0
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 130. model.linkedin_source.stg_linkedin_ads__campaign_history[daily_budget_currency_code]
    • Direct This column is directly copied to the output without transformation
    • Output Columns:
      • daily_budget_currency_code: Directly copied
Column Lineage
%3 130. model.linkedin_source.stg_linkedin_ads__campaign_history 130. model.linkedin_source.stg_linkedin_ads__campaign_history format 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report format 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->119. model.linkedin.linkedin_ads__campaign_report:f0
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 130. model.linkedin_source.stg_linkedin_ads__campaign_history[format]
    • Direct This column is directly copied to the output without transformation
    • Output Columns:
      • format: Directly copied
Column Lineage
%3 130. model.linkedin_source.stg_linkedin_ads__campaign_history 130. model.linkedin_source.stg_linkedin_ads__campaign_history locale_country 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report locale_country 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->119. model.linkedin.linkedin_ads__campaign_report:f0
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 130. model.linkedin_source.stg_linkedin_ads__campaign_history[locale_country]
    • Direct This column is directly copied to the output without transformation
    • Output Columns:
      • locale_country: Directly copied
Column Lineage
%3 130. model.linkedin_source.stg_linkedin_ads__campaign_history 130. model.linkedin_source.stg_linkedin_ads__campaign_history locale_language 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report locale_language 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->119. model.linkedin.linkedin_ads__campaign_report:f0
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 130. model.linkedin_source.stg_linkedin_ads__campaign_history[locale_language]
    • Direct This column is directly copied to the output without transformation
    • Output Columns:
      • locale_language: Directly copied
Column Lineage
%3 130. model.linkedin_source.stg_linkedin_ads__campaign_history 130. model.linkedin_source.stg_linkedin_ads__campaign_history objective_type 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report objective_type 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->119. model.linkedin.linkedin_ads__campaign_report:f0
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 130. model.linkedin_source.stg_linkedin_ads__campaign_history[objective_type]
    • Direct This column is directly copied to the output without transformation
    • Output Columns:
      • objective_type: Directly copied
Column Lineage
%3 130. model.linkedin_source.stg_linkedin_ads__campaign_history 130. model.linkedin_source.stg_linkedin_ads__campaign_history is_offsite_delivery_enabled 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report is_offsite_delivery_enabled 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->119. model.linkedin.linkedin_ads__campaign_report:f0
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 130. model.linkedin_source.stg_linkedin_ads__campaign_history[is_offsite_delivery_enabled]
    • Direct This column is directly copied to the output without transformation
    • Output Columns:
      • is_offsite_delivery_enabled: Directly copied
Column Lineage
%3 130. model.linkedin_source.stg_linkedin_ads__campaign_history 130. model.linkedin_source.stg_linkedin_ads__campaign_history optimization_target_type 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report optimization_target_type 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->119. model.linkedin.linkedin_ads__campaign_report:f0
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 130. model.linkedin_source.stg_linkedin_ads__campaign_history[optimization_target_type]
    • Direct This column is directly copied to the output without transformation
    • Output Columns:
      • optimization_target_type: Directly copied
Column Lineage
%3 130. model.linkedin_source.stg_linkedin_ads__campaign_history 130. model.linkedin_source.stg_linkedin_ads__campaign_history run_schedule_start_at 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report run_schedule_start_at 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->119. model.linkedin.linkedin_ads__campaign_report:f0
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 130. model.linkedin_source.stg_linkedin_ads__campaign_history[run_schedule_start_at]
    • Direct This column is directly copied to the output without transformation
    • Output Columns:
      • run_schedule_start_at: Directly copied
Column Lineage
%3 130. model.linkedin_source.stg_linkedin_ads__campaign_history 130. model.linkedin_source.stg_linkedin_ads__campaign_history run_schedule_end_at 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report run_schedule_end_at 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->119. model.linkedin.linkedin_ads__campaign_report:f0
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 130. model.linkedin_source.stg_linkedin_ads__campaign_history[run_schedule_end_at]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • run_schedule_end_at: Directly copied to the output
Column Lineage
%3 130. model.linkedin_source.stg_linkedin_ads__campaign_history 130. model.linkedin_source.stg_linkedin_ads__campaign_history status 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report campaign_status 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->119. model.linkedin.linkedin_ads__campaign_report:f0
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 130. model.linkedin_source.stg_linkedin_ads__campaign_history[status]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • campaign_status: Directly copied to the output and renamed
Column Lineage
%3 130. model.linkedin_source.stg_linkedin_ads__campaign_history 130. model.linkedin_source.stg_linkedin_ads__campaign_history type 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report type 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->119. model.linkedin.linkedin_ads__campaign_report:f0
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 130. model.linkedin_source.stg_linkedin_ads__campaign_history[type]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • type: Directly copied to the output
Column Lineage
%3 130. model.linkedin_source.stg_linkedin_ads__campaign_history 130. model.linkedin_source.stg_linkedin_ads__campaign_history unit_cost_amount 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report unit_cost_amount 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->119. model.linkedin.linkedin_ads__campaign_report:f0
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 130. model.linkedin_source.stg_linkedin_ads__campaign_history[unit_cost_amount]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • unit_cost_amount: Directly copied to the output
Column Lineage
%3 130. model.linkedin_source.stg_linkedin_ads__campaign_history 130. model.linkedin_source.stg_linkedin_ads__campaign_history unit_cost_currency_code 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report unit_cost_currency_code 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->119. model.linkedin.linkedin_ads__campaign_report:f0
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 130. model.linkedin_source.stg_linkedin_ads__campaign_history[unit_cost_currency_code]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • unit_cost_currency_code: Directly copied to the output
Column Lineage
%3 122. model.linkedin_source.stg_linkedin_ads__account_history 122. model.linkedin_source.stg_linkedin_ads__account_history currency 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report currency 122. model.linkedin_source.stg_linkedin_ads__account_history:f0->119. model.linkedin.linkedin_ads__campaign_report:f0 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp currency 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp:f0->122. model.linkedin_source.stg_linkedin_ads__account_history:f0
122. model.linkedin_source.stg_linkedin_ads__account_history
  • Input Column: 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp[currency]
    • Direct The column is directly copied
    • Output Columns:
      • currency: Directly mapped to currency
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 122. model.linkedin_source.stg_linkedin_ads__account_history[currency]
    • Direct copied directly to the output
    • Output Columns:
      • currency: directly copied
Column Lineage
%3 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign conversion_value_in_local_currency 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report conversion_value_in_local_currency 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->119. model.linkedin.linkedin_ads__campaign_report:f0 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp conversion_value_in_local_currency 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp:f0->124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0
124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign
  • Input Column: 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp[conversion_value_in_local_currency]
    • Cleaning The column is cast to FLOAT and coalesced with 0 if NULL
    • Output Columns:
      • conversion_value_in_local_currency: Directly mapped after cleaning
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign[conversion_value_in_local_currency]
    • Aggregation The column is summed up in the final SELECT statement
    • Cleaning COALESCE is used to replace NULL values with 0
    • Output Columns:
      • conversion_value_in_local_currency: Aggregated sum in the output
Column Lineage
%3 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign external_website_conversions one_click_leads 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report external_website_conversions one_click_leads total_conversions 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->119. model.linkedin.linkedin_ads__campaign_report:f0 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->119. model.linkedin.linkedin_ads__campaign_report:f2 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f1->119. model.linkedin.linkedin_ads__campaign_report:f1 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f1->119. model.linkedin.linkedin_ads__campaign_report:f2 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp external_website_conversions one_click_leads 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp:f0->124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp:f1->124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f1
124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign
  • Input Column: 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp[external_website_conversions]
    • Cleaning The column is cast to BIGINT and coalesced with 0 if NULL
    • Output Columns:
      • external_website_conversions: Directly mapped after cleaning
  • Input Column: 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp[one_click_leads]
    • Cleaning The column is cast to BIGINT type and coalesced with 0
    • Output Columns:
      • one_click_leads: Transformed and mapped
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign[external_website_conversions]
    • Aggregation The column is summed up in the final SELECT statement
    • Cleaning COALESCE is used to replace NULL values with 0
    • Featurization Used to calculate total_conversions
    • Output Columns:
      • external_website_conversions: Aggregated sum in the output
      • total_conversions: Part of the calculation for this new feature
  • Input Column: 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign[one_click_leads]
    • Aggregation The column is summed up in the final SELECT statement
    • Cleaning COALESCE is used to replace NULL values with 0
    • Featurization Used to calculate total_conversions
    • Output Columns:
      • one_click_leads: Aggregated sum in the output
      • total_conversions: Part of the calculation for this new feature
Column Lineage
%3 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign external_website_conversions 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report external_website_conversions total_conversions 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->119. model.linkedin.linkedin_ads__campaign_report:f0 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->119. model.linkedin.linkedin_ads__campaign_report:f1 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp external_website_conversions 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp:f0->124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0
124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign
  • Input Column: 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp[external_website_conversions]
    • Cleaning The column is cast to BIGINT and coalesced with 0 if NULL
    • Output Columns:
      • external_website_conversions: Directly mapped after cleaning
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign[external_website_conversions]
    • Aggregation The column is summed up in the final SELECT statement
    • Cleaning COALESCE is used to replace NULL values with 0
    • Featurization Used to calculate total_conversions
    • Output Columns:
      • external_website_conversions: Aggregated sum in the output
      • total_conversions: Part of the calculation for this new feature
Column Lineage
%3 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign one_click_leads 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report one_click_leads total_conversions 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->119. model.linkedin.linkedin_ads__campaign_report:f0 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->119. model.linkedin.linkedin_ads__campaign_report:f1 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp one_click_leads 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp:f0->124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0
124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign
  • Input Column: 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp[one_click_leads]
    • Cleaning The column is cast to BIGINT type and coalesced with 0
    • Output Columns:
      • one_click_leads: Transformed and mapped
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign[one_click_leads]
    • Aggregation The column is summed up in the final SELECT statement
    • Cleaning COALESCE is used to replace NULL values with 0
    • Featurization Used to calculate total_conversions
    • Output Columns:
      • one_click_leads: Aggregated sum in the output
      • total_conversions: Part of the calculation for this new feature
120. model.linkedin.linkedin_ads__creative_report

This SQL query creates a comprehensive report of LinkedIn ad performance by combining data from multiple sources. It joins creative, campaign, campaign group, and account data with ad analytics, calculates total conversions, and aggregates metrics such as clicks, impressions, cost, and conversion values. The final result provides a detailed view of ad performance across different levels of the advertising hierarchy.

IntegrationAggregationFeaturization
SQL Query
WITH creative AS (
  SELECT
    *
  FROM TEST.PUBLIC_linkedin_ads_source.stg_linkedin_ads__creative_history
  WHERE
    is_latest_version
), campaign AS (
  SELECT
    *
  FROM TEST.PUBLIC_linkedin_ads_source.stg_linkedin_ads__campaign_history
  WHERE
    is_latest_version
), campaign_group AS (
  SELECT
    *
  FROM TEST.PUBLIC_linkedin_ads_source.stg_linkedin_ads__campaign_group_history
  WHERE
    is_latest_version
), account AS (
  SELECT
    *
  FROM TEST.PUBLIC_linkedin_ads_source.stg_linkedin_ads__account_history
  WHERE
    is_latest_version
), report AS (
  SELECT
    *,
    external_website_conversions + one_click_leads AS total_conversions
  FROM TEST.PUBLIC_linkedin_ads_source.stg_linkedin_ads__ad_analytics_by_creative
), final AS (
  SELECT
    report.source_relation,
    report.date_day,
    report.creative_id,
    campaign.campaign_id,
    campaign.campaign_name,
    campaign_group.campaign_group_id,
    campaign_group.campaign_group_name,
    account.account_id,
    account.account_name,
    creative.click_uri,
    creative.status AS creative_status,
    campaign.status AS campaign_status,
    campaign_group.status AS campaign_group_status,
    account.currency,
    creative.last_modified_at,
    creative.created_at,
    SUM(report.total_conversions) AS total_conversions,
    SUM(report.clicks) AS clicks,
    SUM(report.impressions) AS impressions,
    SUM(report.cost) AS cost,
    SUM(COALESCE(report.conversion_value_in_local_currency, 0)) AS conversion_value_in_local_currency,
    SUM(COALESCE(external_website_conversions, 0)) AS external_website_conversions,
    SUM(COALESCE(one_click_leads, 0)) AS one_click_leads
  FROM report
  LEFT JOIN creative
    ON report.creative_id = creative.creative_id
    AND report.source_relation = creative.source_relation
  LEFT JOIN campaign
    ON creative.campaign_id = campaign.campaign_id
    AND creative.source_relation = campaign.source_relation
  LEFT JOIN campaign_group
    ON campaign.campaign_group_id = campaign_group.campaign_group_id
    AND campaign.source_relation = campaign_group.source_relation
  LEFT JOIN account
    ON campaign.account_id = account.account_id
    AND campaign.source_relation = account.source_relation
  GROUP BY
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10,
    11,
    12,
    13,
    14,
    15,
    16
)
SELECT
  *
FROM final
%3 120. model.linkedin.linkedin_ads__creative_report 120. model.linkedin.linkedin_ads__creative_report source_relation account_name account_id date_day clicks impressions cost campaign_group_name campaign_group_id campaign_name campaign_id creative_id last_modified_at created_at creative_status click_uri campaign_group_status campaign_status currency conversion_value_in_local_currency total_conversions external_website_conversions one_click_leads 122. model.linkedin_source.stg_linkedin_ads__account_history 122. model.linkedin_source.stg_linkedin_ads__account_history source_relation account_id account_name currency 122. model.linkedin_source.stg_linkedin_ads__account_history:f0->120. model.linkedin.linkedin_ads__creative_report:f0 122. model.linkedin_source.stg_linkedin_ads__account_history:f1->120. model.linkedin.linkedin_ads__creative_report:f2 122. model.linkedin_source.stg_linkedin_ads__account_history:f2->120. model.linkedin.linkedin_ads__creative_report:f1 122. model.linkedin_source.stg_linkedin_ads__account_history:f3->120. model.linkedin.linkedin_ads__creative_report:f18 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative source_relation creative_id date_day clicks impressions cost conversion_value_in_local_currency external_website_conversions one_click_leads 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f0->120. model.linkedin.linkedin_ads__creative_report:f0 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f1->120. model.linkedin.linkedin_ads__creative_report:f11 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f2->120. model.linkedin.linkedin_ads__creative_report:f3 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f3->120. model.linkedin.linkedin_ads__creative_report:f4 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f4->120. model.linkedin.linkedin_ads__creative_report:f5 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f5->120. model.linkedin.linkedin_ads__creative_report:f6 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f6->120. model.linkedin.linkedin_ads__creative_report:f19 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f7->120. model.linkedin.linkedin_ads__creative_report:f21 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f7->120. model.linkedin.linkedin_ads__creative_report:f20 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f8->120. model.linkedin.linkedin_ads__creative_report:f22 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f8->120. model.linkedin.linkedin_ads__creative_report:f20 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history source_relation campaign_group_id campaign_group_name status 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f0->120. model.linkedin.linkedin_ads__creative_report:f0 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f1->120. model.linkedin.linkedin_ads__creative_report:f8 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f2->120. model.linkedin.linkedin_ads__creative_report:f7 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f3->120. model.linkedin.linkedin_ads__creative_report:f16 130. model.linkedin_source.stg_linkedin_ads__campaign_history 130. model.linkedin_source.stg_linkedin_ads__campaign_history source_relation campaign_id campaign_name status 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->120. model.linkedin.linkedin_ads__creative_report:f0 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f1->120. model.linkedin.linkedin_ads__creative_report:f10 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f2->120. model.linkedin.linkedin_ads__creative_report:f9 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f3->120. model.linkedin.linkedin_ads__creative_report:f17 132. model.linkedin_source.stg_linkedin_ads__creative_history 132. model.linkedin_source.stg_linkedin_ads__creative_history source_relation creative_id last_modified_at created_at status click_uri 132. model.linkedin_source.stg_linkedin_ads__creative_history:f0->120. model.linkedin.linkedin_ads__creative_report:f0 132. model.linkedin_source.stg_linkedin_ads__creative_history:f1->120. model.linkedin.linkedin_ads__creative_report:f11 132. model.linkedin_source.stg_linkedin_ads__creative_history:f2->120. model.linkedin.linkedin_ads__creative_report:f12 132. model.linkedin_source.stg_linkedin_ads__creative_history:f3->120. model.linkedin.linkedin_ads__creative_report:f13 132. model.linkedin_source.stg_linkedin_ads__creative_history:f4->120. model.linkedin.linkedin_ads__creative_report:f14 132. model.linkedin_source.stg_linkedin_ads__creative_history:f5->120. model.linkedin.linkedin_ads__creative_report:f15
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
account_name text A label for the account.
account_id integer Unique internal ID representing the account.
date_day timestamp without time zone The day of the activity.
clicks bigint The count of chargeable clicks.
impressions bigint This is the count of "impressions" for Direct Ads and Sponsored Updates and "sends" for InMails.
cost bigint The cost of the ads in the local currency or USD.
campaign_group_name text A label for the campaign group.
campaign_group_id integer Unique internal ID representing the campaign group.
campaign_name text A label for the creative's campaign.
campaign_id integer Unique internal ID representing the creative's campaign.
creative_id integer Unique internal ID representing the creative.
last_modified_at timestamp without time zone The timestamp of when the version was updated.
created_at timestamp without time zone The timestamp of when the creative was created.
creative_status text ACTIVE - Creative creation is complete and creative is available for review and serve. PAUSED - Creative creation is complete and creative is current, but should temporarily not be served. This status is not valid upon creation. DRAFT - Creative creation is incomplete and may still be edited. ARCHIVED - Creative creation is complete, but creative should not be served and should be separated from non-archived creatives in any UI. CANCELED - Creative is permanently canceled.
click_uri text Required when creative type is TEXT_AD. Maximum character limit of 500 after URL encoding all special characters. Limit does not include the "https://" prefix.
campaign_group_status text Status of campaign's campaign group. Possible values are: ACTIVE - Denotes that the campaign group is capable of serving ads, subject to run date and budget limitations (as well as any other limitations at the account or campaign level). ARCHIVED - Denotes that the campaign group is presently inactive, and should mostly be hidden in the UI until un-archived. CANCELLED - Denotes that the campaign group has been permanently canceled and cannot be reactivated. Not a settable status. DRAFT - Denotes that the campaign group is in a preliminary state and should temporarily not be served. PAUSED - Denotes that the campaign group meets all requirements to be served, but temporarily should not be. PENDING_DELETION - Denotes that the campaign group has been requested to be deleted that is currently pending. REMOVED - Denoted that the campaign group was deleted, but must remain fetchable due to the existence of performance data.
campaign_status text ACTIVE - Denotes that the campaign is fully servable. PAUSED - Denotes that the campaign meets all requirements to be served, but temporarily should not be. ARCHIVED - Denotes that the campaign is presently inactive, and should mostly be hidden in the UI until un-archived. COMPLETED - Denotes that the campaign has reached a specified budgetary or chronological limit. CANCELED - Denotes that the campaign has been permanently canceled, such as when an advertising account is permanently closed. DRAFT - Denotes that the campaign is still being edited and not eligible for serving. Some validation will be postponed until the campaign is activated. PENDING_DELETION - Denotes that the campaign has been requested to be deleted that is currently pending. REMOVED - Denotes that the campaign was deleted, but must remain fetchable due to the existence of performance data.
currency text The ISO 4217 currency code of the account, such as 'USD' for United States Dollar (default).
conversion_value_in_local_currency double precision The value generated by your conversions, displayed in your LinkedIn account's local currency, on the given day.
total_conversions numeric The total conversions being brought in the conversion fields you select in your `linkedin_ads__conversion_fields`.
external_website_conversions numeric The actions taken on your website that you've defined as valuable to your business after clicking on LinkedIn ads.
one_click_leads numeric Leads submitted after clicking on LinkedIn ads.
Column Lineage
%3 122. model.linkedin_source.stg_linkedin_ads__account_history 122. model.linkedin_source.stg_linkedin_ads__account_history source_relation 120. model.linkedin.linkedin_ads__creative_report 120. model.linkedin.linkedin_ads__creative_report source_relation 122. model.linkedin_source.stg_linkedin_ads__account_history:f0->120. model.linkedin.linkedin_ads__creative_report:f0 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative source_relation 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f0->120. model.linkedin.linkedin_ads__creative_report:f0 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history source_relation 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f0->120. model.linkedin.linkedin_ads__creative_report:f0 130. model.linkedin_source.stg_linkedin_ads__campaign_history 130. model.linkedin_source.stg_linkedin_ads__campaign_history source_relation 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->120. model.linkedin.linkedin_ads__creative_report:f0 132. model.linkedin_source.stg_linkedin_ads__creative_history 132. model.linkedin_source.stg_linkedin_ads__creative_history source_relation 132. model.linkedin_source.stg_linkedin_ads__creative_history:f0->120. model.linkedin.linkedin_ads__creative_report:f0
120. model.linkedin.linkedin_ads__creative_report
  • Input Column: 122. model.linkedin_source.stg_linkedin_ads__account_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the JOIN conditions with other tables
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
  • Input Column: 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 130. model.linkedin_source.stg_linkedin_ads__campaign_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 132. model.linkedin_source.stg_linkedin_ads__creative_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
Column Lineage
%3 122. model.linkedin_source.stg_linkedin_ads__account_history 122. model.linkedin_source.stg_linkedin_ads__account_history account_name 120. model.linkedin.linkedin_ads__creative_report 120. model.linkedin.linkedin_ads__creative_report account_name 122. model.linkedin_source.stg_linkedin_ads__account_history:f0->120. model.linkedin.linkedin_ads__creative_report:f0 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp name 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp:f0->122. model.linkedin_source.stg_linkedin_ads__account_history:f0
122. model.linkedin_source.stg_linkedin_ads__account_history
  • Input Column: 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp[name]
    • Direct The column is directly copied
    • Output Columns:
      • account_name: Directly mapped to account_name
120. model.linkedin.linkedin_ads__creative_report
  • Input Column: 122. model.linkedin_source.stg_linkedin_ads__account_history[account_name]
    • Direct directly copied to the output
    • Output Columns:
      • account_name: directly copied
Column Lineage
%3 122. model.linkedin_source.stg_linkedin_ads__account_history 122. model.linkedin_source.stg_linkedin_ads__account_history account_id 120. model.linkedin.linkedin_ads__creative_report 120. model.linkedin.linkedin_ads__creative_report account_id 122. model.linkedin_source.stg_linkedin_ads__account_history:f0->120. model.linkedin.linkedin_ads__creative_report:f0 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp id 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp:f0->122. model.linkedin_source.stg_linkedin_ads__account_history:f0
122. model.linkedin_source.stg_linkedin_ads__account_history
  • Input Column: 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp[id]
    • Direct The column is directly copied
    • Deduplication Used in the PARTITION BY clause of the ROW_NUMBER() function
    • Output Columns:
      • account_id: Directly mapped to account_id
120. model.linkedin.linkedin_ads__creative_report
  • Input Column: 122. model.linkedin_source.stg_linkedin_ads__account_history[account_id]
    • Integration used as the key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • account_id: directly copied
Column Lineage
%3 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative date_day 120. model.linkedin.linkedin_ads__creative_report 120. model.linkedin.linkedin_ads__creative_report date_day 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f0->120. model.linkedin.linkedin_ads__creative_report:f0 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp day 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp:f0->126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f0
126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative
  • Input Column: 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp[day]
    • Cleaning The column is cast as TIMESTAMP in the macro CTE and then truncated to day in the fields CTE
    • Output Columns:
      • date_day: Transformed to date_day using DATE_TRUNC('DAY', day)
120. model.linkedin.linkedin_ads__creative_report
  • Input Column: 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative clicks 120. model.linkedin.linkedin_ads__creative_report 120. model.linkedin.linkedin_ads__creative_report clicks 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f0->120. model.linkedin.linkedin_ads__creative_report:f0 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp clicks 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp:f0->126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f0
126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative
  • Input Column: 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp[clicks]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT in the macro CTE
    • Output Columns:
      • clicks: Directly mapped
120. model.linkedin.linkedin_ads__creative_report
  • Input Column: 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative[clicks]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • clicks: Aggregated sum in the output
Column Lineage
%3 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative impressions 120. model.linkedin.linkedin_ads__creative_report 120. model.linkedin.linkedin_ads__creative_report impressions 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f0->120. model.linkedin.linkedin_ads__creative_report:f0 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp impressions 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp:f0->126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f0
126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative
  • Input Column: 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp[impressions]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT in the macro CTE
    • Output Columns:
      • impressions: Directly mapped
120. model.linkedin.linkedin_ads__creative_report
  • Input Column: 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative[impressions]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • impressions: Aggregated sum in the output
Column Lineage
%3 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative cost 120. model.linkedin.linkedin_ads__creative_report 120. model.linkedin.linkedin_ads__creative_report cost 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f0->120. model.linkedin.linkedin_ads__creative_report:f0 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp cost_in_usd 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp:f0->126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f0
126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative
  • Input Column: 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp[cost_in_usd]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as DECIMAL(28, 6) in the macro CTE
    • Output Columns:
      • cost: Directly mapped and renamed to 'cost'
120. model.linkedin.linkedin_ads__creative_report
  • Input Column: 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative[cost]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • cost: Aggregated sum in the output
Column Lineage
%3 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history campaign_group_name 120. model.linkedin.linkedin_ads__creative_report 120. model.linkedin.linkedin_ads__creative_report campaign_group_name 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f0->120. model.linkedin.linkedin_ads__creative_report:f0 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp name 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp:f0->128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f0
128. model.linkedin_source.stg_linkedin_ads__campaign_group_history
  • Input Column: 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp[name]
    • Direct The column is directly copied to the output
    • Output Columns:
      • campaign_group_name: Directly mapped
120. model.linkedin.linkedin_ads__creative_report
  • Input Column: 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history[campaign_group_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_group_name: directly copied
Column Lineage
%3 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history campaign_group_id 120. model.linkedin.linkedin_ads__creative_report 120. model.linkedin.linkedin_ads__creative_report campaign_group_id 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f0->120. model.linkedin.linkedin_ads__creative_report:f0 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp id 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp:f0->128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f0
128. model.linkedin_source.stg_linkedin_ads__campaign_group_history
  • Input Column: 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp[id]
    • Direct The column is directly copied to the output
    • Deduplication Used in the ROW_NUMBER() window function for determining the latest version
    • Output Columns:
      • campaign_group_id: Directly mapped
120. model.linkedin.linkedin_ads__creative_report
  • Input Column: 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history[campaign_group_id]
    • Integration used as the key to join with the campaign table
    • Direct directly copied to the output
    • Output Columns:
      • campaign_group_id: directly copied
Column Lineage
%3 130. model.linkedin_source.stg_linkedin_ads__campaign_history 130. model.linkedin_source.stg_linkedin_ads__campaign_history campaign_name 120. model.linkedin.linkedin_ads__creative_report 120. model.linkedin.linkedin_ads__creative_report campaign_name 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->120. model.linkedin.linkedin_ads__creative_report:f0 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp name 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp:f0->130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0
130. model.linkedin_source.stg_linkedin_ads__campaign_history
  • Input Column: 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp[name]
    • Direct The column is directly copied to the output
    • Output Columns:
      • campaign_name: Directly mapped
120. model.linkedin.linkedin_ads__creative_report
  • Input Column: 130. model.linkedin_source.stg_linkedin_ads__campaign_history[campaign_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_name: directly copied
Column Lineage
%3 130. model.linkedin_source.stg_linkedin_ads__campaign_history 130. model.linkedin_source.stg_linkedin_ads__campaign_history campaign_id 120. model.linkedin.linkedin_ads__creative_report 120. model.linkedin.linkedin_ads__creative_report campaign_id 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->120. model.linkedin.linkedin_ads__creative_report:f0 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp id 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp:f0->130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0
130. model.linkedin_source.stg_linkedin_ads__campaign_history
  • Input Column: 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp[id]
    • Direct The column is directly copied to the output
    • Deduplication Used in ROW_NUMBER() function to identify the latest version
    • Output Columns:
      • campaign_id: Directly mapped
120. model.linkedin.linkedin_ads__creative_report
  • Input Column: 130. model.linkedin_source.stg_linkedin_ads__campaign_history[campaign_id]
    • Integration used as the key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
Column Lineage
%3 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative creative_id 120. model.linkedin.linkedin_ads__creative_report 120. model.linkedin.linkedin_ads__creative_report creative_id 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f0->120. model.linkedin.linkedin_ads__creative_report:f0 132. model.linkedin_source.stg_linkedin_ads__creative_history 132. model.linkedin_source.stg_linkedin_ads__creative_history creative_id 132. model.linkedin_source.stg_linkedin_ads__creative_history:f0->120. model.linkedin.linkedin_ads__creative_report:f0 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp creative_id 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp:f0->126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f0 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp id 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f0
126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative
  • Input Column: 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp[creative_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT in the macro CTE
    • Output Columns:
      • creative_id: Directly mapped
132. model.linkedin_source.stg_linkedin_ads__creative_history
  • Input Column: 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp[id]
    • Direct The column is directly copied to the output
    • Deduplication Used in the ROW_NUMBER() function to identify the latest version
    • Output Columns:
      • creative_id: Directly mapped
120. model.linkedin.linkedin_ads__creative_report
  • Input Column: 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative[creative_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as the key to join with the creative table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • creative_id: Directly copied to the output
  • Input Column: 132. model.linkedin_source.stg_linkedin_ads__creative_history[creative_id]
    • Integration used as part of the join condition with the report table
    • Direct directly copied to the output
    • Output Columns:
      • creative_id: directly copied
Column Lineage
%3 132. model.linkedin_source.stg_linkedin_ads__creative_history 132. model.linkedin_source.stg_linkedin_ads__creative_history last_modified_at 120. model.linkedin.linkedin_ads__creative_report 120. model.linkedin.linkedin_ads__creative_report last_modified_at 132. model.linkedin_source.stg_linkedin_ads__creative_history:f0->120. model.linkedin.linkedin_ads__creative_report:f0 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp last_modified_time 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f0
132. model.linkedin_source.stg_linkedin_ads__creative_history
  • Input Column: 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp[last_modified_time]
    • Cleaning Cast to TIMESTAMP and coalesced with last_modified_at
    • Deduplication Used in the ORDER BY clause of ROW_NUMBER() function
    • Output Columns:
      • last_modified_at: Transformed and mapped
120. model.linkedin.linkedin_ads__creative_report
  • Input Column: 132. model.linkedin_source.stg_linkedin_ads__creative_history[last_modified_at]
    • Direct directly copied to the output
    • Output Columns:
      • last_modified_at: directly copied
Column Lineage
%3 132. model.linkedin_source.stg_linkedin_ads__creative_history 132. model.linkedin_source.stg_linkedin_ads__creative_history created_at 120. model.linkedin.linkedin_ads__creative_report 120. model.linkedin.linkedin_ads__creative_report created_at 132. model.linkedin_source.stg_linkedin_ads__creative_history:f0->120. model.linkedin.linkedin_ads__creative_report:f0 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp created_time 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f0
132. model.linkedin_source.stg_linkedin_ads__creative_history
  • Input Column: 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp[created_time]
    • Cleaning Cast to TIMESTAMP and coalesced with created_at
    • Output Columns:
      • created_at: Transformed and mapped
120. model.linkedin.linkedin_ads__creative_report
  • Input Column: 132. model.linkedin_source.stg_linkedin_ads__creative_history[created_at]
    • Direct directly copied to the output
    • Output Columns:
      • created_at: directly copied
Column Lineage
%3 132. model.linkedin_source.stg_linkedin_ads__creative_history 132. model.linkedin_source.stg_linkedin_ads__creative_history status 120. model.linkedin.linkedin_ads__creative_report 120. model.linkedin.linkedin_ads__creative_report creative_status 132. model.linkedin_source.stg_linkedin_ads__creative_history:f0->120. model.linkedin.linkedin_ads__creative_report:f0 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp status 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f0
132. model.linkedin_source.stg_linkedin_ads__creative_history
  • Input Column: 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp[status]
    • Cleaning Coalesced with intended_status
    • Output Columns:
      • status: Transformed and mapped
120. model.linkedin.linkedin_ads__creative_report
  • Input Column: 132. model.linkedin_source.stg_linkedin_ads__creative_history[status]
    • Direct directly copied to the output
    • Output Columns:
      • creative_status: directly copied and renamed
Column Lineage
%3 132. model.linkedin_source.stg_linkedin_ads__creative_history 132. model.linkedin_source.stg_linkedin_ads__creative_history base_url click_uri url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 120. model.linkedin.linkedin_ads__creative_report 120. model.linkedin.linkedin_ads__creative_report click_uri 132. model.linkedin_source.stg_linkedin_ads__creative_history:f1->120. model.linkedin.linkedin_ads__creative_report:f0 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp click_uri 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f1 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f0 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f2 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f3 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f7 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f6 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f4 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f5 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f8
132. model.linkedin_source.stg_linkedin_ads__creative_history
  • Input Column: 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp[click_uri]
    • Direct The column is directly copied to the output
    • Featurization Various URL components and UTM parameters are extracted from this column
    • Output Columns:
      • click_uri: Directly mapped
      • base_url: Extracted from click_uri
      • url_host: Extracted from click_uri
      • url_path: Extracted from click_uri
      • utm_source: Extracted from click_uri
      • utm_medium: Extracted from click_uri
      • utm_campaign: Extracted from click_uri
      • utm_content: Extracted from click_uri
      • utm_term: Extracted from click_uri
120. model.linkedin.linkedin_ads__creative_report
  • Input Column: 132. model.linkedin_source.stg_linkedin_ads__creative_history[click_uri]
    • Direct directly copied to the output
    • Output Columns:
      • click_uri: directly copied
Column Lineage
%3 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history status 120. model.linkedin.linkedin_ads__creative_report 120. model.linkedin.linkedin_ads__creative_report campaign_group_status 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f0->120. model.linkedin.linkedin_ads__creative_report:f0
120. model.linkedin.linkedin_ads__creative_report
  • Input Column: 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history[status]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_group_status: directly copied
Column Lineage
%3 130. model.linkedin_source.stg_linkedin_ads__campaign_history 130. model.linkedin_source.stg_linkedin_ads__campaign_history status 120. model.linkedin.linkedin_ads__creative_report 120. model.linkedin.linkedin_ads__creative_report campaign_status 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->120. model.linkedin.linkedin_ads__creative_report:f0
120. model.linkedin.linkedin_ads__creative_report
  • Input Column: 130. model.linkedin_source.stg_linkedin_ads__campaign_history[status]
    • Direct The status is directly copied to the output
    • Filtering The column is used to filter for the latest version of the campaign
    • Output Columns:
      • campaign_status: Directly copied to this output column
Column Lineage
%3 122. model.linkedin_source.stg_linkedin_ads__account_history 122. model.linkedin_source.stg_linkedin_ads__account_history currency 120. model.linkedin.linkedin_ads__creative_report 120. model.linkedin.linkedin_ads__creative_report currency 122. model.linkedin_source.stg_linkedin_ads__account_history:f0->120. model.linkedin.linkedin_ads__creative_report:f0 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp currency 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp:f0->122. model.linkedin_source.stg_linkedin_ads__account_history:f0
122. model.linkedin_source.stg_linkedin_ads__account_history
  • Input Column: 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp[currency]
    • Direct The column is directly copied
    • Output Columns:
      • currency: Directly mapped to currency
120. model.linkedin.linkedin_ads__creative_report
  • Input Column: 122. model.linkedin_source.stg_linkedin_ads__account_history[currency]
    • Direct directly copied to the output
    • Output Columns:
      • currency: directly copied
Column Lineage
%3 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative conversion_value_in_local_currency 120. model.linkedin.linkedin_ads__creative_report 120. model.linkedin.linkedin_ads__creative_report conversion_value_in_local_currency 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f0->120. model.linkedin.linkedin_ads__creative_report:f0
120. model.linkedin.linkedin_ads__creative_report
  • Input Column: 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative[conversion_value_in_local_currency]
    • Cleaning COALESCE is used to replace NULL values with 0
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • conversion_value_in_local_currency: Aggregated sum in the output
Column Lineage
%3 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative external_website_conversions one_click_leads 120. model.linkedin.linkedin_ads__creative_report 120. model.linkedin.linkedin_ads__creative_report external_website_conversions one_click_leads total_conversions 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f0->120. model.linkedin.linkedin_ads__creative_report:f0 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f0->120. model.linkedin.linkedin_ads__creative_report:f2 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f1->120. model.linkedin.linkedin_ads__creative_report:f1 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f1->120. model.linkedin.linkedin_ads__creative_report:f2
120. model.linkedin.linkedin_ads__creative_report
  • Input Column: 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative[external_website_conversions]
    • Featurization Used to calculate total_conversions
    • Cleaning COALESCE is used to replace NULL values with 0
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • external_website_conversions: Aggregated sum in the output
      • total_conversions: Part of the calculation for this new feature
  • Input Column: 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative[one_click_leads]
    • Featurization Used to calculate total_conversions
    • Cleaning COALESCE is used to replace NULL values with 0
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • one_click_leads: Aggregated sum in the output
      • total_conversions: Part of the calculation for this new feature
Column Lineage
%3 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative external_website_conversions 120. model.linkedin.linkedin_ads__creative_report 120. model.linkedin.linkedin_ads__creative_report external_website_conversions total_conversions 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f0->120. model.linkedin.linkedin_ads__creative_report:f0 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f0->120. model.linkedin.linkedin_ads__creative_report:f1
120. model.linkedin.linkedin_ads__creative_report
  • Input Column: 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative[external_website_conversions]
    • Featurization Used to calculate total_conversions
    • Cleaning COALESCE is used to replace NULL values with 0
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • external_website_conversions: Aggregated sum in the output
      • total_conversions: Part of the calculation for this new feature
Column Lineage
%3 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative one_click_leads 120. model.linkedin.linkedin_ads__creative_report 120. model.linkedin.linkedin_ads__creative_report one_click_leads total_conversions 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f0->120. model.linkedin.linkedin_ads__creative_report:f0 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f0->120. model.linkedin.linkedin_ads__creative_report:f1
120. model.linkedin.linkedin_ads__creative_report
  • Input Column: 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative[one_click_leads]
    • Featurization Used to calculate total_conversions
    • Cleaning COALESCE is used to replace NULL values with 0
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • one_click_leads: Aggregated sum in the output
      • total_conversions: Part of the calculation for this new feature
121. model.linkedin.linkedin_ads__url_report

This SQL query integrates data from multiple LinkedIn Ads-related tables (creative, campaign, campaign_group, account, and ad analytics) to create a comprehensive URL report. It joins these tables, calculates total conversions, and aggregates various metrics (conversions, clicks, impressions, cost) by date, URL details, campaign information, and account details. The query filters out records where the click_uri is null and groups the results by relevant dimensions.

IntegrationAggregationFilteringFeaturization
SQL Query
WITH creative AS (
  SELECT
    *
  FROM TEST.PUBLIC_linkedin_ads_source.stg_linkedin_ads__creative_history
  WHERE
    is_latest_version
), campaign AS (
  SELECT
    *
  FROM TEST.PUBLIC_linkedin_ads_source.stg_linkedin_ads__campaign_history
  WHERE
    is_latest_version
), campaign_group AS (
  SELECT
    *
  FROM TEST.PUBLIC_linkedin_ads_source.stg_linkedin_ads__campaign_group_history
  WHERE
    is_latest_version
), account AS (
  SELECT
    *
  FROM TEST.PUBLIC_linkedin_ads_source.stg_linkedin_ads__account_history
  WHERE
    is_latest_version
), report AS (
  SELECT
    *,
    external_website_conversions + one_click_leads AS total_conversions
  FROM TEST.PUBLIC_linkedin_ads_source.stg_linkedin_ads__ad_analytics_by_creative
), final AS (
  SELECT
    report.source_relation,
    report.date_day,
    creative.click_uri,
    creative.base_url,
    creative.url_host,
    creative.url_path,
    creative.utm_source,
    creative.utm_medium,
    creative.utm_campaign,
    creative.utm_content,
    creative.utm_term,
    report.creative_id,
    campaign.campaign_id,
    campaign.campaign_name,
    campaign_group.campaign_group_id,
    campaign_group.campaign_group_name,
    account.account_id,
    account.account_name,
    account.currency,
    SUM(report.total_conversions) AS total_conversions,
    SUM(report.clicks) AS clicks,
    SUM(report.impressions) AS impressions,
    SUM(report.cost) AS cost,
    SUM(COALESCE(report.conversion_value_in_local_currency, 0)) AS conversion_value_in_local_currency,
    SUM(COALESCE(external_website_conversions, 0)) AS external_website_conversions,
    SUM(COALESCE(one_click_leads, 0)) AS one_click_leads
  FROM report
  LEFT JOIN creative
    ON report.creative_id = creative.creative_id
    AND report.source_relation = creative.source_relation
  LEFT JOIN campaign
    ON creative.campaign_id = campaign.campaign_id
    AND creative.source_relation = campaign.source_relation
  LEFT JOIN campaign_group
    ON campaign.campaign_group_id = campaign_group.campaign_group_id
    AND campaign.source_relation = campaign_group.source_relation
  LEFT JOIN account
    ON campaign.account_id = account.account_id
    AND campaign.source_relation = account.source_relation
  WHERE
    NOT creative.click_uri IS NULL
  GROUP BY
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10,
    11,
    12,
    13,
    14,
    15,
    16,
    17,
    18,
    19
)
SELECT
  *
FROM final
%3 121. model.linkedin.linkedin_ads__url_report 121. model.linkedin.linkedin_ads__url_report source_relation account_name account_id date_day clicks impressions cost campaign_group_name campaign_group_id creative_id click_uri base_url url_host url_path utm_source utm_medium utm_campaign utm_content utm_term currency campaign_name campaign_id conversion_value_in_local_currency total_conversions external_website_conversions one_click_leads 122. model.linkedin_source.stg_linkedin_ads__account_history 122. model.linkedin_source.stg_linkedin_ads__account_history source_relation account_id account_name currency 122. model.linkedin_source.stg_linkedin_ads__account_history:f0->121. model.linkedin.linkedin_ads__url_report:f0 122. model.linkedin_source.stg_linkedin_ads__account_history:f1->121. model.linkedin.linkedin_ads__url_report:f2 122. model.linkedin_source.stg_linkedin_ads__account_history:f2->121. model.linkedin.linkedin_ads__url_report:f1 122. model.linkedin_source.stg_linkedin_ads__account_history:f3->121. model.linkedin.linkedin_ads__url_report:f19 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative source_relation creative_id date_day clicks impressions cost conversion_value_in_local_currency external_website_conversions one_click_leads 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f0->121. model.linkedin.linkedin_ads__url_report:f0 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f1->121. model.linkedin.linkedin_ads__url_report:f9 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f2->121. model.linkedin.linkedin_ads__url_report:f3 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f3->121. model.linkedin.linkedin_ads__url_report:f4 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f4->121. model.linkedin.linkedin_ads__url_report:f5 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f5->121. model.linkedin.linkedin_ads__url_report:f6 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f6->121. model.linkedin.linkedin_ads__url_report:f22 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f7->121. model.linkedin.linkedin_ads__url_report:f24 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f7->121. model.linkedin.linkedin_ads__url_report:f23 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f8->121. model.linkedin.linkedin_ads__url_report:f25 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f8->121. model.linkedin.linkedin_ads__url_report:f23 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history source_relation campaign_group_id campaign_group_name 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f0->121. model.linkedin.linkedin_ads__url_report:f0 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f1->121. model.linkedin.linkedin_ads__url_report:f8 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f2->121. model.linkedin.linkedin_ads__url_report:f7 130. model.linkedin_source.stg_linkedin_ads__campaign_history 130. model.linkedin_source.stg_linkedin_ads__campaign_history source_relation campaign_id campaign_name 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->121. model.linkedin.linkedin_ads__url_report:f0 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f1->121. model.linkedin.linkedin_ads__url_report:f21 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f2->121. model.linkedin.linkedin_ads__url_report:f20 132. model.linkedin_source.stg_linkedin_ads__creative_history 132. model.linkedin_source.stg_linkedin_ads__creative_history source_relation creative_id click_uri base_url url_host url_path utm_source utm_medium utm_campaign utm_content utm_term 132. model.linkedin_source.stg_linkedin_ads__creative_history:f0->121. model.linkedin.linkedin_ads__url_report:f0 132. model.linkedin_source.stg_linkedin_ads__creative_history:f1->121. model.linkedin.linkedin_ads__url_report:f9 132. model.linkedin_source.stg_linkedin_ads__creative_history:f2->121. model.linkedin.linkedin_ads__url_report:f10 132. model.linkedin_source.stg_linkedin_ads__creative_history:f3->121. model.linkedin.linkedin_ads__url_report:f11 132. model.linkedin_source.stg_linkedin_ads__creative_history:f4->121. model.linkedin.linkedin_ads__url_report:f12 132. model.linkedin_source.stg_linkedin_ads__creative_history:f5->121. model.linkedin.linkedin_ads__url_report:f13 132. model.linkedin_source.stg_linkedin_ads__creative_history:f6->121. model.linkedin.linkedin_ads__url_report:f14 132. model.linkedin_source.stg_linkedin_ads__creative_history:f7->121. model.linkedin.linkedin_ads__url_report:f15 132. model.linkedin_source.stg_linkedin_ads__creative_history:f8->121. model.linkedin.linkedin_ads__url_report:f16 132. model.linkedin_source.stg_linkedin_ads__creative_history:f9->121. model.linkedin.linkedin_ads__url_report:f17 132. model.linkedin_source.stg_linkedin_ads__creative_history:f10->121. model.linkedin.linkedin_ads__url_report:f18
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
account_name text A label for the account.
account_id integer Unique internal ID representing the account.
date_day timestamp without time zone The day of the activity.
clicks bigint The count of chargeable clicks.
impressions bigint This is the count of "impressions" for Direct Ads and Sponsored Updates and "sends" for InMails.
cost bigint The cost of the ads in the local currency or USD.
campaign_group_name text A label for the campaign group.
campaign_group_id integer Unique internal ID representing the campaign group.
creative_id integer Unique internal ID representing the creative.
click_uri text Required when creative type is TEXT_AD. Maximum character limit of 500 after URL encoding all special characters. Limit does not include the "https://" prefix.
base_url text The base URL of the ad, extracted from the `click_uri`.
url_host text The URL host of the ad, extracted from the `click_uri`.
url_path text The URL path of the ad, extracted from the `click_uri`.
utm_source text The utm_source parameter of the ad, extracted from the `click_uri`.
utm_medium text The utm_medium parameter of the ad, extracted from the `click_uri`.
utm_campaign text The utm_campaign parameter of the ad, extracted from the `click_uri`.
utm_content text The utm_content parameter of the ad, extracted from the `click_uri`.
utm_term text The utm_term parameter of the ad, extracted from the `click_uri`.
currency text The ISO 4217 currency code of the account, such as 'USD' for United States Dollar (default).
campaign_name text A label for the creative's campaign.
campaign_id integer Unique internal ID representing the creative's campaign.
conversion_value_in_local_currency double precision The value generated by your conversions, displayed in your LinkedIn account's local currency, on the given day.
total_conversions numeric The total conversions being brought in the conversion fields you select in your `linkedin_ads__conversion_fields`.
external_website_conversions numeric The actions taken on your website that you've defined as valuable to your business after clicking on LinkedIn ads.
one_click_leads numeric Leads submitted after clicking on LinkedIn ads.
Column Lineage
%3 122. model.linkedin_source.stg_linkedin_ads__account_history 122. model.linkedin_source.stg_linkedin_ads__account_history source_relation 121. model.linkedin.linkedin_ads__url_report 121. model.linkedin.linkedin_ads__url_report source_relation 122. model.linkedin_source.stg_linkedin_ads__account_history:f0->121. model.linkedin.linkedin_ads__url_report:f0 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative source_relation 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f0->121. model.linkedin.linkedin_ads__url_report:f0 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history source_relation 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f0->121. model.linkedin.linkedin_ads__url_report:f0 130. model.linkedin_source.stg_linkedin_ads__campaign_history 130. model.linkedin_source.stg_linkedin_ads__campaign_history source_relation 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->121. model.linkedin.linkedin_ads__url_report:f0 132. model.linkedin_source.stg_linkedin_ads__creative_history 132. model.linkedin_source.stg_linkedin_ads__creative_history source_relation 132. model.linkedin_source.stg_linkedin_ads__creative_history:f0->121. model.linkedin.linkedin_ads__url_report:f0
121. model.linkedin.linkedin_ads__url_report
  • Input Column: 122. model.linkedin_source.stg_linkedin_ads__account_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the JOIN conditions
    • Output Columns:
      • source_relation: Directly copied to the output
  • Input Column: 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 130. model.linkedin_source.stg_linkedin_ads__campaign_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 132. model.linkedin_source.stg_linkedin_ads__creative_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
Column Lineage
%3 122. model.linkedin_source.stg_linkedin_ads__account_history 122. model.linkedin_source.stg_linkedin_ads__account_history account_name 121. model.linkedin.linkedin_ads__url_report 121. model.linkedin.linkedin_ads__url_report account_name 122. model.linkedin_source.stg_linkedin_ads__account_history:f0->121. model.linkedin.linkedin_ads__url_report:f0 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp name 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp:f0->122. model.linkedin_source.stg_linkedin_ads__account_history:f0
122. model.linkedin_source.stg_linkedin_ads__account_history
  • Input Column: 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp[name]
    • Direct The column is directly copied
    • Output Columns:
      • account_name: Directly mapped to account_name
121. model.linkedin.linkedin_ads__url_report
  • Input Column: 122. model.linkedin_source.stg_linkedin_ads__account_history[account_name]
    • Direct directly copied to the output
    • Output Columns:
      • account_name: directly copied
Column Lineage
%3 122. model.linkedin_source.stg_linkedin_ads__account_history 122. model.linkedin_source.stg_linkedin_ads__account_history account_id 121. model.linkedin.linkedin_ads__url_report 121. model.linkedin.linkedin_ads__url_report account_id 122. model.linkedin_source.stg_linkedin_ads__account_history:f0->121. model.linkedin.linkedin_ads__url_report:f0 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp id 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp:f0->122. model.linkedin_source.stg_linkedin_ads__account_history:f0
122. model.linkedin_source.stg_linkedin_ads__account_history
  • Input Column: 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp[id]
    • Direct The column is directly copied
    • Deduplication Used in the PARTITION BY clause of the ROW_NUMBER() function
    • Output Columns:
      • account_id: Directly mapped to account_id
121. model.linkedin.linkedin_ads__url_report
  • Input Column: 122. model.linkedin_source.stg_linkedin_ads__account_history[account_id]
    • Integration used as the key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • account_id: directly copied
Column Lineage
%3 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative date_day 121. model.linkedin.linkedin_ads__url_report 121. model.linkedin.linkedin_ads__url_report date_day 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f0->121. model.linkedin.linkedin_ads__url_report:f0 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp day 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp:f0->126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f0
126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative
  • Input Column: 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp[day]
    • Cleaning The column is cast as TIMESTAMP in the macro CTE and then truncated to day in the fields CTE
    • Output Columns:
      • date_day: Transformed to date_day using DATE_TRUNC('DAY', day)
121. model.linkedin.linkedin_ads__url_report
  • Input Column: 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative clicks 121. model.linkedin.linkedin_ads__url_report 121. model.linkedin.linkedin_ads__url_report clicks 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f0->121. model.linkedin.linkedin_ads__url_report:f0 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp clicks 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp:f0->126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f0
126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative
  • Input Column: 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp[clicks]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT in the macro CTE
    • Output Columns:
      • clicks: Directly mapped
121. model.linkedin.linkedin_ads__url_report
  • Input Column: 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative[clicks]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • clicks: Aggregated sum in the output
Column Lineage
%3 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative impressions 121. model.linkedin.linkedin_ads__url_report 121. model.linkedin.linkedin_ads__url_report impressions 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f0->121. model.linkedin.linkedin_ads__url_report:f0 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp impressions 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp:f0->126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f0
126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative
  • Input Column: 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp[impressions]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT in the macro CTE
    • Output Columns:
      • impressions: Directly mapped
121. model.linkedin.linkedin_ads__url_report
  • Input Column: 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative[impressions]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • impressions: Aggregated sum in the output
Column Lineage
%3 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative cost 121. model.linkedin.linkedin_ads__url_report 121. model.linkedin.linkedin_ads__url_report cost 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f0->121. model.linkedin.linkedin_ads__url_report:f0 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp cost_in_usd 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp:f0->126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f0
126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative
  • Input Column: 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp[cost_in_usd]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as DECIMAL(28, 6) in the macro CTE
    • Output Columns:
      • cost: Directly mapped and renamed to 'cost'
121. model.linkedin.linkedin_ads__url_report
  • Input Column: 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative[cost]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • cost: Aggregated sum in the output
Column Lineage
%3 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history campaign_group_name 121. model.linkedin.linkedin_ads__url_report 121. model.linkedin.linkedin_ads__url_report campaign_group_name 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f0->121. model.linkedin.linkedin_ads__url_report:f0 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp name 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp:f0->128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f0
128. model.linkedin_source.stg_linkedin_ads__campaign_group_history
  • Input Column: 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp[name]
    • Direct The column is directly copied to the output
    • Output Columns:
      • campaign_group_name: Directly mapped
121. model.linkedin.linkedin_ads__url_report
  • Input Column: 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history[campaign_group_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_group_name: directly copied
Column Lineage
%3 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history campaign_group_id 121. model.linkedin.linkedin_ads__url_report 121. model.linkedin.linkedin_ads__url_report campaign_group_id 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f0->121. model.linkedin.linkedin_ads__url_report:f0 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp id 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp:f0->128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f0
128. model.linkedin_source.stg_linkedin_ads__campaign_group_history
  • Input Column: 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp[id]
    • Direct The column is directly copied to the output
    • Deduplication Used in the ROW_NUMBER() window function for determining the latest version
    • Output Columns:
      • campaign_group_id: Directly mapped
121. model.linkedin.linkedin_ads__url_report
  • Input Column: 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history[campaign_group_id]
    • Integration used as the key to join with the campaign table
    • Direct directly copied to the output
    • Output Columns:
      • campaign_group_id: directly copied
Column Lineage
%3 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative creative_id 121. model.linkedin.linkedin_ads__url_report 121. model.linkedin.linkedin_ads__url_report creative_id 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f0->121. model.linkedin.linkedin_ads__url_report:f0 132. model.linkedin_source.stg_linkedin_ads__creative_history 132. model.linkedin_source.stg_linkedin_ads__creative_history creative_id 132. model.linkedin_source.stg_linkedin_ads__creative_history:f0->121. model.linkedin.linkedin_ads__url_report:f0 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp creative_id 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp:f0->126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f0 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp id 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f0
126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative
  • Input Column: 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp[creative_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT in the macro CTE
    • Output Columns:
      • creative_id: Directly mapped
132. model.linkedin_source.stg_linkedin_ads__creative_history
  • Input Column: 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp[id]
    • Direct The column is directly copied to the output
    • Deduplication Used in the ROW_NUMBER() function to identify the latest version
    • Output Columns:
      • creative_id: Directly mapped
121. model.linkedin.linkedin_ads__url_report
  • Input Column: 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative[creative_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with the creative table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • creative_id: Directly copied to the output
  • Input Column: 132. model.linkedin_source.stg_linkedin_ads__creative_history[creative_id]
    • Integration used as the key to join with the report table
    • Direct directly copied to the output
    • Aggregation used in the GROUP BY clause
    • Output Columns:
      • creative_id: directly copied
Column Lineage
%3 132. model.linkedin_source.stg_linkedin_ads__creative_history 132. model.linkedin_source.stg_linkedin_ads__creative_history base_url click_uri url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 121. model.linkedin.linkedin_ads__url_report 121. model.linkedin.linkedin_ads__url_report click_uri 132. model.linkedin_source.stg_linkedin_ads__creative_history:f1->121. model.linkedin.linkedin_ads__url_report:f0 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp click_uri 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f1 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f0 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f2 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f3 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f7 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f6 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f4 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f5 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f8
132. model.linkedin_source.stg_linkedin_ads__creative_history
  • Input Column: 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp[click_uri]
    • Direct The column is directly copied to the output
    • Featurization Various URL components and UTM parameters are extracted from this column
    • Output Columns:
      • click_uri: Directly mapped
      • base_url: Extracted from click_uri
      • url_host: Extracted from click_uri
      • url_path: Extracted from click_uri
      • utm_source: Extracted from click_uri
      • utm_medium: Extracted from click_uri
      • utm_campaign: Extracted from click_uri
      • utm_content: Extracted from click_uri
      • utm_term: Extracted from click_uri
121. model.linkedin.linkedin_ads__url_report
  • Input Column: 132. model.linkedin_source.stg_linkedin_ads__creative_history[click_uri]
    • Filtering used in the WHERE clause to filter out null values
    • Direct directly copied to the output
    • Aggregation used in the GROUP BY clause
    • Output Columns:
      • click_uri: directly copied
Column Lineage
%3 132. model.linkedin_source.stg_linkedin_ads__creative_history 132. model.linkedin_source.stg_linkedin_ads__creative_history base_url click_uri url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 121. model.linkedin.linkedin_ads__url_report 121. model.linkedin.linkedin_ads__url_report base_url 132. model.linkedin_source.stg_linkedin_ads__creative_history:f0->121. model.linkedin.linkedin_ads__url_report:f0 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp click_uri 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f1 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f0 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f2 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f3 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f7 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f6 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f4 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f5 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f8
132. model.linkedin_source.stg_linkedin_ads__creative_history
  • Input Column: 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp[click_uri]
    • Direct The column is directly copied to the output
    • Featurization Various URL components and UTM parameters are extracted from this column
    • Output Columns:
      • click_uri: Directly mapped
      • base_url: Extracted from click_uri
      • url_host: Extracted from click_uri
      • url_path: Extracted from click_uri
      • utm_source: Extracted from click_uri
      • utm_medium: Extracted from click_uri
      • utm_campaign: Extracted from click_uri
      • utm_content: Extracted from click_uri
      • utm_term: Extracted from click_uri
121. model.linkedin.linkedin_ads__url_report
  • Input Column: 132. model.linkedin_source.stg_linkedin_ads__creative_history[base_url]
    • Direct directly copied to the output
    • Aggregation used in the GROUP BY clause
    • Output Columns:
      • base_url: directly copied
Column Lineage
%3 132. model.linkedin_source.stg_linkedin_ads__creative_history 132. model.linkedin_source.stg_linkedin_ads__creative_history base_url click_uri url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 121. model.linkedin.linkedin_ads__url_report 121. model.linkedin.linkedin_ads__url_report url_host 132. model.linkedin_source.stg_linkedin_ads__creative_history:f2->121. model.linkedin.linkedin_ads__url_report:f0 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp click_uri 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f1 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f0 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f2 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f3 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f7 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f6 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f4 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f5 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f8
132. model.linkedin_source.stg_linkedin_ads__creative_history
  • Input Column: 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp[click_uri]
    • Direct The column is directly copied to the output
    • Featurization Various URL components and UTM parameters are extracted from this column
    • Output Columns:
      • click_uri: Directly mapped
      • base_url: Extracted from click_uri
      • url_host: Extracted from click_uri
      • url_path: Extracted from click_uri
      • utm_source: Extracted from click_uri
      • utm_medium: Extracted from click_uri
      • utm_campaign: Extracted from click_uri
      • utm_content: Extracted from click_uri
      • utm_term: Extracted from click_uri
121. model.linkedin.linkedin_ads__url_report
  • Input Column: 132. model.linkedin_source.stg_linkedin_ads__creative_history[url_host]
    • Direct directly copied to the output
    • Aggregation used in the GROUP BY clause
    • Output Columns:
      • url_host: directly copied
Column Lineage
%3 132. model.linkedin_source.stg_linkedin_ads__creative_history 132. model.linkedin_source.stg_linkedin_ads__creative_history base_url click_uri url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 121. model.linkedin.linkedin_ads__url_report 121. model.linkedin.linkedin_ads__url_report url_path 132. model.linkedin_source.stg_linkedin_ads__creative_history:f3->121. model.linkedin.linkedin_ads__url_report:f0 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp click_uri 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f1 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f0 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f2 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f3 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f7 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f6 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f4 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f5 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f8
132. model.linkedin_source.stg_linkedin_ads__creative_history
  • Input Column: 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp[click_uri]
    • Direct The column is directly copied to the output
    • Featurization Various URL components and UTM parameters are extracted from this column
    • Output Columns:
      • click_uri: Directly mapped
      • base_url: Extracted from click_uri
      • url_host: Extracted from click_uri
      • url_path: Extracted from click_uri
      • utm_source: Extracted from click_uri
      • utm_medium: Extracted from click_uri
      • utm_campaign: Extracted from click_uri
      • utm_content: Extracted from click_uri
      • utm_term: Extracted from click_uri
121. model.linkedin.linkedin_ads__url_report
  • Input Column: 132. model.linkedin_source.stg_linkedin_ads__creative_history[url_path]
    • Direct directly copied to the output
    • Aggregation used in the GROUP BY clause
    • Output Columns:
      • url_path: directly copied
Column Lineage
%3 132. model.linkedin_source.stg_linkedin_ads__creative_history 132. model.linkedin_source.stg_linkedin_ads__creative_history base_url click_uri url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 121. model.linkedin.linkedin_ads__url_report 121. model.linkedin.linkedin_ads__url_report utm_source 132. model.linkedin_source.stg_linkedin_ads__creative_history:f7->121. model.linkedin.linkedin_ads__url_report:f0 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp click_uri 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f1 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f0 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f2 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f3 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f7 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f6 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f4 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f5 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f8
132. model.linkedin_source.stg_linkedin_ads__creative_history
  • Input Column: 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp[click_uri]
    • Direct The column is directly copied to the output
    • Featurization Various URL components and UTM parameters are extracted from this column
    • Output Columns:
      • click_uri: Directly mapped
      • base_url: Extracted from click_uri
      • url_host: Extracted from click_uri
      • url_path: Extracted from click_uri
      • utm_source: Extracted from click_uri
      • utm_medium: Extracted from click_uri
      • utm_campaign: Extracted from click_uri
      • utm_content: Extracted from click_uri
      • utm_term: Extracted from click_uri
121. model.linkedin.linkedin_ads__url_report
  • Input Column: 132. model.linkedin_source.stg_linkedin_ads__creative_history[utm_source]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the JOIN condition with the report table
    • Output Columns:
      • utm_source: Directly copied to the output
Column Lineage
%3 132. model.linkedin_source.stg_linkedin_ads__creative_history 132. model.linkedin_source.stg_linkedin_ads__creative_history base_url click_uri url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 121. model.linkedin.linkedin_ads__url_report 121. model.linkedin.linkedin_ads__url_report utm_medium 132. model.linkedin_source.stg_linkedin_ads__creative_history:f6->121. model.linkedin.linkedin_ads__url_report:f0 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp click_uri 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f1 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f0 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f2 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f3 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f7 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f6 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f4 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f5 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f8
132. model.linkedin_source.stg_linkedin_ads__creative_history
  • Input Column: 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp[click_uri]
    • Direct The column is directly copied to the output
    • Featurization Various URL components and UTM parameters are extracted from this column
    • Output Columns:
      • click_uri: Directly mapped
      • base_url: Extracted from click_uri
      • url_host: Extracted from click_uri
      • url_path: Extracted from click_uri
      • utm_source: Extracted from click_uri
      • utm_medium: Extracted from click_uri
      • utm_campaign: Extracted from click_uri
      • utm_content: Extracted from click_uri
      • utm_term: Extracted from click_uri
121. model.linkedin.linkedin_ads__url_report
  • Input Column: 132. model.linkedin_source.stg_linkedin_ads__creative_history[utm_medium]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the JOIN condition with the report table
    • Output Columns:
      • utm_medium: Directly copied to the output
Column Lineage
%3 132. model.linkedin_source.stg_linkedin_ads__creative_history 132. model.linkedin_source.stg_linkedin_ads__creative_history base_url click_uri url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 121. model.linkedin.linkedin_ads__url_report 121. model.linkedin.linkedin_ads__url_report utm_campaign 132. model.linkedin_source.stg_linkedin_ads__creative_history:f4->121. model.linkedin.linkedin_ads__url_report:f0 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp click_uri 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f1 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f0 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f2 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f3 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f7 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f6 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f4 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f5 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f8
132. model.linkedin_source.stg_linkedin_ads__creative_history
  • Input Column: 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp[click_uri]
    • Direct The column is directly copied to the output
    • Featurization Various URL components and UTM parameters are extracted from this column
    • Output Columns:
      • click_uri: Directly mapped
      • base_url: Extracted from click_uri
      • url_host: Extracted from click_uri
      • url_path: Extracted from click_uri
      • utm_source: Extracted from click_uri
      • utm_medium: Extracted from click_uri
      • utm_campaign: Extracted from click_uri
      • utm_content: Extracted from click_uri
      • utm_term: Extracted from click_uri
121. model.linkedin.linkedin_ads__url_report
  • Input Column: 132. model.linkedin_source.stg_linkedin_ads__creative_history[utm_campaign]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the JOIN condition with the report table
    • Output Columns:
      • utm_campaign: Directly copied to the output
Column Lineage
%3 132. model.linkedin_source.stg_linkedin_ads__creative_history 132. model.linkedin_source.stg_linkedin_ads__creative_history base_url click_uri url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 121. model.linkedin.linkedin_ads__url_report 121. model.linkedin.linkedin_ads__url_report utm_content 132. model.linkedin_source.stg_linkedin_ads__creative_history:f5->121. model.linkedin.linkedin_ads__url_report:f0 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp click_uri 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f1 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f0 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f2 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f3 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f7 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f6 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f4 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f5 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f8
132. model.linkedin_source.stg_linkedin_ads__creative_history
  • Input Column: 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp[click_uri]
    • Direct The column is directly copied to the output
    • Featurization Various URL components and UTM parameters are extracted from this column
    • Output Columns:
      • click_uri: Directly mapped
      • base_url: Extracted from click_uri
      • url_host: Extracted from click_uri
      • url_path: Extracted from click_uri
      • utm_source: Extracted from click_uri
      • utm_medium: Extracted from click_uri
      • utm_campaign: Extracted from click_uri
      • utm_content: Extracted from click_uri
      • utm_term: Extracted from click_uri
121. model.linkedin.linkedin_ads__url_report
  • Input Column: 132. model.linkedin_source.stg_linkedin_ads__creative_history[utm_content]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the JOIN condition with the report table
    • Output Columns:
      • utm_content: Directly copied to the output
Column Lineage
%3 132. model.linkedin_source.stg_linkedin_ads__creative_history 132. model.linkedin_source.stg_linkedin_ads__creative_history base_url click_uri url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 121. model.linkedin.linkedin_ads__url_report 121. model.linkedin.linkedin_ads__url_report utm_term 132. model.linkedin_source.stg_linkedin_ads__creative_history:f8->121. model.linkedin.linkedin_ads__url_report:f0 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp click_uri 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f1 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f0 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f2 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f3 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f7 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f6 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f4 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f5 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f8
132. model.linkedin_source.stg_linkedin_ads__creative_history
  • Input Column: 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp[click_uri]
    • Direct The column is directly copied to the output
    • Featurization Various URL components and UTM parameters are extracted from this column
    • Output Columns:
      • click_uri: Directly mapped
      • base_url: Extracted from click_uri
      • url_host: Extracted from click_uri
      • url_path: Extracted from click_uri
      • utm_source: Extracted from click_uri
      • utm_medium: Extracted from click_uri
      • utm_campaign: Extracted from click_uri
      • utm_content: Extracted from click_uri
      • utm_term: Extracted from click_uri
121. model.linkedin.linkedin_ads__url_report
  • Input Column: 132. model.linkedin_source.stg_linkedin_ads__creative_history[utm_term]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the JOIN condition with the report table
    • Output Columns:
      • utm_term: Directly copied to the output
Column Lineage
%3 122. model.linkedin_source.stg_linkedin_ads__account_history 122. model.linkedin_source.stg_linkedin_ads__account_history currency 121. model.linkedin.linkedin_ads__url_report 121. model.linkedin.linkedin_ads__url_report currency 122. model.linkedin_source.stg_linkedin_ads__account_history:f0->121. model.linkedin.linkedin_ads__url_report:f0 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp currency 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp:f0->122. model.linkedin_source.stg_linkedin_ads__account_history:f0
122. model.linkedin_source.stg_linkedin_ads__account_history
  • Input Column: 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp[currency]
    • Direct The column is directly copied
    • Output Columns:
      • currency: Directly mapped to currency
121. model.linkedin.linkedin_ads__url_report
  • Input Column: 122. model.linkedin_source.stg_linkedin_ads__account_history[currency]
    • Direct directly copied to the output
    • Output Columns:
      • currency: directly copied
Column Lineage
%3 130. model.linkedin_source.stg_linkedin_ads__campaign_history 130. model.linkedin_source.stg_linkedin_ads__campaign_history campaign_name 121. model.linkedin.linkedin_ads__url_report 121. model.linkedin.linkedin_ads__url_report campaign_name 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->121. model.linkedin.linkedin_ads__url_report:f0 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp name 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp:f0->130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0
130. model.linkedin_source.stg_linkedin_ads__campaign_history
  • Input Column: 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp[name]
    • Direct The column is directly copied to the output
    • Output Columns:
      • campaign_name: Directly mapped
121. model.linkedin.linkedin_ads__url_report
  • Input Column: 130. model.linkedin_source.stg_linkedin_ads__campaign_history[campaign_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_name: directly copied
Column Lineage
%3 130. model.linkedin_source.stg_linkedin_ads__campaign_history 130. model.linkedin_source.stg_linkedin_ads__campaign_history campaign_id 121. model.linkedin.linkedin_ads__url_report 121. model.linkedin.linkedin_ads__url_report campaign_id 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->121. model.linkedin.linkedin_ads__url_report:f0 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp id 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp:f0->130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0
130. model.linkedin_source.stg_linkedin_ads__campaign_history
  • Input Column: 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp[id]
    • Direct The column is directly copied to the output
    • Deduplication Used in ROW_NUMBER() function to identify the latest version
    • Output Columns:
      • campaign_id: Directly mapped
121. model.linkedin.linkedin_ads__url_report
  • Input Column: 130. model.linkedin_source.stg_linkedin_ads__campaign_history[campaign_id]
    • Integration used as the key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
Column Lineage
%3 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative conversion_value_in_local_currency 121. model.linkedin.linkedin_ads__url_report 121. model.linkedin.linkedin_ads__url_report conversion_value_in_local_currency 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f0->121. model.linkedin.linkedin_ads__url_report:f0
121. model.linkedin.linkedin_ads__url_report
  • Input Column: 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative[conversion_value_in_local_currency]
    • Cleaning COALESCE is used to replace NULL values with 0
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • conversion_value_in_local_currency: Aggregated sum of cleaned values in the output
Column Lineage
%3 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative external_website_conversions one_click_leads 121. model.linkedin.linkedin_ads__url_report 121. model.linkedin.linkedin_ads__url_report external_website_conversions one_click_leads total_conversions 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f0->121. model.linkedin.linkedin_ads__url_report:f0 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f0->121. model.linkedin.linkedin_ads__url_report:f2 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f1->121. model.linkedin.linkedin_ads__url_report:f1 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f1->121. model.linkedin.linkedin_ads__url_report:f2
121. model.linkedin.linkedin_ads__url_report
  • Input Column: 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative[external_website_conversions]
    • Cleaning COALESCE is used to replace NULL values with 0
    • Aggregation The column is summed up in the final SELECT statement
    • Featurization Used to calculate total_conversions
    • Output Columns:
      • external_website_conversions: Aggregated sum of cleaned values in the output
      • total_conversions: Part of the calculation for this new feature
  • Input Column: 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative[one_click_leads]
    • Cleaning COALESCE is used to replace NULL values with 0
    • Aggregation The column is summed up in the final SELECT statement
    • Featurization Used to calculate total_conversions
    • Output Columns:
      • one_click_leads: Aggregated sum of cleaned values in the output
      • total_conversions: Part of the calculation for this new feature
Column Lineage
%3 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative external_website_conversions 121. model.linkedin.linkedin_ads__url_report 121. model.linkedin.linkedin_ads__url_report external_website_conversions total_conversions 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f0->121. model.linkedin.linkedin_ads__url_report:f0 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f0->121. model.linkedin.linkedin_ads__url_report:f1
121. model.linkedin.linkedin_ads__url_report
  • Input Column: 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative[external_website_conversions]
    • Cleaning COALESCE is used to replace NULL values with 0
    • Aggregation The column is summed up in the final SELECT statement
    • Featurization Used to calculate total_conversions
    • Output Columns:
      • external_website_conversions: Aggregated sum of cleaned values in the output
      • total_conversions: Part of the calculation for this new feature
Column Lineage
%3 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative one_click_leads 121. model.linkedin.linkedin_ads__url_report 121. model.linkedin.linkedin_ads__url_report one_click_leads total_conversions 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f0->121. model.linkedin.linkedin_ads__url_report:f0 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f0->121. model.linkedin.linkedin_ads__url_report:f1
121. model.linkedin.linkedin_ads__url_report
  • Input Column: 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative[one_click_leads]
    • Cleaning COALESCE is used to replace NULL values with 0
    • Aggregation The column is summed up in the final SELECT statement
    • Featurization Used to calculate total_conversions
    • Output Columns:
      • one_click_leads: Aggregated sum of cleaned values in the output
      • total_conversions: Part of the calculation for this new feature
122. model.linkedin_source.stg_linkedin_ads__account_history

This SQL query performs several operations on LinkedIn ads account history data. It starts by creating a base CTE from a temporary staging table. Then, it defines a macro CTE with null or empty values for all columns. The fields CTE then selects and casts various columns from the macro CTE, renames some columns, and adds an is_latest_version column using a window function. Finally, it selects all columns from the fields CTE.

CleaningDeduplicationOther
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_linkedin_ads_source.stg_linkedin_ads__account_history_tmp
), macro AS (
  SELECT
    CAST(NULL AS TIMESTAMP) AS created_time,
    CAST(NULL AS TEXT) AS currency,
    CAST(NULL AS INT) AS id,
    CAST(NULL AS TIMESTAMP) AS last_modified_time,
    CAST(NULL AS TEXT) AS name,
    CAST(NULL AS TEXT) AS status,
    CAST(NULL AS TEXT) AS type,
    CAST(NULL AS TEXT) AS version_tag,
    CAST('' AS TEXT) AS source_relation
  FROM base
), fields AS (
  SELECT
    source_relation,
    id AS account_id,
    name AS account_name,
    currency,
    CAST(version_tag AS DECIMAL) AS version_tag,
    status,
    type,
    CAST(last_modified_time AS TIMESTAMP) AS last_modified_at,
    CAST(created_time AS TIMESTAMP) AS created_at,
    ROW_NUMBER() OVER (PARTITION BY source_relation, id ORDER BY last_modified_time DESC) = 1 AS is_latest_version
  FROM macro
)
SELECT
  *
FROM fields
%3 122. model.linkedin_source.stg_linkedin_ads__account_history 122. model.linkedin_source.stg_linkedin_ads__account_history source_relation account_id last_modified_at created_at account_name currency version_tag status type is_latest_version 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp id last_modified_time created_time name currency version_tag 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp:f0->122. model.linkedin_source.stg_linkedin_ads__account_history:f1 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp:f1->122. model.linkedin_source.stg_linkedin_ads__account_history:f2 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp:f2->122. model.linkedin_source.stg_linkedin_ads__account_history:f3 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp:f3->122. model.linkedin_source.stg_linkedin_ads__account_history:f4 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp:f4->122. model.linkedin_source.stg_linkedin_ads__account_history:f5 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp:f5->122. model.linkedin_source.stg_linkedin_ads__account_history:f6
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
account_id integer Unique internal ID representing the account.
last_modified_at timestamp without time zone The timestamp of when the version was updated.
created_at timestamp without time zone The timestamp of when the account was created.
account_name text A label for the account.
currency text The ISO 4217 currency code of the account, such as 'USD' for United States Dollar (default).
version_tag numeric An integer representation of the version of the account.
status text ACTIVE - Account is active; this is the default state CANCELLED - Account has been permanently cancelled DRAFT - Account is in draft status, meaning it's not yet fully set up and it is not serving PENDING_DELETION - Denotes that the account has been requested to be deleted that is currently pending REMOVED - Denotes that the account was deleted, but must remain fetchable due to the existence of performance data.
type text BUSINESS - This is the only value allowed when creating accounts through the API. ENTERPRISE - This value cannot be used to create accounts through the API and is reserved for accounts created by LinkedIn's internal ad operations systems.
is_latest_version boolean Boolean of whether the record is the latest version of the account.
Column Lineage
%3 122. model.linkedin_source.stg_linkedin_ads__account_history 122. model.linkedin_source.stg_linkedin_ads__account_history source_relation 120. model.linkedin.linkedin_ads__creative_report 120. model.linkedin.linkedin_ads__creative_report source_relation 122. model.linkedin_source.stg_linkedin_ads__account_history:f0->120. model.linkedin.linkedin_ads__creative_report:f0 118. model.linkedin.linkedin_ads__campaign_group_report 118. model.linkedin.linkedin_ads__campaign_group_report source_relation 122. model.linkedin_source.stg_linkedin_ads__account_history:f0->118. model.linkedin.linkedin_ads__campaign_group_report:f0 121. model.linkedin.linkedin_ads__url_report 121. model.linkedin.linkedin_ads__url_report source_relation 122. model.linkedin_source.stg_linkedin_ads__account_history:f0->121. model.linkedin.linkedin_ads__url_report:f0 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report source_relation 122. model.linkedin_source.stg_linkedin_ads__account_history:f0->119. model.linkedin.linkedin_ads__campaign_report:f0 117. model.linkedin.linkedin_ads__account_report 117. model.linkedin.linkedin_ads__account_report source_relation 122. model.linkedin_source.stg_linkedin_ads__account_history:f0->117. model.linkedin.linkedin_ads__account_report:f0
117. model.linkedin.linkedin_ads__account_report
  • Input Column: 122. model.linkedin_source.stg_linkedin_ads__account_history[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with campaign and report tables
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
118. model.linkedin.linkedin_ads__campaign_group_report
  • Input Column: 122. model.linkedin_source.stg_linkedin_ads__account_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 122. model.linkedin_source.stg_linkedin_ads__account_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct copied directly to the output
    • Output Columns:
      • source_relation: directly copied
120. model.linkedin.linkedin_ads__creative_report
  • Input Column: 122. model.linkedin_source.stg_linkedin_ads__account_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
121. model.linkedin.linkedin_ads__url_report
  • Input Column: 122. model.linkedin_source.stg_linkedin_ads__account_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
Column Lineage
%3 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp id 122. model.linkedin_source.stg_linkedin_ads__account_history 122. model.linkedin_source.stg_linkedin_ads__account_history account_id 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp:f0->122. model.linkedin_source.stg_linkedin_ads__account_history:f0 120. model.linkedin.linkedin_ads__creative_report 120. model.linkedin.linkedin_ads__creative_report account_id 122. model.linkedin_source.stg_linkedin_ads__account_history:f0->120. model.linkedin.linkedin_ads__creative_report:f0 118. model.linkedin.linkedin_ads__campaign_group_report 118. model.linkedin.linkedin_ads__campaign_group_report account_id 122. model.linkedin_source.stg_linkedin_ads__account_history:f0->118. model.linkedin.linkedin_ads__campaign_group_report:f0 121. model.linkedin.linkedin_ads__url_report 121. model.linkedin.linkedin_ads__url_report account_id 122. model.linkedin_source.stg_linkedin_ads__account_history:f0->121. model.linkedin.linkedin_ads__url_report:f0 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report account_id 122. model.linkedin_source.stg_linkedin_ads__account_history:f0->119. model.linkedin.linkedin_ads__campaign_report:f0 117. model.linkedin.linkedin_ads__account_report 117. model.linkedin.linkedin_ads__account_report account_id 122. model.linkedin_source.stg_linkedin_ads__account_history:f0->117. model.linkedin.linkedin_ads__account_report:f0
122. model.linkedin_source.stg_linkedin_ads__account_history
  • Input Column: 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp[id]
    • Direct The column is directly copied
    • Deduplication Used in the PARTITION BY clause of the ROW_NUMBER() function
    • Output Columns:
      • account_id: Directly mapped to account_id
117. model.linkedin.linkedin_ads__account_report
  • Input Column: 122. model.linkedin_source.stg_linkedin_ads__account_history[account_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with the campaign table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • account_id: Directly copied to the output
118. model.linkedin.linkedin_ads__campaign_group_report
  • Input Column: 122. model.linkedin_source.stg_linkedin_ads__account_history[account_id]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • account_id: directly copied
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 122. model.linkedin_source.stg_linkedin_ads__account_history[account_id]
    • Integration used as the key to join with other tables
    • Direct copied directly to the output
    • Output Columns:
      • account_id: directly copied
120. model.linkedin.linkedin_ads__creative_report
  • Input Column: 122. model.linkedin_source.stg_linkedin_ads__account_history[account_id]
    • Integration used as the key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • account_id: directly copied
121. model.linkedin.linkedin_ads__url_report
  • Input Column: 122. model.linkedin_source.stg_linkedin_ads__account_history[account_id]
    • Integration used as the key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • account_id: directly copied
Column Lineage
%3 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp last_modified_time 122. model.linkedin_source.stg_linkedin_ads__account_history 122. model.linkedin_source.stg_linkedin_ads__account_history last_modified_at 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp:f0->122. model.linkedin_source.stg_linkedin_ads__account_history:f0 117. model.linkedin.linkedin_ads__account_report 117. model.linkedin.linkedin_ads__account_report last_modified_at 122. model.linkedin_source.stg_linkedin_ads__account_history:f0->117. model.linkedin.linkedin_ads__account_report:f0
122. model.linkedin_source.stg_linkedin_ads__account_history
  • Input Column: 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp[last_modified_time]
    • Cleaning Cast to TIMESTAMP datatype
    • Deduplication Used in the ORDER BY clause of the ROW_NUMBER() function
    • Output Columns:
      • last_modified_at: Mapped after casting to TIMESTAMP
117. model.linkedin.linkedin_ads__account_report
  • Input Column: 122. model.linkedin_source.stg_linkedin_ads__account_history[last_modified_at]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • last_modified_at: Directly copied to the output
Column Lineage
%3 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp created_time 122. model.linkedin_source.stg_linkedin_ads__account_history 122. model.linkedin_source.stg_linkedin_ads__account_history created_at 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp:f0->122. model.linkedin_source.stg_linkedin_ads__account_history:f0 117. model.linkedin.linkedin_ads__account_report 117. model.linkedin.linkedin_ads__account_report created_at 122. model.linkedin_source.stg_linkedin_ads__account_history:f0->117. model.linkedin.linkedin_ads__account_report:f0
122. model.linkedin_source.stg_linkedin_ads__account_history
  • Input Column: 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp[created_time]
    • Cleaning Cast to TIMESTAMP datatype
    • Output Columns:
      • created_at: Mapped after casting to TIMESTAMP
117. model.linkedin.linkedin_ads__account_report
  • Input Column: 122. model.linkedin_source.stg_linkedin_ads__account_history[created_at]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • created_at: Directly copied to the output
Column Lineage
%3 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp name 122. model.linkedin_source.stg_linkedin_ads__account_history 122. model.linkedin_source.stg_linkedin_ads__account_history account_name 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp:f0->122. model.linkedin_source.stg_linkedin_ads__account_history:f0 120. model.linkedin.linkedin_ads__creative_report 120. model.linkedin.linkedin_ads__creative_report account_name 122. model.linkedin_source.stg_linkedin_ads__account_history:f0->120. model.linkedin.linkedin_ads__creative_report:f0 118. model.linkedin.linkedin_ads__campaign_group_report 118. model.linkedin.linkedin_ads__campaign_group_report account_name 122. model.linkedin_source.stg_linkedin_ads__account_history:f0->118. model.linkedin.linkedin_ads__campaign_group_report:f0 121. model.linkedin.linkedin_ads__url_report 121. model.linkedin.linkedin_ads__url_report account_name 122. model.linkedin_source.stg_linkedin_ads__account_history:f0->121. model.linkedin.linkedin_ads__url_report:f0 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report account_name 122. model.linkedin_source.stg_linkedin_ads__account_history:f0->119. model.linkedin.linkedin_ads__campaign_report:f0 117. model.linkedin.linkedin_ads__account_report 117. model.linkedin.linkedin_ads__account_report account_name 122. model.linkedin_source.stg_linkedin_ads__account_history:f0->117. model.linkedin.linkedin_ads__account_report:f0
122. model.linkedin_source.stg_linkedin_ads__account_history
  • Input Column: 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp[name]
    • Direct The column is directly copied
    • Output Columns:
      • account_name: Directly mapped to account_name
117. model.linkedin.linkedin_ads__account_report
  • Input Column: 122. model.linkedin_source.stg_linkedin_ads__account_history[account_name]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • account_name: Directly copied to the output
118. model.linkedin.linkedin_ads__campaign_group_report
  • Input Column: 122. model.linkedin_source.stg_linkedin_ads__account_history[account_name]
    • Direct directly copied to the output
    • Output Columns:
      • account_name: directly copied
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 122. model.linkedin_source.stg_linkedin_ads__account_history[account_name]
    • Direct copied directly to the output
    • Output Columns:
      • account_name: directly copied
120. model.linkedin.linkedin_ads__creative_report
  • Input Column: 122. model.linkedin_source.stg_linkedin_ads__account_history[account_name]
    • Direct directly copied to the output
    • Output Columns:
      • account_name: directly copied
121. model.linkedin.linkedin_ads__url_report
  • Input Column: 122. model.linkedin_source.stg_linkedin_ads__account_history[account_name]
    • Direct directly copied to the output
    • Output Columns:
      • account_name: directly copied
Column Lineage
%3 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp currency 122. model.linkedin_source.stg_linkedin_ads__account_history 122. model.linkedin_source.stg_linkedin_ads__account_history currency 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp:f0->122. model.linkedin_source.stg_linkedin_ads__account_history:f0 120. model.linkedin.linkedin_ads__creative_report 120. model.linkedin.linkedin_ads__creative_report currency 122. model.linkedin_source.stg_linkedin_ads__account_history:f0->120. model.linkedin.linkedin_ads__creative_report:f0 118. model.linkedin.linkedin_ads__campaign_group_report 118. model.linkedin.linkedin_ads__campaign_group_report currency 122. model.linkedin_source.stg_linkedin_ads__account_history:f0->118. model.linkedin.linkedin_ads__campaign_group_report:f0 121. model.linkedin.linkedin_ads__url_report 121. model.linkedin.linkedin_ads__url_report currency 122. model.linkedin_source.stg_linkedin_ads__account_history:f0->121. model.linkedin.linkedin_ads__url_report:f0 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report currency 122. model.linkedin_source.stg_linkedin_ads__account_history:f0->119. model.linkedin.linkedin_ads__campaign_report:f0 117. model.linkedin.linkedin_ads__account_report 117. model.linkedin.linkedin_ads__account_report currency 122. model.linkedin_source.stg_linkedin_ads__account_history:f0->117. model.linkedin.linkedin_ads__account_report:f0
122. model.linkedin_source.stg_linkedin_ads__account_history
  • Input Column: 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp[currency]
    • Direct The column is directly copied
    • Output Columns:
      • currency: Directly mapped to currency
117. model.linkedin.linkedin_ads__account_report
  • Input Column: 122. model.linkedin_source.stg_linkedin_ads__account_history[currency]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • currency: Directly copied to the output
118. model.linkedin.linkedin_ads__campaign_group_report
  • Input Column: 122. model.linkedin_source.stg_linkedin_ads__account_history[currency]
    • Direct directly copied to the output
    • Output Columns:
      • currency: directly copied
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 122. model.linkedin_source.stg_linkedin_ads__account_history[currency]
    • Direct copied directly to the output
    • Output Columns:
      • currency: directly copied
120. model.linkedin.linkedin_ads__creative_report
  • Input Column: 122. model.linkedin_source.stg_linkedin_ads__account_history[currency]
    • Direct directly copied to the output
    • Output Columns:
      • currency: directly copied
121. model.linkedin.linkedin_ads__url_report
  • Input Column: 122. model.linkedin_source.stg_linkedin_ads__account_history[currency]
    • Direct directly copied to the output
    • Output Columns:
      • currency: directly copied
Column Lineage
%3 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp version_tag 122. model.linkedin_source.stg_linkedin_ads__account_history 122. model.linkedin_source.stg_linkedin_ads__account_history version_tag 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp:f0->122. model.linkedin_source.stg_linkedin_ads__account_history:f0 117. model.linkedin.linkedin_ads__account_report 117. model.linkedin.linkedin_ads__account_report version_tag 122. model.linkedin_source.stg_linkedin_ads__account_history:f0->117. model.linkedin.linkedin_ads__account_report:f0
122. model.linkedin_source.stg_linkedin_ads__account_history
  • Input Column: 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp[version_tag]
    • Cleaning Cast to DECIMAL datatype
    • Output Columns:
      • version_tag: Mapped after casting to DECIMAL
117. model.linkedin.linkedin_ads__account_report
  • Input Column: 122. model.linkedin_source.stg_linkedin_ads__account_history[version_tag]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • version_tag: Directly copied to the output
Column Lineage
%3 122. model.linkedin_source.stg_linkedin_ads__account_history 122. model.linkedin_source.stg_linkedin_ads__account_history status 117. model.linkedin.linkedin_ads__account_report 117. model.linkedin.linkedin_ads__account_report status 122. model.linkedin_source.stg_linkedin_ads__account_history:f0->117. model.linkedin.linkedin_ads__account_report:f0
117. model.linkedin.linkedin_ads__account_report
  • Input Column: 122. model.linkedin_source.stg_linkedin_ads__account_history[status]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • status: Directly copied to the output
Column Lineage
%3 122. model.linkedin_source.stg_linkedin_ads__account_history 122. model.linkedin_source.stg_linkedin_ads__account_history type 117. model.linkedin.linkedin_ads__account_report 117. model.linkedin.linkedin_ads__account_report type 122. model.linkedin_source.stg_linkedin_ads__account_history:f0->117. model.linkedin.linkedin_ads__account_report:f0
117. model.linkedin.linkedin_ads__account_report
  • Input Column: 122. model.linkedin_source.stg_linkedin_ads__account_history[type]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • type: Directly copied to the output
123. model.linkedin_source.stg_linkedin_ads__account_history_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of TEXT data type, set to NULL. The query is likely used as a placeholder or template for further development, or to initialize a temporary table structure without populating it with data.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp id last_modified_time created_time name currency version_tag 316. source.linkedin_source.linkedin_ads.account_history 316. source.linkedin_source.linkedin_ads.account_history
Name Type Comment
id integer None
last_modified_time timestamp without time zone None
created_time timestamp without time zone None
name text None
currency text None
version_tag integer None
Column Lineage
%3 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp id 122. model.linkedin_source.stg_linkedin_ads__account_history 122. model.linkedin_source.stg_linkedin_ads__account_history account_id 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp:f0->122. model.linkedin_source.stg_linkedin_ads__account_history:f0 120. model.linkedin.linkedin_ads__creative_report 120. model.linkedin.linkedin_ads__creative_report account_id 122. model.linkedin_source.stg_linkedin_ads__account_history:f0->120. model.linkedin.linkedin_ads__creative_report:f0 118. model.linkedin.linkedin_ads__campaign_group_report 118. model.linkedin.linkedin_ads__campaign_group_report account_id 122. model.linkedin_source.stg_linkedin_ads__account_history:f0->118. model.linkedin.linkedin_ads__campaign_group_report:f0 121. model.linkedin.linkedin_ads__url_report 121. model.linkedin.linkedin_ads__url_report account_id 122. model.linkedin_source.stg_linkedin_ads__account_history:f0->121. model.linkedin.linkedin_ads__url_report:f0 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report account_id 122. model.linkedin_source.stg_linkedin_ads__account_history:f0->119. model.linkedin.linkedin_ads__campaign_report:f0 117. model.linkedin.linkedin_ads__account_report 117. model.linkedin.linkedin_ads__account_report account_id 122. model.linkedin_source.stg_linkedin_ads__account_history:f0->117. model.linkedin.linkedin_ads__account_report:f0
122. model.linkedin_source.stg_linkedin_ads__account_history
  • Input Column: 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp[id]
    • Direct The column is directly copied
    • Deduplication Used in the PARTITION BY clause of the ROW_NUMBER() function
    • Output Columns:
      • account_id: Directly mapped to account_id
117. model.linkedin.linkedin_ads__account_report
  • Input Column: 122. model.linkedin_source.stg_linkedin_ads__account_history[account_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with the campaign table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • account_id: Directly copied to the output
118. model.linkedin.linkedin_ads__campaign_group_report
  • Input Column: 122. model.linkedin_source.stg_linkedin_ads__account_history[account_id]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • account_id: directly copied
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 122. model.linkedin_source.stg_linkedin_ads__account_history[account_id]
    • Integration used as the key to join with other tables
    • Direct copied directly to the output
    • Output Columns:
      • account_id: directly copied
120. model.linkedin.linkedin_ads__creative_report
  • Input Column: 122. model.linkedin_source.stg_linkedin_ads__account_history[account_id]
    • Integration used as the key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • account_id: directly copied
121. model.linkedin.linkedin_ads__url_report
  • Input Column: 122. model.linkedin_source.stg_linkedin_ads__account_history[account_id]
    • Integration used as the key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • account_id: directly copied
Column Lineage
%3 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp last_modified_time 122. model.linkedin_source.stg_linkedin_ads__account_history 122. model.linkedin_source.stg_linkedin_ads__account_history last_modified_at 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp:f0->122. model.linkedin_source.stg_linkedin_ads__account_history:f0 117. model.linkedin.linkedin_ads__account_report 117. model.linkedin.linkedin_ads__account_report last_modified_at 122. model.linkedin_source.stg_linkedin_ads__account_history:f0->117. model.linkedin.linkedin_ads__account_report:f0
122. model.linkedin_source.stg_linkedin_ads__account_history
  • Input Column: 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp[last_modified_time]
    • Cleaning Cast to TIMESTAMP datatype
    • Deduplication Used in the ORDER BY clause of the ROW_NUMBER() function
    • Output Columns:
      • last_modified_at: Mapped after casting to TIMESTAMP
117. model.linkedin.linkedin_ads__account_report
  • Input Column: 122. model.linkedin_source.stg_linkedin_ads__account_history[last_modified_at]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • last_modified_at: Directly copied to the output
Column Lineage
%3 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp created_time 122. model.linkedin_source.stg_linkedin_ads__account_history 122. model.linkedin_source.stg_linkedin_ads__account_history created_at 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp:f0->122. model.linkedin_source.stg_linkedin_ads__account_history:f0 117. model.linkedin.linkedin_ads__account_report 117. model.linkedin.linkedin_ads__account_report created_at 122. model.linkedin_source.stg_linkedin_ads__account_history:f0->117. model.linkedin.linkedin_ads__account_report:f0
122. model.linkedin_source.stg_linkedin_ads__account_history
  • Input Column: 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp[created_time]
    • Cleaning Cast to TIMESTAMP datatype
    • Output Columns:
      • created_at: Mapped after casting to TIMESTAMP
117. model.linkedin.linkedin_ads__account_report
  • Input Column: 122. model.linkedin_source.stg_linkedin_ads__account_history[created_at]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • created_at: Directly copied to the output
Column Lineage
%3 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp name 122. model.linkedin_source.stg_linkedin_ads__account_history 122. model.linkedin_source.stg_linkedin_ads__account_history account_name 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp:f0->122. model.linkedin_source.stg_linkedin_ads__account_history:f0 120. model.linkedin.linkedin_ads__creative_report 120. model.linkedin.linkedin_ads__creative_report account_name 122. model.linkedin_source.stg_linkedin_ads__account_history:f0->120. model.linkedin.linkedin_ads__creative_report:f0 118. model.linkedin.linkedin_ads__campaign_group_report 118. model.linkedin.linkedin_ads__campaign_group_report account_name 122. model.linkedin_source.stg_linkedin_ads__account_history:f0->118. model.linkedin.linkedin_ads__campaign_group_report:f0 121. model.linkedin.linkedin_ads__url_report 121. model.linkedin.linkedin_ads__url_report account_name 122. model.linkedin_source.stg_linkedin_ads__account_history:f0->121. model.linkedin.linkedin_ads__url_report:f0 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report account_name 122. model.linkedin_source.stg_linkedin_ads__account_history:f0->119. model.linkedin.linkedin_ads__campaign_report:f0 117. model.linkedin.linkedin_ads__account_report 117. model.linkedin.linkedin_ads__account_report account_name 122. model.linkedin_source.stg_linkedin_ads__account_history:f0->117. model.linkedin.linkedin_ads__account_report:f0
122. model.linkedin_source.stg_linkedin_ads__account_history
  • Input Column: 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp[name]
    • Direct The column is directly copied
    • Output Columns:
      • account_name: Directly mapped to account_name
117. model.linkedin.linkedin_ads__account_report
  • Input Column: 122. model.linkedin_source.stg_linkedin_ads__account_history[account_name]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • account_name: Directly copied to the output
118. model.linkedin.linkedin_ads__campaign_group_report
  • Input Column: 122. model.linkedin_source.stg_linkedin_ads__account_history[account_name]
    • Direct directly copied to the output
    • Output Columns:
      • account_name: directly copied
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 122. model.linkedin_source.stg_linkedin_ads__account_history[account_name]
    • Direct copied directly to the output
    • Output Columns:
      • account_name: directly copied
120. model.linkedin.linkedin_ads__creative_report
  • Input Column: 122. model.linkedin_source.stg_linkedin_ads__account_history[account_name]
    • Direct directly copied to the output
    • Output Columns:
      • account_name: directly copied
121. model.linkedin.linkedin_ads__url_report
  • Input Column: 122. model.linkedin_source.stg_linkedin_ads__account_history[account_name]
    • Direct directly copied to the output
    • Output Columns:
      • account_name: directly copied
Column Lineage
%3 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp currency 122. model.linkedin_source.stg_linkedin_ads__account_history 122. model.linkedin_source.stg_linkedin_ads__account_history currency 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp:f0->122. model.linkedin_source.stg_linkedin_ads__account_history:f0 120. model.linkedin.linkedin_ads__creative_report 120. model.linkedin.linkedin_ads__creative_report currency 122. model.linkedin_source.stg_linkedin_ads__account_history:f0->120. model.linkedin.linkedin_ads__creative_report:f0 118. model.linkedin.linkedin_ads__campaign_group_report 118. model.linkedin.linkedin_ads__campaign_group_report currency 122. model.linkedin_source.stg_linkedin_ads__account_history:f0->118. model.linkedin.linkedin_ads__campaign_group_report:f0 121. model.linkedin.linkedin_ads__url_report 121. model.linkedin.linkedin_ads__url_report currency 122. model.linkedin_source.stg_linkedin_ads__account_history:f0->121. model.linkedin.linkedin_ads__url_report:f0 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report currency 122. model.linkedin_source.stg_linkedin_ads__account_history:f0->119. model.linkedin.linkedin_ads__campaign_report:f0 117. model.linkedin.linkedin_ads__account_report 117. model.linkedin.linkedin_ads__account_report currency 122. model.linkedin_source.stg_linkedin_ads__account_history:f0->117. model.linkedin.linkedin_ads__account_report:f0
122. model.linkedin_source.stg_linkedin_ads__account_history
  • Input Column: 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp[currency]
    • Direct The column is directly copied
    • Output Columns:
      • currency: Directly mapped to currency
117. model.linkedin.linkedin_ads__account_report
  • Input Column: 122. model.linkedin_source.stg_linkedin_ads__account_history[currency]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • currency: Directly copied to the output
118. model.linkedin.linkedin_ads__campaign_group_report
  • Input Column: 122. model.linkedin_source.stg_linkedin_ads__account_history[currency]
    • Direct directly copied to the output
    • Output Columns:
      • currency: directly copied
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 122. model.linkedin_source.stg_linkedin_ads__account_history[currency]
    • Direct copied directly to the output
    • Output Columns:
      • currency: directly copied
120. model.linkedin.linkedin_ads__creative_report
  • Input Column: 122. model.linkedin_source.stg_linkedin_ads__account_history[currency]
    • Direct directly copied to the output
    • Output Columns:
      • currency: directly copied
121. model.linkedin.linkedin_ads__url_report
  • Input Column: 122. model.linkedin_source.stg_linkedin_ads__account_history[currency]
    • Direct directly copied to the output
    • Output Columns:
      • currency: directly copied
Column Lineage
%3 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp version_tag 122. model.linkedin_source.stg_linkedin_ads__account_history 122. model.linkedin_source.stg_linkedin_ads__account_history version_tag 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp:f0->122. model.linkedin_source.stg_linkedin_ads__account_history:f0 117. model.linkedin.linkedin_ads__account_report 117. model.linkedin.linkedin_ads__account_report version_tag 122. model.linkedin_source.stg_linkedin_ads__account_history:f0->117. model.linkedin.linkedin_ads__account_report:f0
122. model.linkedin_source.stg_linkedin_ads__account_history
  • Input Column: 123. model.linkedin_source.stg_linkedin_ads__account_history_tmp[version_tag]
    • Cleaning Cast to DECIMAL datatype
    • Output Columns:
      • version_tag: Mapped after casting to DECIMAL
117. model.linkedin.linkedin_ads__account_report
  • Input Column: 122. model.linkedin_source.stg_linkedin_ads__account_history[version_tag]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • version_tag: Directly copied to the output
124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign

This SQL query performs data cleaning and featurization on LinkedIn ads analytics data. It casts various fields to specific data types, truncates the 'day' field to represent only the date, and calculates or transforms several metrics such as cost, conversion value, and lead counts. The query also adds a source_relation field and renames some columns for clarity.

CleaningFeaturization
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_linkedin_ads_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp
), macro AS (
  SELECT
    CAST(NULL AS INT) AS campaign_id,
    CAST(NULL AS INT) AS clicks,
    CAST(NULL AS DECIMAL(28, 6)) AS cost_in_local_currency,
    CAST(NULL AS DECIMAL(28, 6)) AS cost_in_usd,
    CAST(NULL AS TIMESTAMP) AS day,
    CAST(NULL AS INT) AS impressions,
    CAST(NULL AS DECIMAL(28, 6)) AS conversion_value_in_local_currency,
    CAST(NULL AS TEXT) AS external_website_conversions,
    CAST(NULL AS TEXT) AS one_click_leads,
    CAST('' AS TEXT) AS source_relation
  FROM base
), fields AS (
  SELECT
    source_relation,
    DATE_TRUNC('DAY', day) AS date_day,
    campaign_id,
    clicks,
    impressions,
    cost_in_usd AS cost,
    COALESCE(CAST(conversion_value_in_local_currency AS FLOAT), 0) AS conversion_value_in_local_currency,
    COALESCE(CAST(external_website_conversions AS BIGINT), 0) AS external_website_conversions,
    COALESCE(CAST(one_click_leads AS BIGINT), 0) AS one_click_leads
  FROM macro
)
SELECT
  *
FROM fields
%3 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign source_relation campaign_id date_day clicks impressions cost conversion_value_in_local_currency external_website_conversions one_click_leads 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp campaign_id day clicks conversion_value_in_local_currency cost_in_usd external_website_conversions impressions one_click_leads 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp:f0->124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f1 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp:f1->124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f2 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp:f2->124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f3 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp:f3->124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f6 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp:f4->124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f5 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp:f5->124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f7 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp:f6->124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f4 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp:f7->124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f8
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
campaign_id integer The ID of the related creative.
date_day timestamp without time zone The day of the activity.
clicks integer The count of chargeable clicks.
impressions integer This is the count of "impressions" for Direct Ads and Sponsored Updates and "sends" for InMails.
cost double precision The cost of the ads in the local currency or USD.
conversion_value_in_local_currency double precision The value generated by your conversions, displayed in your LinkedIn account's local currency.
external_website_conversions bigint The actions taken on your website that you've defined as valuable to your business after clicking on LinkedIn ads
one_click_leads bigint Leads submitted after clicking on LinkedIn ads.
Column Lineage
%3 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign source_relation 118. model.linkedin.linkedin_ads__campaign_group_report 118. model.linkedin.linkedin_ads__campaign_group_report source_relation 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->118. model.linkedin.linkedin_ads__campaign_group_report:f0 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report source_relation 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->119. model.linkedin.linkedin_ads__campaign_report:f0 117. model.linkedin.linkedin_ads__account_report 117. model.linkedin.linkedin_ads__account_report source_relation 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->117. model.linkedin.linkedin_ads__account_report:f0
117. model.linkedin.linkedin_ads__account_report
  • Input Column: 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with campaign and account tables
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
118. model.linkedin.linkedin_ads__campaign_group_report
  • Input Column: 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the JOIN conditions
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join conditions with other tables
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
Column Lineage
%3 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp campaign_id 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign campaign_id 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp:f0->124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report campaign_id 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->119. model.linkedin.linkedin_ads__campaign_report:f0
124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign
  • Input Column: 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp[campaign_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to INT type
    • Output Columns:
      • campaign_id: Directly mapped after casting to INT
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign[campaign_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with the campaign table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • campaign_id: Directly copied to the output
Column Lineage
%3 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp day 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign date_day 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp:f0->124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0 118. model.linkedin.linkedin_ads__campaign_group_report 118. model.linkedin.linkedin_ads__campaign_group_report date_day 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->118. model.linkedin.linkedin_ads__campaign_group_report:f0 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report date_day 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->119. model.linkedin.linkedin_ads__campaign_report:f0 117. model.linkedin.linkedin_ads__account_report 117. model.linkedin.linkedin_ads__account_report date_day 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->117. model.linkedin.linkedin_ads__account_report:f0
124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign
  • Input Column: 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp[day]
    • Cleaning The column is cast to TIMESTAMP type and then truncated to day
    • Featurization The date is extracted from this column
    • Output Columns:
      • date_day: Mapped after casting to TIMESTAMP and truncating to day
117. model.linkedin.linkedin_ads__account_report
  • Input Column: 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
118. model.linkedin.linkedin_ads__campaign_group_report
  • Input Column: 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp clicks 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign clicks 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp:f0->124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0 118. model.linkedin.linkedin_ads__campaign_group_report 118. model.linkedin.linkedin_ads__campaign_group_report clicks 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->118. model.linkedin.linkedin_ads__campaign_group_report:f0 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report clicks 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->119. model.linkedin.linkedin_ads__campaign_report:f0 117. model.linkedin.linkedin_ads__account_report 117. model.linkedin.linkedin_ads__account_report clicks 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->117. model.linkedin.linkedin_ads__account_report:f0
124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign
  • Input Column: 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp[clicks]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to INT type
    • Output Columns:
      • clicks: Directly mapped after casting to INT
117. model.linkedin.linkedin_ads__account_report
  • Input Column: 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign[clicks]
    • Aggregation Summed up in the final SELECT statement
    • Output Columns:
      • clicks: Aggregated sum of clicks
118. model.linkedin.linkedin_ads__campaign_group_report
  • Input Column: 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign[clicks]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • clicks: Aggregated sum of clicks
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign[clicks]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • clicks: Aggregated sum in the output
Column Lineage
%3 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp impressions 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign impressions 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp:f0->124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0 118. model.linkedin.linkedin_ads__campaign_group_report 118. model.linkedin.linkedin_ads__campaign_group_report impressions 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->118. model.linkedin.linkedin_ads__campaign_group_report:f0 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report impressions 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->119. model.linkedin.linkedin_ads__campaign_report:f0 117. model.linkedin.linkedin_ads__account_report 117. model.linkedin.linkedin_ads__account_report impressions 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->117. model.linkedin.linkedin_ads__account_report:f0
124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign
  • Input Column: 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp[impressions]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to INT type
    • Output Columns:
      • impressions: Directly mapped
117. model.linkedin.linkedin_ads__account_report
  • Input Column: 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign[impressions]
    • Aggregation Summed up in the final SELECT statement
    • Output Columns:
      • impressions: Aggregated sum of impressions
118. model.linkedin.linkedin_ads__campaign_group_report
  • Input Column: 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign[impressions]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • impressions: Aggregated sum of impressions
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign[impressions]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • impressions: Aggregated sum in the output
Column Lineage
%3 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp cost_in_usd 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign cost 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp:f0->124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0 118. model.linkedin.linkedin_ads__campaign_group_report 118. model.linkedin.linkedin_ads__campaign_group_report cost 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->118. model.linkedin.linkedin_ads__campaign_group_report:f0 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report cost 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->119. model.linkedin.linkedin_ads__campaign_report:f0 117. model.linkedin.linkedin_ads__account_report 117. model.linkedin.linkedin_ads__account_report cost 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->117. model.linkedin.linkedin_ads__account_report:f0
124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign
  • Input Column: 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp[cost_in_usd]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • cost: Directly mapped and renamed
117. model.linkedin.linkedin_ads__account_report
  • Input Column: 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign[cost]
    • Aggregation Summed up in the final SELECT statement
    • Output Columns:
      • cost: Aggregated sum of cost
118. model.linkedin.linkedin_ads__campaign_group_report
  • Input Column: 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign[cost]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • cost: Aggregated sum of cost
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign[cost]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • cost: Aggregated sum in the output
Column Lineage
%3 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp conversion_value_in_local_currency 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign conversion_value_in_local_currency 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp:f0->124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0 118. model.linkedin.linkedin_ads__campaign_group_report 118. model.linkedin.linkedin_ads__campaign_group_report conversion_value_in_local_currency 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->118. model.linkedin.linkedin_ads__campaign_group_report:f0 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report conversion_value_in_local_currency 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->119. model.linkedin.linkedin_ads__campaign_report:f0 117. model.linkedin.linkedin_ads__account_report 117. model.linkedin.linkedin_ads__account_report conversion_value_in_local_currency 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->117. model.linkedin.linkedin_ads__account_report:f0
124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign
  • Input Column: 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp[conversion_value_in_local_currency]
    • Cleaning The column is cast to FLOAT and coalesced with 0 if NULL
    • Output Columns:
      • conversion_value_in_local_currency: Directly mapped after cleaning
117. model.linkedin.linkedin_ads__account_report
  • Input Column: 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign[conversion_value_in_local_currency]
    • Cleaning COALESCE is used to replace NULL values with 0
    • Aggregation Summed up in the final SELECT statement
    • Output Columns:
      • conversion_value_in_local_currency: Aggregated sum of conversion value
118. model.linkedin.linkedin_ads__campaign_group_report
  • Input Column: 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign[conversion_value_in_local_currency]
    • Cleaning COALESCE is used to replace NULL values with 0
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • conversion_value_in_local_currency: Aggregated sum of conversion value
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign[conversion_value_in_local_currency]
    • Aggregation The column is summed up in the final SELECT statement
    • Cleaning COALESCE is used to replace NULL values with 0
    • Output Columns:
      • conversion_value_in_local_currency: Aggregated sum in the output
Column Lineage
%3 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp external_website_conversions 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign external_website_conversions 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp:f0->124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0 118. model.linkedin.linkedin_ads__campaign_group_report 118. model.linkedin.linkedin_ads__campaign_group_report external_website_conversions total_conversions 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->118. model.linkedin.linkedin_ads__campaign_group_report:f0 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->118. model.linkedin.linkedin_ads__campaign_group_report:f1 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report external_website_conversions total_conversions 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->119. model.linkedin.linkedin_ads__campaign_report:f0 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->119. model.linkedin.linkedin_ads__campaign_report:f1 117. model.linkedin.linkedin_ads__account_report 117. model.linkedin.linkedin_ads__account_report external_website_conversions total_conversions 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->117. model.linkedin.linkedin_ads__account_report:f0 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->117. model.linkedin.linkedin_ads__account_report:f1
124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign
  • Input Column: 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp[external_website_conversions]
    • Cleaning The column is cast to BIGINT and coalesced with 0 if NULL
    • Output Columns:
      • external_website_conversions: Directly mapped after cleaning
117. model.linkedin.linkedin_ads__account_report
  • Input Column: 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign[external_website_conversions]
    • Cleaning COALESCE is used to replace NULL values with 0
    • Aggregation Summed up in the final SELECT statement
    • Featurization Used to calculate total_conversions
    • Output Columns:
      • external_website_conversions: Aggregated sum of external website conversions
      • total_conversions: Part of the calculation for total conversions
118. model.linkedin.linkedin_ads__campaign_group_report
  • Input Column: 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign[external_website_conversions]
    • Featurization Used to calculate total_conversions
    • Cleaning COALESCE is used to replace NULL values with 0
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • external_website_conversions: Aggregated sum of external website conversions
      • total_conversions: Part of the calculation for total_conversions
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign[external_website_conversions]
    • Aggregation The column is summed up in the final SELECT statement
    • Cleaning COALESCE is used to replace NULL values with 0
    • Featurization Used to calculate total_conversions
    • Output Columns:
      • external_website_conversions: Aggregated sum in the output
      • total_conversions: Part of the calculation for this new feature
Column Lineage
%3 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp one_click_leads 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign one_click_leads 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp:f0->124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0 118. model.linkedin.linkedin_ads__campaign_group_report 118. model.linkedin.linkedin_ads__campaign_group_report one_click_leads total_conversions 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->118. model.linkedin.linkedin_ads__campaign_group_report:f0 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->118. model.linkedin.linkedin_ads__campaign_group_report:f1 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report one_click_leads total_conversions 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->119. model.linkedin.linkedin_ads__campaign_report:f0 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->119. model.linkedin.linkedin_ads__campaign_report:f1 117. model.linkedin.linkedin_ads__account_report 117. model.linkedin.linkedin_ads__account_report one_click_leads total_conversions 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->117. model.linkedin.linkedin_ads__account_report:f0 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->117. model.linkedin.linkedin_ads__account_report:f1
124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign
  • Input Column: 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp[one_click_leads]
    • Cleaning The column is cast to BIGINT type and coalesced with 0
    • Output Columns:
      • one_click_leads: Transformed and mapped
117. model.linkedin.linkedin_ads__account_report
  • Input Column: 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign[one_click_leads]
    • Cleaning COALESCE is used to replace NULL values with 0
    • Aggregation Summed up in the final SELECT statement
    • Featurization Used to calculate total_conversions
    • Output Columns:
      • one_click_leads: Aggregated sum of one-click leads
      • total_conversions: Part of the calculation for total conversions
118. model.linkedin.linkedin_ads__campaign_group_report
  • Input Column: 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign[one_click_leads]
    • Featurization Used to calculate total_conversions
    • Cleaning COALESCE is used to replace NULL values with 0
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • one_click_leads: Aggregated sum of one-click leads
      • total_conversions: Part of the calculation for total_conversions
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign[one_click_leads]
    • Aggregation The column is summed up in the final SELECT statement
    • Cleaning COALESCE is used to replace NULL values with 0
    • Featurization Used to calculate total_conversions
    • Output Columns:
      • one_click_leads: Aggregated sum in the output
      • total_conversions: Part of the calculation for this new feature
125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of type TEXT, which is set to NULL. The LIMIT 0 clause ensures no rows are returned. This appears to be a template or placeholder query, possibly used for schema definition or testing purposes in a dbt (data build tool) project.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp campaign_id day _fivetran_synced action_clicks ad_unit_clicks approximate_unique_impressions card_clicks card_impressions clicks comment_likes comments company_page_clicks conversion_value_in_local_currency cost_in_local_currency cost_in_usd external_website_conversions external_website_post_click_conversions external_website_post_view_conversions follows full_screen_plays impressions landing_page_clicks lead_generation_mail_contact_info_shares lead_generation_mail_interested_clicks likes one_click_lead_form_opens one_click_leads opens other_engagements shares text_url_clicks total_engagements video_completions video_first_quartile_completions video_midpoint_completions video_starts video_third_quartile_completions video_views viral_card_clicks viral_card_impressions viral_clicks viral_comment_likes viral_comments viral_company_page_clicks viral_external_website_conversions viral_external_website_post_click_conversions viral_external_website_post_view_conversions viral_follows viral_full_screen_plays viral_impressions viral_landing_page_clicks viral_likes viral_one_click_lead_form_opens viral_one_click_leads viral_other_engagements viral_shares viral_total_engagements viral_video_completions viral_video_first_quartile_completions viral_video_midpoint_completions viral_video_starts viral_video_third_quartile_completions viral_video_views 317. source.linkedin_source.linkedin_ads.ad_analytics_by_campaign 317. source.linkedin_source.linkedin_ads.ad_analytics_by_campaign
Name Type Comment
campaign_id integer None
day timestamp without time zone None
_fivetran_synced text None
action_clicks integer None
ad_unit_clicks integer None
approximate_unique_impressions integer None
card_clicks integer None
card_impressions integer None
clicks integer None
comment_likes integer None
comments integer None
company_page_clicks integer None
conversion_value_in_local_currency integer None
cost_in_local_currency double precision None
cost_in_usd double precision None
external_website_conversions integer None
external_website_post_click_conversions integer None
external_website_post_view_conversions integer None
follows integer None
full_screen_plays integer None
impressions integer None
landing_page_clicks integer None
lead_generation_mail_contact_info_shares integer None
lead_generation_mail_interested_clicks integer None
likes integer None
one_click_lead_form_opens integer None
one_click_leads integer None
opens integer None
other_engagements integer None
shares integer None
text_url_clicks integer None
total_engagements integer None
video_completions integer None
video_first_quartile_completions integer None
video_midpoint_completions integer None
video_starts integer None
video_third_quartile_completions integer None
video_views integer None
viral_card_clicks integer None
viral_card_impressions integer None
viral_clicks integer None
viral_comment_likes integer None
viral_comments integer None
viral_company_page_clicks integer None
viral_external_website_conversions integer None
viral_external_website_post_click_conversions integer None
viral_external_website_post_view_conversions integer None
viral_follows integer None
viral_full_screen_plays integer None
viral_impressions integer None
viral_landing_page_clicks integer None
viral_likes integer None
viral_one_click_lead_form_opens integer None
viral_one_click_leads integer None
viral_other_engagements integer None
viral_shares integer None
viral_total_engagements integer None
viral_video_completions integer None
viral_video_first_quartile_completions integer None
viral_video_midpoint_completions integer None
viral_video_starts integer None
viral_video_third_quartile_completions integer None
viral_video_views integer None
Column Lineage
%3 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp campaign_id 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign campaign_id 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp:f0->124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report campaign_id 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->119. model.linkedin.linkedin_ads__campaign_report:f0
124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign
  • Input Column: 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp[campaign_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to INT type
    • Output Columns:
      • campaign_id: Directly mapped after casting to INT
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign[campaign_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with the campaign table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • campaign_id: Directly copied to the output
Column Lineage
%3 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp day 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign date_day 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp:f0->124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0 118. model.linkedin.linkedin_ads__campaign_group_report 118. model.linkedin.linkedin_ads__campaign_group_report date_day 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->118. model.linkedin.linkedin_ads__campaign_group_report:f0 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report date_day 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->119. model.linkedin.linkedin_ads__campaign_report:f0 117. model.linkedin.linkedin_ads__account_report 117. model.linkedin.linkedin_ads__account_report date_day 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->117. model.linkedin.linkedin_ads__account_report:f0
124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign
  • Input Column: 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp[day]
    • Cleaning The column is cast to TIMESTAMP type and then truncated to day
    • Featurization The date is extracted from this column
    • Output Columns:
      • date_day: Mapped after casting to TIMESTAMP and truncating to day
117. model.linkedin.linkedin_ads__account_report
  • Input Column: 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
118. model.linkedin.linkedin_ads__campaign_group_report
  • Input Column: 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp clicks 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign clicks 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp:f0->124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0 118. model.linkedin.linkedin_ads__campaign_group_report 118. model.linkedin.linkedin_ads__campaign_group_report clicks 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->118. model.linkedin.linkedin_ads__campaign_group_report:f0 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report clicks 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->119. model.linkedin.linkedin_ads__campaign_report:f0 117. model.linkedin.linkedin_ads__account_report 117. model.linkedin.linkedin_ads__account_report clicks 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->117. model.linkedin.linkedin_ads__account_report:f0
124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign
  • Input Column: 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp[clicks]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to INT type
    • Output Columns:
      • clicks: Directly mapped after casting to INT
117. model.linkedin.linkedin_ads__account_report
  • Input Column: 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign[clicks]
    • Aggregation Summed up in the final SELECT statement
    • Output Columns:
      • clicks: Aggregated sum of clicks
118. model.linkedin.linkedin_ads__campaign_group_report
  • Input Column: 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign[clicks]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • clicks: Aggregated sum of clicks
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign[clicks]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • clicks: Aggregated sum in the output
Column Lineage
%3 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp conversion_value_in_local_currency 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign conversion_value_in_local_currency 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp:f0->124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0 118. model.linkedin.linkedin_ads__campaign_group_report 118. model.linkedin.linkedin_ads__campaign_group_report conversion_value_in_local_currency 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->118. model.linkedin.linkedin_ads__campaign_group_report:f0 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report conversion_value_in_local_currency 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->119. model.linkedin.linkedin_ads__campaign_report:f0 117. model.linkedin.linkedin_ads__account_report 117. model.linkedin.linkedin_ads__account_report conversion_value_in_local_currency 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->117. model.linkedin.linkedin_ads__account_report:f0
124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign
  • Input Column: 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp[conversion_value_in_local_currency]
    • Cleaning The column is cast to FLOAT and coalesced with 0 if NULL
    • Output Columns:
      • conversion_value_in_local_currency: Directly mapped after cleaning
117. model.linkedin.linkedin_ads__account_report
  • Input Column: 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign[conversion_value_in_local_currency]
    • Cleaning COALESCE is used to replace NULL values with 0
    • Aggregation Summed up in the final SELECT statement
    • Output Columns:
      • conversion_value_in_local_currency: Aggregated sum of conversion value
118. model.linkedin.linkedin_ads__campaign_group_report
  • Input Column: 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign[conversion_value_in_local_currency]
    • Cleaning COALESCE is used to replace NULL values with 0
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • conversion_value_in_local_currency: Aggregated sum of conversion value
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign[conversion_value_in_local_currency]
    • Aggregation The column is summed up in the final SELECT statement
    • Cleaning COALESCE is used to replace NULL values with 0
    • Output Columns:
      • conversion_value_in_local_currency: Aggregated sum in the output
Column Lineage
%3 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp cost_in_usd 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign cost 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp:f0->124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0 118. model.linkedin.linkedin_ads__campaign_group_report 118. model.linkedin.linkedin_ads__campaign_group_report cost 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->118. model.linkedin.linkedin_ads__campaign_group_report:f0 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report cost 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->119. model.linkedin.linkedin_ads__campaign_report:f0 117. model.linkedin.linkedin_ads__account_report 117. model.linkedin.linkedin_ads__account_report cost 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->117. model.linkedin.linkedin_ads__account_report:f0
124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign
  • Input Column: 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp[cost_in_usd]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • cost: Directly mapped and renamed
117. model.linkedin.linkedin_ads__account_report
  • Input Column: 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign[cost]
    • Aggregation Summed up in the final SELECT statement
    • Output Columns:
      • cost: Aggregated sum of cost
118. model.linkedin.linkedin_ads__campaign_group_report
  • Input Column: 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign[cost]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • cost: Aggregated sum of cost
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign[cost]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • cost: Aggregated sum in the output
Column Lineage
%3 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp external_website_conversions 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign external_website_conversions 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp:f0->124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0 118. model.linkedin.linkedin_ads__campaign_group_report 118. model.linkedin.linkedin_ads__campaign_group_report external_website_conversions total_conversions 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->118. model.linkedin.linkedin_ads__campaign_group_report:f0 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->118. model.linkedin.linkedin_ads__campaign_group_report:f1 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report external_website_conversions total_conversions 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->119. model.linkedin.linkedin_ads__campaign_report:f0 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->119. model.linkedin.linkedin_ads__campaign_report:f1 117. model.linkedin.linkedin_ads__account_report 117. model.linkedin.linkedin_ads__account_report external_website_conversions total_conversions 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->117. model.linkedin.linkedin_ads__account_report:f0 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->117. model.linkedin.linkedin_ads__account_report:f1
124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign
  • Input Column: 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp[external_website_conversions]
    • Cleaning The column is cast to BIGINT and coalesced with 0 if NULL
    • Output Columns:
      • external_website_conversions: Directly mapped after cleaning
117. model.linkedin.linkedin_ads__account_report
  • Input Column: 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign[external_website_conversions]
    • Cleaning COALESCE is used to replace NULL values with 0
    • Aggregation Summed up in the final SELECT statement
    • Featurization Used to calculate total_conversions
    • Output Columns:
      • external_website_conversions: Aggregated sum of external website conversions
      • total_conversions: Part of the calculation for total conversions
118. model.linkedin.linkedin_ads__campaign_group_report
  • Input Column: 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign[external_website_conversions]
    • Featurization Used to calculate total_conversions
    • Cleaning COALESCE is used to replace NULL values with 0
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • external_website_conversions: Aggregated sum of external website conversions
      • total_conversions: Part of the calculation for total_conversions
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign[external_website_conversions]
    • Aggregation The column is summed up in the final SELECT statement
    • Cleaning COALESCE is used to replace NULL values with 0
    • Featurization Used to calculate total_conversions
    • Output Columns:
      • external_website_conversions: Aggregated sum in the output
      • total_conversions: Part of the calculation for this new feature
Column Lineage
%3 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp impressions 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign impressions 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp:f0->124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0 118. model.linkedin.linkedin_ads__campaign_group_report 118. model.linkedin.linkedin_ads__campaign_group_report impressions 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->118. model.linkedin.linkedin_ads__campaign_group_report:f0 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report impressions 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->119. model.linkedin.linkedin_ads__campaign_report:f0 117. model.linkedin.linkedin_ads__account_report 117. model.linkedin.linkedin_ads__account_report impressions 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->117. model.linkedin.linkedin_ads__account_report:f0
124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign
  • Input Column: 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp[impressions]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to INT type
    • Output Columns:
      • impressions: Directly mapped
117. model.linkedin.linkedin_ads__account_report
  • Input Column: 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign[impressions]
    • Aggregation Summed up in the final SELECT statement
    • Output Columns:
      • impressions: Aggregated sum of impressions
118. model.linkedin.linkedin_ads__campaign_group_report
  • Input Column: 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign[impressions]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • impressions: Aggregated sum of impressions
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign[impressions]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • impressions: Aggregated sum in the output
Column Lineage
%3 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp one_click_leads 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign one_click_leads 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp:f0->124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0 118. model.linkedin.linkedin_ads__campaign_group_report 118. model.linkedin.linkedin_ads__campaign_group_report one_click_leads total_conversions 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->118. model.linkedin.linkedin_ads__campaign_group_report:f0 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->118. model.linkedin.linkedin_ads__campaign_group_report:f1 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report one_click_leads total_conversions 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->119. model.linkedin.linkedin_ads__campaign_report:f0 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->119. model.linkedin.linkedin_ads__campaign_report:f1 117. model.linkedin.linkedin_ads__account_report 117. model.linkedin.linkedin_ads__account_report one_click_leads total_conversions 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->117. model.linkedin.linkedin_ads__account_report:f0 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign:f0->117. model.linkedin.linkedin_ads__account_report:f1
124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign
  • Input Column: 125. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign_tmp[one_click_leads]
    • Cleaning The column is cast to BIGINT type and coalesced with 0
    • Output Columns:
      • one_click_leads: Transformed and mapped
117. model.linkedin.linkedin_ads__account_report
  • Input Column: 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign[one_click_leads]
    • Cleaning COALESCE is used to replace NULL values with 0
    • Aggregation Summed up in the final SELECT statement
    • Featurization Used to calculate total_conversions
    • Output Columns:
      • one_click_leads: Aggregated sum of one-click leads
      • total_conversions: Part of the calculation for total conversions
118. model.linkedin.linkedin_ads__campaign_group_report
  • Input Column: 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign[one_click_leads]
    • Featurization Used to calculate total_conversions
    • Cleaning COALESCE is used to replace NULL values with 0
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • one_click_leads: Aggregated sum of one-click leads
      • total_conversions: Part of the calculation for total_conversions
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 124. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_campaign[one_click_leads]
    • Aggregation The column is summed up in the final SELECT statement
    • Cleaning COALESCE is used to replace NULL values with 0
    • Featurization Used to calculate total_conversions
    • Output Columns:
      • one_click_leads: Aggregated sum in the output
      • total_conversions: Part of the calculation for this new feature
126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative

This SQL query stages data from a LinkedIn Ads source table. It performs type casting, date truncation, and column renaming. The query also applies COALESCE functions to handle potential NULL values in certain columns, converting them to default values (0 for numeric columns). The final SELECT statement retrieves all columns from the 'fields' CTE.

CleaningFeaturization
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_linkedin_ads_source.stg_linkedin_ads__ad_analytics_by_creative_tmp
), macro AS (
  SELECT
    CAST(NULL AS INT) AS clicks,
    CAST(NULL AS DECIMAL(28, 6)) AS cost_in_local_currency,
    CAST(NULL AS DECIMAL(28, 6)) AS cost_in_usd,
    CAST(NULL AS INT) AS creative_id,
    CAST(NULL AS TIMESTAMP) AS day,
    CAST(NULL AS INT) AS impressions,
    CAST(NULL AS DECIMAL(28, 6)) AS conversion_value_in_local_currency,
    CAST(NULL AS TEXT) AS external_website_conversions,
    CAST(NULL AS TEXT) AS one_click_leads,
    CAST('' AS TEXT) AS source_relation
  FROM base
), fields AS (
  SELECT
    source_relation,
    DATE_TRUNC('DAY', day) AS date_day,
    creative_id,
    clicks,
    impressions,
    cost_in_usd AS cost,
    COALESCE(CAST(conversion_value_in_local_currency AS FLOAT), 0) AS conversion_value_in_local_currency,
    COALESCE(CAST(external_website_conversions AS BIGINT), 0) AS external_website_conversions,
    COALESCE(CAST(one_click_leads AS BIGINT), 0) AS one_click_leads
  FROM macro
)
SELECT
  *
FROM fields
%3 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative source_relation creative_id date_day clicks impressions cost conversion_value_in_local_currency external_website_conversions one_click_leads 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp creative_id day clicks impressions cost_in_usd 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp:f0->126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f1 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp:f1->126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f2 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp:f2->126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f3 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp:f3->126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f4 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp:f4->126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f5
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
creative_id integer The ID of the related creative.
date_day timestamp without time zone The day of the activity.
clicks integer The count of chargeable clicks.
impressions integer This is the count of "impressions" for Direct Ads and Sponsored Updates and "sends" for InMails.
cost integer The cost of the ads in the local currency or USD.
conversion_value_in_local_currency double precision The value generated by your conversions, displayed in your LinkedIn account's local currency.
external_website_conversions bigint The actions taken on your website that you've defined as valuable to your business after clicking on LinkedIn ads
one_click_leads bigint Leads submitted after clicking on LinkedIn ads.
Column Lineage
%3 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative source_relation 120. model.linkedin.linkedin_ads__creative_report 120. model.linkedin.linkedin_ads__creative_report source_relation 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f0->120. model.linkedin.linkedin_ads__creative_report:f0 121. model.linkedin.linkedin_ads__url_report 121. model.linkedin.linkedin_ads__url_report source_relation 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f0->121. model.linkedin.linkedin_ads__url_report:f0
120. model.linkedin.linkedin_ads__creative_report
  • Input Column: 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the JOIN conditions with other tables
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
121. model.linkedin.linkedin_ads__url_report
  • Input Column: 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the JOIN conditions
    • Output Columns:
      • source_relation: Directly copied to the output
Column Lineage
%3 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp creative_id 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative creative_id 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp:f0->126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f0 120. model.linkedin.linkedin_ads__creative_report 120. model.linkedin.linkedin_ads__creative_report creative_id 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f0->120. model.linkedin.linkedin_ads__creative_report:f0 121. model.linkedin.linkedin_ads__url_report 121. model.linkedin.linkedin_ads__url_report creative_id 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f0->121. model.linkedin.linkedin_ads__url_report:f0
126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative
  • Input Column: 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp[creative_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT in the macro CTE
    • Output Columns:
      • creative_id: Directly mapped
120. model.linkedin.linkedin_ads__creative_report
  • Input Column: 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative[creative_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as the key to join with the creative table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • creative_id: Directly copied to the output
121. model.linkedin.linkedin_ads__url_report
  • Input Column: 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative[creative_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with the creative table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • creative_id: Directly copied to the output
Column Lineage
%3 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp day 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative date_day 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp:f0->126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f0 120. model.linkedin.linkedin_ads__creative_report 120. model.linkedin.linkedin_ads__creative_report date_day 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f0->120. model.linkedin.linkedin_ads__creative_report:f0 121. model.linkedin.linkedin_ads__url_report 121. model.linkedin.linkedin_ads__url_report date_day 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f0->121. model.linkedin.linkedin_ads__url_report:f0
126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative
  • Input Column: 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp[day]
    • Cleaning The column is cast as TIMESTAMP in the macro CTE and then truncated to day in the fields CTE
    • Output Columns:
      • date_day: Transformed to date_day using DATE_TRUNC('DAY', day)
120. model.linkedin.linkedin_ads__creative_report
  • Input Column: 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
121. model.linkedin.linkedin_ads__url_report
  • Input Column: 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp clicks 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative clicks 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp:f0->126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f0 120. model.linkedin.linkedin_ads__creative_report 120. model.linkedin.linkedin_ads__creative_report clicks 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f0->120. model.linkedin.linkedin_ads__creative_report:f0 121. model.linkedin.linkedin_ads__url_report 121. model.linkedin.linkedin_ads__url_report clicks 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f0->121. model.linkedin.linkedin_ads__url_report:f0
126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative
  • Input Column: 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp[clicks]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT in the macro CTE
    • Output Columns:
      • clicks: Directly mapped
120. model.linkedin.linkedin_ads__creative_report
  • Input Column: 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative[clicks]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • clicks: Aggregated sum in the output
121. model.linkedin.linkedin_ads__url_report
  • Input Column: 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative[clicks]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • clicks: Aggregated sum in the output
Column Lineage
%3 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp impressions 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative impressions 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp:f0->126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f0 120. model.linkedin.linkedin_ads__creative_report 120. model.linkedin.linkedin_ads__creative_report impressions 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f0->120. model.linkedin.linkedin_ads__creative_report:f0 121. model.linkedin.linkedin_ads__url_report 121. model.linkedin.linkedin_ads__url_report impressions 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f0->121. model.linkedin.linkedin_ads__url_report:f0
126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative
  • Input Column: 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp[impressions]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT in the macro CTE
    • Output Columns:
      • impressions: Directly mapped
120. model.linkedin.linkedin_ads__creative_report
  • Input Column: 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative[impressions]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • impressions: Aggregated sum in the output
121. model.linkedin.linkedin_ads__url_report
  • Input Column: 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative[impressions]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • impressions: Aggregated sum in the output
Column Lineage
%3 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp cost_in_usd 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative cost 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp:f0->126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f0 120. model.linkedin.linkedin_ads__creative_report 120. model.linkedin.linkedin_ads__creative_report cost 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f0->120. model.linkedin.linkedin_ads__creative_report:f0 121. model.linkedin.linkedin_ads__url_report 121. model.linkedin.linkedin_ads__url_report cost 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f0->121. model.linkedin.linkedin_ads__url_report:f0
126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative
  • Input Column: 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp[cost_in_usd]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as DECIMAL(28, 6) in the macro CTE
    • Output Columns:
      • cost: Directly mapped and renamed to 'cost'
120. model.linkedin.linkedin_ads__creative_report
  • Input Column: 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative[cost]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • cost: Aggregated sum in the output
121. model.linkedin.linkedin_ads__url_report
  • Input Column: 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative[cost]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • cost: Aggregated sum in the output
Column Lineage
%3 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative conversion_value_in_local_currency 120. model.linkedin.linkedin_ads__creative_report 120. model.linkedin.linkedin_ads__creative_report conversion_value_in_local_currency 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f0->120. model.linkedin.linkedin_ads__creative_report:f0 121. model.linkedin.linkedin_ads__url_report 121. model.linkedin.linkedin_ads__url_report conversion_value_in_local_currency 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f0->121. model.linkedin.linkedin_ads__url_report:f0
120. model.linkedin.linkedin_ads__creative_report
  • Input Column: 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative[conversion_value_in_local_currency]
    • Cleaning COALESCE is used to replace NULL values with 0
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • conversion_value_in_local_currency: Aggregated sum in the output
121. model.linkedin.linkedin_ads__url_report
  • Input Column: 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative[conversion_value_in_local_currency]
    • Cleaning COALESCE is used to replace NULL values with 0
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • conversion_value_in_local_currency: Aggregated sum of cleaned values in the output
Column Lineage
%3 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative external_website_conversions 120. model.linkedin.linkedin_ads__creative_report 120. model.linkedin.linkedin_ads__creative_report external_website_conversions total_conversions 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f0->120. model.linkedin.linkedin_ads__creative_report:f0 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f0->120. model.linkedin.linkedin_ads__creative_report:f1 121. model.linkedin.linkedin_ads__url_report 121. model.linkedin.linkedin_ads__url_report external_website_conversions total_conversions 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f0->121. model.linkedin.linkedin_ads__url_report:f0 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f0->121. model.linkedin.linkedin_ads__url_report:f1
120. model.linkedin.linkedin_ads__creative_report
  • Input Column: 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative[external_website_conversions]
    • Featurization Used to calculate total_conversions
    • Cleaning COALESCE is used to replace NULL values with 0
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • external_website_conversions: Aggregated sum in the output
      • total_conversions: Part of the calculation for this new feature
121. model.linkedin.linkedin_ads__url_report
  • Input Column: 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative[external_website_conversions]
    • Cleaning COALESCE is used to replace NULL values with 0
    • Aggregation The column is summed up in the final SELECT statement
    • Featurization Used to calculate total_conversions
    • Output Columns:
      • external_website_conversions: Aggregated sum of cleaned values in the output
      • total_conversions: Part of the calculation for this new feature
Column Lineage
%3 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative one_click_leads 120. model.linkedin.linkedin_ads__creative_report 120. model.linkedin.linkedin_ads__creative_report one_click_leads total_conversions 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f0->120. model.linkedin.linkedin_ads__creative_report:f0 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f0->120. model.linkedin.linkedin_ads__creative_report:f1 121. model.linkedin.linkedin_ads__url_report 121. model.linkedin.linkedin_ads__url_report one_click_leads total_conversions 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f0->121. model.linkedin.linkedin_ads__url_report:f0 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f0->121. model.linkedin.linkedin_ads__url_report:f1
120. model.linkedin.linkedin_ads__creative_report
  • Input Column: 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative[one_click_leads]
    • Featurization Used to calculate total_conversions
    • Cleaning COALESCE is used to replace NULL values with 0
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • one_click_leads: Aggregated sum in the output
      • total_conversions: Part of the calculation for this new feature
121. model.linkedin.linkedin_ads__url_report
  • Input Column: 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative[one_click_leads]
    • Cleaning COALESCE is used to replace NULL values with 0
    • Aggregation The column is summed up in the final SELECT statement
    • Featurization Used to calculate total_conversions
    • Output Columns:
      • one_click_leads: Aggregated sum of cleaned values in the output
      • total_conversions: Part of the calculation for this new feature
127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of type TEXT, which is set to NULL. The LIMIT 0 clause ensures that no rows are returned. This appears to be a template or placeholder query, possibly used for schema definition or testing purposes in a dbt (data build tool) project.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp creative_id day clicks impressions cost_in_local_currency cost_in_usd 318. source.linkedin_source.linkedin_ads.ad_analytics_by_creative 318. source.linkedin_source.linkedin_ads.ad_analytics_by_creative
Name Type Comment
creative_id integer None
day timestamp without time zone None
clicks integer None
impressions integer None
cost_in_local_currency integer None
cost_in_usd integer None
Column Lineage
%3 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp creative_id 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative creative_id 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp:f0->126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f0 120. model.linkedin.linkedin_ads__creative_report 120. model.linkedin.linkedin_ads__creative_report creative_id 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f0->120. model.linkedin.linkedin_ads__creative_report:f0 121. model.linkedin.linkedin_ads__url_report 121. model.linkedin.linkedin_ads__url_report creative_id 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f0->121. model.linkedin.linkedin_ads__url_report:f0
126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative
  • Input Column: 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp[creative_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT in the macro CTE
    • Output Columns:
      • creative_id: Directly mapped
120. model.linkedin.linkedin_ads__creative_report
  • Input Column: 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative[creative_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as the key to join with the creative table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • creative_id: Directly copied to the output
121. model.linkedin.linkedin_ads__url_report
  • Input Column: 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative[creative_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with the creative table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • creative_id: Directly copied to the output
Column Lineage
%3 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp day 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative date_day 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp:f0->126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f0 120. model.linkedin.linkedin_ads__creative_report 120. model.linkedin.linkedin_ads__creative_report date_day 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f0->120. model.linkedin.linkedin_ads__creative_report:f0 121. model.linkedin.linkedin_ads__url_report 121. model.linkedin.linkedin_ads__url_report date_day 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f0->121. model.linkedin.linkedin_ads__url_report:f0
126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative
  • Input Column: 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp[day]
    • Cleaning The column is cast as TIMESTAMP in the macro CTE and then truncated to day in the fields CTE
    • Output Columns:
      • date_day: Transformed to date_day using DATE_TRUNC('DAY', day)
120. model.linkedin.linkedin_ads__creative_report
  • Input Column: 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
121. model.linkedin.linkedin_ads__url_report
  • Input Column: 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp clicks 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative clicks 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp:f0->126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f0 120. model.linkedin.linkedin_ads__creative_report 120. model.linkedin.linkedin_ads__creative_report clicks 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f0->120. model.linkedin.linkedin_ads__creative_report:f0 121. model.linkedin.linkedin_ads__url_report 121. model.linkedin.linkedin_ads__url_report clicks 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f0->121. model.linkedin.linkedin_ads__url_report:f0
126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative
  • Input Column: 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp[clicks]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT in the macro CTE
    • Output Columns:
      • clicks: Directly mapped
120. model.linkedin.linkedin_ads__creative_report
  • Input Column: 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative[clicks]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • clicks: Aggregated sum in the output
121. model.linkedin.linkedin_ads__url_report
  • Input Column: 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative[clicks]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • clicks: Aggregated sum in the output
Column Lineage
%3 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp impressions 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative impressions 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp:f0->126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f0 120. model.linkedin.linkedin_ads__creative_report 120. model.linkedin.linkedin_ads__creative_report impressions 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f0->120. model.linkedin.linkedin_ads__creative_report:f0 121. model.linkedin.linkedin_ads__url_report 121. model.linkedin.linkedin_ads__url_report impressions 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f0->121. model.linkedin.linkedin_ads__url_report:f0
126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative
  • Input Column: 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp[impressions]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT in the macro CTE
    • Output Columns:
      • impressions: Directly mapped
120. model.linkedin.linkedin_ads__creative_report
  • Input Column: 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative[impressions]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • impressions: Aggregated sum in the output
121. model.linkedin.linkedin_ads__url_report
  • Input Column: 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative[impressions]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • impressions: Aggregated sum in the output
Column Lineage
%3 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp cost_in_usd 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative cost 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp:f0->126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f0 120. model.linkedin.linkedin_ads__creative_report 120. model.linkedin.linkedin_ads__creative_report cost 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f0->120. model.linkedin.linkedin_ads__creative_report:f0 121. model.linkedin.linkedin_ads__url_report 121. model.linkedin.linkedin_ads__url_report cost 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative:f0->121. model.linkedin.linkedin_ads__url_report:f0
126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative
  • Input Column: 127. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative_tmp[cost_in_usd]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as DECIMAL(28, 6) in the macro CTE
    • Output Columns:
      • cost: Directly mapped and renamed to 'cost'
120. model.linkedin.linkedin_ads__creative_report
  • Input Column: 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative[cost]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • cost: Aggregated sum in the output
121. model.linkedin.linkedin_ads__url_report
  • Input Column: 126. model.linkedin_source.stg_linkedin_ads__ad_analytics_by_creative[cost]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • cost: Aggregated sum in the output
128. model.linkedin_source.stg_linkedin_ads__campaign_group_history

This SQL query stages data from a LinkedIn Ads campaign group history source. It casts and renames columns, converts timestamp fields, adds a flag for the latest version of each campaign group, and prepares the data for further processing or analysis.

CleaningDeduplicationFeaturization
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_linkedin_ads_source.stg_linkedin_ads__campaign_group_history_tmp
), macro AS (
  SELECT
    CAST(NULL AS INT) AS account_id,
    CAST(NULL AS BOOLEAN) AS backfilled,
    CAST(NULL AS TIMESTAMP) AS created_time,
    CAST(NULL AS INT) AS id,
    CAST(NULL AS TIMESTAMP) AS last_modified_time,
    CAST(NULL AS TEXT) AS name,
    CAST(NULL AS TIMESTAMP) AS run_schedule_end,
    CAST(NULL AS TIMESTAMP) AS run_schedule_start,
    CAST(NULL AS TEXT) AS status,
    CAST('' AS TEXT) AS source_relation
  FROM base
), fields AS (
  SELECT
    source_relation,
    id AS campaign_group_id,
    name AS campaign_group_name,
    account_id,
    status,
    backfilled AS is_backfilled,
    CAST(run_schedule_start AS TIMESTAMP) AS run_schedule_start_at,
    CAST(run_schedule_end AS TIMESTAMP) AS run_schedule_end_at,
    CAST(last_modified_time AS TIMESTAMP) AS last_modified_at,
    CAST(created_time AS TIMESTAMP) AS created_at,
    ROW_NUMBER() OVER (PARTITION BY source_relation, id ORDER BY last_modified_time DESC) = 1 AS is_latest_version
  FROM macro
)
SELECT
  *
FROM fields
%3 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history source_relation campaign_group_id last_modified_at account_id created_at campaign_group_name is_backfilled run_schedule_start_at run_schedule_end_at status is_latest_version 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp id last_modified_time account_id created_time name 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp:f0->128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f1 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp:f1->128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f2 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp:f2->128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f3 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp:f3->128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f4 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp:f4->128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f5
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
campaign_group_id integer Unique internal ID representing the campaign group.
last_modified_at timestamp without time zone The timestamp of when the version was updated.
account_id bigint The ID of the account the campaign group belongs to.
created_at timestamp without time zone The timestamp of when the campaign group was created.
campaign_group_name text A label for the campaign group.
is_backfilled boolean Flag that denotes whether the campaign group was created organically or to backfill existing campaigns. This is a read-only field set by the system. Default = false.
run_schedule_start_at timestamp without time zone Represents the inclusive (greater than or equal to) date when to start running the associated campaigns under this campaign group. This field is required.
run_schedule_end_at timestamp without time zone Represents the exclusive (strictly less than) date when to stop running the associated campaigns under this campaign group. If this field is unset, it indicates an open range with no end date.
status text Status of campaign group. Possible values are: ACTIVE - Denotes that the campaign group is capable of serving ads, subject to run date and budget limitations (as well as any other limitations at the account or campaign level). ARCHIVED - Denotes that the campaign group is presently inactive, and should mostly be hidden in the UI until un-archived. CANCELLED - Denotes that the campaign group has been permanently canceled and cannot be reactivated. Not a settable status. DRAFT - Denotes that the campaign group is in a preliminary state and should temporarily not be served. PAUSED - Denotes that the campaign group meets all requirements to be served, but temporarily should not be. PENDING_DELETION - Denotes that the campaign group has been requested to be deleted that is currently pending. REMOVED - Denoted that the campaign group was deleted, but must remain fetchable due to the existence of performance data.
is_latest_version boolean Boolean of whether the record is the latest version of the campaign group.
Column Lineage
%3 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history source_relation 120. model.linkedin.linkedin_ads__creative_report 120. model.linkedin.linkedin_ads__creative_report source_relation 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f0->120. model.linkedin.linkedin_ads__creative_report:f0 118. model.linkedin.linkedin_ads__campaign_group_report 118. model.linkedin.linkedin_ads__campaign_group_report source_relation 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f0->118. model.linkedin.linkedin_ads__campaign_group_report:f0 121. model.linkedin.linkedin_ads__url_report 121. model.linkedin.linkedin_ads__url_report source_relation 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f0->121. model.linkedin.linkedin_ads__url_report:f0 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report source_relation 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f0->119. model.linkedin.linkedin_ads__campaign_report:f0
118. model.linkedin.linkedin_ads__campaign_group_report
  • Input Column: 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
120. model.linkedin.linkedin_ads__creative_report
  • Input Column: 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
121. model.linkedin.linkedin_ads__url_report
  • Input Column: 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
Column Lineage
%3 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp id 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history campaign_group_id 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp:f0->128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f0 120. model.linkedin.linkedin_ads__creative_report 120. model.linkedin.linkedin_ads__creative_report campaign_group_id 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f0->120. model.linkedin.linkedin_ads__creative_report:f0 118. model.linkedin.linkedin_ads__campaign_group_report 118. model.linkedin.linkedin_ads__campaign_group_report campaign_group_id 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f0->118. model.linkedin.linkedin_ads__campaign_group_report:f0 121. model.linkedin.linkedin_ads__url_report 121. model.linkedin.linkedin_ads__url_report campaign_group_id 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f0->121. model.linkedin.linkedin_ads__url_report:f0 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report campaign_group_id 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f0->119. model.linkedin.linkedin_ads__campaign_report:f0
128. model.linkedin_source.stg_linkedin_ads__campaign_group_history
  • Input Column: 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp[id]
    • Direct The column is directly copied to the output
    • Deduplication Used in the ROW_NUMBER() window function for determining the latest version
    • Output Columns:
      • campaign_group_id: Directly mapped
118. model.linkedin.linkedin_ads__campaign_group_report
  • Input Column: 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history[campaign_group_id]
    • Integration used as part of the join condition with the campaign table
    • Direct directly copied to the output
    • Aggregation used in the GROUP BY clause
    • Output Columns:
      • campaign_group_id: directly copied
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history[campaign_group_id]
    • Integration used as the key to join with the campaign table
    • Direct directly copied to the output
    • Output Columns:
      • campaign_group_id: directly copied
120. model.linkedin.linkedin_ads__creative_report
  • Input Column: 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history[campaign_group_id]
    • Integration used as the key to join with the campaign table
    • Direct directly copied to the output
    • Output Columns:
      • campaign_group_id: directly copied
121. model.linkedin.linkedin_ads__url_report
  • Input Column: 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history[campaign_group_id]
    • Integration used as the key to join with the campaign table
    • Direct directly copied to the output
    • Output Columns:
      • campaign_group_id: directly copied
Column Lineage
%3 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp last_modified_time 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history last_modified_at 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp:f0->128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f0 118. model.linkedin.linkedin_ads__campaign_group_report 118. model.linkedin.linkedin_ads__campaign_group_report last_modified_at 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f0->118. model.linkedin.linkedin_ads__campaign_group_report:f0
128. model.linkedin_source.stg_linkedin_ads__campaign_group_history
  • Input Column: 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp[last_modified_time]
    • Cleaning Cast to TIMESTAMP data type
    • Deduplication Used in the ROW_NUMBER() window function for ordering and determining the latest version
    • Output Columns:
      • last_modified_at: Mapped after casting to TIMESTAMP
118. model.linkedin.linkedin_ads__campaign_group_report
  • Input Column: 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history[last_modified_at]
    • Direct directly copied to the output
    • Aggregation used in the GROUP BY clause
    • Output Columns:
      • last_modified_at: directly copied
Column Lineage
%3 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp account_id 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history account_id 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp:f0->128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f0
128. model.linkedin_source.stg_linkedin_ads__campaign_group_history
  • Input Column: 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp[account_id]
    • Direct The column is directly copied to the output
    • Output Columns:
      • account_id: Directly mapped
Column Lineage
%3 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp created_time 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history created_at 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp:f0->128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f0 118. model.linkedin.linkedin_ads__campaign_group_report 118. model.linkedin.linkedin_ads__campaign_group_report created_at 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f0->118. model.linkedin.linkedin_ads__campaign_group_report:f0
128. model.linkedin_source.stg_linkedin_ads__campaign_group_history
  • Input Column: 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp[created_time]
    • Cleaning Cast to TIMESTAMP data type
    • Output Columns:
      • created_at: Mapped after casting to TIMESTAMP
118. model.linkedin.linkedin_ads__campaign_group_report
  • Input Column: 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history[created_at]
    • Direct directly copied to the output
    • Aggregation used in the GROUP BY clause
    • Output Columns:
      • created_at: directly copied
Column Lineage
%3 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp name 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history campaign_group_name 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp:f0->128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f0 120. model.linkedin.linkedin_ads__creative_report 120. model.linkedin.linkedin_ads__creative_report campaign_group_name 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f0->120. model.linkedin.linkedin_ads__creative_report:f0 118. model.linkedin.linkedin_ads__campaign_group_report 118. model.linkedin.linkedin_ads__campaign_group_report campaign_group_name 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f0->118. model.linkedin.linkedin_ads__campaign_group_report:f0 121. model.linkedin.linkedin_ads__url_report 121. model.linkedin.linkedin_ads__url_report campaign_group_name 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f0->121. model.linkedin.linkedin_ads__url_report:f0 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report campaign_group_name 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f0->119. model.linkedin.linkedin_ads__campaign_report:f0
128. model.linkedin_source.stg_linkedin_ads__campaign_group_history
  • Input Column: 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp[name]
    • Direct The column is directly copied to the output
    • Output Columns:
      • campaign_group_name: Directly mapped
118. model.linkedin.linkedin_ads__campaign_group_report
  • Input Column: 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history[campaign_group_name]
    • Direct directly copied to the output
    • Aggregation used in the GROUP BY clause
    • Output Columns:
      • campaign_group_name: directly copied
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history[campaign_group_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_group_name: directly copied
120. model.linkedin.linkedin_ads__creative_report
  • Input Column: 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history[campaign_group_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_group_name: directly copied
121. model.linkedin.linkedin_ads__url_report
  • Input Column: 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history[campaign_group_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_group_name: directly copied
Column Lineage
%3 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history is_backfilled 118. model.linkedin.linkedin_ads__campaign_group_report 118. model.linkedin.linkedin_ads__campaign_group_report is_backfilled 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f0->118. model.linkedin.linkedin_ads__campaign_group_report:f0
118. model.linkedin.linkedin_ads__campaign_group_report
  • Input Column: 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history[is_backfilled]
    • Direct directly copied to the output
    • Aggregation used in the GROUP BY clause
    • Output Columns:
      • is_backfilled: directly copied
Column Lineage
%3 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history run_schedule_start_at 118. model.linkedin.linkedin_ads__campaign_group_report 118. model.linkedin.linkedin_ads__campaign_group_report run_schedule_start_at 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f0->118. model.linkedin.linkedin_ads__campaign_group_report:f0
118. model.linkedin.linkedin_ads__campaign_group_report
  • Input Column: 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history[run_schedule_start_at]
    • Direct directly copied to the output
    • Aggregation used in the GROUP BY clause
    • Output Columns:
      • run_schedule_start_at: directly copied
Column Lineage
%3 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history run_schedule_end_at 118. model.linkedin.linkedin_ads__campaign_group_report 118. model.linkedin.linkedin_ads__campaign_group_report run_schedule_end_at 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f0->118. model.linkedin.linkedin_ads__campaign_group_report:f0
118. model.linkedin.linkedin_ads__campaign_group_report
  • Input Column: 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history[run_schedule_end_at]
    • Direct directly copied to the output
    • Aggregation used in the GROUP BY clause
    • Output Columns:
      • run_schedule_end_at: directly copied
Column Lineage
%3 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history status 120. model.linkedin.linkedin_ads__creative_report 120. model.linkedin.linkedin_ads__creative_report campaign_group_status 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f0->120. model.linkedin.linkedin_ads__creative_report:f0 118. model.linkedin.linkedin_ads__campaign_group_report 118. model.linkedin.linkedin_ads__campaign_group_report status 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f0->118. model.linkedin.linkedin_ads__campaign_group_report:f0 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report campaign_group_status 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f0->119. model.linkedin.linkedin_ads__campaign_report:f0
118. model.linkedin.linkedin_ads__campaign_group_report
  • Input Column: 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history[status]
    • Direct directly copied to the output
    • Aggregation used in the GROUP BY clause
    • Output Columns:
      • status: directly copied
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history[status]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_group_status: directly copied
120. model.linkedin.linkedin_ads__creative_report
  • Input Column: 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history[status]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_group_status: directly copied
129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of TEXT data type, set to NULL. The query is likely used as a placeholder or template for a staging table in a dbt (data build tool) project, specifically for LinkedIn ads campaign group history data.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp id last_modified_time account_id created_time name 319. source.linkedin_source.linkedin_ads.campaign_group_history 319. source.linkedin_source.linkedin_ads.campaign_group_history
Name Type Comment
id integer None
last_modified_time timestamp without time zone None
account_id bigint None
created_time timestamp without time zone None
name text None
Column Lineage
%3 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp id 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history campaign_group_id 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp:f0->128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f0 120. model.linkedin.linkedin_ads__creative_report 120. model.linkedin.linkedin_ads__creative_report campaign_group_id 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f0->120. model.linkedin.linkedin_ads__creative_report:f0 118. model.linkedin.linkedin_ads__campaign_group_report 118. model.linkedin.linkedin_ads__campaign_group_report campaign_group_id 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f0->118. model.linkedin.linkedin_ads__campaign_group_report:f0 121. model.linkedin.linkedin_ads__url_report 121. model.linkedin.linkedin_ads__url_report campaign_group_id 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f0->121. model.linkedin.linkedin_ads__url_report:f0 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report campaign_group_id 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f0->119. model.linkedin.linkedin_ads__campaign_report:f0
128. model.linkedin_source.stg_linkedin_ads__campaign_group_history
  • Input Column: 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp[id]
    • Direct The column is directly copied to the output
    • Deduplication Used in the ROW_NUMBER() window function for determining the latest version
    • Output Columns:
      • campaign_group_id: Directly mapped
118. model.linkedin.linkedin_ads__campaign_group_report
  • Input Column: 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history[campaign_group_id]
    • Integration used as part of the join condition with the campaign table
    • Direct directly copied to the output
    • Aggregation used in the GROUP BY clause
    • Output Columns:
      • campaign_group_id: directly copied
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history[campaign_group_id]
    • Integration used as the key to join with the campaign table
    • Direct directly copied to the output
    • Output Columns:
      • campaign_group_id: directly copied
120. model.linkedin.linkedin_ads__creative_report
  • Input Column: 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history[campaign_group_id]
    • Integration used as the key to join with the campaign table
    • Direct directly copied to the output
    • Output Columns:
      • campaign_group_id: directly copied
121. model.linkedin.linkedin_ads__url_report
  • Input Column: 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history[campaign_group_id]
    • Integration used as the key to join with the campaign table
    • Direct directly copied to the output
    • Output Columns:
      • campaign_group_id: directly copied
Column Lineage
%3 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp last_modified_time 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history last_modified_at 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp:f0->128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f0 118. model.linkedin.linkedin_ads__campaign_group_report 118. model.linkedin.linkedin_ads__campaign_group_report last_modified_at 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f0->118. model.linkedin.linkedin_ads__campaign_group_report:f0
128. model.linkedin_source.stg_linkedin_ads__campaign_group_history
  • Input Column: 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp[last_modified_time]
    • Cleaning Cast to TIMESTAMP data type
    • Deduplication Used in the ROW_NUMBER() window function for ordering and determining the latest version
    • Output Columns:
      • last_modified_at: Mapped after casting to TIMESTAMP
118. model.linkedin.linkedin_ads__campaign_group_report
  • Input Column: 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history[last_modified_at]
    • Direct directly copied to the output
    • Aggregation used in the GROUP BY clause
    • Output Columns:
      • last_modified_at: directly copied
Column Lineage
%3 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp account_id 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history account_id 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp:f0->128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f0
128. model.linkedin_source.stg_linkedin_ads__campaign_group_history
  • Input Column: 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp[account_id]
    • Direct The column is directly copied to the output
    • Output Columns:
      • account_id: Directly mapped
Column Lineage
%3 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp created_time 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history created_at 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp:f0->128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f0 118. model.linkedin.linkedin_ads__campaign_group_report 118. model.linkedin.linkedin_ads__campaign_group_report created_at 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f0->118. model.linkedin.linkedin_ads__campaign_group_report:f0
128. model.linkedin_source.stg_linkedin_ads__campaign_group_history
  • Input Column: 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp[created_time]
    • Cleaning Cast to TIMESTAMP data type
    • Output Columns:
      • created_at: Mapped after casting to TIMESTAMP
118. model.linkedin.linkedin_ads__campaign_group_report
  • Input Column: 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history[created_at]
    • Direct directly copied to the output
    • Aggregation used in the GROUP BY clause
    • Output Columns:
      • created_at: directly copied
Column Lineage
%3 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp name 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history campaign_group_name 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp:f0->128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f0 120. model.linkedin.linkedin_ads__creative_report 120. model.linkedin.linkedin_ads__creative_report campaign_group_name 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f0->120. model.linkedin.linkedin_ads__creative_report:f0 118. model.linkedin.linkedin_ads__campaign_group_report 118. model.linkedin.linkedin_ads__campaign_group_report campaign_group_name 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f0->118. model.linkedin.linkedin_ads__campaign_group_report:f0 121. model.linkedin.linkedin_ads__url_report 121. model.linkedin.linkedin_ads__url_report campaign_group_name 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f0->121. model.linkedin.linkedin_ads__url_report:f0 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report campaign_group_name 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history:f0->119. model.linkedin.linkedin_ads__campaign_report:f0
128. model.linkedin_source.stg_linkedin_ads__campaign_group_history
  • Input Column: 129. model.linkedin_source.stg_linkedin_ads__campaign_group_history_tmp[name]
    • Direct The column is directly copied to the output
    • Output Columns:
      • campaign_group_name: Directly mapped
118. model.linkedin.linkedin_ads__campaign_group_report
  • Input Column: 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history[campaign_group_name]
    • Direct directly copied to the output
    • Aggregation used in the GROUP BY clause
    • Output Columns:
      • campaign_group_name: directly copied
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history[campaign_group_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_group_name: directly copied
120. model.linkedin.linkedin_ads__creative_report
  • Input Column: 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history[campaign_group_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_group_name: directly copied
121. model.linkedin.linkedin_ads__url_report
  • Input Column: 128. model.linkedin_source.stg_linkedin_ads__campaign_group_history[campaign_group_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_group_name: directly copied
130. model.linkedin_source.stg_linkedin_ads__campaign_history

This SQL query stages data from a LinkedIn Ads campaign history source. It begins by selecting all columns from a temporary staging table, then defines a set of columns with specific data types using a CTE named 'macro'. The 'fields' CTE then selects and renames columns, casts some to appropriate data types, and adds a flag to identify the latest version of each campaign. The final SELECT statement returns all columns from the 'fields' CTE.

CleaningDeduplicationOther
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_linkedin_ads_source.stg_linkedin_ads__campaign_history_tmp
), macro AS (
  SELECT
    CAST(NULL AS INT) AS account_id,
    CAST(NULL AS BOOLEAN) AS audience_expansion_enabled,
    CAST(NULL AS INT) AS campaign_group_id,
    CAST(NULL AS TEXT) AS cost_type,
    CAST(NULL AS TIMESTAMP) AS created_time,
    CAST(NULL AS TEXT) AS creative_selection,
    CAST(NULL AS FLOAT) AS daily_budget_amount,
    CAST(NULL AS TEXT) AS daily_budget_currency_code,
    CAST(NULL AS TEXT) AS format,
    CAST(NULL AS INT) AS id,
    CAST(NULL AS TIMESTAMP) AS last_modified_time,
    CAST(NULL AS TEXT) AS locale_country,
    CAST(NULL AS TEXT) AS locale_language,
    CAST(NULL AS TEXT) AS name,
    CAST(NULL AS TEXT) AS objective_type,
    CAST(NULL AS BOOLEAN) AS offsite_delivery_enabled,
    CAST(NULL AS TEXT) AS optimization_target_type,
    CAST(NULL AS TIMESTAMP) AS run_schedule_end,
    CAST(NULL AS TIMESTAMP) AS run_schedule_start,
    CAST(NULL AS TEXT) AS status,
    CAST(NULL AS TEXT) AS type,
    CAST(NULL AS FLOAT) AS unit_cost_amount,
    CAST(NULL AS TEXT) AS unit_cost_currency_code,
    CAST(NULL AS TEXT) AS version_tag,
    CAST('' AS TEXT) AS source_relation
  FROM base
), fields AS (
  SELECT
    source_relation,
    id AS campaign_id,
    name AS campaign_name,
    CAST(version_tag AS DECIMAL) AS version_tag,
    campaign_group_id,
    account_id,
    status,
    type,
    cost_type,
    creative_selection,
    daily_budget_amount,
    daily_budget_currency_code,
    unit_cost_amount,
    unit_cost_currency_code,
    format,
    locale_country,
    locale_language,
    objective_type,
    optimization_target_type,
    audience_expansion_enabled AS is_audience_expansion_enabled,
    offsite_delivery_enabled AS is_offsite_delivery_enabled,
    CAST(run_schedule_start AS TIMESTAMP) AS run_schedule_start_at,
    CAST(run_schedule_end AS TIMESTAMP) AS run_schedule_end_at,
    CAST(last_modified_time AS TIMESTAMP) AS last_modified_at,
    CAST(created_time AS TIMESTAMP) AS created_at,
    ROW_NUMBER() OVER (PARTITION BY source_relation, id ORDER BY last_modified_time DESC) = 1 AS is_latest_version
  FROM macro
)
SELECT
  *
FROM fields
%3 130. model.linkedin_source.stg_linkedin_ads__campaign_history 130. model.linkedin_source.stg_linkedin_ads__campaign_history source_relation campaign_id last_modified_at account_id campaign_group_id created_at campaign_name version_tag is_audience_expansion_enabled cost_type creative_selection daily_budget_amount daily_budget_currency_code format locale_country locale_language objective_type is_offsite_delivery_enabled optimization_target_type run_schedule_start_at run_schedule_end_at status type unit_cost_amount unit_cost_currency_code is_latest_version 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp id last_modified_time account_id campaign_group_id created_time name version_tag 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp:f0->130. model.linkedin_source.stg_linkedin_ads__campaign_history:f1 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp:f1->130. model.linkedin_source.stg_linkedin_ads__campaign_history:f2 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp:f2->130. model.linkedin_source.stg_linkedin_ads__campaign_history:f3 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp:f3->130. model.linkedin_source.stg_linkedin_ads__campaign_history:f4 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp:f4->130. model.linkedin_source.stg_linkedin_ads__campaign_history:f5 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp:f5->130. model.linkedin_source.stg_linkedin_ads__campaign_history:f6 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp:f6->130. model.linkedin_source.stg_linkedin_ads__campaign_history:f7
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
campaign_id integer Unique internal ID representing the campaign.
last_modified_at timestamp without time zone The timestamp of when the version was updated.
account_id bigint The ID of the account the campaign belongs to.
campaign_group_id integer The ID of the campaign group the campaign belongs to.
created_at timestamp without time zone The timestamp of when the campaign was created.
campaign_name text A label for the campaign.
version_tag numeric An integer representation of the version of the campaign.
is_audience_expansion_enabled boolean Boolean (default=false) representing whether Audience Expansion is enabled for the campaign provides query expansion for certain targeting criteria.
cost_type text CPM - Cost per thousand advertising impressions. If type=SPONSORED_INMAILS; cost per send(CPS) is measured as CPM x 1000. CPC- Cost per individual click on the associated link. CPV- Cost per view for video ads.
creative_selection text ROUND_ROBIN - Rotate through available creatives to serve them as evenly as possible. OPTIMIZED (default) - Bias selection taking into account such as expected performance. Not available for Message and Conversation Ads (type=SPONSORED_INMAILS).
daily_budget_amount double precision Maximum amount to spend per day UTC. The amount of money as a real number string.
daily_budget_currency_code text ISO currency code. The currency must match that of the parent account.
format text The ad format on the campaign level. See https://docs.microsoft.com/en-us/linkedin/marketing/integrations/ads/campaign-formats?view=li-lms-2022-07
locale_country text Locale of the campaign. An uppercase two-letter country code as defined by ISO-3166.
locale_language text Locale of the campaign. A lowercase two-letter language code as defined by ISO-639.
objective_type text Campaign Objective type values. Click [here](https://docs.microsoft.com/en-us/linkedin/marketing/integrations/ads-reporting/ad-budget-pricing-type-combinations?view=li-lms-2022-07) for Campaign Objective descriptions. One of: - BRAND_AWARENESS - ENGAGEMENT - JOB_APPLICANTS - LEAD_GENERATION - WEBSITE_CONVERSIONS - WEBSITE_VISITS - VIDEO_VIEWS
is_offsite_delivery_enabled boolean Boolean indicating if this campaign to allowed to be served on the LinkedIn Audience Network to extend the reach of your campaign by delivering ads beyond the LinkedIn feed to members on third-party apps and sites. (default will be "True" from June 30, 2022)
optimization_target_type text Determines how this campaign is optimized for spending. If this is not set, there is no optimization. Refer to the documentation here. Default = 'NONE'.
run_schedule_start_at timestamp without time zone Scheduled date range to run associated creatives. The start date must be non-null. Represents the inclusive (greater than or equal to) value in which to start the range.
run_schedule_end_at timestamp without time zone Scheduled date range to run associated creatives. The start date must be non-null. Represents the exclusive (strictly less than) value in which to end the range, if provided.
status text ACTIVE - Denotes that the campaign is fully servable. PAUSED - Denotes that the campaign meets all requirements to be served, but temporarily should not be. ARCHIVED - Denotes that the campaign is presently inactive, and should mostly be hidden in the UI until un-archived. COMPLETED - Denotes that the campaign has reached a specified budgetary or chronological limit. CANCELED - Denotes that the campaign has been permanently canceled, such as when an advertising account is permanently closed. DRAFT - Denotes that the campaign is still being edited and not eligible for serving. Some validation will be postponed until the campaign is activated. PENDING_DELETION - Denotes that the campaign has been requested to be deleted that is currently pending. REMOVED - Denotes that the campaign was deleted, but must remain fetchable due to the existence of performance data.
type text TEXT_AD - Text-based ads that show up in the right column or top of the page on LinkedIn. SPONSORED_UPDATES - Native ads that promote a company's content updates in the LinkedIn feed. SPONSORED_INMAILS - Personalized messages with a call-to-action button delivered to a LinkedIn's member inbox. DYNAMIC - Ads that are dynamically personalized.
unit_cost_amount double precision This value is used as one of the following: amount to bid (for manual bidding), amount which is the target cost (for target cost bidding) per click, impression, or other event depending on the pricing model, or cost cap (for cost cap bidding). The amount of money as a real number string. The amount should be non-negative if the bidding strategy is manual, target cost, or cost cap bidding. The default is 0 with the currency code set to match that of the associated account.
unit_cost_currency_code text Amount to bid per click, impression, or other event depending on the pricing model. The default is 0 with the currency code set to match that of the associated account. ISO currency code.
is_latest_version boolean Boolean of whether the record is the latest version of the campaign.
Column Lineage
%3 130. model.linkedin_source.stg_linkedin_ads__campaign_history 130. model.linkedin_source.stg_linkedin_ads__campaign_history source_relation 120. model.linkedin.linkedin_ads__creative_report 120. model.linkedin.linkedin_ads__creative_report source_relation 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->120. model.linkedin.linkedin_ads__creative_report:f0 118. model.linkedin.linkedin_ads__campaign_group_report 118. model.linkedin.linkedin_ads__campaign_group_report source_relation 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->118. model.linkedin.linkedin_ads__campaign_group_report:f0 121. model.linkedin.linkedin_ads__url_report 121. model.linkedin.linkedin_ads__url_report source_relation 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->121. model.linkedin.linkedin_ads__url_report:f0 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report source_relation 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->119. model.linkedin.linkedin_ads__campaign_report:f0 117. model.linkedin.linkedin_ads__account_report 117. model.linkedin.linkedin_ads__account_report source_relation 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->117. model.linkedin.linkedin_ads__account_report:f0
117. model.linkedin.linkedin_ads__account_report
  • Input Column: 130. model.linkedin_source.stg_linkedin_ads__campaign_history[source_relation]
    • Integration used as part of the join condition with the report and account tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
118. model.linkedin.linkedin_ads__campaign_group_report
  • Input Column: 130. model.linkedin_source.stg_linkedin_ads__campaign_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 130. model.linkedin_source.stg_linkedin_ads__campaign_history[source_relation]
    • Direct The column is directly copied without transformation
    • Integration Used as part of the join condition with other tables
    • Output Columns:
      • source_relation: Directly copied to the output
120. model.linkedin.linkedin_ads__creative_report
  • Input Column: 130. model.linkedin_source.stg_linkedin_ads__campaign_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
121. model.linkedin.linkedin_ads__url_report
  • Input Column: 130. model.linkedin_source.stg_linkedin_ads__campaign_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
Column Lineage
%3 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp id 130. model.linkedin_source.stg_linkedin_ads__campaign_history 130. model.linkedin_source.stg_linkedin_ads__campaign_history campaign_id 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp:f0->130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0 120. model.linkedin.linkedin_ads__creative_report 120. model.linkedin.linkedin_ads__creative_report campaign_id 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->120. model.linkedin.linkedin_ads__creative_report:f0 121. model.linkedin.linkedin_ads__url_report 121. model.linkedin.linkedin_ads__url_report campaign_id 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->121. model.linkedin.linkedin_ads__url_report:f0 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report campaign_id 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->119. model.linkedin.linkedin_ads__campaign_report:f0
130. model.linkedin_source.stg_linkedin_ads__campaign_history
  • Input Column: 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp[id]
    • Direct The column is directly copied to the output
    • Deduplication Used in ROW_NUMBER() function to identify the latest version
    • Output Columns:
      • campaign_id: Directly mapped
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 130. model.linkedin_source.stg_linkedin_ads__campaign_history[campaign_id]
    • Direct The column is directly copied without transformation
    • Integration Used as a key to join with the report table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • campaign_id: Directly copied to the output
120. model.linkedin.linkedin_ads__creative_report
  • Input Column: 130. model.linkedin_source.stg_linkedin_ads__campaign_history[campaign_id]
    • Integration used as the key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
121. model.linkedin.linkedin_ads__url_report
  • Input Column: 130. model.linkedin_source.stg_linkedin_ads__campaign_history[campaign_id]
    • Integration used as the key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
Column Lineage
%3 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp last_modified_time 130. model.linkedin_source.stg_linkedin_ads__campaign_history 130. model.linkedin_source.stg_linkedin_ads__campaign_history last_modified_at 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp:f0->130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report last_modified_at 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->119. model.linkedin.linkedin_ads__campaign_report:f0
130. model.linkedin_source.stg_linkedin_ads__campaign_history
  • Input Column: 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp[last_modified_time]
    • Cleaning Cast to TIMESTAMP data type
    • Deduplication Used in ROW_NUMBER() function to order and identify the latest version
    • Output Columns:
      • last_modified_at: Mapped after casting to TIMESTAMP
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 130. model.linkedin_source.stg_linkedin_ads__campaign_history[last_modified_at]
    • Direct The column is directly copied without transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • last_modified_at: Directly copied to the output
Column Lineage
%3 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp account_id 130. model.linkedin_source.stg_linkedin_ads__campaign_history 130. model.linkedin_source.stg_linkedin_ads__campaign_history account_id 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp:f0->130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0
130. model.linkedin_source.stg_linkedin_ads__campaign_history
  • Input Column: 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp[account_id]
    • Direct The column is directly copied to the output
    • Output Columns:
      • account_id: Directly mapped
Column Lineage
%3 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp campaign_group_id 130. model.linkedin_source.stg_linkedin_ads__campaign_history 130. model.linkedin_source.stg_linkedin_ads__campaign_history campaign_group_id 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp:f0->130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0 118. model.linkedin.linkedin_ads__campaign_group_report 118. model.linkedin.linkedin_ads__campaign_group_report campaign_group_id 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->118. model.linkedin.linkedin_ads__campaign_group_report:f0
130. model.linkedin_source.stg_linkedin_ads__campaign_history
  • Input Column: 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp[campaign_group_id]
    • Direct The column is directly copied to the output
    • Output Columns:
      • campaign_group_id: Directly mapped
118. model.linkedin.linkedin_ads__campaign_group_report
  • Input Column: 130. model.linkedin_source.stg_linkedin_ads__campaign_history[campaign_group_id]
    • Integration used to join with the campaign_group table
    • Output Columns:
      • campaign_group_id: directly copied after joining
Column Lineage
%3 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp created_time 130. model.linkedin_source.stg_linkedin_ads__campaign_history 130. model.linkedin_source.stg_linkedin_ads__campaign_history created_at 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp:f0->130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report created_at 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->119. model.linkedin.linkedin_ads__campaign_report:f0
130. model.linkedin_source.stg_linkedin_ads__campaign_history
  • Input Column: 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp[created_time]
    • Cleaning Cast to TIMESTAMP data type
    • Output Columns:
      • created_at: Mapped after casting to TIMESTAMP
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 130. model.linkedin_source.stg_linkedin_ads__campaign_history[created_at]
    • Direct The column is directly copied without transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • created_at: Directly copied to the output
Column Lineage
%3 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp name 130. model.linkedin_source.stg_linkedin_ads__campaign_history 130. model.linkedin_source.stg_linkedin_ads__campaign_history campaign_name 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp:f0->130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0 120. model.linkedin.linkedin_ads__creative_report 120. model.linkedin.linkedin_ads__creative_report campaign_name 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->120. model.linkedin.linkedin_ads__creative_report:f0 121. model.linkedin.linkedin_ads__url_report 121. model.linkedin.linkedin_ads__url_report campaign_name 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->121. model.linkedin.linkedin_ads__url_report:f0 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report campaign_name 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->119. model.linkedin.linkedin_ads__campaign_report:f0
130. model.linkedin_source.stg_linkedin_ads__campaign_history
  • Input Column: 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp[name]
    • Direct The column is directly copied to the output
    • Output Columns:
      • campaign_name: Directly mapped
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 130. model.linkedin_source.stg_linkedin_ads__campaign_history[campaign_name]
    • Direct The column is directly copied without transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • campaign_name: Directly copied to the output
120. model.linkedin.linkedin_ads__creative_report
  • Input Column: 130. model.linkedin_source.stg_linkedin_ads__campaign_history[campaign_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_name: directly copied
121. model.linkedin.linkedin_ads__url_report
  • Input Column: 130. model.linkedin_source.stg_linkedin_ads__campaign_history[campaign_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_name: directly copied
Column Lineage
%3 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp version_tag 130. model.linkedin_source.stg_linkedin_ads__campaign_history 130. model.linkedin_source.stg_linkedin_ads__campaign_history version_tag 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp:f0->130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report version_tag 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->119. model.linkedin.linkedin_ads__campaign_report:f0
130. model.linkedin_source.stg_linkedin_ads__campaign_history
  • Input Column: 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp[version_tag]
    • Cleaning Cast to DECIMAL data type
    • Output Columns:
      • version_tag: Mapped after casting to DECIMAL
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 130. model.linkedin_source.stg_linkedin_ads__campaign_history[version_tag]
    • Direct The column is directly copied without transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • version_tag: Directly copied to the output
Column Lineage
%3 130. model.linkedin_source.stg_linkedin_ads__campaign_history 130. model.linkedin_source.stg_linkedin_ads__campaign_history is_audience_expansion_enabled 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report is_audience_expansion_enabled 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->119. model.linkedin.linkedin_ads__campaign_report:f0
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 130. model.linkedin_source.stg_linkedin_ads__campaign_history[is_audience_expansion_enabled]
    • Direct The column is directly copied without transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • is_audience_expansion_enabled: Directly copied to the output
Column Lineage
%3 130. model.linkedin_source.stg_linkedin_ads__campaign_history 130. model.linkedin_source.stg_linkedin_ads__campaign_history cost_type 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report cost_type 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->119. model.linkedin.linkedin_ads__campaign_report:f0
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 130. model.linkedin_source.stg_linkedin_ads__campaign_history[cost_type]
    • Direct The column is directly copied without transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • cost_type: Directly copied to the output
Column Lineage
%3 130. model.linkedin_source.stg_linkedin_ads__campaign_history 130. model.linkedin_source.stg_linkedin_ads__campaign_history creative_selection 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report creative_selection 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->119. model.linkedin.linkedin_ads__campaign_report:f0
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 130. model.linkedin_source.stg_linkedin_ads__campaign_history[creative_selection]
    • Direct This column is directly copied to the output without transformation
    • Output Columns:
      • creative_selection: Directly copied
Column Lineage
%3 130. model.linkedin_source.stg_linkedin_ads__campaign_history 130. model.linkedin_source.stg_linkedin_ads__campaign_history daily_budget_amount 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report daily_budget_amount 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->119. model.linkedin.linkedin_ads__campaign_report:f0
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 130. model.linkedin_source.stg_linkedin_ads__campaign_history[daily_budget_amount]
    • Direct This column is directly copied to the output without transformation
    • Output Columns:
      • daily_budget_amount: Directly copied
Column Lineage
%3 130. model.linkedin_source.stg_linkedin_ads__campaign_history 130. model.linkedin_source.stg_linkedin_ads__campaign_history daily_budget_currency_code 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report daily_budget_currency_code 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->119. model.linkedin.linkedin_ads__campaign_report:f0
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 130. model.linkedin_source.stg_linkedin_ads__campaign_history[daily_budget_currency_code]
    • Direct This column is directly copied to the output without transformation
    • Output Columns:
      • daily_budget_currency_code: Directly copied
Column Lineage
%3 130. model.linkedin_source.stg_linkedin_ads__campaign_history 130. model.linkedin_source.stg_linkedin_ads__campaign_history format 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report format 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->119. model.linkedin.linkedin_ads__campaign_report:f0
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 130. model.linkedin_source.stg_linkedin_ads__campaign_history[format]
    • Direct This column is directly copied to the output without transformation
    • Output Columns:
      • format: Directly copied
Column Lineage
%3 130. model.linkedin_source.stg_linkedin_ads__campaign_history 130. model.linkedin_source.stg_linkedin_ads__campaign_history locale_country 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report locale_country 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->119. model.linkedin.linkedin_ads__campaign_report:f0
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 130. model.linkedin_source.stg_linkedin_ads__campaign_history[locale_country]
    • Direct This column is directly copied to the output without transformation
    • Output Columns:
      • locale_country: Directly copied
Column Lineage
%3 130. model.linkedin_source.stg_linkedin_ads__campaign_history 130. model.linkedin_source.stg_linkedin_ads__campaign_history locale_language 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report locale_language 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->119. model.linkedin.linkedin_ads__campaign_report:f0
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 130. model.linkedin_source.stg_linkedin_ads__campaign_history[locale_language]
    • Direct This column is directly copied to the output without transformation
    • Output Columns:
      • locale_language: Directly copied
Column Lineage
%3 130. model.linkedin_source.stg_linkedin_ads__campaign_history 130. model.linkedin_source.stg_linkedin_ads__campaign_history objective_type 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report objective_type 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->119. model.linkedin.linkedin_ads__campaign_report:f0
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 130. model.linkedin_source.stg_linkedin_ads__campaign_history[objective_type]
    • Direct This column is directly copied to the output without transformation
    • Output Columns:
      • objective_type: Directly copied
Column Lineage
%3 130. model.linkedin_source.stg_linkedin_ads__campaign_history 130. model.linkedin_source.stg_linkedin_ads__campaign_history is_offsite_delivery_enabled 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report is_offsite_delivery_enabled 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->119. model.linkedin.linkedin_ads__campaign_report:f0
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 130. model.linkedin_source.stg_linkedin_ads__campaign_history[is_offsite_delivery_enabled]
    • Direct This column is directly copied to the output without transformation
    • Output Columns:
      • is_offsite_delivery_enabled: Directly copied
Column Lineage
%3 130. model.linkedin_source.stg_linkedin_ads__campaign_history 130. model.linkedin_source.stg_linkedin_ads__campaign_history optimization_target_type 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report optimization_target_type 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->119. model.linkedin.linkedin_ads__campaign_report:f0
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 130. model.linkedin_source.stg_linkedin_ads__campaign_history[optimization_target_type]
    • Direct This column is directly copied to the output without transformation
    • Output Columns:
      • optimization_target_type: Directly copied
Column Lineage
%3 130. model.linkedin_source.stg_linkedin_ads__campaign_history 130. model.linkedin_source.stg_linkedin_ads__campaign_history run_schedule_start_at 118. model.linkedin.linkedin_ads__campaign_group_report 118. model.linkedin.linkedin_ads__campaign_group_report run_schedule_start_at 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->118. model.linkedin.linkedin_ads__campaign_group_report:f0 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report run_schedule_start_at 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->119. model.linkedin.linkedin_ads__campaign_report:f0
118. model.linkedin.linkedin_ads__campaign_group_report
  • Input Column: 130. model.linkedin_source.stg_linkedin_ads__campaign_history[run_schedule_start_at]
    • Integration This column is used to join the campaign table with the campaign_group table
    • Output Columns:
      • run_schedule_start_at: It is directly copied to the output
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 130. model.linkedin_source.stg_linkedin_ads__campaign_history[run_schedule_start_at]
    • Direct This column is directly copied to the output without transformation
    • Output Columns:
      • run_schedule_start_at: Directly copied
Column Lineage
%3 130. model.linkedin_source.stg_linkedin_ads__campaign_history 130. model.linkedin_source.stg_linkedin_ads__campaign_history run_schedule_end_at 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report run_schedule_end_at 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->119. model.linkedin.linkedin_ads__campaign_report:f0
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 130. model.linkedin_source.stg_linkedin_ads__campaign_history[run_schedule_end_at]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • run_schedule_end_at: Directly copied to the output
Column Lineage
%3 130. model.linkedin_source.stg_linkedin_ads__campaign_history 130. model.linkedin_source.stg_linkedin_ads__campaign_history status 120. model.linkedin.linkedin_ads__creative_report 120. model.linkedin.linkedin_ads__creative_report campaign_status 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->120. model.linkedin.linkedin_ads__creative_report:f0 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report campaign_status 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->119. model.linkedin.linkedin_ads__campaign_report:f0
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 130. model.linkedin_source.stg_linkedin_ads__campaign_history[status]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • campaign_status: Directly copied to the output and renamed
120. model.linkedin.linkedin_ads__creative_report
  • Input Column: 130. model.linkedin_source.stg_linkedin_ads__campaign_history[status]
    • Direct The status is directly copied to the output
    • Filtering The column is used to filter for the latest version of the campaign
    • Output Columns:
      • campaign_status: Directly copied to this output column
Column Lineage
%3 130. model.linkedin_source.stg_linkedin_ads__campaign_history 130. model.linkedin_source.stg_linkedin_ads__campaign_history type 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report type 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->119. model.linkedin.linkedin_ads__campaign_report:f0
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 130. model.linkedin_source.stg_linkedin_ads__campaign_history[type]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • type: Directly copied to the output
Column Lineage
%3 130. model.linkedin_source.stg_linkedin_ads__campaign_history 130. model.linkedin_source.stg_linkedin_ads__campaign_history unit_cost_amount 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report unit_cost_amount 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->119. model.linkedin.linkedin_ads__campaign_report:f0
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 130. model.linkedin_source.stg_linkedin_ads__campaign_history[unit_cost_amount]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • unit_cost_amount: Directly copied to the output
Column Lineage
%3 130. model.linkedin_source.stg_linkedin_ads__campaign_history 130. model.linkedin_source.stg_linkedin_ads__campaign_history unit_cost_currency_code 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report unit_cost_currency_code 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->119. model.linkedin.linkedin_ads__campaign_report:f0
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 130. model.linkedin_source.stg_linkedin_ads__campaign_history[unit_cost_currency_code]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • unit_cost_currency_code: Directly copied to the output
131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of type TEXT. It's likely used as a placeholder or template for further development or testing purposes.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp id last_modified_time account_id campaign_group_id created_time name version_tag 320. source.linkedin_source.linkedin_ads.campaign_history 320. source.linkedin_source.linkedin_ads.campaign_history
Name Type Comment
id integer None
last_modified_time timestamp without time zone None
account_id bigint None
campaign_group_id integer None
created_time timestamp without time zone None
name text None
version_tag integer None
Column Lineage
%3 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp id 130. model.linkedin_source.stg_linkedin_ads__campaign_history 130. model.linkedin_source.stg_linkedin_ads__campaign_history campaign_id 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp:f0->130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0 120. model.linkedin.linkedin_ads__creative_report 120. model.linkedin.linkedin_ads__creative_report campaign_id 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->120. model.linkedin.linkedin_ads__creative_report:f0 121. model.linkedin.linkedin_ads__url_report 121. model.linkedin.linkedin_ads__url_report campaign_id 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->121. model.linkedin.linkedin_ads__url_report:f0 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report campaign_id 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->119. model.linkedin.linkedin_ads__campaign_report:f0
130. model.linkedin_source.stg_linkedin_ads__campaign_history
  • Input Column: 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp[id]
    • Direct The column is directly copied to the output
    • Deduplication Used in ROW_NUMBER() function to identify the latest version
    • Output Columns:
      • campaign_id: Directly mapped
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 130. model.linkedin_source.stg_linkedin_ads__campaign_history[campaign_id]
    • Direct The column is directly copied without transformation
    • Integration Used as a key to join with the report table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • campaign_id: Directly copied to the output
120. model.linkedin.linkedin_ads__creative_report
  • Input Column: 130. model.linkedin_source.stg_linkedin_ads__campaign_history[campaign_id]
    • Integration used as the key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
121. model.linkedin.linkedin_ads__url_report
  • Input Column: 130. model.linkedin_source.stg_linkedin_ads__campaign_history[campaign_id]
    • Integration used as the key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
Column Lineage
%3 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp last_modified_time 130. model.linkedin_source.stg_linkedin_ads__campaign_history 130. model.linkedin_source.stg_linkedin_ads__campaign_history last_modified_at 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp:f0->130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report last_modified_at 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->119. model.linkedin.linkedin_ads__campaign_report:f0
130. model.linkedin_source.stg_linkedin_ads__campaign_history
  • Input Column: 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp[last_modified_time]
    • Cleaning Cast to TIMESTAMP data type
    • Deduplication Used in ROW_NUMBER() function to order and identify the latest version
    • Output Columns:
      • last_modified_at: Mapped after casting to TIMESTAMP
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 130. model.linkedin_source.stg_linkedin_ads__campaign_history[last_modified_at]
    • Direct The column is directly copied without transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • last_modified_at: Directly copied to the output
Column Lineage
%3 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp account_id 130. model.linkedin_source.stg_linkedin_ads__campaign_history 130. model.linkedin_source.stg_linkedin_ads__campaign_history account_id 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp:f0->130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0
130. model.linkedin_source.stg_linkedin_ads__campaign_history
  • Input Column: 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp[account_id]
    • Direct The column is directly copied to the output
    • Output Columns:
      • account_id: Directly mapped
Column Lineage
%3 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp campaign_group_id 130. model.linkedin_source.stg_linkedin_ads__campaign_history 130. model.linkedin_source.stg_linkedin_ads__campaign_history campaign_group_id 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp:f0->130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0 118. model.linkedin.linkedin_ads__campaign_group_report 118. model.linkedin.linkedin_ads__campaign_group_report campaign_group_id 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->118. model.linkedin.linkedin_ads__campaign_group_report:f0
130. model.linkedin_source.stg_linkedin_ads__campaign_history
  • Input Column: 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp[campaign_group_id]
    • Direct The column is directly copied to the output
    • Output Columns:
      • campaign_group_id: Directly mapped
118. model.linkedin.linkedin_ads__campaign_group_report
  • Input Column: 130. model.linkedin_source.stg_linkedin_ads__campaign_history[campaign_group_id]
    • Integration used to join with the campaign_group table
    • Output Columns:
      • campaign_group_id: directly copied after joining
Column Lineage
%3 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp created_time 130. model.linkedin_source.stg_linkedin_ads__campaign_history 130. model.linkedin_source.stg_linkedin_ads__campaign_history created_at 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp:f0->130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report created_at 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->119. model.linkedin.linkedin_ads__campaign_report:f0
130. model.linkedin_source.stg_linkedin_ads__campaign_history
  • Input Column: 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp[created_time]
    • Cleaning Cast to TIMESTAMP data type
    • Output Columns:
      • created_at: Mapped after casting to TIMESTAMP
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 130. model.linkedin_source.stg_linkedin_ads__campaign_history[created_at]
    • Direct The column is directly copied without transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • created_at: Directly copied to the output
Column Lineage
%3 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp name 130. model.linkedin_source.stg_linkedin_ads__campaign_history 130. model.linkedin_source.stg_linkedin_ads__campaign_history campaign_name 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp:f0->130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0 120. model.linkedin.linkedin_ads__creative_report 120. model.linkedin.linkedin_ads__creative_report campaign_name 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->120. model.linkedin.linkedin_ads__creative_report:f0 121. model.linkedin.linkedin_ads__url_report 121. model.linkedin.linkedin_ads__url_report campaign_name 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->121. model.linkedin.linkedin_ads__url_report:f0 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report campaign_name 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->119. model.linkedin.linkedin_ads__campaign_report:f0
130. model.linkedin_source.stg_linkedin_ads__campaign_history
  • Input Column: 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp[name]
    • Direct The column is directly copied to the output
    • Output Columns:
      • campaign_name: Directly mapped
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 130. model.linkedin_source.stg_linkedin_ads__campaign_history[campaign_name]
    • Direct The column is directly copied without transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • campaign_name: Directly copied to the output
120. model.linkedin.linkedin_ads__creative_report
  • Input Column: 130. model.linkedin_source.stg_linkedin_ads__campaign_history[campaign_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_name: directly copied
121. model.linkedin.linkedin_ads__url_report
  • Input Column: 130. model.linkedin_source.stg_linkedin_ads__campaign_history[campaign_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_name: directly copied
Column Lineage
%3 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp version_tag 130. model.linkedin_source.stg_linkedin_ads__campaign_history 130. model.linkedin_source.stg_linkedin_ads__campaign_history version_tag 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp:f0->130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0 119. model.linkedin.linkedin_ads__campaign_report 119. model.linkedin.linkedin_ads__campaign_report version_tag 130. model.linkedin_source.stg_linkedin_ads__campaign_history:f0->119. model.linkedin.linkedin_ads__campaign_report:f0
130. model.linkedin_source.stg_linkedin_ads__campaign_history
  • Input Column: 131. model.linkedin_source.stg_linkedin_ads__campaign_history_tmp[version_tag]
    • Cleaning Cast to DECIMAL data type
    • Output Columns:
      • version_tag: Mapped after casting to DECIMAL
119. model.linkedin.linkedin_ads__campaign_report
  • Input Column: 130. model.linkedin_source.stg_linkedin_ads__campaign_history[version_tag]
    • Direct The column is directly copied without transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • version_tag: Directly copied to the output
132. model.linkedin_source.stg_linkedin_ads__creative_history

This SQL query processes data from a LinkedIn Ads creative history table. It performs several operations: 1. Casts and renames columns for consistency 2. Selects the latest version of each creative based on last modified time 3. Extracts various URL components and UTM parameters from the click_uri field 4. Cleans and standardizes data formats

CleaningDeduplicationFeaturization
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_linkedin_ads_source.stg_linkedin_ads__creative_history_tmp
), macro AS (
  SELECT
    CAST(NULL AS INT) AS campaign_id,
    CAST(NULL AS TEXT) AS click_uri,
    CAST(NULL AS TIMESTAMP) AS created_time,
    CAST(NULL AS TIMESTAMP) AS created_at,
    CAST(NULL AS INT) AS id,
    CAST(NULL AS TIMESTAMP) AS last_modified_time,
    CAST(NULL AS TIMESTAMP) AS last_modified_at,
    CAST(NULL AS TEXT) AS intended_status,
    CAST(NULL AS TEXT) AS status,
    CAST('' AS TEXT) AS source_relation
  FROM base
), fields AS (
  SELECT
    source_relation,
    id AS creative_id,
    campaign_id,
    COALESCE(status, intended_status) AS status,
    click_uri,
    CAST(COALESCE(last_modified_time, last_modified_at) AS TIMESTAMP) AS last_modified_at,
    CAST(COALESCE(created_time, created_at) AS TIMESTAMP) AS created_at,
    ROW_NUMBER() OVER (PARTITION BY source_relation, id ORDER BY COALESCE(last_modified_time, last_modified_at) DESC) = 1 AS is_latest_version
  FROM macro
), url_fields AS (
  SELECT
    *,
    SPLIT_PART(click_uri, '?', 1) AS base_url,
    TRY_CAST(SPLIT_PART(
      SPLIT_PART(
        REPLACE(REPLACE(REPLACE(click_uri, 'android-app://', ''), 'http://', ''), 'https://', ''),
        '/',
        1
      ),
      '?',
      1
    ) AS TEXT) AS url_host,
    '/' || TRY_CAST(SPLIT_PART(
      CASE
        WHEN LENGTH(REPLACE(REPLACE(click_uri, 'http://', ''), 'https://', '')) - COALESCE(
          NULLIF(STR_POSITION(REPLACE(REPLACE(click_uri, 'http://', ''), 'https://', ''), '/'), 0),
          STR_POSITION(REPLACE(REPLACE(click_uri, 'http://', ''), 'https://', ''), '?') - 1
        ) = 0
        THEN ''
        ELSE RIGHT(
          REPLACE(REPLACE(click_uri, 'http://', ''), 'https://', ''),
          LENGTH(REPLACE(REPLACE(click_uri, 'http://', ''), 'https://', '')) - COALESCE(
            NULLIF(STR_POSITION(REPLACE(REPLACE(click_uri, 'http://', ''), 'https://', ''), '/'), 0),
            STR_POSITION(REPLACE(REPLACE(click_uri, 'http://', ''), 'https://', ''), '?') - 1
          )
        )
      END,
      '?',
      1
    ) AS TEXT) AS url_path,
    NULLIF(SPLIT_PART(SPLIT_PART(click_uri, 'utm_source=', 2), '&', 1), '') AS utm_source,
    NULLIF(SPLIT_PART(SPLIT_PART(click_uri, 'utm_medium=', 2), '&', 1), '') AS utm_medium,
    NULLIF(SPLIT_PART(SPLIT_PART(click_uri, 'utm_campaign=', 2), '&', 1), '') AS utm_campaign,
    NULLIF(SPLIT_PART(SPLIT_PART(click_uri, 'utm_content=', 2), '&', 1), '') AS utm_content,
    NULLIF(SPLIT_PART(SPLIT_PART(click_uri, 'utm_term=', 2), '&', 1), '') AS utm_term
  FROM fields
)
SELECT
  *
FROM url_fields
%3 132. model.linkedin_source.stg_linkedin_ads__creative_history 132. model.linkedin_source.stg_linkedin_ads__creative_history source_relation creative_id last_modified_at created_at campaign_id status click_uri base_url url_host url_path utm_source utm_medium utm_campaign utm_content utm_term is_latest_version 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp id last_modified_time created_time campaign_id status click_uri 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f1 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f1->132. model.linkedin_source.stg_linkedin_ads__creative_history:f2 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f2->132. model.linkedin_source.stg_linkedin_ads__creative_history:f3 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f3->132. model.linkedin_source.stg_linkedin_ads__creative_history:f4 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f4->132. model.linkedin_source.stg_linkedin_ads__creative_history:f5 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f5->132. model.linkedin_source.stg_linkedin_ads__creative_history:f6 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f5->132. model.linkedin_source.stg_linkedin_ads__creative_history:f7 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f5->132. model.linkedin_source.stg_linkedin_ads__creative_history:f8 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f5->132. model.linkedin_source.stg_linkedin_ads__creative_history:f9 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f5->132. model.linkedin_source.stg_linkedin_ads__creative_history:f10 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f5->132. model.linkedin_source.stg_linkedin_ads__creative_history:f11 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f5->132. model.linkedin_source.stg_linkedin_ads__creative_history:f12 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f5->132. model.linkedin_source.stg_linkedin_ads__creative_history:f13 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f5->132. model.linkedin_source.stg_linkedin_ads__creative_history:f14
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
creative_id integer Unique internal ID representing the creative.
last_modified_at timestamp without time zone The timestamp of when the version was updated.
created_at timestamp without time zone The timestamp of when the creative was created.
campaign_id integer The ID of the campaign the creative belongs to.
status text ACTIVE - Creative creation is complete and creative is available for review and serve. PAUSED - Creative creation is complete and creative is current, but should temporarily not be served. This status is not valid upon creation. DRAFT - Creative creation is incomplete and may still be edited. ARCHIVED - Creative creation is complete, but creative should not be served and should be separated from non-archived creatives in any UI. CANCELED - Creative is permanently canceled.
click_uri text Required when creative type is TEXT_AD. Maximum character limit of 500 after URL encoding all special characters. Limit does not include the "https://" prefix.
base_url text The base URL of the ad, extracted from the `click_uri`.
url_host text The URL host of the ad, extracted from the `click_uri`.
url_path text The URL path of the ad, extracted from the `click_uri`.
utm_source text The utm_source parameter of the ad, extracted from the `click_uri`.
utm_medium text The utm_medium parameter of the ad, extracted from the `click_uri`.
utm_campaign text The utm_campaign parameter of the ad, extracted from the `click_uri`.
utm_content text The utm_content parameter of the ad, extracted from the `click_uri`.
utm_term text The utm_term parameter of the ad, extracted from the `click_uri`.
is_latest_version boolean Boolean of whether the record is the latest version of the creative.
Column Lineage
%3 132. model.linkedin_source.stg_linkedin_ads__creative_history 132. model.linkedin_source.stg_linkedin_ads__creative_history source_relation 120. model.linkedin.linkedin_ads__creative_report 120. model.linkedin.linkedin_ads__creative_report source_relation 132. model.linkedin_source.stg_linkedin_ads__creative_history:f0->120. model.linkedin.linkedin_ads__creative_report:f0 121. model.linkedin.linkedin_ads__url_report 121. model.linkedin.linkedin_ads__url_report source_relation 132. model.linkedin_source.stg_linkedin_ads__creative_history:f0->121. model.linkedin.linkedin_ads__url_report:f0
120. model.linkedin.linkedin_ads__creative_report
  • Input Column: 132. model.linkedin_source.stg_linkedin_ads__creative_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
121. model.linkedin.linkedin_ads__url_report
  • Input Column: 132. model.linkedin_source.stg_linkedin_ads__creative_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
Column Lineage
%3 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp id 132. model.linkedin_source.stg_linkedin_ads__creative_history 132. model.linkedin_source.stg_linkedin_ads__creative_history creative_id 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f0 120. model.linkedin.linkedin_ads__creative_report 120. model.linkedin.linkedin_ads__creative_report creative_id 132. model.linkedin_source.stg_linkedin_ads__creative_history:f0->120. model.linkedin.linkedin_ads__creative_report:f0 121. model.linkedin.linkedin_ads__url_report 121. model.linkedin.linkedin_ads__url_report creative_id 132. model.linkedin_source.stg_linkedin_ads__creative_history:f0->121. model.linkedin.linkedin_ads__url_report:f0
132. model.linkedin_source.stg_linkedin_ads__creative_history
  • Input Column: 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp[id]
    • Direct The column is directly copied to the output
    • Deduplication Used in the ROW_NUMBER() function to identify the latest version
    • Output Columns:
      • creative_id: Directly mapped
120. model.linkedin.linkedin_ads__creative_report
  • Input Column: 132. model.linkedin_source.stg_linkedin_ads__creative_history[creative_id]
    • Integration used as part of the join condition with the report table
    • Direct directly copied to the output
    • Output Columns:
      • creative_id: directly copied
121. model.linkedin.linkedin_ads__url_report
  • Input Column: 132. model.linkedin_source.stg_linkedin_ads__creative_history[creative_id]
    • Integration used as the key to join with the report table
    • Direct directly copied to the output
    • Aggregation used in the GROUP BY clause
    • Output Columns:
      • creative_id: directly copied
Column Lineage
%3 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp last_modified_time 132. model.linkedin_source.stg_linkedin_ads__creative_history 132. model.linkedin_source.stg_linkedin_ads__creative_history last_modified_at 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f0 120. model.linkedin.linkedin_ads__creative_report 120. model.linkedin.linkedin_ads__creative_report last_modified_at 132. model.linkedin_source.stg_linkedin_ads__creative_history:f0->120. model.linkedin.linkedin_ads__creative_report:f0
132. model.linkedin_source.stg_linkedin_ads__creative_history
  • Input Column: 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp[last_modified_time]
    • Cleaning Cast to TIMESTAMP and coalesced with last_modified_at
    • Deduplication Used in the ORDER BY clause of ROW_NUMBER() function
    • Output Columns:
      • last_modified_at: Transformed and mapped
120. model.linkedin.linkedin_ads__creative_report
  • Input Column: 132. model.linkedin_source.stg_linkedin_ads__creative_history[last_modified_at]
    • Direct directly copied to the output
    • Output Columns:
      • last_modified_at: directly copied
Column Lineage
%3 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp created_time 132. model.linkedin_source.stg_linkedin_ads__creative_history 132. model.linkedin_source.stg_linkedin_ads__creative_history created_at 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f0 120. model.linkedin.linkedin_ads__creative_report 120. model.linkedin.linkedin_ads__creative_report created_at 132. model.linkedin_source.stg_linkedin_ads__creative_history:f0->120. model.linkedin.linkedin_ads__creative_report:f0
132. model.linkedin_source.stg_linkedin_ads__creative_history
  • Input Column: 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp[created_time]
    • Cleaning Cast to TIMESTAMP and coalesced with created_at
    • Output Columns:
      • created_at: Transformed and mapped
120. model.linkedin.linkedin_ads__creative_report
  • Input Column: 132. model.linkedin_source.stg_linkedin_ads__creative_history[created_at]
    • Direct directly copied to the output
    • Output Columns:
      • created_at: directly copied
Column Lineage
%3 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp campaign_id 132. model.linkedin_source.stg_linkedin_ads__creative_history 132. model.linkedin_source.stg_linkedin_ads__creative_history campaign_id 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f0
132. model.linkedin_source.stg_linkedin_ads__creative_history
  • Input Column: 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp[campaign_id]
    • Direct The column is directly copied to the output
    • Output Columns:
      • campaign_id: Directly mapped
Column Lineage
%3 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp status 132. model.linkedin_source.stg_linkedin_ads__creative_history 132. model.linkedin_source.stg_linkedin_ads__creative_history status 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f0 120. model.linkedin.linkedin_ads__creative_report 120. model.linkedin.linkedin_ads__creative_report creative_status 132. model.linkedin_source.stg_linkedin_ads__creative_history:f0->120. model.linkedin.linkedin_ads__creative_report:f0
132. model.linkedin_source.stg_linkedin_ads__creative_history
  • Input Column: 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp[status]
    • Cleaning Coalesced with intended_status
    • Output Columns:
      • status: Transformed and mapped
120. model.linkedin.linkedin_ads__creative_report
  • Input Column: 132. model.linkedin_source.stg_linkedin_ads__creative_history[status]
    • Direct directly copied to the output
    • Output Columns:
      • creative_status: directly copied and renamed
Column Lineage
%3 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp click_uri 132. model.linkedin_source.stg_linkedin_ads__creative_history 132. model.linkedin_source.stg_linkedin_ads__creative_history base_url click_uri url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f1 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f0 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f2 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f3 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f7 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f6 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f4 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f5 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f8 120. model.linkedin.linkedin_ads__creative_report 120. model.linkedin.linkedin_ads__creative_report click_uri 132. model.linkedin_source.stg_linkedin_ads__creative_history:f1->120. model.linkedin.linkedin_ads__creative_report:f0 121. model.linkedin.linkedin_ads__url_report 121. model.linkedin.linkedin_ads__url_report click_uri 132. model.linkedin_source.stg_linkedin_ads__creative_history:f1->121. model.linkedin.linkedin_ads__url_report:f0
132. model.linkedin_source.stg_linkedin_ads__creative_history
  • Input Column: 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp[click_uri]
    • Direct The column is directly copied to the output
    • Featurization Various URL components and UTM parameters are extracted from this column
    • Output Columns:
      • click_uri: Directly mapped
      • base_url: Extracted from click_uri
      • url_host: Extracted from click_uri
      • url_path: Extracted from click_uri
      • utm_source: Extracted from click_uri
      • utm_medium: Extracted from click_uri
      • utm_campaign: Extracted from click_uri
      • utm_content: Extracted from click_uri
      • utm_term: Extracted from click_uri
120. model.linkedin.linkedin_ads__creative_report
  • Input Column: 132. model.linkedin_source.stg_linkedin_ads__creative_history[click_uri]
    • Direct directly copied to the output
    • Output Columns:
      • click_uri: directly copied
121. model.linkedin.linkedin_ads__url_report
  • Input Column: 132. model.linkedin_source.stg_linkedin_ads__creative_history[click_uri]
    • Filtering used in the WHERE clause to filter out null values
    • Direct directly copied to the output
    • Aggregation used in the GROUP BY clause
    • Output Columns:
      • click_uri: directly copied
Column Lineage
%3 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp click_uri 132. model.linkedin_source.stg_linkedin_ads__creative_history 132. model.linkedin_source.stg_linkedin_ads__creative_history base_url click_uri url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f1 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f0 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f2 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f3 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f7 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f6 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f4 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f5 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f8 121. model.linkedin.linkedin_ads__url_report 121. model.linkedin.linkedin_ads__url_report base_url 132. model.linkedin_source.stg_linkedin_ads__creative_history:f0->121. model.linkedin.linkedin_ads__url_report:f0
132. model.linkedin_source.stg_linkedin_ads__creative_history
  • Input Column: 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp[click_uri]
    • Direct The column is directly copied to the output
    • Featurization Various URL components and UTM parameters are extracted from this column
    • Output Columns:
      • click_uri: Directly mapped
      • base_url: Extracted from click_uri
      • url_host: Extracted from click_uri
      • url_path: Extracted from click_uri
      • utm_source: Extracted from click_uri
      • utm_medium: Extracted from click_uri
      • utm_campaign: Extracted from click_uri
      • utm_content: Extracted from click_uri
      • utm_term: Extracted from click_uri
121. model.linkedin.linkedin_ads__url_report
  • Input Column: 132. model.linkedin_source.stg_linkedin_ads__creative_history[base_url]
    • Direct directly copied to the output
    • Aggregation used in the GROUP BY clause
    • Output Columns:
      • base_url: directly copied
Column Lineage
%3 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp click_uri 132. model.linkedin_source.stg_linkedin_ads__creative_history 132. model.linkedin_source.stg_linkedin_ads__creative_history base_url click_uri url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f1 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f0 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f2 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f3 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f7 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f6 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f4 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f5 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f8 121. model.linkedin.linkedin_ads__url_report 121. model.linkedin.linkedin_ads__url_report url_host 132. model.linkedin_source.stg_linkedin_ads__creative_history:f2->121. model.linkedin.linkedin_ads__url_report:f0
132. model.linkedin_source.stg_linkedin_ads__creative_history
  • Input Column: 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp[click_uri]
    • Direct The column is directly copied to the output
    • Featurization Various URL components and UTM parameters are extracted from this column
    • Output Columns:
      • click_uri: Directly mapped
      • base_url: Extracted from click_uri
      • url_host: Extracted from click_uri
      • url_path: Extracted from click_uri
      • utm_source: Extracted from click_uri
      • utm_medium: Extracted from click_uri
      • utm_campaign: Extracted from click_uri
      • utm_content: Extracted from click_uri
      • utm_term: Extracted from click_uri
121. model.linkedin.linkedin_ads__url_report
  • Input Column: 132. model.linkedin_source.stg_linkedin_ads__creative_history[url_host]
    • Direct directly copied to the output
    • Aggregation used in the GROUP BY clause
    • Output Columns:
      • url_host: directly copied
Column Lineage
%3 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp click_uri 132. model.linkedin_source.stg_linkedin_ads__creative_history 132. model.linkedin_source.stg_linkedin_ads__creative_history base_url click_uri url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f1 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f0 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f2 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f3 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f7 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f6 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f4 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f5 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f8 121. model.linkedin.linkedin_ads__url_report 121. model.linkedin.linkedin_ads__url_report url_path 132. model.linkedin_source.stg_linkedin_ads__creative_history:f3->121. model.linkedin.linkedin_ads__url_report:f0
132. model.linkedin_source.stg_linkedin_ads__creative_history
  • Input Column: 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp[click_uri]
    • Direct The column is directly copied to the output
    • Featurization Various URL components and UTM parameters are extracted from this column
    • Output Columns:
      • click_uri: Directly mapped
      • base_url: Extracted from click_uri
      • url_host: Extracted from click_uri
      • url_path: Extracted from click_uri
      • utm_source: Extracted from click_uri
      • utm_medium: Extracted from click_uri
      • utm_campaign: Extracted from click_uri
      • utm_content: Extracted from click_uri
      • utm_term: Extracted from click_uri
121. model.linkedin.linkedin_ads__url_report
  • Input Column: 132. model.linkedin_source.stg_linkedin_ads__creative_history[url_path]
    • Direct directly copied to the output
    • Aggregation used in the GROUP BY clause
    • Output Columns:
      • url_path: directly copied
Column Lineage
%3 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp click_uri 132. model.linkedin_source.stg_linkedin_ads__creative_history 132. model.linkedin_source.stg_linkedin_ads__creative_history base_url click_uri url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f1 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f0 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f2 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f3 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f7 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f6 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f4 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f5 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f8 121. model.linkedin.linkedin_ads__url_report 121. model.linkedin.linkedin_ads__url_report utm_source 132. model.linkedin_source.stg_linkedin_ads__creative_history:f7->121. model.linkedin.linkedin_ads__url_report:f0
132. model.linkedin_source.stg_linkedin_ads__creative_history
  • Input Column: 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp[click_uri]
    • Direct The column is directly copied to the output
    • Featurization Various URL components and UTM parameters are extracted from this column
    • Output Columns:
      • click_uri: Directly mapped
      • base_url: Extracted from click_uri
      • url_host: Extracted from click_uri
      • url_path: Extracted from click_uri
      • utm_source: Extracted from click_uri
      • utm_medium: Extracted from click_uri
      • utm_campaign: Extracted from click_uri
      • utm_content: Extracted from click_uri
      • utm_term: Extracted from click_uri
121. model.linkedin.linkedin_ads__url_report
  • Input Column: 132. model.linkedin_source.stg_linkedin_ads__creative_history[utm_source]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the JOIN condition with the report table
    • Output Columns:
      • utm_source: Directly copied to the output
Column Lineage
%3 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp click_uri 132. model.linkedin_source.stg_linkedin_ads__creative_history 132. model.linkedin_source.stg_linkedin_ads__creative_history base_url click_uri url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f1 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f0 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f2 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f3 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f7 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f6 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f4 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f5 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f8 121. model.linkedin.linkedin_ads__url_report 121. model.linkedin.linkedin_ads__url_report utm_medium 132. model.linkedin_source.stg_linkedin_ads__creative_history:f6->121. model.linkedin.linkedin_ads__url_report:f0
132. model.linkedin_source.stg_linkedin_ads__creative_history
  • Input Column: 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp[click_uri]
    • Direct The column is directly copied to the output
    • Featurization Various URL components and UTM parameters are extracted from this column
    • Output Columns:
      • click_uri: Directly mapped
      • base_url: Extracted from click_uri
      • url_host: Extracted from click_uri
      • url_path: Extracted from click_uri
      • utm_source: Extracted from click_uri
      • utm_medium: Extracted from click_uri
      • utm_campaign: Extracted from click_uri
      • utm_content: Extracted from click_uri
      • utm_term: Extracted from click_uri
121. model.linkedin.linkedin_ads__url_report
  • Input Column: 132. model.linkedin_source.stg_linkedin_ads__creative_history[utm_medium]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the JOIN condition with the report table
    • Output Columns:
      • utm_medium: Directly copied to the output
Column Lineage
%3 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp click_uri 132. model.linkedin_source.stg_linkedin_ads__creative_history 132. model.linkedin_source.stg_linkedin_ads__creative_history base_url click_uri url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f1 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f0 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f2 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f3 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f7 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f6 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f4 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f5 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f8 121. model.linkedin.linkedin_ads__url_report 121. model.linkedin.linkedin_ads__url_report utm_campaign 132. model.linkedin_source.stg_linkedin_ads__creative_history:f4->121. model.linkedin.linkedin_ads__url_report:f0
132. model.linkedin_source.stg_linkedin_ads__creative_history
  • Input Column: 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp[click_uri]
    • Direct The column is directly copied to the output
    • Featurization Various URL components and UTM parameters are extracted from this column
    • Output Columns:
      • click_uri: Directly mapped
      • base_url: Extracted from click_uri
      • url_host: Extracted from click_uri
      • url_path: Extracted from click_uri
      • utm_source: Extracted from click_uri
      • utm_medium: Extracted from click_uri
      • utm_campaign: Extracted from click_uri
      • utm_content: Extracted from click_uri
      • utm_term: Extracted from click_uri
121. model.linkedin.linkedin_ads__url_report
  • Input Column: 132. model.linkedin_source.stg_linkedin_ads__creative_history[utm_campaign]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the JOIN condition with the report table
    • Output Columns:
      • utm_campaign: Directly copied to the output
Column Lineage
%3 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp click_uri 132. model.linkedin_source.stg_linkedin_ads__creative_history 132. model.linkedin_source.stg_linkedin_ads__creative_history base_url click_uri url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f1 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f0 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f2 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f3 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f7 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f6 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f4 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f5 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f8 121. model.linkedin.linkedin_ads__url_report 121. model.linkedin.linkedin_ads__url_report utm_content 132. model.linkedin_source.stg_linkedin_ads__creative_history:f5->121. model.linkedin.linkedin_ads__url_report:f0
132. model.linkedin_source.stg_linkedin_ads__creative_history
  • Input Column: 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp[click_uri]
    • Direct The column is directly copied to the output
    • Featurization Various URL components and UTM parameters are extracted from this column
    • Output Columns:
      • click_uri: Directly mapped
      • base_url: Extracted from click_uri
      • url_host: Extracted from click_uri
      • url_path: Extracted from click_uri
      • utm_source: Extracted from click_uri
      • utm_medium: Extracted from click_uri
      • utm_campaign: Extracted from click_uri
      • utm_content: Extracted from click_uri
      • utm_term: Extracted from click_uri
121. model.linkedin.linkedin_ads__url_report
  • Input Column: 132. model.linkedin_source.stg_linkedin_ads__creative_history[utm_content]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the JOIN condition with the report table
    • Output Columns:
      • utm_content: Directly copied to the output
Column Lineage
%3 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp click_uri 132. model.linkedin_source.stg_linkedin_ads__creative_history 132. model.linkedin_source.stg_linkedin_ads__creative_history base_url click_uri url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f1 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f0 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f2 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f3 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f7 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f6 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f4 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f5 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f8 121. model.linkedin.linkedin_ads__url_report 121. model.linkedin.linkedin_ads__url_report utm_term 132. model.linkedin_source.stg_linkedin_ads__creative_history:f8->121. model.linkedin.linkedin_ads__url_report:f0
132. model.linkedin_source.stg_linkedin_ads__creative_history
  • Input Column: 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp[click_uri]
    • Direct The column is directly copied to the output
    • Featurization Various URL components and UTM parameters are extracted from this column
    • Output Columns:
      • click_uri: Directly mapped
      • base_url: Extracted from click_uri
      • url_host: Extracted from click_uri
      • url_path: Extracted from click_uri
      • utm_source: Extracted from click_uri
      • utm_medium: Extracted from click_uri
      • utm_campaign: Extracted from click_uri
      • utm_content: Extracted from click_uri
      • utm_term: Extracted from click_uri
121. model.linkedin.linkedin_ads__url_report
  • Input Column: 132. model.linkedin_source.stg_linkedin_ads__creative_history[utm_term]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the JOIN condition with the report table
    • Output Columns:
      • utm_term: Directly copied to the output
133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of type TEXT. It's likely used as a placeholder or template for further operations in dbt (data build tool).

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp id last_modified_time created_time campaign_id type version_tag status click_uri 321. source.linkedin_source.linkedin_ads.creative_history 321. source.linkedin_source.linkedin_ads.creative_history
Name Type Comment
id integer None
last_modified_time timestamp without time zone None
created_time timestamp without time zone None
campaign_id integer None
type text None
version_tag integer None
status text None
click_uri text None
Column Lineage
%3 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp id 132. model.linkedin_source.stg_linkedin_ads__creative_history 132. model.linkedin_source.stg_linkedin_ads__creative_history creative_id 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f0 120. model.linkedin.linkedin_ads__creative_report 120. model.linkedin.linkedin_ads__creative_report creative_id 132. model.linkedin_source.stg_linkedin_ads__creative_history:f0->120. model.linkedin.linkedin_ads__creative_report:f0 121. model.linkedin.linkedin_ads__url_report 121. model.linkedin.linkedin_ads__url_report creative_id 132. model.linkedin_source.stg_linkedin_ads__creative_history:f0->121. model.linkedin.linkedin_ads__url_report:f0
132. model.linkedin_source.stg_linkedin_ads__creative_history
  • Input Column: 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp[id]
    • Direct The column is directly copied to the output
    • Deduplication Used in the ROW_NUMBER() function to identify the latest version
    • Output Columns:
      • creative_id: Directly mapped
120. model.linkedin.linkedin_ads__creative_report
  • Input Column: 132. model.linkedin_source.stg_linkedin_ads__creative_history[creative_id]
    • Integration used as part of the join condition with the report table
    • Direct directly copied to the output
    • Output Columns:
      • creative_id: directly copied
121. model.linkedin.linkedin_ads__url_report
  • Input Column: 132. model.linkedin_source.stg_linkedin_ads__creative_history[creative_id]
    • Integration used as the key to join with the report table
    • Direct directly copied to the output
    • Aggregation used in the GROUP BY clause
    • Output Columns:
      • creative_id: directly copied
Column Lineage
%3 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp last_modified_time 132. model.linkedin_source.stg_linkedin_ads__creative_history 132. model.linkedin_source.stg_linkedin_ads__creative_history last_modified_at 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f0 120. model.linkedin.linkedin_ads__creative_report 120. model.linkedin.linkedin_ads__creative_report last_modified_at 132. model.linkedin_source.stg_linkedin_ads__creative_history:f0->120. model.linkedin.linkedin_ads__creative_report:f0
132. model.linkedin_source.stg_linkedin_ads__creative_history
  • Input Column: 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp[last_modified_time]
    • Cleaning Cast to TIMESTAMP and coalesced with last_modified_at
    • Deduplication Used in the ORDER BY clause of ROW_NUMBER() function
    • Output Columns:
      • last_modified_at: Transformed and mapped
120. model.linkedin.linkedin_ads__creative_report
  • Input Column: 132. model.linkedin_source.stg_linkedin_ads__creative_history[last_modified_at]
    • Direct directly copied to the output
    • Output Columns:
      • last_modified_at: directly copied
Column Lineage
%3 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp created_time 132. model.linkedin_source.stg_linkedin_ads__creative_history 132. model.linkedin_source.stg_linkedin_ads__creative_history created_at 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f0 120. model.linkedin.linkedin_ads__creative_report 120. model.linkedin.linkedin_ads__creative_report created_at 132. model.linkedin_source.stg_linkedin_ads__creative_history:f0->120. model.linkedin.linkedin_ads__creative_report:f0
132. model.linkedin_source.stg_linkedin_ads__creative_history
  • Input Column: 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp[created_time]
    • Cleaning Cast to TIMESTAMP and coalesced with created_at
    • Output Columns:
      • created_at: Transformed and mapped
120. model.linkedin.linkedin_ads__creative_report
  • Input Column: 132. model.linkedin_source.stg_linkedin_ads__creative_history[created_at]
    • Direct directly copied to the output
    • Output Columns:
      • created_at: directly copied
Column Lineage
%3 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp campaign_id 132. model.linkedin_source.stg_linkedin_ads__creative_history 132. model.linkedin_source.stg_linkedin_ads__creative_history campaign_id 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f0
132. model.linkedin_source.stg_linkedin_ads__creative_history
  • Input Column: 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp[campaign_id]
    • Direct The column is directly copied to the output
    • Output Columns:
      • campaign_id: Directly mapped
Column Lineage
%3 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp status 132. model.linkedin_source.stg_linkedin_ads__creative_history 132. model.linkedin_source.stg_linkedin_ads__creative_history status 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f0 120. model.linkedin.linkedin_ads__creative_report 120. model.linkedin.linkedin_ads__creative_report creative_status 132. model.linkedin_source.stg_linkedin_ads__creative_history:f0->120. model.linkedin.linkedin_ads__creative_report:f0
132. model.linkedin_source.stg_linkedin_ads__creative_history
  • Input Column: 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp[status]
    • Cleaning Coalesced with intended_status
    • Output Columns:
      • status: Transformed and mapped
120. model.linkedin.linkedin_ads__creative_report
  • Input Column: 132. model.linkedin_source.stg_linkedin_ads__creative_history[status]
    • Direct directly copied to the output
    • Output Columns:
      • creative_status: directly copied and renamed
Column Lineage
%3 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp click_uri 132. model.linkedin_source.stg_linkedin_ads__creative_history 132. model.linkedin_source.stg_linkedin_ads__creative_history base_url click_uri url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f1 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f0 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f2 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f3 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f7 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f6 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f4 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f5 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp:f0->132. model.linkedin_source.stg_linkedin_ads__creative_history:f8 120. model.linkedin.linkedin_ads__creative_report 120. model.linkedin.linkedin_ads__creative_report click_uri 132. model.linkedin_source.stg_linkedin_ads__creative_history:f1->120. model.linkedin.linkedin_ads__creative_report:f0 121. model.linkedin.linkedin_ads__url_report 121. model.linkedin.linkedin_ads__url_report base_url click_uri url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 132. model.linkedin_source.stg_linkedin_ads__creative_history:f1->121. model.linkedin.linkedin_ads__url_report:f1 132. model.linkedin_source.stg_linkedin_ads__creative_history:f0->121. model.linkedin.linkedin_ads__url_report:f0 132. model.linkedin_source.stg_linkedin_ads__creative_history:f2->121. model.linkedin.linkedin_ads__url_report:f2 132. model.linkedin_source.stg_linkedin_ads__creative_history:f3->121. model.linkedin.linkedin_ads__url_report:f3 132. model.linkedin_source.stg_linkedin_ads__creative_history:f7->121. model.linkedin.linkedin_ads__url_report:f7 132. model.linkedin_source.stg_linkedin_ads__creative_history:f6->121. model.linkedin.linkedin_ads__url_report:f6 132. model.linkedin_source.stg_linkedin_ads__creative_history:f4->121. model.linkedin.linkedin_ads__url_report:f4 132. model.linkedin_source.stg_linkedin_ads__creative_history:f5->121. model.linkedin.linkedin_ads__url_report:f5 132. model.linkedin_source.stg_linkedin_ads__creative_history:f8->121. model.linkedin.linkedin_ads__url_report:f8
132. model.linkedin_source.stg_linkedin_ads__creative_history
  • Input Column: 133. model.linkedin_source.stg_linkedin_ads__creative_history_tmp[click_uri]
    • Direct The column is directly copied to the output
    • Featurization Various URL components and UTM parameters are extracted from this column
    • Output Columns:
      • click_uri: Directly mapped
      • base_url: Extracted from click_uri
      • url_host: Extracted from click_uri
      • url_path: Extracted from click_uri
      • utm_source: Extracted from click_uri
      • utm_medium: Extracted from click_uri
      • utm_campaign: Extracted from click_uri
      • utm_content: Extracted from click_uri
      • utm_term: Extracted from click_uri
120. model.linkedin.linkedin_ads__creative_report
  • Input Column: 132. model.linkedin_source.stg_linkedin_ads__creative_history[click_uri]
    • Direct directly copied to the output
    • Output Columns:
      • click_uri: directly copied
121. model.linkedin.linkedin_ads__url_report
  • Input Column: 132. model.linkedin_source.stg_linkedin_ads__creative_history[click_uri]
    • Filtering used in the WHERE clause to filter out null values
    • Direct directly copied to the output
    • Aggregation used in the GROUP BY clause
    • Output Columns:
      • click_uri: directly copied
  • Input Column: 132. model.linkedin_source.stg_linkedin_ads__creative_history[base_url]
    • Direct directly copied to the output
    • Aggregation used in the GROUP BY clause
    • Output Columns:
      • base_url: directly copied
  • Input Column: 132. model.linkedin_source.stg_linkedin_ads__creative_history[url_host]
    • Direct directly copied to the output
    • Aggregation used in the GROUP BY clause
    • Output Columns:
      • url_host: directly copied
  • Input Column: 132. model.linkedin_source.stg_linkedin_ads__creative_history[url_path]
    • Direct directly copied to the output
    • Aggregation used in the GROUP BY clause
    • Output Columns:
      • url_path: directly copied
  • Input Column: 132. model.linkedin_source.stg_linkedin_ads__creative_history[utm_source]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the JOIN condition with the report table
    • Output Columns:
      • utm_source: Directly copied to the output
  • Input Column: 132. model.linkedin_source.stg_linkedin_ads__creative_history[utm_medium]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the JOIN condition with the report table
    • Output Columns:
      • utm_medium: Directly copied to the output
  • Input Column: 132. model.linkedin_source.stg_linkedin_ads__creative_history[utm_campaign]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the JOIN condition with the report table
    • Output Columns:
      • utm_campaign: Directly copied to the output
  • Input Column: 132. model.linkedin_source.stg_linkedin_ads__creative_history[utm_content]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the JOIN condition with the report table
    • Output Columns:
      • utm_content: Directly copied to the output
  • Input Column: 132. model.linkedin_source.stg_linkedin_ads__creative_history[utm_term]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the JOIN condition with the report table
    • Output Columns:
      • utm_term: Directly copied to the output
134. model.microsoft_ads.microsoft_ads__account_report

This SQL query combines daily account report data with the most recent account history information. It joins these two datasets, groups the results by various dimensions (including date, account details, device information, and network), and calculates aggregate metrics such as clicks, impressions, and spend. The query provides a comprehensive view of account performance with relevant account details.

IntegrationAggregationFiltering
SQL Query
WITH report AS (
  SELECT
    *
  FROM TEST.PUBLIC_microsoft_ads_source.stg_microsoft_ads__account_daily_report
), accounts AS (
  SELECT
    *
  FROM TEST.PUBLIC_microsoft_ads_source.stg_microsoft_ads__account_history
  WHERE
    is_most_recent_record = TRUE
), joined AS (
  SELECT
    report.source_relation,
    report.date_day,
    accounts.account_name,
    report.account_id,
    accounts.time_zone AS account_timezone,
    report.device_os,
    report.device_type,
    report.network,
    report.currency_code,
    SUM(report.clicks) AS clicks,
    SUM(report.impressions) AS impressions,
    SUM(report.spend) AS spend
  FROM report
  LEFT JOIN accounts
    ON report.account_id = accounts.account_id
    AND report.source_relation = accounts.source_relation
  GROUP BY
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9
)
SELECT
  *
FROM joined
%3 134. model.microsoft_ads.microsoft_ads__account_report 134. model.microsoft_ads.microsoft_ads__account_report source_relation date_day account_name account_id account_timezone device_os device_type network currency_code clicks impressions spend 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report source_relation date_day account_id device_os device_type network currency_code clicks impressions spend 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f0->134. model.microsoft_ads.microsoft_ads__account_report:f0 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f1->134. model.microsoft_ads.microsoft_ads__account_report:f1 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f2->134. model.microsoft_ads.microsoft_ads__account_report:f3 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f3->134. model.microsoft_ads.microsoft_ads__account_report:f5 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f4->134. model.microsoft_ads.microsoft_ads__account_report:f6 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f5->134. model.microsoft_ads.microsoft_ads__account_report:f7 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f6->134. model.microsoft_ads.microsoft_ads__account_report:f8 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f7->134. model.microsoft_ads.microsoft_ads__account_report:f9 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f8->134. model.microsoft_ads.microsoft_ads__account_report:f10 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f9->134. model.microsoft_ads.microsoft_ads__account_report:f11 143. model.microsoft_ads_source.stg_microsoft_ads__account_history 143. model.microsoft_ads_source.stg_microsoft_ads__account_history source_relation account_id account_name time_zone 143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0->134. model.microsoft_ads.microsoft_ads__account_report:f0 143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f1->134. model.microsoft_ads.microsoft_ads__account_report:f3 143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f2->134. model.microsoft_ads.microsoft_ads__account_report:f2 143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f3->134. model.microsoft_ads.microsoft_ads__account_report:f4
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
date_day date The date of the report.
account_name character varying The name of the account, if present in the source data.
account_id bigint The ID representing the account.
account_timezone text The time zone associated with this account.
device_os text The device operating system associated with this record; values include but may not be limited to 'Windows', 'iOS', 'Android', 'Other', 'BlackBerry' and 'Unknown'.
device_type text The device type associated with this record; values include but may not be limited to 'Computer', 'Smartphone', 'Tablet' and 'Unknown'.
network text The network associated with this record.
currency_code text The currency used for all monetary values for entities under this profile.
clicks bigint The count of clicks.
impressions bigint The count of impressions.
spend double precision The cost of the ads.
Column Lineage
%3 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report source_relation 134. model.microsoft_ads.microsoft_ads__account_report 134. model.microsoft_ads.microsoft_ads__account_report source_relation 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f0->134. model.microsoft_ads.microsoft_ads__account_report:f0 143. model.microsoft_ads_source.stg_microsoft_ads__account_history 143. model.microsoft_ads_source.stg_microsoft_ads__account_history source_relation 143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0->134. model.microsoft_ads.microsoft_ads__account_report:f0
134. model.microsoft_ads.microsoft_ads__account_report
  • Input Column: 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with the accounts table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
  • Input Column: 143. model.microsoft_ads_source.stg_microsoft_ads__account_history[source_relation]
    • Integration used as part of the join condition with the report table
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
Column Lineage
%3 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report date_day 134. model.microsoft_ads.microsoft_ads__account_report 134. model.microsoft_ads.microsoft_ads__account_report date_day 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f0->134. model.microsoft_ads.microsoft_ads__account_report:f0 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp date 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp:f0->141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f0
141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report
  • Input Column: 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp[date]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as DATE type
    • Output Columns:
      • date_day: Directly mapped and renamed
134. model.microsoft_ads.microsoft_ads__account_report
  • Input Column: 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 143. model.microsoft_ads_source.stg_microsoft_ads__account_history 143. model.microsoft_ads_source.stg_microsoft_ads__account_history account_name 134. model.microsoft_ads.microsoft_ads__account_report 134. model.microsoft_ads.microsoft_ads__account_report account_name 143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0->134. model.microsoft_ads.microsoft_ads__account_report:f0 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp name 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp:f0->143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0
143. model.microsoft_ads_source.stg_microsoft_ads__account_history
  • Input Column: 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • account_name: Directly mapped to this output column
134. model.microsoft_ads.microsoft_ads__account_report
  • Input Column: 143. model.microsoft_ads_source.stg_microsoft_ads__account_history[account_name]
    • Direct directly copied to the output
    • Output Columns:
      • account_name: directly copied
Column Lineage
%3 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report account_id 134. model.microsoft_ads.microsoft_ads__account_report 134. model.microsoft_ads.microsoft_ads__account_report account_id 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f0->134. model.microsoft_ads.microsoft_ads__account_report:f0 143. model.microsoft_ads_source.stg_microsoft_ads__account_history 143. model.microsoft_ads_source.stg_microsoft_ads__account_history account_id 143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0->134. model.microsoft_ads.microsoft_ads__account_report:f0 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp account_id 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp:f0->141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f0 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp id 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp:f0->143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0
141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report
  • Input Column: 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp[account_id]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as INT type
    • Output Columns:
      • account_id: Directly mapped
143. model.microsoft_ads_source.stg_microsoft_ads__account_history
  • Input Column: 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp[id]
    • Direct The column is directly copied without transformation
    • Deduplication Used in the PARTITION BY clause of the ROW_NUMBER() function to identify the most recent record for each account
    • Output Columns:
      • account_id: Directly mapped to this output column
134. model.microsoft_ads.microsoft_ads__account_report
  • Input Column: 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report[account_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as the key to join with the accounts table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • account_id: Directly copied to the output
  • Input Column: 143. model.microsoft_ads_source.stg_microsoft_ads__account_history[account_id]
    • Integration used as the primary key for joining with the report table
    • Direct directly copied to the output
    • Output Columns:
      • account_id: directly copied
Column Lineage
%3 143. model.microsoft_ads_source.stg_microsoft_ads__account_history 143. model.microsoft_ads_source.stg_microsoft_ads__account_history time_zone 134. model.microsoft_ads.microsoft_ads__account_report 134. model.microsoft_ads.microsoft_ads__account_report account_timezone 143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0->134. model.microsoft_ads.microsoft_ads__account_report:f0 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp time_zone 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp:f0->143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0
143. model.microsoft_ads_source.stg_microsoft_ads__account_history
  • Input Column: 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp[time_zone]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • time_zone: Directly mapped to this output column
134. model.microsoft_ads.microsoft_ads__account_report
  • Input Column: 143. model.microsoft_ads_source.stg_microsoft_ads__account_history[time_zone]
    • Direct directly copied to the output
    • Output Columns:
      • account_timezone: directly copied and renamed
Column Lineage
%3 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report device_os 134. model.microsoft_ads.microsoft_ads__account_report 134. model.microsoft_ads.microsoft_ads__account_report device_os 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f0->134. model.microsoft_ads.microsoft_ads__account_report:f0 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp device_os 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp:f0->141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f0
141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report
  • Input Column: 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp[device_os]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • device_os: Directly mapped
134. model.microsoft_ads.microsoft_ads__account_report
  • Input Column: 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report[device_os]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • device_os: Directly copied to the output
Column Lineage
%3 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report device_type 134. model.microsoft_ads.microsoft_ads__account_report 134. model.microsoft_ads.microsoft_ads__account_report device_type 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f0->134. model.microsoft_ads.microsoft_ads__account_report:f0 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp device_type 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp:f0->141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f0
141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report
  • Input Column: 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp[device_type]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • device_type: Directly mapped
134. model.microsoft_ads.microsoft_ads__account_report
  • Input Column: 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report[device_type]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • device_type: Directly copied to the output
Column Lineage
%3 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report network 134. model.microsoft_ads.microsoft_ads__account_report 134. model.microsoft_ads.microsoft_ads__account_report network 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f0->134. model.microsoft_ads.microsoft_ads__account_report:f0 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp network 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp:f0->141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f0
141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report
  • Input Column: 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp[network]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • network: Directly mapped
134. model.microsoft_ads.microsoft_ads__account_report
  • Input Column: 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report[network]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • network: Directly copied to the output
Column Lineage
%3 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report currency_code 134. model.microsoft_ads.microsoft_ads__account_report 134. model.microsoft_ads.microsoft_ads__account_report currency_code 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f0->134. model.microsoft_ads.microsoft_ads__account_report:f0 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp currency_code 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp:f0->141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f0
141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report
  • Input Column: 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp[currency_code]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • currency_code: Directly mapped
134. model.microsoft_ads.microsoft_ads__account_report
  • Input Column: 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report[currency_code]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • currency_code: Directly copied to the output
Column Lineage
%3 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report clicks 134. model.microsoft_ads.microsoft_ads__account_report 134. model.microsoft_ads.microsoft_ads__account_report clicks 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f0->134. model.microsoft_ads.microsoft_ads__account_report:f0 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp clicks 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp:f0->141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f0
141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report
  • Input Column: 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp[clicks]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to INT data type
    • Output Columns:
      • clicks: It is directly mapped to the output 'clicks' column after casting
134. model.microsoft_ads.microsoft_ads__account_report
  • Input Column: 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report[clicks]
    • Aggregation The clicks are summed up in the GROUP BY clause
    • Output Columns:
      • clicks: Summed up and directly mapped to the output 'clicks' column
Column Lineage
%3 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report impressions 134. model.microsoft_ads.microsoft_ads__account_report 134. model.microsoft_ads.microsoft_ads__account_report impressions 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f0->134. model.microsoft_ads.microsoft_ads__account_report:f0 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp impressions 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp:f0->141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f0
141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report
  • Input Column: 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp[impressions]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to INT data type
    • Output Columns:
      • impressions: It is directly mapped to the output 'impressions' column after casting
134. model.microsoft_ads.microsoft_ads__account_report
  • Input Column: 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report[impressions]
    • Aggregation The impressions are summed up in the GROUP BY clause
    • Output Columns:
      • impressions: Summed up and directly mapped to the output 'impressions' column
Column Lineage
%3 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report spend 134. model.microsoft_ads.microsoft_ads__account_report 134. model.microsoft_ads.microsoft_ads__account_report spend 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f0->134. model.microsoft_ads.microsoft_ads__account_report:f0 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp spend 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp:f0->141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f0
141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report
  • Input Column: 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp[spend]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to FLOAT data type
    • Output Columns:
      • spend: It is directly mapped to the output 'spend' column after casting
134. model.microsoft_ads.microsoft_ads__account_report
  • Input Column: 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report[spend]
    • Aggregation The spend is summed up in the GROUP BY clause
    • Output Columns:
      • spend: Summed up and directly mapped to the output 'spend' column
135. model.microsoft_ads.microsoft_ads__ad_group_report

This SQL query combines data from multiple staging tables to create a comprehensive ad group report. It joins ad group daily report data with the most recent records from ad groups, campaigns, and accounts. The query then aggregates metrics like clicks, impressions, and spend, grouping them by various dimensions such as date, account, campaign, ad group, device, and network information.

IntegrationAggregationFiltering
SQL Query
WITH report AS (
  SELECT
    *
  FROM TEST.PUBLIC_microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report
), ad_groups AS (
  SELECT
    *
  FROM TEST.PUBLIC_microsoft_ads_source.stg_microsoft_ads__ad_group_history
  WHERE
    is_most_recent_record = TRUE
), campaigns AS (
  SELECT
    *
  FROM TEST.PUBLIC_microsoft_ads_source.stg_microsoft_ads__campaign_history
  WHERE
    is_most_recent_record = TRUE
), accounts AS (
  SELECT
    *
  FROM TEST.PUBLIC_microsoft_ads_source.stg_microsoft_ads__account_history
  WHERE
    is_most_recent_record = TRUE
), joined AS (
  SELECT
    report.source_relation,
    report.date_day,
    accounts.account_name,
    report.account_id,
    campaigns.campaign_name,
    report.campaign_id,
    ad_groups.ad_group_name,
    report.ad_group_id,
    report.device_os,
    report.device_type,
    report.network,
    report.currency_code,
    SUM(report.clicks) AS clicks,
    SUM(report.impressions) AS impressions,
    SUM(report.spend) AS spend
  FROM report
  LEFT JOIN accounts
    ON report.account_id = accounts.account_id
    AND report.source_relation = accounts.source_relation
  LEFT JOIN campaigns
    ON report.campaign_id = campaigns.campaign_id
    AND report.source_relation = campaigns.source_relation
  LEFT JOIN ad_groups
    ON report.ad_group_id = ad_groups.ad_group_id
    AND report.source_relation = ad_groups.source_relation
  GROUP BY
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10,
    11,
    12
)
SELECT
  *
FROM joined
%3 135. model.microsoft_ads.microsoft_ads__ad_group_report 135. model.microsoft_ads.microsoft_ads__ad_group_report source_relation date_day account_name account_id campaign_name campaign_id ad_group_name ad_group_id device_os device_type network currency_code clicks impressions spend 143. model.microsoft_ads_source.stg_microsoft_ads__account_history 143. model.microsoft_ads_source.stg_microsoft_ads__account_history source_relation account_id account_name 143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0->135. model.microsoft_ads.microsoft_ads__ad_group_report:f0 143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f1->135. model.microsoft_ads.microsoft_ads__ad_group_report:f3 143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f2->135. model.microsoft_ads.microsoft_ads__ad_group_report:f2 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report source_relation date_day account_id campaign_id ad_group_id currency_code device_os device_type network clicks impressions spend 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f0->135. model.microsoft_ads.microsoft_ads__ad_group_report:f0 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f1->135. model.microsoft_ads.microsoft_ads__ad_group_report:f1 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f2->135. model.microsoft_ads.microsoft_ads__ad_group_report:f3 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f3->135. model.microsoft_ads.microsoft_ads__ad_group_report:f5 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f4->135. model.microsoft_ads.microsoft_ads__ad_group_report:f7 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f5->135. model.microsoft_ads.microsoft_ads__ad_group_report:f11 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f6->135. model.microsoft_ads.microsoft_ads__ad_group_report:f8 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f7->135. model.microsoft_ads.microsoft_ads__ad_group_report:f9 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f8->135. model.microsoft_ads.microsoft_ads__ad_group_report:f10 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f9->135. model.microsoft_ads.microsoft_ads__ad_group_report:f12 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f10->135. model.microsoft_ads.microsoft_ads__ad_group_report:f13 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f11->135. model.microsoft_ads.microsoft_ads__ad_group_report:f14 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history source_relation ad_group_id ad_group_name 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f0->135. model.microsoft_ads.microsoft_ads__ad_group_report:f0 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f1->135. model.microsoft_ads.microsoft_ads__ad_group_report:f7 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f2->135. model.microsoft_ads.microsoft_ads__ad_group_report:f6 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history source_relation campaign_id campaign_name 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0->135. model.microsoft_ads.microsoft_ads__ad_group_report:f0 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f1->135. model.microsoft_ads.microsoft_ads__ad_group_report:f5 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f2->135. model.microsoft_ads.microsoft_ads__ad_group_report:f4
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
date_day date The date of the report.
account_name character varying The name of the account, if present in the source data.
account_id bigint The ID representing the account.
campaign_name text The name of the campaign, if present in the source data.
campaign_id bigint The ID representing the campaign, if present in the source data.
ad_group_name text The name of the ad group, if present in the source data.
ad_group_id bigint The ID representing the ad group, if present in the source data.
device_os text The device operating system associated with this record; values include but may not be limited to 'Windows', 'iOS', 'Android', 'Other', 'BlackBerry' and 'Unknown'.
device_type text The device type associated with this record; values include but may not be limited to 'Computer', 'Smartphone', 'Tablet' and 'Unknown'.
network text The network associated with this record.
currency_code text The currency used for all monetary values for entities under this profile.
clicks bigint The count of clicks.
impressions bigint The count of impressions.
spend double precision The cost of the ads.
Column Lineage
%3 143. model.microsoft_ads_source.stg_microsoft_ads__account_history 143. model.microsoft_ads_source.stg_microsoft_ads__account_history source_relation 135. model.microsoft_ads.microsoft_ads__ad_group_report 135. model.microsoft_ads.microsoft_ads__ad_group_report source_relation 143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0->135. model.microsoft_ads.microsoft_ads__ad_group_report:f0 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report source_relation 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f0->135. model.microsoft_ads.microsoft_ads__ad_group_report:f0 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history source_relation 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f0->135. model.microsoft_ads.microsoft_ads__ad_group_report:f0 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history source_relation 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0->135. model.microsoft_ads.microsoft_ads__ad_group_report:f0
135. model.microsoft_ads.microsoft_ads__ad_group_report
  • Input Column: 143. model.microsoft_ads_source.stg_microsoft_ads__account_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with other tables
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
  • Input Column: 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history[source_relation]
    • Integration used as a key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history[source_relation]
    • Integration used as a key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
Column Lineage
%3 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report date_day 135. model.microsoft_ads.microsoft_ads__ad_group_report 135. model.microsoft_ads.microsoft_ads__ad_group_report date_day 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f0->135. model.microsoft_ads.microsoft_ads__ad_group_report:f0 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp date 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp:f0->147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f0
147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report
  • Input Column: 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp[date]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as DATE type
    • Output Columns:
      • date_day: Directly mapped and renamed
135. model.microsoft_ads.microsoft_ads__ad_group_report
  • Input Column: 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 143. model.microsoft_ads_source.stg_microsoft_ads__account_history 143. model.microsoft_ads_source.stg_microsoft_ads__account_history account_name 135. model.microsoft_ads.microsoft_ads__ad_group_report 135. model.microsoft_ads.microsoft_ads__ad_group_report account_name 143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0->135. model.microsoft_ads.microsoft_ads__ad_group_report:f0 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp name 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp:f0->143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0
143. model.microsoft_ads_source.stg_microsoft_ads__account_history
  • Input Column: 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • account_name: Directly mapped to this output column
135. model.microsoft_ads.microsoft_ads__ad_group_report
  • Input Column: 143. model.microsoft_ads_source.stg_microsoft_ads__account_history[account_name]
    • Direct directly copied to the output
    • Output Columns:
      • account_name: directly copied
Column Lineage
%3 143. model.microsoft_ads_source.stg_microsoft_ads__account_history 143. model.microsoft_ads_source.stg_microsoft_ads__account_history account_id 135. model.microsoft_ads.microsoft_ads__ad_group_report 135. model.microsoft_ads.microsoft_ads__ad_group_report account_id 143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0->135. model.microsoft_ads.microsoft_ads__ad_group_report:f0 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report account_id 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f0->135. model.microsoft_ads.microsoft_ads__ad_group_report:f0 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp id 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp:f0->143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp account_id 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp:f0->147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f0
143. model.microsoft_ads_source.stg_microsoft_ads__account_history
  • Input Column: 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp[id]
    • Direct The column is directly copied without transformation
    • Deduplication Used in the PARTITION BY clause of the ROW_NUMBER() function to identify the most recent record for each account
    • Output Columns:
      • account_id: Directly mapped to this output column
147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report
  • Input Column: 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp[account_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT type
    • Output Columns:
      • account_id: Directly mapped
135. model.microsoft_ads.microsoft_ads__ad_group_report
  • Input Column: 143. model.microsoft_ads_source.stg_microsoft_ads__account_history[account_id]
    • Integration used as the key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • account_id: directly copied
  • Input Column: 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report[account_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a join key with the accounts table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • account_id: Directly copied to the output
Column Lineage
%3 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history campaign_name 135. model.microsoft_ads.microsoft_ads__ad_group_report 135. model.microsoft_ads.microsoft_ads__ad_group_report campaign_name 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0->135. model.microsoft_ads.microsoft_ads__ad_group_report:f0 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp name 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp:f0->155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0
155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history
  • Input Column: 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • campaign_name: Directly mapped
135. model.microsoft_ads.microsoft_ads__ad_group_report
  • Input Column: 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history[campaign_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_name: directly copied
Column Lineage
%3 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report campaign_id 135. model.microsoft_ads.microsoft_ads__ad_group_report 135. model.microsoft_ads.microsoft_ads__ad_group_report campaign_id 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f0->135. model.microsoft_ads.microsoft_ads__ad_group_report:f0 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history campaign_id 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0->135. model.microsoft_ads.microsoft_ads__ad_group_report:f0 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp campaign_id 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp:f0->147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f0 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp id 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp:f0->155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0
147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report
  • Input Column: 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp[campaign_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT type
    • Output Columns:
      • campaign_id: Directly mapped
155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history
  • Input Column: 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp[id]
    • Direct The column is directly copied without transformation
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • campaign_id: Directly mapped
135. model.microsoft_ads.microsoft_ads__ad_group_report
  • Input Column: 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report[campaign_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a join key with the campaigns table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • campaign_id: Directly copied to the output
  • Input Column: 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history[campaign_id]
    • Integration used as a key to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
Column Lineage
%3 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history ad_group_name 135. model.microsoft_ads.microsoft_ads__ad_group_report 135. model.microsoft_ads.microsoft_ads__ad_group_report ad_group_name 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f0->135. model.microsoft_ads.microsoft_ads__ad_group_report:f0 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp name 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp:f0->149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f0
149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history
  • Input Column: 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • ad_group_name: Directly mapped to this output column
135. model.microsoft_ads.microsoft_ads__ad_group_report
  • Input Column: 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history[ad_group_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_name: directly copied
Column Lineage
%3 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report ad_group_id 135. model.microsoft_ads.microsoft_ads__ad_group_report 135. model.microsoft_ads.microsoft_ads__ad_group_report ad_group_id 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f0->135. model.microsoft_ads.microsoft_ads__ad_group_report:f0 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history ad_group_id 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f0->135. model.microsoft_ads.microsoft_ads__ad_group_report:f0 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp ad_group_id 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp:f0->147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f0 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp id 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp:f0->149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f0
147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report
  • Input Column: 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp[ad_group_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT type
    • Output Columns:
      • ad_group_id: Directly mapped
149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history
  • Input Column: 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp[id]
    • Direct The column is directly copied without transformation
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • ad_group_id: Directly mapped to this output column
135. model.microsoft_ads.microsoft_ads__ad_group_report
  • Input Column: 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report[ad_group_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a join key with the ad_groups table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • ad_group_id: Directly copied to the output
  • Input Column: 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history[ad_group_id]
    • Integration used as a key to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_id: directly copied
Column Lineage
%3 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report device_os 135. model.microsoft_ads.microsoft_ads__ad_group_report 135. model.microsoft_ads.microsoft_ads__ad_group_report device_os 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f0->135. model.microsoft_ads.microsoft_ads__ad_group_report:f0 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp device_os 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp:f0->147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f0
147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report
  • Input Column: 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp[device_os]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • device_os: Directly mapped
135. model.microsoft_ads.microsoft_ads__ad_group_report
  • Input Column: 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report[device_os]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • device_os: Directly copied to the output
Column Lineage
%3 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report device_type 135. model.microsoft_ads.microsoft_ads__ad_group_report 135. model.microsoft_ads.microsoft_ads__ad_group_report device_type 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f0->135. model.microsoft_ads.microsoft_ads__ad_group_report:f0 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp device_type 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp:f0->147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f0
147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report
  • Input Column: 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp[device_type]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • device_type: Directly mapped
135. model.microsoft_ads.microsoft_ads__ad_group_report
  • Input Column: 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report[device_type]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • device_type: Directly copied to the output
Column Lineage
%3 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report network 135. model.microsoft_ads.microsoft_ads__ad_group_report 135. model.microsoft_ads.microsoft_ads__ad_group_report network 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f0->135. model.microsoft_ads.microsoft_ads__ad_group_report:f0 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp network 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp:f0->147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f0
147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report
  • Input Column: 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp[network]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • network: Directly mapped
135. model.microsoft_ads.microsoft_ads__ad_group_report
  • Input Column: 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report[network]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • network: Directly copied to the output
Column Lineage
%3 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report currency_code 135. model.microsoft_ads.microsoft_ads__ad_group_report 135. model.microsoft_ads.microsoft_ads__ad_group_report currency_code 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f0->135. model.microsoft_ads.microsoft_ads__ad_group_report:f0 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp currency_code 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp:f0->147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f0
147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report
  • Input Column: 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp[currency_code]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • currency_code: Directly mapped
135. model.microsoft_ads.microsoft_ads__ad_group_report
  • Input Column: 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report[currency_code]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • currency_code: Directly copied to the output
Column Lineage
%3 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report clicks 135. model.microsoft_ads.microsoft_ads__ad_group_report 135. model.microsoft_ads.microsoft_ads__ad_group_report clicks 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f0->135. model.microsoft_ads.microsoft_ads__ad_group_report:f0 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp clicks 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp:f0->147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f0
147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report
  • Input Column: 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp[clicks]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • clicks: Directly copied to the output column of the same name
135. model.microsoft_ads.microsoft_ads__ad_group_report
  • Input Column: 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report[clicks]
    • Aggregation The clicks are summed up in the GROUP BY clause
    • Output Columns:
      • clicks: Summed up in the SELECT statement as SUM(report.clicks)
Column Lineage
%3 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report impressions 135. model.microsoft_ads.microsoft_ads__ad_group_report 135. model.microsoft_ads.microsoft_ads__ad_group_report impressions 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f0->135. model.microsoft_ads.microsoft_ads__ad_group_report:f0 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp impressions 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp:f0->147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f0
147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report
  • Input Column: 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp[impressions]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • impressions: Directly copied to the output column of the same name
135. model.microsoft_ads.microsoft_ads__ad_group_report
  • Input Column: 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report[impressions]
    • Aggregation The impressions are summed up in the GROUP BY clause
    • Output Columns:
      • impressions: Summed up in the SELECT statement as SUM(report.impressions)
Column Lineage
%3 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report spend 135. model.microsoft_ads.microsoft_ads__ad_group_report 135. model.microsoft_ads.microsoft_ads__ad_group_report spend 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f0->135. model.microsoft_ads.microsoft_ads__ad_group_report:f0 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp spend 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp:f0->147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f0
147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report
  • Input Column: 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp[spend]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • spend: Directly copied to the output column of the same name
135. model.microsoft_ads.microsoft_ads__ad_group_report
  • Input Column: 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report[spend]
    • Aggregation The spend is summed up in the GROUP BY clause
    • Output Columns:
      • spend: Summed up in the SELECT statement as SUM(report.spend)
136. model.microsoft_ads.microsoft_ads__ad_report

This SQL query integrates data from multiple Microsoft Ads related tables (ad daily report, ad history, ad group history, campaign history, and account history) to create a comprehensive ad performance report. It filters for the most recent records in the history tables, joins these tables with the daily report data, and aggregates metrics such as clicks, impressions, and spend. The result is a detailed view of ad performance across various dimensions including account, campaign, ad group, ad, device, and network.

FilteringIntegrationAggregation
SQL Query
WITH report AS (
  SELECT
    *
  FROM TEST.PUBLIC_microsoft_ads_source.stg_microsoft_ads__ad_daily_report
), ads AS (
  SELECT
    *
  FROM TEST.PUBLIC_microsoft_ads_source.stg_microsoft_ads__ad_history
  WHERE
    is_most_recent_record = TRUE
), ad_groups AS (
  SELECT
    *
  FROM TEST.PUBLIC_microsoft_ads_source.stg_microsoft_ads__ad_group_history
  WHERE
    is_most_recent_record = TRUE
), campaigns AS (
  SELECT
    *
  FROM TEST.PUBLIC_microsoft_ads_source.stg_microsoft_ads__campaign_history
  WHERE
    is_most_recent_record = TRUE
), accounts AS (
  SELECT
    *
  FROM TEST.PUBLIC_microsoft_ads_source.stg_microsoft_ads__account_history
  WHERE
    is_most_recent_record = TRUE
), joined AS (
  SELECT
    report.source_relation,
    report.date_day,
    accounts.account_name,
    report.account_id,
    campaigns.campaign_name,
    report.campaign_id,
    ad_groups.ad_group_name,
    report.ad_group_id,
    ads.ad_name,
    report.ad_id,
    ads.type AS ad_type,
    report.device_os,
    report.device_type,
    report.network,
    report.currency_code,
    SUM(report.clicks) AS clicks,
    SUM(report.impressions) AS impressions,
    SUM(report.spend) AS spend
  FROM report
  LEFT JOIN ads
    ON report.ad_id = ads.ad_id AND report.source_relation = ads.source_relation
  LEFT JOIN ad_groups
    ON report.ad_group_id = ad_groups.ad_group_id
    AND report.source_relation = ad_groups.source_relation
  LEFT JOIN campaigns
    ON report.campaign_id = campaigns.campaign_id
    AND report.source_relation = campaigns.source_relation
  LEFT JOIN accounts
    ON report.account_id = accounts.account_id
    AND report.source_relation = accounts.source_relation
  GROUP BY
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10,
    11,
    12,
    13,
    14,
    15
)
SELECT
  *
FROM joined
%3 136. model.microsoft_ads.microsoft_ads__ad_report 136. model.microsoft_ads.microsoft_ads__ad_report source_relation date_day account_name account_id campaign_name campaign_id ad_group_name ad_group_id ad_name ad_id ad_type device_os device_type network currency_code clicks impressions spend 143. model.microsoft_ads_source.stg_microsoft_ads__account_history 143. model.microsoft_ads_source.stg_microsoft_ads__account_history source_relation account_id account_name 143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0->136. model.microsoft_ads.microsoft_ads__ad_report:f0 143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f1->136. model.microsoft_ads.microsoft_ads__ad_report:f3 143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f2->136. model.microsoft_ads.microsoft_ads__ad_report:f2 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report source_relation date_day account_id campaign_id ad_group_id ad_id currency_code device_os device_type network clicks impressions spend 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0->136. model.microsoft_ads.microsoft_ads__ad_report:f0 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f1->136. model.microsoft_ads.microsoft_ads__ad_report:f1 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f2->136. model.microsoft_ads.microsoft_ads__ad_report:f3 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f3->136. model.microsoft_ads.microsoft_ads__ad_report:f5 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f4->136. model.microsoft_ads.microsoft_ads__ad_report:f7 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f5->136. model.microsoft_ads.microsoft_ads__ad_report:f9 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f6->136. model.microsoft_ads.microsoft_ads__ad_report:f14 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f7->136. model.microsoft_ads.microsoft_ads__ad_report:f11 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f8->136. model.microsoft_ads.microsoft_ads__ad_report:f12 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f9->136. model.microsoft_ads.microsoft_ads__ad_report:f13 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f10->136. model.microsoft_ads.microsoft_ads__ad_report:f15 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f11->136. model.microsoft_ads.microsoft_ads__ad_report:f16 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f12->136. model.microsoft_ads.microsoft_ads__ad_report:f17 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history source_relation ad_group_id ad_group_name 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f0->136. model.microsoft_ads.microsoft_ads__ad_report:f0 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f1->136. model.microsoft_ads.microsoft_ads__ad_report:f7 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f2->136. model.microsoft_ads.microsoft_ads__ad_report:f6 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history source_relation ad_id ad_name type 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->136. model.microsoft_ads.microsoft_ads__ad_report:f0 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f1->136. model.microsoft_ads.microsoft_ads__ad_report:f9 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f2->136. model.microsoft_ads.microsoft_ads__ad_report:f8 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f3->136. model.microsoft_ads.microsoft_ads__ad_report:f10 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history source_relation campaign_id campaign_name 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0->136. model.microsoft_ads.microsoft_ads__ad_report:f0 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f1->136. model.microsoft_ads.microsoft_ads__ad_report:f5 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f2->136. model.microsoft_ads.microsoft_ads__ad_report:f4
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
date_day date The date of the report.
account_name character varying The name of the account, if present in the source data.
account_id bigint The ID representing the account.
campaign_name text The name of the campaign, if present in the source data.
campaign_id bigint The ID representing the campaign, if present in the source data.
ad_group_name text The name of the ad group, if present in the source data.
ad_group_id bigint The ID representing the ad group, if present in the source data.
ad_name text The name of the ad, if present in the source data.
ad_id bigint The ID representing the ad, if present in the source data.
ad_type text The type of the ad in Google Ads.
device_os text The device operating system associated with this record; values include but may not be limited to 'Windows', 'iOS', 'Android', 'Other', 'BlackBerry' and 'Unknown'.
device_type text The device type associated with this record; values include but may not be limited to 'Computer', 'Smartphone', 'Tablet' and 'Unknown'.
network text The network associated with this record.
currency_code text The currency used for all monetary values for entities under this profile.
clicks bigint The count of clicks.
impressions bigint The count of impressions.
spend double precision The cost of the ads.
Column Lineage
%3 143. model.microsoft_ads_source.stg_microsoft_ads__account_history 143. model.microsoft_ads_source.stg_microsoft_ads__account_history source_relation 136. model.microsoft_ads.microsoft_ads__ad_report 136. model.microsoft_ads.microsoft_ads__ad_report source_relation 143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0->136. model.microsoft_ads.microsoft_ads__ad_report:f0 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report source_relation 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0->136. model.microsoft_ads.microsoft_ads__ad_report:f0 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history source_relation 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f0->136. model.microsoft_ads.microsoft_ads__ad_report:f0 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history source_relation 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->136. model.microsoft_ads.microsoft_ads__ad_report:f0 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history source_relation 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0->136. model.microsoft_ads.microsoft_ads__ad_report:f0
136. model.microsoft_ads.microsoft_ads__ad_report
  • Input Column: 143. model.microsoft_ads_source.stg_microsoft_ads__account_history[source_relation]
    • Integration used as part of the join condition with the report table
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with other tables
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
  • Input Column: 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history[source_relation]
    • Integration used as part of the join condition with the report table
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
Column Lineage
%3 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report date_day 136. model.microsoft_ads.microsoft_ads__ad_report 136. model.microsoft_ads.microsoft_ads__ad_report date_day 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0->136. model.microsoft_ads.microsoft_ads__ad_report:f0 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp date 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp:f0->145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0
145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report
  • Input Column: 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp[date]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as DATE type
    • Output Columns:
      • date_day: Directly mapped and renamed
136. model.microsoft_ads.microsoft_ads__ad_report
  • Input Column: 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 143. model.microsoft_ads_source.stg_microsoft_ads__account_history 143. model.microsoft_ads_source.stg_microsoft_ads__account_history account_name 136. model.microsoft_ads.microsoft_ads__ad_report 136. model.microsoft_ads.microsoft_ads__ad_report account_name 143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0->136. model.microsoft_ads.microsoft_ads__ad_report:f0 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp name 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp:f0->143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0
143. model.microsoft_ads_source.stg_microsoft_ads__account_history
  • Input Column: 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • account_name: Directly mapped to this output column
136. model.microsoft_ads.microsoft_ads__ad_report
  • Input Column: 143. model.microsoft_ads_source.stg_microsoft_ads__account_history[account_name]
    • Direct directly copied to the output
    • Output Columns:
      • account_name: directly copied
Column Lineage
%3 143. model.microsoft_ads_source.stg_microsoft_ads__account_history 143. model.microsoft_ads_source.stg_microsoft_ads__account_history account_id 136. model.microsoft_ads.microsoft_ads__ad_report 136. model.microsoft_ads.microsoft_ads__ad_report account_id 143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0->136. model.microsoft_ads.microsoft_ads__ad_report:f0 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report account_id 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0->136. model.microsoft_ads.microsoft_ads__ad_report:f0 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp id 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp:f0->143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp account_id 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp:f0->145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0
143. model.microsoft_ads_source.stg_microsoft_ads__account_history
  • Input Column: 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp[id]
    • Direct The column is directly copied without transformation
    • Deduplication Used in the PARTITION BY clause of the ROW_NUMBER() function to identify the most recent record for each account
    • Output Columns:
      • account_id: Directly mapped to this output column
145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report
  • Input Column: 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp[account_id]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as INT type
    • Output Columns:
      • account_id: Directly mapped
136. model.microsoft_ads.microsoft_ads__ad_report
  • Input Column: 143. model.microsoft_ads_source.stg_microsoft_ads__account_history[account_id]
    • Integration used as part of the join condition with the report table
    • Output Columns:
      • account_id: directly copied from the report table, not this table
  • Input Column: 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report[account_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with the accounts table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • account_id: Directly copied to the output
Column Lineage
%3 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history campaign_name 136. model.microsoft_ads.microsoft_ads__ad_report 136. model.microsoft_ads.microsoft_ads__ad_report campaign_name 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0->136. model.microsoft_ads.microsoft_ads__ad_report:f0 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp name 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp:f0->155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0
155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history
  • Input Column: 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • campaign_name: Directly mapped
136. model.microsoft_ads.microsoft_ads__ad_report
  • Input Column: 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history[campaign_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_name: directly copied
Column Lineage
%3 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report campaign_id 136. model.microsoft_ads.microsoft_ads__ad_report 136. model.microsoft_ads.microsoft_ads__ad_report campaign_id 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0->136. model.microsoft_ads.microsoft_ads__ad_report:f0 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history campaign_id 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0->136. model.microsoft_ads.microsoft_ads__ad_report:f0 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp campaign_id 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp:f0->145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp id 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp:f0->155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0
145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report
  • Input Column: 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp[campaign_id]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as INT type
    • Output Columns:
      • campaign_id: Directly mapped
155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history
  • Input Column: 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp[id]
    • Direct The column is directly copied without transformation
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • campaign_id: Directly mapped
136. model.microsoft_ads.microsoft_ads__ad_report
  • Input Column: 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report[campaign_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with the campaigns table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • campaign_id: Directly copied to the output
  • Input Column: 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history[campaign_id]
    • Integration used as the key to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
Column Lineage
%3 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history ad_group_name 136. model.microsoft_ads.microsoft_ads__ad_report 136. model.microsoft_ads.microsoft_ads__ad_report ad_group_name 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f0->136. model.microsoft_ads.microsoft_ads__ad_report:f0 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp name 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp:f0->149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f0
149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history
  • Input Column: 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • ad_group_name: Directly mapped to this output column
136. model.microsoft_ads.microsoft_ads__ad_report
  • Input Column: 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history[ad_group_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_name: directly copied
Column Lineage
%3 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report ad_group_id 136. model.microsoft_ads.microsoft_ads__ad_report 136. model.microsoft_ads.microsoft_ads__ad_report ad_group_id 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0->136. model.microsoft_ads.microsoft_ads__ad_report:f0 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history ad_group_id 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f0->136. model.microsoft_ads.microsoft_ads__ad_report:f0 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp ad_group_id 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp:f0->145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp id 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp:f0->149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f0
145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report
  • Input Column: 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp[ad_group_id]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as INT type
    • Output Columns:
      • ad_group_id: Directly mapped
149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history
  • Input Column: 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp[id]
    • Direct The column is directly copied without transformation
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • ad_group_id: Directly mapped to this output column
136. model.microsoft_ads.microsoft_ads__ad_report
  • Input Column: 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report[ad_group_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with the ad_groups table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • ad_group_id: Directly copied to the output
  • Input Column: 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history[ad_group_id]
    • Integration used as the key to join with the report table
    • Output Columns:
      • ad_group_id: directly copied
Column Lineage
%3 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history ad_name 136. model.microsoft_ads.microsoft_ads__ad_report 136. model.microsoft_ads.microsoft_ads__ad_report ad_name 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->136. model.microsoft_ads.microsoft_ads__ad_report:f0 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp title_part_1 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp:f0->151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0
151. model.microsoft_ads_source.stg_microsoft_ads__ad_history
  • Input Column: 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp[title_part_1]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • ad_name: Directly mapped and renamed
136. model.microsoft_ads.microsoft_ads__ad_report
  • Input Column: 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history[ad_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_name: directly copied
Column Lineage
%3 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report ad_id 136. model.microsoft_ads.microsoft_ads__ad_report 136. model.microsoft_ads.microsoft_ads__ad_report ad_id 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0->136. model.microsoft_ads.microsoft_ads__ad_report:f0 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history ad_id 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->136. model.microsoft_ads.microsoft_ads__ad_report:f0 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp ad_id 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp:f0->145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp id 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp:f0->151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0
145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report
  • Input Column: 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp[ad_id]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as INT type
    • Output Columns:
      • ad_id: Directly mapped
151. model.microsoft_ads_source.stg_microsoft_ads__ad_history
  • Input Column: 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp[id]
    • Direct The column is directly copied without transformation
    • Deduplication Used in the PARTITION BY clause of ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • ad_id: Directly mapped and renamed
136. model.microsoft_ads.microsoft_ads__ad_report
  • Input Column: 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report[ad_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with the ads table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • ad_id: Directly copied to the output
  • Input Column: 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history[ad_id]
    • Integration used as the key to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • ad_id: directly copied
Column Lineage
%3 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history type 136. model.microsoft_ads.microsoft_ads__ad_report 136. model.microsoft_ads.microsoft_ads__ad_report ad_type 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->136. model.microsoft_ads.microsoft_ads__ad_report:f0 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp type 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp:f0->151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0
151. model.microsoft_ads_source.stg_microsoft_ads__ad_history
  • Input Column: 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp[type]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • type: Directly mapped without renaming
136. model.microsoft_ads.microsoft_ads__ad_report
  • Input Column: 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history[type]
    • Direct directly copied to the output
    • Output Columns:
      • ad_type: directly copied
Column Lineage
%3 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report device_os 136. model.microsoft_ads.microsoft_ads__ad_report 136. model.microsoft_ads.microsoft_ads__ad_report device_os 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0->136. model.microsoft_ads.microsoft_ads__ad_report:f0 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp device_os 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp:f0->145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0
145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report
  • Input Column: 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp[device_os]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • device_os: Directly mapped
136. model.microsoft_ads.microsoft_ads__ad_report
  • Input Column: 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report[device_os]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • device_os: Directly copied to the output
Column Lineage
%3 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report device_type 136. model.microsoft_ads.microsoft_ads__ad_report 136. model.microsoft_ads.microsoft_ads__ad_report device_type 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0->136. model.microsoft_ads.microsoft_ads__ad_report:f0 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp device_type 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp:f0->145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0
145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report
  • Input Column: 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp[device_type]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • device_type: Directly mapped
136. model.microsoft_ads.microsoft_ads__ad_report
  • Input Column: 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report[device_type]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • device_type: Directly copied to the output
Column Lineage
%3 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report network 136. model.microsoft_ads.microsoft_ads__ad_report 136. model.microsoft_ads.microsoft_ads__ad_report network 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0->136. model.microsoft_ads.microsoft_ads__ad_report:f0 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp network 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp:f0->145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0
145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report
  • Input Column: 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp[network]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • network: Directly mapped
136. model.microsoft_ads.microsoft_ads__ad_report
  • Input Column: 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report[network]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • network: Directly copied to the output
Column Lineage
%3 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report currency_code 136. model.microsoft_ads.microsoft_ads__ad_report 136. model.microsoft_ads.microsoft_ads__ad_report currency_code 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0->136. model.microsoft_ads.microsoft_ads__ad_report:f0 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp currency_code 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp:f0->145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0
145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report
  • Input Column: 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp[currency_code]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • currency_code: Directly mapped
136. model.microsoft_ads.microsoft_ads__ad_report
  • Input Column: 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report[currency_code]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • currency_code: Directly copied to the output
Column Lineage
%3 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report clicks 136. model.microsoft_ads.microsoft_ads__ad_report 136. model.microsoft_ads.microsoft_ads__ad_report clicks 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0->136. model.microsoft_ads.microsoft_ads__ad_report:f0 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp clicks 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp:f0->145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0
145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report
  • Input Column: 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp[clicks]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT
    • Output Columns:
      • clicks: Directly copied to the output column after casting
136. model.microsoft_ads.microsoft_ads__ad_report
  • Input Column: 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report[clicks]
    • Aggregation The clicks are summed up in the GROUP BY clause
    • Output Columns:
      • clicks: Summed up in the SELECT statement
Column Lineage
%3 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report impressions 136. model.microsoft_ads.microsoft_ads__ad_report 136. model.microsoft_ads.microsoft_ads__ad_report impressions 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0->136. model.microsoft_ads.microsoft_ads__ad_report:f0 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp impressions 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp:f0->145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0
145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report
  • Input Column: 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp[impressions]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT
    • Output Columns:
      • impressions: Directly copied to the output column after casting
136. model.microsoft_ads.microsoft_ads__ad_report
  • Input Column: 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report[impressions]
    • Aggregation The impressions are summed up in the GROUP BY clause
    • Output Columns:
      • impressions: Summed up in the SELECT statement
Column Lineage
%3 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report spend 136. model.microsoft_ads.microsoft_ads__ad_report 136. model.microsoft_ads.microsoft_ads__ad_report spend 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0->136. model.microsoft_ads.microsoft_ads__ad_report:f0 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp spend 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp:f0->145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0
145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report
  • Input Column: 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp[spend]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as FLOAT
    • Output Columns:
      • spend: Directly copied to the output column after casting
136. model.microsoft_ads.microsoft_ads__ad_report
  • Input Column: 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report[spend]
    • Aggregation The spend is summed up in the GROUP BY clause
    • Output Columns:
      • spend: Summed up in the SELECT statement
137. model.microsoft_ads.microsoft_ads__campaign_report

This SQL query integrates data from three sources: campaign daily reports, campaign history, and account history. It joins these tables based on account and campaign IDs, filtering for the most recent records in the history tables. The query then aggregates data, calculating sums for clicks, impressions, and spend, while grouping by various dimensions such as date, account, campaign, device, and network information. The result is a comprehensive report that combines campaign performance metrics with the latest account and campaign details.

FilteringIntegrationAggregation
SQL Query
WITH report AS (
  SELECT
    *
  FROM TEST.PUBLIC_microsoft_ads_source.stg_microsoft_ads__campaign_daily_report
), campaigns AS (
  SELECT
    *
  FROM TEST.PUBLIC_microsoft_ads_source.stg_microsoft_ads__campaign_history
  WHERE
    is_most_recent_record = TRUE
), accounts AS (
  SELECT
    *
  FROM TEST.PUBLIC_microsoft_ads_source.stg_microsoft_ads__account_history
  WHERE
    is_most_recent_record = TRUE
), joined AS (
  SELECT
    report.source_relation,
    report.date_day,
    accounts.account_name,
    report.account_id,
    campaigns.campaign_name,
    report.campaign_id,
    campaigns.type AS campaign_type,
    campaigns.time_zone AS campaign_timezone,
    campaigns.status AS campaign_status,
    report.device_os,
    report.device_type,
    report.network,
    report.currency_code,
    SUM(report.clicks) AS clicks,
    SUM(report.impressions) AS impressions,
    SUM(report.spend) AS spend
  FROM report
  LEFT JOIN accounts
    ON report.account_id = accounts.account_id
    AND report.source_relation = accounts.source_relation
  LEFT JOIN campaigns
    ON report.campaign_id = campaigns.campaign_id
    AND report.source_relation = campaigns.source_relation
  GROUP BY
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10,
    11,
    12,
    13
)
SELECT
  *
FROM joined
%3 137. model.microsoft_ads.microsoft_ads__campaign_report 137. model.microsoft_ads.microsoft_ads__campaign_report source_relation date_day account_name account_id campaign_name campaign_id campaign_type campaign_timezone campaign_status device_os device_type network currency_code clicks impressions spend 143. model.microsoft_ads_source.stg_microsoft_ads__account_history 143. model.microsoft_ads_source.stg_microsoft_ads__account_history source_relation account_id account_name 143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0->137. model.microsoft_ads.microsoft_ads__campaign_report:f0 143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f1->137. model.microsoft_ads.microsoft_ads__campaign_report:f3 143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f2->137. model.microsoft_ads.microsoft_ads__campaign_report:f2 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report source_relation date_day account_id campaign_id currency_code device_os device_type network clicks impressions spend 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f0->137. model.microsoft_ads.microsoft_ads__campaign_report:f0 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f1->137. model.microsoft_ads.microsoft_ads__campaign_report:f1 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f2->137. model.microsoft_ads.microsoft_ads__campaign_report:f3 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f3->137. model.microsoft_ads.microsoft_ads__campaign_report:f5 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f4->137. model.microsoft_ads.microsoft_ads__campaign_report:f12 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f5->137. model.microsoft_ads.microsoft_ads__campaign_report:f9 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f6->137. model.microsoft_ads.microsoft_ads__campaign_report:f10 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f7->137. model.microsoft_ads.microsoft_ads__campaign_report:f11 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f8->137. model.microsoft_ads.microsoft_ads__campaign_report:f13 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f9->137. model.microsoft_ads.microsoft_ads__campaign_report:f14 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f10->137. model.microsoft_ads.microsoft_ads__campaign_report:f15 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history source_relation campaign_id campaign_name type time_zone status 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0->137. model.microsoft_ads.microsoft_ads__campaign_report:f0 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f1->137. model.microsoft_ads.microsoft_ads__campaign_report:f5 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f2->137. model.microsoft_ads.microsoft_ads__campaign_report:f4 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f3->137. model.microsoft_ads.microsoft_ads__campaign_report:f6 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f4->137. model.microsoft_ads.microsoft_ads__campaign_report:f7 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f5->137. model.microsoft_ads.microsoft_ads__campaign_report:f8
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
date_day date The date of the report.
account_name character varying The name of the account, if present in the source data.
account_id bigint The ID representing the account.
campaign_name text The name of the campaign, if present in the source data.
campaign_id bigint The ID representing the campaign, if present in the source data.
campaign_type text The campaign type associated with this record; see the following [documentation](https://docs.microsoft.com/en-us/advertising/campaign-management-service/campaigntype?view=bingads-13) for more information on values and definitions.
campaign_timezone text The time zone associated with this campaign.
campaign_status text Status of the Campaign.
device_os text The device operating system associated with this record; values include but may not be limited to 'Windows', 'iOS', 'Android', 'Other', 'BlackBerry' and 'Unknown'.
device_type text The device type associated with this record; values include but may not be limited to 'Computer', 'Smartphone', 'Tablet' and 'Unknown'.
network text The network associated with this record.
currency_code text The currency used for all monetary values for entities under this profile.
clicks bigint The count of clicks.
impressions bigint The count of impressions.
spend double precision The cost of the ads.
Column Lineage
%3 143. model.microsoft_ads_source.stg_microsoft_ads__account_history 143. model.microsoft_ads_source.stg_microsoft_ads__account_history source_relation 137. model.microsoft_ads.microsoft_ads__campaign_report 137. model.microsoft_ads.microsoft_ads__campaign_report source_relation 143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0->137. model.microsoft_ads.microsoft_ads__campaign_report:f0 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report source_relation 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f0->137. model.microsoft_ads.microsoft_ads__campaign_report:f0 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history source_relation 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0->137. model.microsoft_ads.microsoft_ads__campaign_report:f0
137. model.microsoft_ads.microsoft_ads__campaign_report
  • Input Column: 143. model.microsoft_ads_source.stg_microsoft_ads__account_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with other tables
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
  • Input Column: 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
Column Lineage
%3 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report date_day 137. model.microsoft_ads.microsoft_ads__campaign_report 137. model.microsoft_ads.microsoft_ads__campaign_report date_day 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f0->137. model.microsoft_ads.microsoft_ads__campaign_report:f0 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp date 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp:f0->153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f0
153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report
  • Input Column: 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp[date]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to DATE type
    • Output Columns:
      • date_day: Directly mapped and renamed
137. model.microsoft_ads.microsoft_ads__campaign_report
  • Input Column: 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 143. model.microsoft_ads_source.stg_microsoft_ads__account_history 143. model.microsoft_ads_source.stg_microsoft_ads__account_history account_name 137. model.microsoft_ads.microsoft_ads__campaign_report 137. model.microsoft_ads.microsoft_ads__campaign_report account_name 143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0->137. model.microsoft_ads.microsoft_ads__campaign_report:f0 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp name 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp:f0->143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0
143. model.microsoft_ads_source.stg_microsoft_ads__account_history
  • Input Column: 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • account_name: Directly mapped to this output column
137. model.microsoft_ads.microsoft_ads__campaign_report
  • Input Column: 143. model.microsoft_ads_source.stg_microsoft_ads__account_history[account_name]
    • Direct directly copied to the output
    • Output Columns:
      • account_name: directly copied
Column Lineage
%3 143. model.microsoft_ads_source.stg_microsoft_ads__account_history 143. model.microsoft_ads_source.stg_microsoft_ads__account_history account_id 137. model.microsoft_ads.microsoft_ads__campaign_report 137. model.microsoft_ads.microsoft_ads__campaign_report account_id 143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0->137. model.microsoft_ads.microsoft_ads__campaign_report:f0 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report account_id 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f0->137. model.microsoft_ads.microsoft_ads__campaign_report:f0 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp id 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp:f0->143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp account_id 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp:f0->153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f0
143. model.microsoft_ads_source.stg_microsoft_ads__account_history
  • Input Column: 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp[id]
    • Direct The column is directly copied without transformation
    • Deduplication Used in the PARTITION BY clause of the ROW_NUMBER() function to identify the most recent record for each account
    • Output Columns:
      • account_id: Directly mapped to this output column
153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report
  • Input Column: 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp[account_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to INT type
    • Output Columns:
      • account_id: Directly mapped
137. model.microsoft_ads.microsoft_ads__campaign_report
  • Input Column: 143. model.microsoft_ads_source.stg_microsoft_ads__account_history[account_id]
    • Integration used as the key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • account_id: directly copied
  • Input Column: 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report[account_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with the accounts table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • account_id: Directly copied to the output
Column Lineage
%3 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history campaign_name 137. model.microsoft_ads.microsoft_ads__campaign_report 137. model.microsoft_ads.microsoft_ads__campaign_report campaign_name 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0->137. model.microsoft_ads.microsoft_ads__campaign_report:f0 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp name 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp:f0->155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0
155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history
  • Input Column: 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • campaign_name: Directly mapped
137. model.microsoft_ads.microsoft_ads__campaign_report
  • Input Column: 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history[campaign_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_name: directly copied
Column Lineage
%3 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report campaign_id 137. model.microsoft_ads.microsoft_ads__campaign_report 137. model.microsoft_ads.microsoft_ads__campaign_report campaign_id 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f0->137. model.microsoft_ads.microsoft_ads__campaign_report:f0 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history campaign_id 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0->137. model.microsoft_ads.microsoft_ads__campaign_report:f0 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp campaign_id 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp:f0->153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f0 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp id 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp:f0->155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0
153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report
  • Input Column: 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp[campaign_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to INT type
    • Output Columns:
      • campaign_id: Directly mapped
155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history
  • Input Column: 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp[id]
    • Direct The column is directly copied without transformation
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • campaign_id: Directly mapped
137. model.microsoft_ads.microsoft_ads__campaign_report
  • Input Column: 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report[campaign_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with the campaigns table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • campaign_id: Directly copied to the output
  • Input Column: 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history[campaign_id]
    • Integration used as part of the join condition with the report table
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
Column Lineage
%3 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history type 137. model.microsoft_ads.microsoft_ads__campaign_report 137. model.microsoft_ads.microsoft_ads__campaign_report campaign_type 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0->137. model.microsoft_ads.microsoft_ads__campaign_report:f0 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp type 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp:f0->155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0
155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history
  • Input Column: 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp[type]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • type: Directly mapped
137. model.microsoft_ads.microsoft_ads__campaign_report
  • Input Column: 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history[type]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_type: directly copied
Column Lineage
%3 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history time_zone 137. model.microsoft_ads.microsoft_ads__campaign_report 137. model.microsoft_ads.microsoft_ads__campaign_report campaign_timezone 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0->137. model.microsoft_ads.microsoft_ads__campaign_report:f0 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp time_zone 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp:f0->155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0
155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history
  • Input Column: 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp[time_zone]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • time_zone: Directly mapped
137. model.microsoft_ads.microsoft_ads__campaign_report
  • Input Column: 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history[time_zone]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_timezone: directly copied
Column Lineage
%3 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history status 137. model.microsoft_ads.microsoft_ads__campaign_report 137. model.microsoft_ads.microsoft_ads__campaign_report campaign_status 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0->137. model.microsoft_ads.microsoft_ads__campaign_report:f0 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp status 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp:f0->155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0
155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history
  • Input Column: 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp[status]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • status: Directly mapped
137. model.microsoft_ads.microsoft_ads__campaign_report
  • Input Column: 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history[status]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_status: directly copied
Column Lineage
%3 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report device_os 137. model.microsoft_ads.microsoft_ads__campaign_report 137. model.microsoft_ads.microsoft_ads__campaign_report device_os 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f0->137. model.microsoft_ads.microsoft_ads__campaign_report:f0 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp device_os 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp:f0->153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f0
153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report
  • Input Column: 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp[device_os]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • device_os: Directly mapped
137. model.microsoft_ads.microsoft_ads__campaign_report
  • Input Column: 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report[device_os]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • device_os: Directly copied to the output
Column Lineage
%3 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report device_type 137. model.microsoft_ads.microsoft_ads__campaign_report 137. model.microsoft_ads.microsoft_ads__campaign_report device_type 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f0->137. model.microsoft_ads.microsoft_ads__campaign_report:f0 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp device_type 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp:f0->153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f0
153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report
  • Input Column: 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp[device_type]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • device_type: Directly mapped
137. model.microsoft_ads.microsoft_ads__campaign_report
  • Input Column: 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report[device_type]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • device_type: Directly copied to the output
Column Lineage
%3 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report network 137. model.microsoft_ads.microsoft_ads__campaign_report 137. model.microsoft_ads.microsoft_ads__campaign_report network 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f0->137. model.microsoft_ads.microsoft_ads__campaign_report:f0 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp network 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp:f0->153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f0
153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report
  • Input Column: 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp[network]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • network: Directly mapped
137. model.microsoft_ads.microsoft_ads__campaign_report
  • Input Column: 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report[network]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • network: Directly copied to the output
Column Lineage
%3 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report currency_code 137. model.microsoft_ads.microsoft_ads__campaign_report 137. model.microsoft_ads.microsoft_ads__campaign_report currency_code 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f0->137. model.microsoft_ads.microsoft_ads__campaign_report:f0 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp currency_code 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp:f0->153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f0
153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report
  • Input Column: 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp[currency_code]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • currency_code: Directly mapped
137. model.microsoft_ads.microsoft_ads__campaign_report
  • Input Column: 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report[currency_code]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • currency_code: Directly copied to the output
Column Lineage
%3 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report clicks 137. model.microsoft_ads.microsoft_ads__campaign_report 137. model.microsoft_ads.microsoft_ads__campaign_report clicks 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f0->137. model.microsoft_ads.microsoft_ads__campaign_report:f0 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp clicks 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp:f0->153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f0
153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report
  • Input Column: 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp[clicks]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT in the 'fields' CTE
    • Output Columns:
      • clicks: Directly mapped to the output column
137. model.microsoft_ads.microsoft_ads__campaign_report
  • Input Column: 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report[clicks]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • clicks: Summed up and directly mapped to the output 'clicks' column
Column Lineage
%3 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report impressions 137. model.microsoft_ads.microsoft_ads__campaign_report 137. model.microsoft_ads.microsoft_ads__campaign_report impressions 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f0->137. model.microsoft_ads.microsoft_ads__campaign_report:f0 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp impressions 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp:f0->153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f0
153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report
  • Input Column: 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp[impressions]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT in the 'fields' CTE
    • Output Columns:
      • impressions: Directly mapped to the output column
137. model.microsoft_ads.microsoft_ads__campaign_report
  • Input Column: 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report[impressions]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • impressions: Summed up and directly mapped to the output 'impressions' column
Column Lineage
%3 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report spend 137. model.microsoft_ads.microsoft_ads__campaign_report 137. model.microsoft_ads.microsoft_ads__campaign_report spend 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f0->137. model.microsoft_ads.microsoft_ads__campaign_report:f0 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp spend 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp:f0->153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f0
153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report
  • Input Column: 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp[spend]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as FLOAT in the 'fields' CTE
    • Output Columns:
      • spend: Directly mapped to the output column
137. model.microsoft_ads.microsoft_ads__campaign_report
  • Input Column: 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report[spend]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • spend: Summed up and directly mapped to the output 'spend' column
138. model.microsoft_ads.microsoft_ads__keyword_report

This SQL query combines data from multiple Microsoft Ads-related tables to create a comprehensive keyword report. It joins daily keyword report data with the most recent records from keyword, ad, ad group, campaign, and account history tables. The query then aggregates the data, summarizing clicks, impressions, and spend while grouping by various dimensions such as date, account, campaign, ad group, ad, keyword, and device information.

FilteringIntegrationAggregation
SQL Query
WITH report AS (
  SELECT
    *
  FROM TEST.PUBLIC_microsoft_ads_source.stg_microsoft_ads__keyword_daily_report
), keywords AS (
  SELECT
    *
  FROM TEST.PUBLIC_microsoft_ads_source.stg_microsoft_ads__keyword_history
  WHERE
    is_most_recent_record = TRUE
), ads AS (
  SELECT
    *
  FROM TEST.PUBLIC_microsoft_ads_source.stg_microsoft_ads__ad_history
  WHERE
    is_most_recent_record = TRUE
), ad_groups AS (
  SELECT
    *
  FROM TEST.PUBLIC_microsoft_ads_source.stg_microsoft_ads__ad_group_history
  WHERE
    is_most_recent_record = TRUE
), campaigns AS (
  SELECT
    *
  FROM TEST.PUBLIC_microsoft_ads_source.stg_microsoft_ads__campaign_history
  WHERE
    is_most_recent_record = TRUE
), accounts AS (
  SELECT
    *
  FROM TEST.PUBLIC_microsoft_ads_source.stg_microsoft_ads__account_history
  WHERE
    is_most_recent_record = TRUE
), joined AS (
  SELECT
    report.source_relation,
    report.date_day,
    accounts.account_name,
    report.account_id,
    campaigns.campaign_name,
    report.campaign_id,
    ad_groups.ad_group_name,
    report.ad_group_id,
    ads.ad_name,
    report.ad_id,
    keywords.keyword_name,
    report.keyword_id,
    keywords.match_type,
    report.device_os,
    report.device_type,
    report.network,
    report.currency_code,
    SUM(report.clicks) AS clicks,
    SUM(report.impressions) AS impressions,
    SUM(report.spend) AS spend
  FROM report
  LEFT JOIN ads
    ON report.ad_id = ads.ad_id AND report.source_relation = ads.source_relation
  LEFT JOIN ad_groups
    ON report.ad_group_id = ad_groups.ad_group_id
    AND report.source_relation = ad_groups.source_relation
  LEFT JOIN campaigns
    ON report.campaign_id = campaigns.campaign_id
    AND report.source_relation = campaigns.source_relation
  LEFT JOIN accounts
    ON report.account_id = accounts.account_id
    AND report.source_relation = accounts.source_relation
  LEFT JOIN keywords
    ON report.keyword_id = keywords.keyword_id
    AND report.source_relation = keywords.source_relation
  GROUP BY
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10,
    11,
    12,
    13,
    14,
    15,
    16,
    17
)
SELECT
  *
FROM joined
%3 138. model.microsoft_ads.microsoft_ads__keyword_report 138. model.microsoft_ads.microsoft_ads__keyword_report source_relation date_day account_name account_id campaign_name campaign_id ad_group_name ad_group_id ad_name ad_id keyword_name keyword_id match_type device_os device_type network currency_code clicks impressions spend 143. model.microsoft_ads_source.stg_microsoft_ads__account_history 143. model.microsoft_ads_source.stg_microsoft_ads__account_history source_relation account_id account_name 143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0 143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f1->138. model.microsoft_ads.microsoft_ads__keyword_report:f3 143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f2->138. model.microsoft_ads.microsoft_ads__keyword_report:f2 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history source_relation ad_group_id ad_group_name 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f1->138. model.microsoft_ads.microsoft_ads__keyword_report:f7 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f2->138. model.microsoft_ads.microsoft_ads__keyword_report:f6 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history source_relation ad_id ad_name 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f1->138. model.microsoft_ads.microsoft_ads__keyword_report:f9 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f2->138. model.microsoft_ads.microsoft_ads__keyword_report:f8 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history source_relation campaign_id campaign_name 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f1->138. model.microsoft_ads.microsoft_ads__keyword_report:f5 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f2->138. model.microsoft_ads.microsoft_ads__keyword_report:f4 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report source_relation date_day account_id campaign_id ad_group_id ad_id keyword_id currency_code device_os device_type network clicks impressions spend 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f1->138. model.microsoft_ads.microsoft_ads__keyword_report:f1 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f2->138. model.microsoft_ads.microsoft_ads__keyword_report:f3 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f3->138. model.microsoft_ads.microsoft_ads__keyword_report:f5 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f4->138. model.microsoft_ads.microsoft_ads__keyword_report:f7 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f5->138. model.microsoft_ads.microsoft_ads__keyword_report:f9 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f6->138. model.microsoft_ads.microsoft_ads__keyword_report:f11 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f7->138. model.microsoft_ads.microsoft_ads__keyword_report:f16 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f8->138. model.microsoft_ads.microsoft_ads__keyword_report:f13 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f9->138. model.microsoft_ads.microsoft_ads__keyword_report:f14 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f10->138. model.microsoft_ads.microsoft_ads__keyword_report:f15 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f11->138. model.microsoft_ads.microsoft_ads__keyword_report:f17 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f12->138. model.microsoft_ads.microsoft_ads__keyword_report:f18 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f13->138. model.microsoft_ads.microsoft_ads__keyword_report:f19 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history source_relation keyword_id keyword_name match_type 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history:f1->138. model.microsoft_ads.microsoft_ads__keyword_report:f11 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history:f2->138. model.microsoft_ads.microsoft_ads__keyword_report:f10 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history:f3->138. model.microsoft_ads.microsoft_ads__keyword_report:f12
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
date_day date The date of the report.
account_name character varying The name of the account, if present in the source data.
account_id bigint The ID representing the account.
campaign_name text The name of the campaign, if present in the source data.
campaign_id bigint The ID representing the campaign, if present in the source data.
ad_group_name text The name of the ad group, if present in the source data.
ad_group_id bigint The ID representing the ad group, if present in the source data.
ad_name text The name of the ad, if present in the source data.
ad_id bigint The ID representing the ad, if present in the source data.
keyword_name text The keyword(s) associated with this record.
keyword_id bigint The ID representing the keyword, if present in the source data.
match_type text Type of matching for the keyword used in bid. One of: BROAD, PHRASE, or EXACT.
device_os text The device operating system associated with this record; values include but may not be limited to 'Windows', 'iOS', 'Android', 'Other', 'BlackBerry' and 'Unknown'.
device_type text The device type associated with this record; values include but may not be limited to 'Computer', 'Smartphone', 'Tablet' and 'Unknown'.
network text The network associated with this record.
currency_code text The currency used for all monetary values for entities under this profile.
clicks bigint The count of clicks.
impressions bigint The count of impressions.
spend double precision The cost of the ads.
Column Lineage
%3 143. model.microsoft_ads_source.stg_microsoft_ads__account_history 143. model.microsoft_ads_source.stg_microsoft_ads__account_history source_relation 138. model.microsoft_ads.microsoft_ads__keyword_report 138. model.microsoft_ads.microsoft_ads__keyword_report source_relation 143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history source_relation 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history source_relation 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history source_relation 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report source_relation 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history source_relation 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0
138. model.microsoft_ads.microsoft_ads__keyword_report
  • Input Column: 143. model.microsoft_ads_source.stg_microsoft_ads__account_history[source_relation]
    • Integration used as part of the join condition with the report table
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history[source_relation]
    • Integration used as part of the join condition with the report table
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history[source_relation]
    • Integration used as a key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history[source_relation]
    • Integration used as part of the join condition with report table
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with other tables
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
  • Input Column: 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history[source_relation]
    • Integration used as part of the join condition with the report table
    • Direct directly selected in the final output
    • Output Columns:
      • source_relation: directly copied to the output
Column Lineage
%3 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report date_day 138. model.microsoft_ads.microsoft_ads__keyword_report 138. model.microsoft_ads.microsoft_ads__keyword_report date_day 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp date 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp:f0->157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0
157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report
  • Input Column: 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp[date]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast to DATE type
    • Output Columns:
      • date_day: Directly mapped after casting
138. model.microsoft_ads.microsoft_ads__keyword_report
  • Input Column: 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 143. model.microsoft_ads_source.stg_microsoft_ads__account_history 143. model.microsoft_ads_source.stg_microsoft_ads__account_history account_name 138. model.microsoft_ads.microsoft_ads__keyword_report 138. model.microsoft_ads.microsoft_ads__keyword_report account_name 143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp name 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp:f0->143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0
143. model.microsoft_ads_source.stg_microsoft_ads__account_history
  • Input Column: 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • account_name: Directly mapped to this output column
138. model.microsoft_ads.microsoft_ads__keyword_report
  • Input Column: 143. model.microsoft_ads_source.stg_microsoft_ads__account_history[account_name]
    • Direct directly copied to the output
    • Output Columns:
      • account_name: directly copied
Column Lineage
%3 143. model.microsoft_ads_source.stg_microsoft_ads__account_history 143. model.microsoft_ads_source.stg_microsoft_ads__account_history account_id 138. model.microsoft_ads.microsoft_ads__keyword_report 138. model.microsoft_ads.microsoft_ads__keyword_report account_id 143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report account_id 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp id 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp:f0->143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp account_id 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp:f0->157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0
143. model.microsoft_ads_source.stg_microsoft_ads__account_history
  • Input Column: 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp[id]
    • Direct The column is directly copied without transformation
    • Deduplication Used in the PARTITION BY clause of the ROW_NUMBER() function to identify the most recent record for each account
    • Output Columns:
      • account_id: Directly mapped to this output column
157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report
  • Input Column: 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp[account_id]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast to INT type
    • Output Columns:
      • account_id: Directly mapped after casting
138. model.microsoft_ads.microsoft_ads__keyword_report
  • Input Column: 143. model.microsoft_ads_source.stg_microsoft_ads__account_history[account_id]
    • Integration used as part of the join condition with the report table
    • Output Columns:
      • account_id: directly copied from the report table, not this table
  • Input Column: 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report[account_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with the accounts table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • account_id: Directly copied to the output
Column Lineage
%3 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history campaign_name 138. model.microsoft_ads.microsoft_ads__keyword_report 138. model.microsoft_ads.microsoft_ads__keyword_report campaign_name 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp name 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp:f0->155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0
155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history
  • Input Column: 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • campaign_name: Directly mapped
138. model.microsoft_ads.microsoft_ads__keyword_report
  • Input Column: 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history[campaign_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_name: directly copied
Column Lineage
%3 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history campaign_id 138. model.microsoft_ads.microsoft_ads__keyword_report 138. model.microsoft_ads.microsoft_ads__keyword_report campaign_id 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report campaign_id 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp id 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp:f0->155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp campaign_id 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp:f0->157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0
155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history
  • Input Column: 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp[id]
    • Direct The column is directly copied without transformation
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • campaign_id: Directly mapped
157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report
  • Input Column: 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp[campaign_id]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast to INT type
    • Output Columns:
      • campaign_id: Directly mapped after casting
138. model.microsoft_ads.microsoft_ads__keyword_report
  • Input Column: 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history[campaign_id]
    • Integration used as part of the join condition with report table
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
  • Input Column: 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report[campaign_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with the campaigns table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • campaign_id: Directly copied to the output
Column Lineage
%3 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history ad_group_name 138. model.microsoft_ads.microsoft_ads__keyword_report 138. model.microsoft_ads.microsoft_ads__keyword_report ad_group_name 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp name 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp:f0->149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f0
149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history
  • Input Column: 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • ad_group_name: Directly mapped to this output column
138. model.microsoft_ads.microsoft_ads__keyword_report
  • Input Column: 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history[ad_group_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_name: directly copied
Column Lineage
%3 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history ad_group_id 138. model.microsoft_ads.microsoft_ads__keyword_report 138. model.microsoft_ads.microsoft_ads__keyword_report ad_group_id 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report ad_group_id 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp id 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp:f0->149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f0 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp ad_group_id 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp:f0->157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0
149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history
  • Input Column: 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp[id]
    • Direct The column is directly copied without transformation
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • ad_group_id: Directly mapped to this output column
157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report
  • Input Column: 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp[ad_group_id]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast to INT type
    • Output Columns:
      • ad_group_id: Directly mapped after casting
138. model.microsoft_ads.microsoft_ads__keyword_report
  • Input Column: 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history[ad_group_id]
    • Integration used as the key to join with the report table
    • Output Columns:
      • ad_group_id: directly copied
  • Input Column: 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report[ad_group_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with the ad_groups table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • ad_group_id: Directly copied to the output
Column Lineage
%3 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history ad_name 138. model.microsoft_ads.microsoft_ads__keyword_report 138. model.microsoft_ads.microsoft_ads__keyword_report ad_name 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp title_part_1 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp:f0->151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0
151. model.microsoft_ads_source.stg_microsoft_ads__ad_history
  • Input Column: 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp[title_part_1]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • ad_name: Directly mapped and renamed
138. model.microsoft_ads.microsoft_ads__keyword_report
  • Input Column: 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history[ad_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_name: directly copied
Column Lineage
%3 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history ad_id 138. model.microsoft_ads.microsoft_ads__keyword_report 138. model.microsoft_ads.microsoft_ads__keyword_report ad_id 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report ad_id 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp id 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp:f0->151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp ad_id 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp:f0->157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0
151. model.microsoft_ads_source.stg_microsoft_ads__ad_history
  • Input Column: 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp[id]
    • Direct The column is directly copied without transformation
    • Deduplication Used in the PARTITION BY clause of ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • ad_id: Directly mapped and renamed
157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report
  • Input Column: 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp[ad_id]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast to INT type
    • Output Columns:
      • ad_id: Directly mapped after casting
138. model.microsoft_ads.microsoft_ads__keyword_report
  • Input Column: 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history[ad_id]
    • Integration used as a key to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • ad_id: directly copied
  • Input Column: 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report[ad_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with the ads table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • ad_id: Directly copied to the output
Column Lineage
%3 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history keyword_name 138. model.microsoft_ads.microsoft_ads__keyword_report 138. model.microsoft_ads.microsoft_ads__keyword_report keyword_name 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0 160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp 160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp name 160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp:f0->159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history:f0
159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history
  • Input Column: 160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp[name]
    • Direct The column is directly copied to the output
    • Output Columns:
      • keyword_name: Directly mapped to this output column
138. model.microsoft_ads.microsoft_ads__keyword_report
  • Input Column: 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history[keyword_name]
    • Direct directly selected in the final output
    • Output Columns:
      • keyword_name: directly copied to the output
Column Lineage
%3 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report keyword_id 138. model.microsoft_ads.microsoft_ads__keyword_report 138. model.microsoft_ads.microsoft_ads__keyword_report keyword_id 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history keyword_id 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp keyword_id 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp:f0->157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0 160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp 160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp id 160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp:f0->159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history:f0
157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report
  • Input Column: 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp[keyword_id]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast to INT type
    • Output Columns:
      • keyword_id: Directly mapped after casting
159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history
  • Input Column: 160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp[id]
    • Direct The column is directly copied to the output
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • keyword_id: Directly mapped to this output column
138. model.microsoft_ads.microsoft_ads__keyword_report
  • Input Column: 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report[keyword_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with the keywords table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • keyword_id: Directly copied to the output
  • Input Column: 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history[keyword_id]
    • Integration used as part of the join condition with the report table
    • Output Columns:
      • keyword_id: directly copied to the output
Column Lineage
%3 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history match_type 138. model.microsoft_ads.microsoft_ads__keyword_report 138. model.microsoft_ads.microsoft_ads__keyword_report match_type 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0 160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp 160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp match_type 160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp:f0->159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history:f0
159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history
  • Input Column: 160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp[match_type]
    • Direct The column is directly copied to the output
    • Output Columns:
      • match_type: Directly mapped to this output column
138. model.microsoft_ads.microsoft_ads__keyword_report
  • Input Column: 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history[match_type]
    • Direct directly selected in the final output
    • Output Columns:
      • match_type: directly copied to the output
Column Lineage
%3 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report device_os 138. model.microsoft_ads.microsoft_ads__keyword_report 138. model.microsoft_ads.microsoft_ads__keyword_report device_os 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp device_os 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp:f0->157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0
157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report
  • Input Column: 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp[device_os]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • device_os: Directly mapped after casting
138. model.microsoft_ads.microsoft_ads__keyword_report
  • Input Column: 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report[device_os]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • device_os: Directly copied to the output
Column Lineage
%3 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report device_type 138. model.microsoft_ads.microsoft_ads__keyword_report 138. model.microsoft_ads.microsoft_ads__keyword_report device_type 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp device_type 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp:f0->157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0
157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report
  • Input Column: 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp[device_type]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • device_type: Directly mapped after casting
138. model.microsoft_ads.microsoft_ads__keyword_report
  • Input Column: 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report[device_type]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • device_type: Directly copied to the output
Column Lineage
%3 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report network 138. model.microsoft_ads.microsoft_ads__keyword_report 138. model.microsoft_ads.microsoft_ads__keyword_report network 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp network 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp:f0->157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0
157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report
  • Input Column: 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp[network]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • network: Directly mapped after casting
138. model.microsoft_ads.microsoft_ads__keyword_report
  • Input Column: 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report[network]
    • Direct The column is directly copied without any transformation
    • Aggregation The column is grouped by in the final SELECT statement
    • Output Columns:
      • network: Directly copied to the output
Column Lineage
%3 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report currency_code 138. model.microsoft_ads.microsoft_ads__keyword_report 138. model.microsoft_ads.microsoft_ads__keyword_report currency_code 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp currency_code 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp:f0->157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0
157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report
  • Input Column: 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp[currency_code]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • currency_code: Directly mapped after casting
138. model.microsoft_ads.microsoft_ads__keyword_report
  • Input Column: 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report[currency_code]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • currency_code: Directly copied to the output
Column Lineage
%3 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report clicks 138. model.microsoft_ads.microsoft_ads__keyword_report 138. model.microsoft_ads.microsoft_ads__keyword_report clicks 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp clicks 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp:f0->157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0
157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report
  • Input Column: 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp[clicks]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to INT data type
    • Output Columns:
      • clicks: Directly mapped after casting
138. model.microsoft_ads.microsoft_ads__keyword_report
  • Input Column: 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report[clicks]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • clicks: Aggregated sum in the output
Column Lineage
%3 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report impressions 138. model.microsoft_ads.microsoft_ads__keyword_report 138. model.microsoft_ads.microsoft_ads__keyword_report impressions 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp impressions 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp:f0->157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0
157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report
  • Input Column: 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp[impressions]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to INT data type
    • Output Columns:
      • impressions: Directly mapped after casting
138. model.microsoft_ads.microsoft_ads__keyword_report
  • Input Column: 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report[impressions]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • impressions: Aggregated sum in the output
Column Lineage
%3 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report spend 138. model.microsoft_ads.microsoft_ads__keyword_report 138. model.microsoft_ads.microsoft_ads__keyword_report spend 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp spend 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp:f0->157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0
157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report
  • Input Column: 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp[spend]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to FLOAT data type
    • Output Columns:
      • spend: Directly mapped after casting
138. model.microsoft_ads.microsoft_ads__keyword_report
  • Input Column: 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report[spend]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • spend: Aggregated sum in the output
139. model.microsoft_ads.microsoft_ads__search_report

This SQL query integrates data from multiple Microsoft Ads-related tables to create a comprehensive search report. It joins historical data from accounts, campaigns, ad groups, ads, and keywords with daily search report data. The query filters for the most recent records in the historical tables, combines this information with the daily report, and aggregates metrics such as clicks, impressions, and spend. The result is a detailed view of search performance across various dimensions like account, campaign, ad group, keyword, and device.

FilteringIntegrationAggregation
SQL Query
WITH report AS (
  SELECT
    *
  FROM TEST.PUBLIC_microsoft_ads_source.stg_microsoft_ads__search_daily_report
), keywords AS (
  SELECT
    *
  FROM TEST.PUBLIC_microsoft_ads_source.stg_microsoft_ads__keyword_history
  WHERE
    is_most_recent_record = TRUE
), ads AS (
  SELECT
    *
  FROM TEST.PUBLIC_microsoft_ads_source.stg_microsoft_ads__ad_history
  WHERE
    is_most_recent_record = TRUE
), ad_groups AS (
  SELECT
    *
  FROM TEST.PUBLIC_microsoft_ads_source.stg_microsoft_ads__ad_group_history
  WHERE
    is_most_recent_record = TRUE
), campaigns AS (
  SELECT
    *
  FROM TEST.PUBLIC_microsoft_ads_source.stg_microsoft_ads__campaign_history
  WHERE
    is_most_recent_record = TRUE
), accounts AS (
  SELECT
    *
  FROM TEST.PUBLIC_microsoft_ads_source.stg_microsoft_ads__account_history
  WHERE
    is_most_recent_record = TRUE
), joined AS (
  SELECT
    report.source_relation,
    report.date_day,
    accounts.account_name,
    report.account_id,
    campaigns.campaign_name,
    report.campaign_id,
    ad_groups.ad_group_name,
    report.ad_group_id,
    ads.ad_name,
    report.ad_id,
    report.keyword_id,
    keywords.keyword_name,
    COALESCE(report.delivered_match_type, report.bid_match_type) AS match_type,
    report.search_query,
    report.device_os,
    report.device_type,
    report.network,
    SUM(report.clicks) AS clicks,
    SUM(report.impressions) AS impressions,
    SUM(report.spend) AS spend
  FROM report
  LEFT JOIN ads
    ON report.ad_id = ads.ad_id AND report.source_relation = ads.source_relation
  LEFT JOIN ad_groups
    ON report.ad_group_id = ad_groups.ad_group_id
    AND report.source_relation = ad_groups.source_relation
  LEFT JOIN campaigns
    ON report.campaign_id = campaigns.campaign_id
    AND report.source_relation = campaigns.source_relation
  LEFT JOIN accounts
    ON report.account_id = accounts.account_id
    AND report.source_relation = accounts.source_relation
  LEFT JOIN keywords
    ON report.keyword_id = keywords.keyword_id
    AND report.source_relation = keywords.source_relation
  GROUP BY
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10,
    11,
    12,
    13,
    14,
    15,
    16,
    17
)
SELECT
  *
FROM joined
%3 139. model.microsoft_ads.microsoft_ads__search_report 139. model.microsoft_ads.microsoft_ads__search_report source_relation date_day account_name account_id campaign_name campaign_id ad_group_name ad_group_id ad_name ad_id keyword_name keyword_id match_type search_query device_os device_type network clicks impressions spend 143. model.microsoft_ads_source.stg_microsoft_ads__account_history 143. model.microsoft_ads_source.stg_microsoft_ads__account_history source_relation account_id account_name 143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0 143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f1->139. model.microsoft_ads.microsoft_ads__search_report:f3 143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f2->139. model.microsoft_ads.microsoft_ads__search_report:f2 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history source_relation ad_group_id ad_group_name 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f1->139. model.microsoft_ads.microsoft_ads__search_report:f7 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f2->139. model.microsoft_ads.microsoft_ads__search_report:f6 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history source_relation ad_id ad_name 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f1->139. model.microsoft_ads.microsoft_ads__search_report:f9 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f2->139. model.microsoft_ads.microsoft_ads__search_report:f8 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history source_relation campaign_id campaign_name 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f1->139. model.microsoft_ads.microsoft_ads__search_report:f5 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f2->139. model.microsoft_ads.microsoft_ads__search_report:f4 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history source_relation keyword_id keyword_name 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history:f1->139. model.microsoft_ads.microsoft_ads__search_report:f11 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history:f2->139. model.microsoft_ads.microsoft_ads__search_report:f10 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report source_relation date_day account_id campaign_id ad_group_id ad_id keyword_id search_query device_os device_type network bid_match_type delivered_match_type clicks impressions spend 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f1->139. model.microsoft_ads.microsoft_ads__search_report:f1 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f2->139. model.microsoft_ads.microsoft_ads__search_report:f3 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f3->139. model.microsoft_ads.microsoft_ads__search_report:f5 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f4->139. model.microsoft_ads.microsoft_ads__search_report:f7 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f5->139. model.microsoft_ads.microsoft_ads__search_report:f9 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f6->139. model.microsoft_ads.microsoft_ads__search_report:f11 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f7->139. model.microsoft_ads.microsoft_ads__search_report:f13 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f8->139. model.microsoft_ads.microsoft_ads__search_report:f14 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f9->139. model.microsoft_ads.microsoft_ads__search_report:f15 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f10->139. model.microsoft_ads.microsoft_ads__search_report:f16 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f11->139. model.microsoft_ads.microsoft_ads__search_report:f12 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f12->139. model.microsoft_ads.microsoft_ads__search_report:f12 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f13->139. model.microsoft_ads.microsoft_ads__search_report:f17 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f14->139. model.microsoft_ads.microsoft_ads__search_report:f18 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f15->139. model.microsoft_ads.microsoft_ads__search_report:f19
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
date_day date The date of the report.
account_name character varying The name of the account, if present in the source data.
account_id bigint The ID representing the account.
campaign_name text The name of the campaign, if present in the source data.
campaign_id bigint The ID representing the campaign, if present in the source data.
ad_group_name text The name of the ad group, if present in the source data.
ad_group_id bigint The ID representing the ad group, if present in the source data.
ad_name text The name of the ad, if present in the source data.
ad_id bigint The ID representing the ad, if present in the source data.
keyword_name text The keyword(s) associated with this record.
keyword_id bigint The ID representing the keyword, if present in the source data.
match_type text Type of matching for the keyword used in bid. One of: BROAD, PHRASE, or EXACT.
search_query text The search query text.
device_os text The device operating system associated with this record; values include but may not be limited to 'Windows', 'iOS', 'Android', 'Other', 'BlackBerry' and 'Unknown'.
device_type text The device type associated with this record; values include but may not be limited to 'Computer', 'Smartphone', 'Tablet' and 'Unknown'.
network text The network associated with this record.
clicks bigint The count of clicks.
impressions bigint The count of impressions.
spend double precision The cost of the ads.
Column Lineage
%3 143. model.microsoft_ads_source.stg_microsoft_ads__account_history 143. model.microsoft_ads_source.stg_microsoft_ads__account_history source_relation 139. model.microsoft_ads.microsoft_ads__search_report 139. model.microsoft_ads.microsoft_ads__search_report source_relation 143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history source_relation 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history source_relation 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history source_relation 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history source_relation 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report source_relation 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0
139. model.microsoft_ads.microsoft_ads__search_report
  • Input Column: 143. model.microsoft_ads_source.stg_microsoft_ads__account_history[source_relation]
    • Integration Used as part of the JOIN condition to link with other tables
    • Direct Directly copied to the output
    • Output Columns:
      • source_relation: Directly copied
  • Input Column: 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history[source_relation]
    • Integration used as a join key with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history[source_relation]
    • Integration used as part of the JOIN condition with the report table
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history[source_relation]
    • Integration used as part of the join condition with the report table
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history[source_relation]
    • Integration used as a key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with other tables
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
Column Lineage
%3 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report date_day 139. model.microsoft_ads.microsoft_ads__search_report 139. model.microsoft_ads.microsoft_ads__search_report date_day 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp date 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp:f0->161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0
161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report
  • Input Column: 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp[date]
    • Cleaning The column is cast to DATE type
    • Output Columns:
      • date_day: It is directly mapped to date_day after casting
139. model.microsoft_ads.microsoft_ads__search_report
  • Input Column: 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 143. model.microsoft_ads_source.stg_microsoft_ads__account_history 143. model.microsoft_ads_source.stg_microsoft_ads__account_history account_name 139. model.microsoft_ads.microsoft_ads__search_report 139. model.microsoft_ads.microsoft_ads__search_report account_name 143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp name 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp:f0->143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0
143. model.microsoft_ads_source.stg_microsoft_ads__account_history
  • Input Column: 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • account_name: Directly mapped to this output column
139. model.microsoft_ads.microsoft_ads__search_report
  • Input Column: 143. model.microsoft_ads_source.stg_microsoft_ads__account_history[account_name]
    • Direct Directly copied to the output
    • Output Columns:
      • account_name: Directly copied
Column Lineage
%3 143. model.microsoft_ads_source.stg_microsoft_ads__account_history 143. model.microsoft_ads_source.stg_microsoft_ads__account_history account_id 139. model.microsoft_ads.microsoft_ads__search_report 139. model.microsoft_ads.microsoft_ads__search_report account_id 143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report account_id 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp id 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp:f0->143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp account_id 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp:f0->161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0
143. model.microsoft_ads_source.stg_microsoft_ads__account_history
  • Input Column: 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp[id]
    • Direct The column is directly copied without transformation
    • Deduplication Used in the PARTITION BY clause of the ROW_NUMBER() function to identify the most recent record for each account
    • Output Columns:
      • account_id: Directly mapped to this output column
161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report
  • Input Column: 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp[account_id]
    • Cleaning The column is cast to INT type
    • Output Columns:
      • account_id: It is directly mapped to account_id after casting
139. model.microsoft_ads.microsoft_ads__search_report
  • Input Column: 143. model.microsoft_ads_source.stg_microsoft_ads__account_history[account_id]
    • Integration Used as part of the JOIN condition to link with other tables
    • Direct Directly copied to the output
    • Output Columns:
      • account_id: Directly copied
  • Input Column: 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report[account_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a join key with the accounts table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • account_id: Directly copied to the output
Column Lineage
%3 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history campaign_name 139. model.microsoft_ads.microsoft_ads__search_report 139. model.microsoft_ads.microsoft_ads__search_report campaign_name 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp name 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp:f0->155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0
155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history
  • Input Column: 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • campaign_name: Directly mapped
139. model.microsoft_ads.microsoft_ads__search_report
  • Input Column: 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history[campaign_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_name: directly copied
Column Lineage
%3 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history campaign_id 139. model.microsoft_ads.microsoft_ads__search_report 139. model.microsoft_ads.microsoft_ads__search_report campaign_id 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report campaign_id 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp id 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp:f0->155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp campaign_id 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp:f0->161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0
155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history
  • Input Column: 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp[id]
    • Direct The column is directly copied without transformation
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • campaign_id: Directly mapped
161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report
  • Input Column: 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp[campaign_id]
    • Cleaning The column is cast to INT type
    • Output Columns:
      • campaign_id: It is directly mapped to campaign_id after casting
139. model.microsoft_ads.microsoft_ads__search_report
  • Input Column: 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history[campaign_id]
    • Integration used as the key to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
  • Input Column: 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report[campaign_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a join key with the campaigns table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • campaign_id: Directly copied to the output
Column Lineage
%3 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history ad_group_name 139. model.microsoft_ads.microsoft_ads__search_report 139. model.microsoft_ads.microsoft_ads__search_report ad_group_name 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp name 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp:f0->149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f0
149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history
  • Input Column: 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • ad_group_name: Directly mapped to this output column
139. model.microsoft_ads.microsoft_ads__search_report
  • Input Column: 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history[ad_group_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_name: directly copied
Column Lineage
%3 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history ad_group_id 139. model.microsoft_ads.microsoft_ads__search_report 139. model.microsoft_ads.microsoft_ads__search_report ad_group_id 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report ad_group_id 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp id 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp:f0->149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f0 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp ad_group_id 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp:f0->161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0
149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history
  • Input Column: 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp[id]
    • Direct The column is directly copied without transformation
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • ad_group_id: Directly mapped to this output column
161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report
  • Input Column: 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp[ad_group_id]
    • Cleaning The column is cast to INT type
    • Output Columns:
      • ad_group_id: It is directly mapped to ad_group_id after casting
139. model.microsoft_ads.microsoft_ads__search_report
  • Input Column: 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history[ad_group_id]
    • Integration used as a join key with the report table
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_id: directly copied
  • Input Column: 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report[ad_group_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a join key with the ad_groups table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • ad_group_id: Directly copied to the output
Column Lineage
%3 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history ad_name 139. model.microsoft_ads.microsoft_ads__search_report 139. model.microsoft_ads.microsoft_ads__search_report ad_name 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp title_part_1 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp:f0->151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0
151. model.microsoft_ads_source.stg_microsoft_ads__ad_history
  • Input Column: 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp[title_part_1]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • ad_name: Directly mapped and renamed
139. model.microsoft_ads.microsoft_ads__search_report
  • Input Column: 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history[ad_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_name: directly copied
Column Lineage
%3 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history ad_id 139. model.microsoft_ads.microsoft_ads__search_report 139. model.microsoft_ads.microsoft_ads__search_report ad_id 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report ad_id 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp id 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp:f0->151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp ad_id 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp:f0->161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0
151. model.microsoft_ads_source.stg_microsoft_ads__ad_history
  • Input Column: 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp[id]
    • Direct The column is directly copied without transformation
    • Deduplication Used in the PARTITION BY clause of ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • ad_id: Directly mapped and renamed
161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report
  • Input Column: 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp[ad_id]
    • Cleaning The column is cast to INT type
    • Output Columns:
      • ad_id: It is directly mapped to ad_id after casting
139. model.microsoft_ads.microsoft_ads__search_report
  • Input Column: 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history[ad_id]
    • Integration used as the key to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • ad_id: directly copied
  • Input Column: 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report[ad_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a join key with the ads table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • ad_id: Directly copied to the output
Column Lineage
%3 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history keyword_name 139. model.microsoft_ads.microsoft_ads__search_report 139. model.microsoft_ads.microsoft_ads__search_report keyword_name 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0 160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp 160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp name 160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp:f0->159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history:f0
159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history
  • Input Column: 160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp[name]
    • Direct The column is directly copied to the output
    • Output Columns:
      • keyword_name: Directly mapped to this output column
139. model.microsoft_ads.microsoft_ads__search_report
  • Input Column: 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history[keyword_name]
    • Direct directly copied to the output
    • Output Columns:
      • keyword_name: directly copied
Column Lineage
%3 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history keyword_id 139. model.microsoft_ads.microsoft_ads__search_report 139. model.microsoft_ads.microsoft_ads__search_report keyword_id 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report keyword_id 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0 160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp 160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp id 160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp:f0->159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history:f0 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp keyword_id 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp:f0->161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0
159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history
  • Input Column: 160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp[id]
    • Direct The column is directly copied to the output
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • keyword_id: Directly mapped to this output column
161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report
  • Input Column: 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp[keyword_id]
    • Cleaning The column is cast to INT type
    • Output Columns:
      • keyword_id: It is directly mapped to keyword_id after casting
139. model.microsoft_ads.microsoft_ads__search_report
  • Input Column: 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history[keyword_id]
    • Integration used as a key to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • keyword_id: directly copied
  • Input Column: 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report[keyword_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a join key with the keywords table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • keyword_id: Directly copied to the output
Column Lineage
%3 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report bid_match_type delivered_match_type 139. model.microsoft_ads.microsoft_ads__search_report 139. model.microsoft_ads.microsoft_ads__search_report match_type 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f1->139. model.microsoft_ads.microsoft_ads__search_report:f0 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp bid_match_type delivered_match_type 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp:f0->161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp:f1->161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f1
161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report
  • Input Column: 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp[bid_match_type]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to TEXT data type
    • Output Columns:
      • bid_match_type: Directly mapped after casting
  • Input Column: 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp[delivered_match_type]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to TEXT data type
    • Output Columns:
      • delivered_match_type: Directly mapped after casting
139. model.microsoft_ads.microsoft_ads__search_report
  • Input Column: 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report[bid_match_type]
    • Cleaning Used in COALESCE function to determine match_type
    • Output Columns:
      • match_type: Used as fallback in COALESCE(report.delivered_match_type, report.bid_match_type)
  • Input Column: 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report[delivered_match_type]
    • Cleaning Used in COALESCE function to determine match_type
    • Output Columns:
      • match_type: Primary source in COALESCE(report.delivered_match_type, report.bid_match_type)
Column Lineage
%3 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report search_query 139. model.microsoft_ads.microsoft_ads__search_report 139. model.microsoft_ads.microsoft_ads__search_report search_query 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp search_query 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp:f0->161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0
161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report
  • Input Column: 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp[search_query]
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • search_query: It is directly mapped to search_query after casting
139. model.microsoft_ads.microsoft_ads__search_report
  • Input Column: 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report[search_query]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • search_query: Directly copied to the output
Column Lineage
%3 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report device_os 139. model.microsoft_ads.microsoft_ads__search_report 139. model.microsoft_ads.microsoft_ads__search_report device_os 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp device_os 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp:f0->161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0
161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report
  • Input Column: 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp[device_os]
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • device_os: It is directly mapped to device_os after casting
139. model.microsoft_ads.microsoft_ads__search_report
  • Input Column: 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report[device_os]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • device_os: Directly copied to the output
Column Lineage
%3 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report device_type 139. model.microsoft_ads.microsoft_ads__search_report 139. model.microsoft_ads.microsoft_ads__search_report device_type 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp device_type 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp:f0->161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0
161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report
  • Input Column: 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp[device_type]
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • device_type: It is directly mapped to device_type after casting
139. model.microsoft_ads.microsoft_ads__search_report
  • Input Column: 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report[device_type]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • device_type: Directly copied to the output
Column Lineage
%3 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report network 139. model.microsoft_ads.microsoft_ads__search_report 139. model.microsoft_ads.microsoft_ads__search_report network 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp network 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp:f0->161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0
161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report
  • Input Column: 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp[network]
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • network: It is directly mapped to network after casting
139. model.microsoft_ads.microsoft_ads__search_report
  • Input Column: 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report[network]
    • Direct The column is directly copied without any transformation
    • Aggregation The column is grouped by in the final SELECT statement
    • Output Columns:
      • network: Directly copied to the output
Column Lineage
%3 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report clicks 139. model.microsoft_ads.microsoft_ads__search_report 139. model.microsoft_ads.microsoft_ads__search_report clicks 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp clicks 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp:f0->161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0
161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report
  • Input Column: 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp[clicks]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to INT data type
    • Output Columns:
      • clicks: Directly mapped after casting
139. model.microsoft_ads.microsoft_ads__search_report
  • Input Column: 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report[clicks]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • clicks: Aggregated sum in the output
Column Lineage
%3 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report impressions 139. model.microsoft_ads.microsoft_ads__search_report 139. model.microsoft_ads.microsoft_ads__search_report impressions 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp impressions 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp:f0->161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0
161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report
  • Input Column: 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp[impressions]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to INT data type
    • Output Columns:
      • impressions: Directly mapped after casting
139. model.microsoft_ads.microsoft_ads__search_report
  • Input Column: 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report[impressions]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • impressions: Aggregated sum in the output
Column Lineage
%3 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report spend 139. model.microsoft_ads.microsoft_ads__search_report 139. model.microsoft_ads.microsoft_ads__search_report spend 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp spend 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp:f0->161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0
161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report
  • Input Column: 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp[spend]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to FLOAT data type
    • Output Columns:
      • spend: Directly mapped after casting
139. model.microsoft_ads.microsoft_ads__search_report
  • Input Column: 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report[spend]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • spend: Aggregated sum in the output
140. model.microsoft_ads.microsoft_ads__url_report

This SQL query integrates data from multiple Microsoft Ads related tables (ad daily report, ad history, ad group history, campaign history, and account history) to create a comprehensive URL report. It cleans and extracts various URL components (base URL, host, path) and UTM parameters from the final URL. The query also performs aggregations on metrics like clicks, impressions, and spend. Finally, it filters out records where the base URL is null.

IntegrationCleaningFeaturizationAggregationFiltering
SQL Query
WITH report AS (
  SELECT
    *
  FROM TEST.PUBLIC_microsoft_ads_source.stg_microsoft_ads__ad_daily_report
), ads AS (
  SELECT
    *
  FROM TEST.PUBLIC_microsoft_ads_source.stg_microsoft_ads__ad_history
  WHERE
    is_most_recent_record = TRUE
), ad_groups AS (
  SELECT
    *
  FROM TEST.PUBLIC_microsoft_ads_source.stg_microsoft_ads__ad_group_history
  WHERE
    is_most_recent_record = TRUE
), campaigns AS (
  SELECT
    *
  FROM TEST.PUBLIC_microsoft_ads_source.stg_microsoft_ads__campaign_history
  WHERE
    is_most_recent_record = TRUE
), accounts AS (
  SELECT
    *
  FROM TEST.PUBLIC_microsoft_ads_source.stg_microsoft_ads__account_history
  WHERE
    is_most_recent_record = TRUE
), joined AS (
  SELECT
    report.source_relation,
    report.date_day,
    accounts.account_name,
    report.account_id,
    campaigns.campaign_name,
    report.campaign_id,
    ad_groups.ad_group_name,
    report.ad_group_id,
    ads.ad_name,
    report.ad_id,
    report.device_os,
    report.device_type,
    report.network,
    report.currency_code,
    SPLIT_PART(ads.final_url, '?', 1) AS base_url,
    TRY_CAST(SPLIT_PART(
      SPLIT_PART(
        REPLACE(REPLACE(REPLACE(ads.final_url, 'android-app://', ''), 'http://', ''), 'https://', ''),
        '/',
        1
      ),
      '?',
      1
    ) AS TEXT) AS url_host,
    '/' || TRY_CAST(SPLIT_PART(
      CASE
        WHEN LENGTH(REPLACE(REPLACE(ads.final_url, 'http://', ''), 'https://', '')) - COALESCE(
          NULLIF(
            STR_POSITION(REPLACE(REPLACE(ads.final_url, 'http://', ''), 'https://', ''), '/'),
            0
          ),
          STR_POSITION(REPLACE(REPLACE(ads.final_url, 'http://', ''), 'https://', ''), '?') - 1
        ) = 0
        THEN ''
        ELSE RIGHT(
          REPLACE(REPLACE(ads.final_url, 'http://', ''), 'https://', ''),
          LENGTH(REPLACE(REPLACE(ads.final_url, 'http://', ''), 'https://', '')) - COALESCE(
            NULLIF(
              STR_POSITION(REPLACE(REPLACE(ads.final_url, 'http://', ''), 'https://', ''), '/'),
              0
            ),
            STR_POSITION(REPLACE(REPLACE(ads.final_url, 'http://', ''), 'https://', ''), '?') - 1
          )
        )
      END,
      '?',
      1
    ) AS TEXT) AS url_path,
    NULLIF(SPLIT_PART(SPLIT_PART(ads.final_url, 'utm_source=', 2), '&', 1), '') AS utm_source,
    NULLIF(SPLIT_PART(SPLIT_PART(ads.final_url, 'utm_medium=', 2), '&', 1), '') AS utm_medium,
    NULLIF(SPLIT_PART(SPLIT_PART(ads.final_url, 'utm_campaign=', 2), '&', 1), '') AS utm_campaign,
    NULLIF(SPLIT_PART(SPLIT_PART(ads.final_url, 'utm_content=', 2), '&', 1), '') AS utm_content,
    NULLIF(SPLIT_PART(SPLIT_PART(ads.final_url, 'utm_term=', 2), '&', 1), '') AS utm_term,
    SUM(report.clicks) AS clicks,
    SUM(report.impressions) AS impressions,
    SUM(report.spend) AS spend
  FROM report
  LEFT JOIN ads
    ON report.ad_id = ads.ad_id AND report.source_relation = ads.source_relation
  LEFT JOIN ad_groups
    ON report.ad_group_id = ad_groups.ad_group_id
    AND report.source_relation = ad_groups.source_relation
  LEFT JOIN campaigns
    ON report.campaign_id = campaigns.campaign_id
    AND report.source_relation = campaigns.source_relation
  LEFT JOIN accounts
    ON report.account_id = accounts.account_id
    AND report.source_relation = accounts.source_relation
  GROUP BY
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10,
    11,
    12,
    13,
    14,
    15,
    16,
    17,
    18,
    19,
    20,
    21,
    22
), filtered AS (
  SELECT
    *
  FROM joined
  WHERE
    NOT base_url IS NULL
)
SELECT
  *
FROM filtered
%3 140. model.microsoft_ads.microsoft_ads__url_report 140. model.microsoft_ads.microsoft_ads__url_report source_relation date_day account_name account_id campaign_name campaign_id ad_group_name ad_group_id ad_name ad_id device_os device_type network currency_code base_url url_host url_path utm_source utm_medium utm_campaign utm_content utm_term clicks impressions spend 143. model.microsoft_ads_source.stg_microsoft_ads__account_history 143. model.microsoft_ads_source.stg_microsoft_ads__account_history source_relation account_id account_name 143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0 143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f1->140. model.microsoft_ads.microsoft_ads__url_report:f3 143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f2->140. model.microsoft_ads.microsoft_ads__url_report:f2 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report source_relation date_day account_id campaign_id ad_group_id ad_id currency_code device_os device_type network clicks impressions spend 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f1->140. model.microsoft_ads.microsoft_ads__url_report:f1 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f2->140. model.microsoft_ads.microsoft_ads__url_report:f3 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f3->140. model.microsoft_ads.microsoft_ads__url_report:f5 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f4->140. model.microsoft_ads.microsoft_ads__url_report:f7 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f5->140. model.microsoft_ads.microsoft_ads__url_report:f9 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f6->140. model.microsoft_ads.microsoft_ads__url_report:f13 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f7->140. model.microsoft_ads.microsoft_ads__url_report:f10 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f8->140. model.microsoft_ads.microsoft_ads__url_report:f11 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f9->140. model.microsoft_ads.microsoft_ads__url_report:f12 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f10->140. model.microsoft_ads.microsoft_ads__url_report:f22 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f11->140. model.microsoft_ads.microsoft_ads__url_report:f23 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f12->140. model.microsoft_ads.microsoft_ads__url_report:f24 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history source_relation ad_group_id ad_group_name 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f1->140. model.microsoft_ads.microsoft_ads__url_report:f7 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f2->140. model.microsoft_ads.microsoft_ads__url_report:f6 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history source_relation ad_id ad_name final_url 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f1->140. model.microsoft_ads.microsoft_ads__url_report:f9 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f2->140. model.microsoft_ads.microsoft_ads__url_report:f8 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f3->140. model.microsoft_ads.microsoft_ads__url_report:f14 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f3->140. model.microsoft_ads.microsoft_ads__url_report:f15 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f3->140. model.microsoft_ads.microsoft_ads__url_report:f16 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f3->140. model.microsoft_ads.microsoft_ads__url_report:f17 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f3->140. model.microsoft_ads.microsoft_ads__url_report:f18 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f3->140. model.microsoft_ads.microsoft_ads__url_report:f19 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f3->140. model.microsoft_ads.microsoft_ads__url_report:f20 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f3->140. model.microsoft_ads.microsoft_ads__url_report:f21 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history source_relation campaign_id campaign_name 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f1->140. model.microsoft_ads.microsoft_ads__url_report:f5 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f2->140. model.microsoft_ads.microsoft_ads__url_report:f4
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
date_day date The date of the report.
account_name character varying The name of the account, if present in the source data.
account_id bigint The ID representing the account.
campaign_name text The name of the campaign, if present in the source data.
campaign_id bigint The ID representing the campaign, if present in the source data.
ad_group_name text The name of the ad group, if present in the source data.
ad_group_id bigint The ID representing the ad group, if present in the source data.
ad_name text The name of the ad, if present in the source data.
ad_id bigint The ID representing the ad, if present in the source data.
device_os text The device operating system associated with this record; values include but may not be limited to 'Windows', 'iOS', 'Android', 'Other', 'BlackBerry' and 'Unknown'.
device_type text The device type associated with this record; values include but may not be limited to 'Computer', 'Smartphone', 'Tablet' and 'Unknown'.
network text The network associated with this record.
currency_code text The currency used for all monetary values for entities under this profile.
base_url text The base URL of the ad, extracted from the `final_url`.
url_host text The URL host of the ad, extracted from the `final_url`.
url_path text The URL path of the ad, extracted from the `final_url`.
utm_source text The site that sent traffic to your page. Microsoft Advertising sets this to Bing; extracted from the `final_url`.
utm_medium text Which channel was used. Microsoft Advertising sets this to cp; extracted from the `final_url`.
utm_campaign text Which campaign the keyword came from; extracted from the `final_url`.
utm_content text Which ad group the keyword came from; extracted from the `final_url`.
utm_term text Which keyword brought people to your website; extracted from the `final_url`.
clicks bigint The count of clicks.
impressions bigint The count of impressions.
spend double precision The cost of the ads.
Column Lineage
%3 143. model.microsoft_ads_source.stg_microsoft_ads__account_history 143. model.microsoft_ads_source.stg_microsoft_ads__account_history source_relation 140. model.microsoft_ads.microsoft_ads__url_report 140. model.microsoft_ads.microsoft_ads__url_report source_relation 143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report source_relation 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history source_relation 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history source_relation 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history source_relation 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0
140. model.microsoft_ads.microsoft_ads__url_report
  • Input Column: 143. model.microsoft_ads_source.stg_microsoft_ads__account_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct copied directly to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with other tables
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
  • Input Column: 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history[source_relation]
    • Integration used as part of the join condition with the report table
    • Direct copied directly to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
Column Lineage
%3 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report date_day 140. model.microsoft_ads.microsoft_ads__url_report 140. model.microsoft_ads.microsoft_ads__url_report date_day 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp date 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp:f0->145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0
145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report
  • Input Column: 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp[date]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as DATE type
    • Output Columns:
      • date_day: Directly mapped and renamed
140. model.microsoft_ads.microsoft_ads__url_report
  • Input Column: 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 143. model.microsoft_ads_source.stg_microsoft_ads__account_history 143. model.microsoft_ads_source.stg_microsoft_ads__account_history account_name 140. model.microsoft_ads.microsoft_ads__url_report 140. model.microsoft_ads.microsoft_ads__url_report account_name 143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp name 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp:f0->143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0
143. model.microsoft_ads_source.stg_microsoft_ads__account_history
  • Input Column: 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • account_name: Directly mapped to this output column
140. model.microsoft_ads.microsoft_ads__url_report
  • Input Column: 143. model.microsoft_ads_source.stg_microsoft_ads__account_history[account_name]
    • Direct copied directly to the output
    • Output Columns:
      • account_name: directly copied
Column Lineage
%3 143. model.microsoft_ads_source.stg_microsoft_ads__account_history 143. model.microsoft_ads_source.stg_microsoft_ads__account_history account_id 140. model.microsoft_ads.microsoft_ads__url_report 140. model.microsoft_ads.microsoft_ads__url_report account_id 143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report account_id 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp id 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp:f0->143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp account_id 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp:f0->145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0
143. model.microsoft_ads_source.stg_microsoft_ads__account_history
  • Input Column: 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp[id]
    • Direct The column is directly copied without transformation
    • Deduplication Used in the PARTITION BY clause of the ROW_NUMBER() function to identify the most recent record for each account
    • Output Columns:
      • account_id: Directly mapped to this output column
145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report
  • Input Column: 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp[account_id]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as INT type
    • Output Columns:
      • account_id: Directly mapped
140. model.microsoft_ads.microsoft_ads__url_report
  • Input Column: 143. model.microsoft_ads_source.stg_microsoft_ads__account_history[account_id]
    • Integration used as part of the join condition with other tables
    • Direct copied directly to the output
    • Output Columns:
      • account_id: directly copied
  • Input Column: 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report[account_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a join key with the accounts table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • account_id: Directly copied to the output
Column Lineage
%3 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history campaign_name 140. model.microsoft_ads.microsoft_ads__url_report 140. model.microsoft_ads.microsoft_ads__url_report campaign_name 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp name 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp:f0->155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0
155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history
  • Input Column: 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • campaign_name: Directly mapped
140. model.microsoft_ads.microsoft_ads__url_report
  • Input Column: 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history[campaign_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_name: directly copied
Column Lineage
%3 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report campaign_id 140. model.microsoft_ads.microsoft_ads__url_report 140. model.microsoft_ads.microsoft_ads__url_report campaign_id 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history campaign_id 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp campaign_id 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp:f0->145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp id 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp:f0->155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0
145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report
  • Input Column: 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp[campaign_id]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as INT type
    • Output Columns:
      • campaign_id: Directly mapped
155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history
  • Input Column: 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp[id]
    • Direct The column is directly copied without transformation
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • campaign_id: Directly mapped
140. model.microsoft_ads.microsoft_ads__url_report
  • Input Column: 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report[campaign_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a join key with the campaigns table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • campaign_id: Directly copied to the output
  • Input Column: 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history[campaign_id]
    • Integration used as the key to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
Column Lineage
%3 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history ad_group_name 140. model.microsoft_ads.microsoft_ads__url_report 140. model.microsoft_ads.microsoft_ads__url_report ad_group_name 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp name 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp:f0->149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f0
149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history
  • Input Column: 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • ad_group_name: Directly mapped to this output column
140. model.microsoft_ads.microsoft_ads__url_report
  • Input Column: 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history[ad_group_name]
    • Direct copied directly to the output
    • Output Columns:
      • ad_group_name: directly copied
Column Lineage
%3 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report ad_group_id 140. model.microsoft_ads.microsoft_ads__url_report 140. model.microsoft_ads.microsoft_ads__url_report ad_group_id 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history ad_group_id 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp ad_group_id 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp:f0->145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp id 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp:f0->149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f0
145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report
  • Input Column: 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp[ad_group_id]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as INT type
    • Output Columns:
      • ad_group_id: Directly mapped
149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history
  • Input Column: 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp[id]
    • Direct The column is directly copied without transformation
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • ad_group_id: Directly mapped to this output column
140. model.microsoft_ads.microsoft_ads__url_report
  • Input Column: 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report[ad_group_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a join key with the ad_groups table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • ad_group_id: Directly copied to the output
  • Input Column: 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history[ad_group_id]
    • Integration used as part of the join condition with the report table
    • Output Columns:
      • ad_group_id: directly copied from the report table
Column Lineage
%3 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history ad_name 140. model.microsoft_ads.microsoft_ads__url_report 140. model.microsoft_ads.microsoft_ads__url_report ad_name 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp title_part_1 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp:f0->151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0
151. model.microsoft_ads_source.stg_microsoft_ads__ad_history
  • Input Column: 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp[title_part_1]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • ad_name: Directly mapped and renamed
140. model.microsoft_ads.microsoft_ads__url_report
  • Input Column: 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history[ad_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_name: directly copied
Column Lineage
%3 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report ad_id 140. model.microsoft_ads.microsoft_ads__url_report 140. model.microsoft_ads.microsoft_ads__url_report ad_id 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history ad_id 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp ad_id 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp:f0->145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp id 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp:f0->151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0
145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report
  • Input Column: 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp[ad_id]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as INT type
    • Output Columns:
      • ad_id: Directly mapped
151. model.microsoft_ads_source.stg_microsoft_ads__ad_history
  • Input Column: 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp[id]
    • Direct The column is directly copied without transformation
    • Deduplication Used in the PARTITION BY clause of ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • ad_id: Directly mapped and renamed
140. model.microsoft_ads.microsoft_ads__url_report
  • Input Column: 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report[ad_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a join key with the ads table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • ad_id: Directly copied to the output
  • Input Column: 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history[ad_id]
    • Integration used as the key to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • ad_id: directly copied
Column Lineage
%3 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report device_os 140. model.microsoft_ads.microsoft_ads__url_report 140. model.microsoft_ads.microsoft_ads__url_report device_os 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp device_os 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp:f0->145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0
145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report
  • Input Column: 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp[device_os]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • device_os: Directly mapped
140. model.microsoft_ads.microsoft_ads__url_report
  • Input Column: 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report[device_os]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • device_os: Directly copied to the output
Column Lineage
%3 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report device_type 140. model.microsoft_ads.microsoft_ads__url_report 140. model.microsoft_ads.microsoft_ads__url_report device_type 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp device_type 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp:f0->145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0
145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report
  • Input Column: 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp[device_type]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • device_type: Directly mapped
140. model.microsoft_ads.microsoft_ads__url_report
  • Input Column: 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report[device_type]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • device_type: Directly copied to the output
Column Lineage
%3 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report network 140. model.microsoft_ads.microsoft_ads__url_report 140. model.microsoft_ads.microsoft_ads__url_report network 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp network 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp:f0->145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0
145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report
  • Input Column: 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp[network]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • network: Directly mapped
140. model.microsoft_ads.microsoft_ads__url_report
  • Input Column: 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report[network]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • network: Directly copied to the output
Column Lineage
%3 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report currency_code 140. model.microsoft_ads.microsoft_ads__url_report 140. model.microsoft_ads.microsoft_ads__url_report currency_code 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp currency_code 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp:f0->145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0
145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report
  • Input Column: 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp[currency_code]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • currency_code: Directly mapped
140. model.microsoft_ads.microsoft_ads__url_report
  • Input Column: 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report[currency_code]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • currency_code: Directly copied to the output
Column Lineage
%3 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history final_url 140. model.microsoft_ads.microsoft_ads__url_report 140. model.microsoft_ads.microsoft_ads__url_report base_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f1 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f2 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f6 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f5 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f3 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f4 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f7 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp final_url 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp:f0->151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0
151. model.microsoft_ads_source.stg_microsoft_ads__ad_history
  • Input Column: 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp[final_url]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • final_url: Directly mapped without renaming
140. model.microsoft_ads.microsoft_ads__url_report
  • Input Column: 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history[final_url]
    • Featurization various URL components and UTM parameters are extracted from this column
    • Cleaning the URL is cleaned and processed to extract different parts
    • Output Columns:
      • base_url: extracted from final_url
      • url_host: extracted and cleaned from final_url
      • url_path: extracted and cleaned from final_url
      • utm_source: extracted from final_url
      • utm_medium: extracted from final_url
      • utm_campaign: extracted from final_url
      • utm_content: extracted from final_url
      • utm_term: extracted from final_url
Column Lineage
%3 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history final_url 140. model.microsoft_ads.microsoft_ads__url_report 140. model.microsoft_ads.microsoft_ads__url_report base_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f1 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f2 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f6 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f5 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f3 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f4 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f7 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp final_url 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp:f0->151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0
151. model.microsoft_ads_source.stg_microsoft_ads__ad_history
  • Input Column: 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp[final_url]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • final_url: Directly mapped without renaming
140. model.microsoft_ads.microsoft_ads__url_report
  • Input Column: 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history[final_url]
    • Featurization various URL components and UTM parameters are extracted from this column
    • Cleaning the URL is cleaned and processed to extract different parts
    • Output Columns:
      • base_url: extracted from final_url
      • url_host: extracted and cleaned from final_url
      • url_path: extracted and cleaned from final_url
      • utm_source: extracted from final_url
      • utm_medium: extracted from final_url
      • utm_campaign: extracted from final_url
      • utm_content: extracted from final_url
      • utm_term: extracted from final_url
Column Lineage
%3 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history final_url 140. model.microsoft_ads.microsoft_ads__url_report 140. model.microsoft_ads.microsoft_ads__url_report base_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f1 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f2 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f6 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f5 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f3 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f4 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f7 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp final_url 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp:f0->151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0
151. model.microsoft_ads_source.stg_microsoft_ads__ad_history
  • Input Column: 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp[final_url]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • final_url: Directly mapped without renaming
140. model.microsoft_ads.microsoft_ads__url_report
  • Input Column: 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history[final_url]
    • Featurization various URL components and UTM parameters are extracted from this column
    • Cleaning the URL is cleaned and processed to extract different parts
    • Output Columns:
      • base_url: extracted from final_url
      • url_host: extracted and cleaned from final_url
      • url_path: extracted and cleaned from final_url
      • utm_source: extracted from final_url
      • utm_medium: extracted from final_url
      • utm_campaign: extracted from final_url
      • utm_content: extracted from final_url
      • utm_term: extracted from final_url
Column Lineage
%3 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history final_url 140. model.microsoft_ads.microsoft_ads__url_report 140. model.microsoft_ads.microsoft_ads__url_report base_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f1 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f2 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f6 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f5 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f3 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f4 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f7 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp final_url 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp:f0->151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0
151. model.microsoft_ads_source.stg_microsoft_ads__ad_history
  • Input Column: 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp[final_url]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • final_url: Directly mapped without renaming
140. model.microsoft_ads.microsoft_ads__url_report
  • Input Column: 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history[final_url]
    • Featurization various URL components and UTM parameters are extracted from this column
    • Cleaning the URL is cleaned and processed to extract different parts
    • Output Columns:
      • base_url: extracted from final_url
      • url_host: extracted and cleaned from final_url
      • url_path: extracted and cleaned from final_url
      • utm_source: extracted from final_url
      • utm_medium: extracted from final_url
      • utm_campaign: extracted from final_url
      • utm_content: extracted from final_url
      • utm_term: extracted from final_url
Column Lineage
%3 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history final_url 140. model.microsoft_ads.microsoft_ads__url_report 140. model.microsoft_ads.microsoft_ads__url_report base_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f1 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f2 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f6 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f5 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f3 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f4 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f7 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp final_url 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp:f0->151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0
151. model.microsoft_ads_source.stg_microsoft_ads__ad_history
  • Input Column: 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp[final_url]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • final_url: Directly mapped without renaming
140. model.microsoft_ads.microsoft_ads__url_report
  • Input Column: 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history[final_url]
    • Featurization various URL components and UTM parameters are extracted from this column
    • Cleaning the URL is cleaned and processed to extract different parts
    • Output Columns:
      • base_url: extracted from final_url
      • url_host: extracted and cleaned from final_url
      • url_path: extracted and cleaned from final_url
      • utm_source: extracted from final_url
      • utm_medium: extracted from final_url
      • utm_campaign: extracted from final_url
      • utm_content: extracted from final_url
      • utm_term: extracted from final_url
Column Lineage
%3 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history final_url 140. model.microsoft_ads.microsoft_ads__url_report 140. model.microsoft_ads.microsoft_ads__url_report base_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f1 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f2 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f6 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f5 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f3 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f4 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f7 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp final_url 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp:f0->151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0
151. model.microsoft_ads_source.stg_microsoft_ads__ad_history
  • Input Column: 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp[final_url]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • final_url: Directly mapped without renaming
140. model.microsoft_ads.microsoft_ads__url_report
  • Input Column: 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history[final_url]
    • Featurization various URL components and UTM parameters are extracted from this column
    • Cleaning the URL is cleaned and processed to extract different parts
    • Output Columns:
      • base_url: extracted from final_url
      • url_host: extracted and cleaned from final_url
      • url_path: extracted and cleaned from final_url
      • utm_source: extracted from final_url
      • utm_medium: extracted from final_url
      • utm_campaign: extracted from final_url
      • utm_content: extracted from final_url
      • utm_term: extracted from final_url
Column Lineage
%3 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history final_url 140. model.microsoft_ads.microsoft_ads__url_report 140. model.microsoft_ads.microsoft_ads__url_report base_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f1 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f2 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f6 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f5 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f3 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f4 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f7 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp final_url 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp:f0->151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0
151. model.microsoft_ads_source.stg_microsoft_ads__ad_history
  • Input Column: 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp[final_url]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • final_url: Directly mapped without renaming
140. model.microsoft_ads.microsoft_ads__url_report
  • Input Column: 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history[final_url]
    • Featurization various URL components and UTM parameters are extracted from this column
    • Cleaning the URL is cleaned and processed to extract different parts
    • Output Columns:
      • base_url: extracted from final_url
      • url_host: extracted and cleaned from final_url
      • url_path: extracted and cleaned from final_url
      • utm_source: extracted from final_url
      • utm_medium: extracted from final_url
      • utm_campaign: extracted from final_url
      • utm_content: extracted from final_url
      • utm_term: extracted from final_url
Column Lineage
%3 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history final_url 140. model.microsoft_ads.microsoft_ads__url_report 140. model.microsoft_ads.microsoft_ads__url_report base_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f1 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f2 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f6 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f5 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f3 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f4 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f7 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp final_url 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp:f0->151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0
151. model.microsoft_ads_source.stg_microsoft_ads__ad_history
  • Input Column: 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp[final_url]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • final_url: Directly mapped without renaming
140. model.microsoft_ads.microsoft_ads__url_report
  • Input Column: 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history[final_url]
    • Featurization various URL components and UTM parameters are extracted from this column
    • Cleaning the URL is cleaned and processed to extract different parts
    • Output Columns:
      • base_url: extracted from final_url
      • url_host: extracted and cleaned from final_url
      • url_path: extracted and cleaned from final_url
      • utm_source: extracted from final_url
      • utm_medium: extracted from final_url
      • utm_campaign: extracted from final_url
      • utm_content: extracted from final_url
      • utm_term: extracted from final_url
Column Lineage
%3 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report clicks 140. model.microsoft_ads.microsoft_ads__url_report 140. model.microsoft_ads.microsoft_ads__url_report clicks 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp clicks 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp:f0->145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0
145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report
  • Input Column: 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp[clicks]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT
    • Output Columns:
      • clicks: Directly copied to the output column after casting
140. model.microsoft_ads.microsoft_ads__url_report
  • Input Column: 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report[clicks]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • clicks: The sum of clicks is mapped to the output 'clicks' column
Column Lineage
%3 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report impressions 140. model.microsoft_ads.microsoft_ads__url_report 140. model.microsoft_ads.microsoft_ads__url_report impressions 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp impressions 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp:f0->145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0
145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report
  • Input Column: 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp[impressions]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT
    • Output Columns:
      • impressions: Directly copied to the output column after casting
140. model.microsoft_ads.microsoft_ads__url_report
  • Input Column: 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report[impressions]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • impressions: The sum of impressions is mapped to the output 'impressions' column
Column Lineage
%3 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report spend 140. model.microsoft_ads.microsoft_ads__url_report 140. model.microsoft_ads.microsoft_ads__url_report spend 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp spend 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp:f0->145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0
145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report
  • Input Column: 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp[spend]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as FLOAT
    • Output Columns:
      • spend: Directly copied to the output column after casting
140. model.microsoft_ads.microsoft_ads__url_report
  • Input Column: 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report[spend]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • spend: The sum of spend is mapped to the output 'spend' column
141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report

This SQL query stages data from a temporary table, casts columns to specific data types, renames some columns, and selects a subset of columns for the final output. It appears to be preparing data from a Microsoft Ads account daily report for further use.

CleaningOther
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp
), fields AS (
  SELECT
    CAST(NULL AS INT) AS account_id,
    CAST(NULL AS TEXT) AS ad_distribution,
    CAST(NULL AS TEXT) AS bid_match_type,
    CAST(NULL AS INT) AS clicks,
    CAST(NULL AS TEXT) AS currency_code,
    CAST(NULL AS DATE) AS date,
    CAST(NULL AS TEXT) AS delivered_match_type,
    CAST(NULL AS TEXT) AS device_os,
    CAST(NULL AS TEXT) AS device_type,
    CAST(NULL AS INT) AS impressions,
    CAST(NULL AS TEXT) AS network,
    CAST(NULL AS FLOAT) AS spend,
    CAST(NULL AS TEXT) AS top_vs_other,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    date AS date_day,
    account_id,
    device_os,
    device_type,
    network,
    currency_code,
    ad_distribution,
    bid_match_type,
    delivered_match_type,
    top_vs_other,
    clicks,
    impressions,
    spend
  FROM fields
)
SELECT
  *
FROM final
%3 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report source_relation date_day account_id device_os device_type network currency_code ad_distribution bid_match_type delivered_match_type top_vs_other clicks impressions spend 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp date account_id device_os device_type network currency_code ad_distribution bid_match_type delivered_match_type top_vs_other clicks impressions spend 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp:f0->141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f1 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp:f1->141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f2 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp:f2->141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f3 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp:f3->141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f4 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp:f4->141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f5 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp:f5->141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f6 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp:f6->141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f7 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp:f7->141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f8 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp:f8->141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f9 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp:f9->141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f10 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp:f10->141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f11 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp:f11->141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f12 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp:f12->141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f13
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
date_day date The date of the report.
account_id bigint The ID representing the account.
device_os text The device operating system associated with this record; values include but may not be limited to 'Windows', 'iOS', 'Android', 'Other', 'BlackBerry' and 'Unknown'.
device_type text The device type associated with this record; values include but may not be limited to 'Computer', 'Smartphone', 'Tablet' and 'Unknown'.
network text The network associated with this record.
currency_code text The currency code associated with spend and, if applicable, other metrics associated with currency.
ad_distribution text The distribution medium associated with this record.
bid_match_type text The bid match type associated with this record; values include 'Broad', 'Exact', 'Phrase'.
delivered_match_type text The delivered match type associated with this record; values include 'Broad', 'Exact', 'Phrase'.
top_vs_other text The position of the ad associated with this record. For more information, refer to Microsoft [documentation](https://help.ads.microsoft.com/apex/index/22/en/14009).
clicks integer The count of clicks.
impressions integer The count of impressions.
spend double precision The cost of the ads.
Column Lineage
%3 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report source_relation 134. model.microsoft_ads.microsoft_ads__account_report 134. model.microsoft_ads.microsoft_ads__account_report source_relation 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f0->134. model.microsoft_ads.microsoft_ads__account_report:f0
134. model.microsoft_ads.microsoft_ads__account_report
  • Input Column: 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with the accounts table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
Column Lineage
%3 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp date 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report date_day 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp:f0->141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f0 134. model.microsoft_ads.microsoft_ads__account_report 134. model.microsoft_ads.microsoft_ads__account_report date_day 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f0->134. model.microsoft_ads.microsoft_ads__account_report:f0
141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report
  • Input Column: 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp[date]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as DATE type
    • Output Columns:
      • date_day: Directly mapped and renamed
134. model.microsoft_ads.microsoft_ads__account_report
  • Input Column: 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp account_id 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report account_id 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp:f0->141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f0 134. model.microsoft_ads.microsoft_ads__account_report 134. model.microsoft_ads.microsoft_ads__account_report account_id 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f0->134. model.microsoft_ads.microsoft_ads__account_report:f0
141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report
  • Input Column: 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp[account_id]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as INT type
    • Output Columns:
      • account_id: Directly mapped
134. model.microsoft_ads.microsoft_ads__account_report
  • Input Column: 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report[account_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as the key to join with the accounts table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • account_id: Directly copied to the output
Column Lineage
%3 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp device_os 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report device_os 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp:f0->141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f0 134. model.microsoft_ads.microsoft_ads__account_report 134. model.microsoft_ads.microsoft_ads__account_report device_os 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f0->134. model.microsoft_ads.microsoft_ads__account_report:f0
141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report
  • Input Column: 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp[device_os]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • device_os: Directly mapped
134. model.microsoft_ads.microsoft_ads__account_report
  • Input Column: 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report[device_os]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • device_os: Directly copied to the output
Column Lineage
%3 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp device_type 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report device_type 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp:f0->141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f0 134. model.microsoft_ads.microsoft_ads__account_report 134. model.microsoft_ads.microsoft_ads__account_report device_type 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f0->134. model.microsoft_ads.microsoft_ads__account_report:f0
141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report
  • Input Column: 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp[device_type]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • device_type: Directly mapped
134. model.microsoft_ads.microsoft_ads__account_report
  • Input Column: 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report[device_type]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • device_type: Directly copied to the output
Column Lineage
%3 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp network 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report network 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp:f0->141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f0 134. model.microsoft_ads.microsoft_ads__account_report 134. model.microsoft_ads.microsoft_ads__account_report network 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f0->134. model.microsoft_ads.microsoft_ads__account_report:f0
141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report
  • Input Column: 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp[network]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • network: Directly mapped
134. model.microsoft_ads.microsoft_ads__account_report
  • Input Column: 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report[network]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • network: Directly copied to the output
Column Lineage
%3 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp currency_code 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report currency_code 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp:f0->141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f0 134. model.microsoft_ads.microsoft_ads__account_report 134. model.microsoft_ads.microsoft_ads__account_report currency_code 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f0->134. model.microsoft_ads.microsoft_ads__account_report:f0
141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report
  • Input Column: 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp[currency_code]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • currency_code: Directly mapped
134. model.microsoft_ads.microsoft_ads__account_report
  • Input Column: 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report[currency_code]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • currency_code: Directly copied to the output
Column Lineage
%3 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp ad_distribution 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report ad_distribution 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp:f0->141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f0
141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report
  • Input Column: 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp[ad_distribution]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • ad_distribution: Directly mapped
Column Lineage
%3 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp bid_match_type 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report bid_match_type 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp:f0->141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f0
141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report
  • Input Column: 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp[bid_match_type]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • bid_match_type: Directly mapped
Column Lineage
%3 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp delivered_match_type 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report delivered_match_type 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp:f0->141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f0
141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report
  • Input Column: 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp[delivered_match_type]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • delivered_match_type: Directly mapped
Column Lineage
%3 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp top_vs_other 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report top_vs_other 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp:f0->141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f0
141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report
  • Input Column: 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp[top_vs_other]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • top_vs_other: Directly mapped
Column Lineage
%3 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp clicks 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report clicks 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp:f0->141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f0 134. model.microsoft_ads.microsoft_ads__account_report 134. model.microsoft_ads.microsoft_ads__account_report clicks 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f0->134. model.microsoft_ads.microsoft_ads__account_report:f0
141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report
  • Input Column: 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp[clicks]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to INT data type
    • Output Columns:
      • clicks: It is directly mapped to the output 'clicks' column after casting
134. model.microsoft_ads.microsoft_ads__account_report
  • Input Column: 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report[clicks]
    • Aggregation The clicks are summed up in the GROUP BY clause
    • Output Columns:
      • clicks: Summed up and directly mapped to the output 'clicks' column
Column Lineage
%3 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp impressions 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report impressions 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp:f0->141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f0 134. model.microsoft_ads.microsoft_ads__account_report 134. model.microsoft_ads.microsoft_ads__account_report impressions 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f0->134. model.microsoft_ads.microsoft_ads__account_report:f0
141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report
  • Input Column: 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp[impressions]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to INT data type
    • Output Columns:
      • impressions: It is directly mapped to the output 'impressions' column after casting
134. model.microsoft_ads.microsoft_ads__account_report
  • Input Column: 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report[impressions]
    • Aggregation The impressions are summed up in the GROUP BY clause
    • Output Columns:
      • impressions: Summed up and directly mapped to the output 'impressions' column
Column Lineage
%3 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp spend 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report spend 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp:f0->141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f0 134. model.microsoft_ads.microsoft_ads__account_report 134. model.microsoft_ads.microsoft_ads__account_report spend 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f0->134. model.microsoft_ads.microsoft_ads__account_report:f0
141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report
  • Input Column: 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp[spend]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to FLOAT data type
    • Output Columns:
      • spend: It is directly mapped to the output 'spend' column after casting
134. model.microsoft_ads.microsoft_ads__account_report
  • Input Column: 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report[spend]
    • Aggregation The spend is summed up in the GROUP BY clause
    • Output Columns:
      • spend: Summed up and directly mapped to the output 'spend' column
142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of type TEXT. The query doesn't retrieve any actual data; it's likely used as a placeholder or template for structure definition.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp date account_id device_os device_type network currency_code ad_distribution bid_match_type delivered_match_type top_vs_other clicks impressions spend 323. source.microsoft_ads_source.microsoft_ads.account_performance_daily_report 323. source.microsoft_ads_source.microsoft_ads.account_performance_daily_report
Name Type Comment
date date None
account_id bigint None
device_os text None
device_type text None
network text None
currency_code text None
ad_distribution text None
bid_match_type text None
delivered_match_type text None
top_vs_other text None
clicks integer None
impressions integer None
spend double precision None
Column Lineage
%3 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp date 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report date_day 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp:f0->141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f0 134. model.microsoft_ads.microsoft_ads__account_report 134. model.microsoft_ads.microsoft_ads__account_report date_day 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f0->134. model.microsoft_ads.microsoft_ads__account_report:f0
141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report
  • Input Column: 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp[date]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as DATE type
    • Output Columns:
      • date_day: Directly mapped and renamed
134. model.microsoft_ads.microsoft_ads__account_report
  • Input Column: 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp account_id 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report account_id 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp:f0->141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f0 134. model.microsoft_ads.microsoft_ads__account_report 134. model.microsoft_ads.microsoft_ads__account_report account_id 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f0->134. model.microsoft_ads.microsoft_ads__account_report:f0
141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report
  • Input Column: 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp[account_id]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as INT type
    • Output Columns:
      • account_id: Directly mapped
134. model.microsoft_ads.microsoft_ads__account_report
  • Input Column: 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report[account_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as the key to join with the accounts table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • account_id: Directly copied to the output
Column Lineage
%3 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp device_os 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report device_os 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp:f0->141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f0 134. model.microsoft_ads.microsoft_ads__account_report 134. model.microsoft_ads.microsoft_ads__account_report device_os 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f0->134. model.microsoft_ads.microsoft_ads__account_report:f0
141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report
  • Input Column: 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp[device_os]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • device_os: Directly mapped
134. model.microsoft_ads.microsoft_ads__account_report
  • Input Column: 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report[device_os]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • device_os: Directly copied to the output
Column Lineage
%3 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp device_type 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report device_type 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp:f0->141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f0 134. model.microsoft_ads.microsoft_ads__account_report 134. model.microsoft_ads.microsoft_ads__account_report device_type 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f0->134. model.microsoft_ads.microsoft_ads__account_report:f0
141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report
  • Input Column: 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp[device_type]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • device_type: Directly mapped
134. model.microsoft_ads.microsoft_ads__account_report
  • Input Column: 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report[device_type]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • device_type: Directly copied to the output
Column Lineage
%3 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp network 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report network 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp:f0->141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f0 134. model.microsoft_ads.microsoft_ads__account_report 134. model.microsoft_ads.microsoft_ads__account_report network 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f0->134. model.microsoft_ads.microsoft_ads__account_report:f0
141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report
  • Input Column: 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp[network]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • network: Directly mapped
134. model.microsoft_ads.microsoft_ads__account_report
  • Input Column: 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report[network]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • network: Directly copied to the output
Column Lineage
%3 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp currency_code 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report currency_code 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp:f0->141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f0 134. model.microsoft_ads.microsoft_ads__account_report 134. model.microsoft_ads.microsoft_ads__account_report currency_code 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f0->134. model.microsoft_ads.microsoft_ads__account_report:f0
141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report
  • Input Column: 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp[currency_code]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • currency_code: Directly mapped
134. model.microsoft_ads.microsoft_ads__account_report
  • Input Column: 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report[currency_code]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • currency_code: Directly copied to the output
Column Lineage
%3 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp ad_distribution 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report ad_distribution 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp:f0->141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f0
141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report
  • Input Column: 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp[ad_distribution]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • ad_distribution: Directly mapped
Column Lineage
%3 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp bid_match_type 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report bid_match_type 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp:f0->141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f0
141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report
  • Input Column: 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp[bid_match_type]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • bid_match_type: Directly mapped
Column Lineage
%3 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp delivered_match_type 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report delivered_match_type 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp:f0->141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f0
141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report
  • Input Column: 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp[delivered_match_type]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • delivered_match_type: Directly mapped
Column Lineage
%3 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp top_vs_other 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report top_vs_other 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp:f0->141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f0
141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report
  • Input Column: 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp[top_vs_other]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • top_vs_other: Directly mapped
Column Lineage
%3 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp clicks 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report clicks 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp:f0->141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f0 134. model.microsoft_ads.microsoft_ads__account_report 134. model.microsoft_ads.microsoft_ads__account_report clicks 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f0->134. model.microsoft_ads.microsoft_ads__account_report:f0
141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report
  • Input Column: 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp[clicks]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to INT data type
    • Output Columns:
      • clicks: It is directly mapped to the output 'clicks' column after casting
134. model.microsoft_ads.microsoft_ads__account_report
  • Input Column: 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report[clicks]
    • Aggregation The clicks are summed up in the GROUP BY clause
    • Output Columns:
      • clicks: Summed up and directly mapped to the output 'clicks' column
Column Lineage
%3 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp impressions 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report impressions 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp:f0->141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f0 134. model.microsoft_ads.microsoft_ads__account_report 134. model.microsoft_ads.microsoft_ads__account_report impressions 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f0->134. model.microsoft_ads.microsoft_ads__account_report:f0
141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report
  • Input Column: 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp[impressions]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to INT data type
    • Output Columns:
      • impressions: It is directly mapped to the output 'impressions' column after casting
134. model.microsoft_ads.microsoft_ads__account_report
  • Input Column: 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report[impressions]
    • Aggregation The impressions are summed up in the GROUP BY clause
    • Output Columns:
      • impressions: Summed up and directly mapped to the output 'impressions' column
Column Lineage
%3 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp spend 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report spend 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp:f0->141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f0 134. model.microsoft_ads.microsoft_ads__account_report 134. model.microsoft_ads.microsoft_ads__account_report spend 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report:f0->134. model.microsoft_ads.microsoft_ads__account_report:f0
141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report
  • Input Column: 142. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report_tmp[spend]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to FLOAT data type
    • Output Columns:
      • spend: It is directly mapped to the output 'spend' column after casting
134. model.microsoft_ads.microsoft_ads__account_report
  • Input Column: 141. model.microsoft_ads_source.stg_microsoft_ads__account_daily_report[spend]
    • Aggregation The spend is summed up in the GROUP BY clause
    • Output Columns:
      • spend: Summed up and directly mapped to the output 'spend' column
143. model.microsoft_ads_source.stg_microsoft_ads__account_history

This SQL query creates a staged version of Microsoft Ads account history data. It starts with a base table, creates a fields CTE with NULL or empty values for specific columns, and then constructs a final CTE that selects and renames columns from the fields CTE. The query also adds a flag to identify the most recent record for each account using a window function. The final SELECT statement retrieves all columns from the final CTE.

CleaningDeduplicationOther
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_microsoft_ads_source.stg_microsoft_ads__account_history_tmp
), fields AS (
  SELECT
    CAST(NULL AS INT) AS id,
    CAST(NULL AS TEXT) AS name,
    CAST(NULL AS TIMESTAMP) AS last_modified_time,
    CAST(NULL AS TEXT) AS time_zone,
    CAST(NULL AS TEXT) AS currency_code,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    id AS account_id,
    name AS account_name,
    last_modified_time AS modified_at,
    time_zone,
    currency_code,
    ROW_NUMBER() OVER (PARTITION BY source_relation, id ORDER BY last_modified_time DESC) = 1 AS is_most_recent_record
  FROM fields
)
SELECT
  *
FROM final
%3 143. model.microsoft_ads_source.stg_microsoft_ads__account_history 143. model.microsoft_ads_source.stg_microsoft_ads__account_history source_relation account_id account_name modified_at time_zone currency_code is_most_recent_record 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp id name last_modified_time time_zone currency_code 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp:f0->143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f1 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp:f1->143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f2 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp:f2->143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f3 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp:f3->143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f4 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp:f4->143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f5
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
account_id integer The ID representing the account.
account_name character varying The name of the account, if present in the source data.
modified_at timestamp without time zone The time each version of the object was last modified, i.e. when that version of the object was 'created'.
time_zone text The time zone associated with this record.
currency_code text The currency code associated with spend and, if applicable, other metrics associated with currency.
is_most_recent_record boolean Boolean representing whether a record is the most recent version of that record.
Column Lineage
%3 143. model.microsoft_ads_source.stg_microsoft_ads__account_history 143. model.microsoft_ads_source.stg_microsoft_ads__account_history source_relation 136. model.microsoft_ads.microsoft_ads__ad_report 136. model.microsoft_ads.microsoft_ads__ad_report source_relation 143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0->136. model.microsoft_ads.microsoft_ads__ad_report:f0 137. model.microsoft_ads.microsoft_ads__campaign_report 137. model.microsoft_ads.microsoft_ads__campaign_report source_relation 143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0->137. model.microsoft_ads.microsoft_ads__campaign_report:f0 139. model.microsoft_ads.microsoft_ads__search_report 139. model.microsoft_ads.microsoft_ads__search_report source_relation 143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0 135. model.microsoft_ads.microsoft_ads__ad_group_report 135. model.microsoft_ads.microsoft_ads__ad_group_report source_relation 143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0->135. model.microsoft_ads.microsoft_ads__ad_group_report:f0 140. model.microsoft_ads.microsoft_ads__url_report 140. model.microsoft_ads.microsoft_ads__url_report source_relation 143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0 138. model.microsoft_ads.microsoft_ads__keyword_report 138. model.microsoft_ads.microsoft_ads__keyword_report source_relation 143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0 134. model.microsoft_ads.microsoft_ads__account_report 134. model.microsoft_ads.microsoft_ads__account_report source_relation 143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0->134. model.microsoft_ads.microsoft_ads__account_report:f0
134. model.microsoft_ads.microsoft_ads__account_report
  • Input Column: 143. model.microsoft_ads_source.stg_microsoft_ads__account_history[source_relation]
    • Integration used as part of the join condition with the report table
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
135. model.microsoft_ads.microsoft_ads__ad_group_report
  • Input Column: 143. model.microsoft_ads_source.stg_microsoft_ads__account_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
136. model.microsoft_ads.microsoft_ads__ad_report
  • Input Column: 143. model.microsoft_ads_source.stg_microsoft_ads__account_history[source_relation]
    • Integration used as part of the join condition with the report table
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
137. model.microsoft_ads.microsoft_ads__campaign_report
  • Input Column: 143. model.microsoft_ads_source.stg_microsoft_ads__account_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
138. model.microsoft_ads.microsoft_ads__keyword_report
  • Input Column: 143. model.microsoft_ads_source.stg_microsoft_ads__account_history[source_relation]
    • Integration used as part of the join condition with the report table
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
139. model.microsoft_ads.microsoft_ads__search_report
  • Input Column: 143. model.microsoft_ads_source.stg_microsoft_ads__account_history[source_relation]
    • Integration Used as part of the JOIN condition to link with other tables
    • Direct Directly copied to the output
    • Output Columns:
      • source_relation: Directly copied
140. model.microsoft_ads.microsoft_ads__url_report
  • Input Column: 143. model.microsoft_ads_source.stg_microsoft_ads__account_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct copied directly to the output
    • Output Columns:
      • source_relation: directly copied
Column Lineage
%3 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp id 143. model.microsoft_ads_source.stg_microsoft_ads__account_history 143. model.microsoft_ads_source.stg_microsoft_ads__account_history account_id 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp:f0->143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0 136. model.microsoft_ads.microsoft_ads__ad_report 136. model.microsoft_ads.microsoft_ads__ad_report account_id 143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0->136. model.microsoft_ads.microsoft_ads__ad_report:f0 137. model.microsoft_ads.microsoft_ads__campaign_report 137. model.microsoft_ads.microsoft_ads__campaign_report account_id 143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0->137. model.microsoft_ads.microsoft_ads__campaign_report:f0 139. model.microsoft_ads.microsoft_ads__search_report 139. model.microsoft_ads.microsoft_ads__search_report account_id 143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0 135. model.microsoft_ads.microsoft_ads__ad_group_report 135. model.microsoft_ads.microsoft_ads__ad_group_report account_id 143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0->135. model.microsoft_ads.microsoft_ads__ad_group_report:f0 140. model.microsoft_ads.microsoft_ads__url_report 140. model.microsoft_ads.microsoft_ads__url_report account_id 143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0 138. model.microsoft_ads.microsoft_ads__keyword_report 138. model.microsoft_ads.microsoft_ads__keyword_report account_id 143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0 134. model.microsoft_ads.microsoft_ads__account_report 134. model.microsoft_ads.microsoft_ads__account_report account_id 143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0->134. model.microsoft_ads.microsoft_ads__account_report:f0
143. model.microsoft_ads_source.stg_microsoft_ads__account_history
  • Input Column: 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp[id]
    • Direct The column is directly copied without transformation
    • Deduplication Used in the PARTITION BY clause of the ROW_NUMBER() function to identify the most recent record for each account
    • Output Columns:
      • account_id: Directly mapped to this output column
134. model.microsoft_ads.microsoft_ads__account_report
  • Input Column: 143. model.microsoft_ads_source.stg_microsoft_ads__account_history[account_id]
    • Integration used as the primary key for joining with the report table
    • Direct directly copied to the output
    • Output Columns:
      • account_id: directly copied
135. model.microsoft_ads.microsoft_ads__ad_group_report
  • Input Column: 143. model.microsoft_ads_source.stg_microsoft_ads__account_history[account_id]
    • Integration used as the key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • account_id: directly copied
136. model.microsoft_ads.microsoft_ads__ad_report
  • Input Column: 143. model.microsoft_ads_source.stg_microsoft_ads__account_history[account_id]
    • Integration used as part of the join condition with the report table
    • Output Columns:
      • account_id: directly copied from the report table, not this table
137. model.microsoft_ads.microsoft_ads__campaign_report
  • Input Column: 143. model.microsoft_ads_source.stg_microsoft_ads__account_history[account_id]
    • Integration used as the key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • account_id: directly copied
138. model.microsoft_ads.microsoft_ads__keyword_report
  • Input Column: 143. model.microsoft_ads_source.stg_microsoft_ads__account_history[account_id]
    • Integration used as part of the join condition with the report table
    • Output Columns:
      • account_id: directly copied from the report table, not this table
139. model.microsoft_ads.microsoft_ads__search_report
  • Input Column: 143. model.microsoft_ads_source.stg_microsoft_ads__account_history[account_id]
    • Integration Used as part of the JOIN condition to link with other tables
    • Direct Directly copied to the output
    • Output Columns:
      • account_id: Directly copied
140. model.microsoft_ads.microsoft_ads__url_report
  • Input Column: 143. model.microsoft_ads_source.stg_microsoft_ads__account_history[account_id]
    • Integration used as part of the join condition with other tables
    • Direct copied directly to the output
    • Output Columns:
      • account_id: directly copied
Column Lineage
%3 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp name 143. model.microsoft_ads_source.stg_microsoft_ads__account_history 143. model.microsoft_ads_source.stg_microsoft_ads__account_history account_name 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp:f0->143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0 136. model.microsoft_ads.microsoft_ads__ad_report 136. model.microsoft_ads.microsoft_ads__ad_report account_name 143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0->136. model.microsoft_ads.microsoft_ads__ad_report:f0 137. model.microsoft_ads.microsoft_ads__campaign_report 137. model.microsoft_ads.microsoft_ads__campaign_report account_name 143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0->137. model.microsoft_ads.microsoft_ads__campaign_report:f0 139. model.microsoft_ads.microsoft_ads__search_report 139. model.microsoft_ads.microsoft_ads__search_report account_name 143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0 135. model.microsoft_ads.microsoft_ads__ad_group_report 135. model.microsoft_ads.microsoft_ads__ad_group_report account_name 143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0->135. model.microsoft_ads.microsoft_ads__ad_group_report:f0 140. model.microsoft_ads.microsoft_ads__url_report 140. model.microsoft_ads.microsoft_ads__url_report account_name 143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0 138. model.microsoft_ads.microsoft_ads__keyword_report 138. model.microsoft_ads.microsoft_ads__keyword_report account_name 143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0 134. model.microsoft_ads.microsoft_ads__account_report 134. model.microsoft_ads.microsoft_ads__account_report account_name 143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0->134. model.microsoft_ads.microsoft_ads__account_report:f0
143. model.microsoft_ads_source.stg_microsoft_ads__account_history
  • Input Column: 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • account_name: Directly mapped to this output column
134. model.microsoft_ads.microsoft_ads__account_report
  • Input Column: 143. model.microsoft_ads_source.stg_microsoft_ads__account_history[account_name]
    • Direct directly copied to the output
    • Output Columns:
      • account_name: directly copied
135. model.microsoft_ads.microsoft_ads__ad_group_report
  • Input Column: 143. model.microsoft_ads_source.stg_microsoft_ads__account_history[account_name]
    • Direct directly copied to the output
    • Output Columns:
      • account_name: directly copied
136. model.microsoft_ads.microsoft_ads__ad_report
  • Input Column: 143. model.microsoft_ads_source.stg_microsoft_ads__account_history[account_name]
    • Direct directly copied to the output
    • Output Columns:
      • account_name: directly copied
137. model.microsoft_ads.microsoft_ads__campaign_report
  • Input Column: 143. model.microsoft_ads_source.stg_microsoft_ads__account_history[account_name]
    • Direct directly copied to the output
    • Output Columns:
      • account_name: directly copied
138. model.microsoft_ads.microsoft_ads__keyword_report
  • Input Column: 143. model.microsoft_ads_source.stg_microsoft_ads__account_history[account_name]
    • Direct directly copied to the output
    • Output Columns:
      • account_name: directly copied
139. model.microsoft_ads.microsoft_ads__search_report
  • Input Column: 143. model.microsoft_ads_source.stg_microsoft_ads__account_history[account_name]
    • Direct Directly copied to the output
    • Output Columns:
      • account_name: Directly copied
140. model.microsoft_ads.microsoft_ads__url_report
  • Input Column: 143. model.microsoft_ads_source.stg_microsoft_ads__account_history[account_name]
    • Direct copied directly to the output
    • Output Columns:
      • account_name: directly copied
Column Lineage
%3 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp last_modified_time 143. model.microsoft_ads_source.stg_microsoft_ads__account_history 143. model.microsoft_ads_source.stg_microsoft_ads__account_history modified_at 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp:f0->143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0
143. model.microsoft_ads_source.stg_microsoft_ads__account_history
  • Input Column: 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp[last_modified_time]
    • Direct The column is directly copied without transformation
    • Deduplication Used in the ORDER BY clause of the ROW_NUMBER() function to determine the most recent record
    • Output Columns:
      • modified_at: Directly mapped to this output column
Column Lineage
%3 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp time_zone 143. model.microsoft_ads_source.stg_microsoft_ads__account_history 143. model.microsoft_ads_source.stg_microsoft_ads__account_history time_zone 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp:f0->143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0 134. model.microsoft_ads.microsoft_ads__account_report 134. model.microsoft_ads.microsoft_ads__account_report account_timezone 143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0->134. model.microsoft_ads.microsoft_ads__account_report:f0
143. model.microsoft_ads_source.stg_microsoft_ads__account_history
  • Input Column: 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp[time_zone]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • time_zone: Directly mapped to this output column
134. model.microsoft_ads.microsoft_ads__account_report
  • Input Column: 143. model.microsoft_ads_source.stg_microsoft_ads__account_history[time_zone]
    • Direct directly copied to the output
    • Output Columns:
      • account_timezone: directly copied and renamed
Column Lineage
%3 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp currency_code 143. model.microsoft_ads_source.stg_microsoft_ads__account_history 143. model.microsoft_ads_source.stg_microsoft_ads__account_history currency_code 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp:f0->143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0
143. model.microsoft_ads_source.stg_microsoft_ads__account_history
  • Input Column: 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp[currency_code]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • currency_code: Directly mapped to this output column
144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of TEXT data type. It's likely used as a placeholder or template for a staging table in a dbt (data build tool) project, specifically for Microsoft Ads account history data.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp id name last_modified_time time_zone currency_code 322. source.microsoft_ads_source.microsoft_ads.account_history 322. source.microsoft_ads_source.microsoft_ads.account_history
Name Type Comment
id integer None
name character varying None
last_modified_time timestamp without time zone None
time_zone text None
currency_code text None
Column Lineage
%3 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp id 143. model.microsoft_ads_source.stg_microsoft_ads__account_history 143. model.microsoft_ads_source.stg_microsoft_ads__account_history account_id 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp:f0->143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0 136. model.microsoft_ads.microsoft_ads__ad_report 136. model.microsoft_ads.microsoft_ads__ad_report account_id 143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0->136. model.microsoft_ads.microsoft_ads__ad_report:f0 137. model.microsoft_ads.microsoft_ads__campaign_report 137. model.microsoft_ads.microsoft_ads__campaign_report account_id 143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0->137. model.microsoft_ads.microsoft_ads__campaign_report:f0 139. model.microsoft_ads.microsoft_ads__search_report 139. model.microsoft_ads.microsoft_ads__search_report account_id 143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0 135. model.microsoft_ads.microsoft_ads__ad_group_report 135. model.microsoft_ads.microsoft_ads__ad_group_report account_id 143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0->135. model.microsoft_ads.microsoft_ads__ad_group_report:f0 140. model.microsoft_ads.microsoft_ads__url_report 140. model.microsoft_ads.microsoft_ads__url_report account_id 143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0 138. model.microsoft_ads.microsoft_ads__keyword_report 138. model.microsoft_ads.microsoft_ads__keyword_report account_id 143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0 134. model.microsoft_ads.microsoft_ads__account_report 134. model.microsoft_ads.microsoft_ads__account_report account_id 143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0->134. model.microsoft_ads.microsoft_ads__account_report:f0
143. model.microsoft_ads_source.stg_microsoft_ads__account_history
  • Input Column: 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp[id]
    • Direct The column is directly copied without transformation
    • Deduplication Used in the PARTITION BY clause of the ROW_NUMBER() function to identify the most recent record for each account
    • Output Columns:
      • account_id: Directly mapped to this output column
134. model.microsoft_ads.microsoft_ads__account_report
  • Input Column: 143. model.microsoft_ads_source.stg_microsoft_ads__account_history[account_id]
    • Integration used as the primary key for joining with the report table
    • Direct directly copied to the output
    • Output Columns:
      • account_id: directly copied
135. model.microsoft_ads.microsoft_ads__ad_group_report
  • Input Column: 143. model.microsoft_ads_source.stg_microsoft_ads__account_history[account_id]
    • Integration used as the key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • account_id: directly copied
136. model.microsoft_ads.microsoft_ads__ad_report
  • Input Column: 143. model.microsoft_ads_source.stg_microsoft_ads__account_history[account_id]
    • Integration used as part of the join condition with the report table
    • Output Columns:
      • account_id: directly copied from the report table, not this table
137. model.microsoft_ads.microsoft_ads__campaign_report
  • Input Column: 143. model.microsoft_ads_source.stg_microsoft_ads__account_history[account_id]
    • Integration used as the key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • account_id: directly copied
138. model.microsoft_ads.microsoft_ads__keyword_report
  • Input Column: 143. model.microsoft_ads_source.stg_microsoft_ads__account_history[account_id]
    • Integration used as part of the join condition with the report table
    • Output Columns:
      • account_id: directly copied from the report table, not this table
139. model.microsoft_ads.microsoft_ads__search_report
  • Input Column: 143. model.microsoft_ads_source.stg_microsoft_ads__account_history[account_id]
    • Integration Used as part of the JOIN condition to link with other tables
    • Direct Directly copied to the output
    • Output Columns:
      • account_id: Directly copied
140. model.microsoft_ads.microsoft_ads__url_report
  • Input Column: 143. model.microsoft_ads_source.stg_microsoft_ads__account_history[account_id]
    • Integration used as part of the join condition with other tables
    • Direct copied directly to the output
    • Output Columns:
      • account_id: directly copied
Column Lineage
%3 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp name 143. model.microsoft_ads_source.stg_microsoft_ads__account_history 143. model.microsoft_ads_source.stg_microsoft_ads__account_history account_name 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp:f0->143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0 136. model.microsoft_ads.microsoft_ads__ad_report 136. model.microsoft_ads.microsoft_ads__ad_report account_name 143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0->136. model.microsoft_ads.microsoft_ads__ad_report:f0 137. model.microsoft_ads.microsoft_ads__campaign_report 137. model.microsoft_ads.microsoft_ads__campaign_report account_name 143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0->137. model.microsoft_ads.microsoft_ads__campaign_report:f0 139. model.microsoft_ads.microsoft_ads__search_report 139. model.microsoft_ads.microsoft_ads__search_report account_name 143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0 135. model.microsoft_ads.microsoft_ads__ad_group_report 135. model.microsoft_ads.microsoft_ads__ad_group_report account_name 143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0->135. model.microsoft_ads.microsoft_ads__ad_group_report:f0 140. model.microsoft_ads.microsoft_ads__url_report 140. model.microsoft_ads.microsoft_ads__url_report account_name 143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0 138. model.microsoft_ads.microsoft_ads__keyword_report 138. model.microsoft_ads.microsoft_ads__keyword_report account_name 143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0 134. model.microsoft_ads.microsoft_ads__account_report 134. model.microsoft_ads.microsoft_ads__account_report account_name 143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0->134. model.microsoft_ads.microsoft_ads__account_report:f0
143. model.microsoft_ads_source.stg_microsoft_ads__account_history
  • Input Column: 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • account_name: Directly mapped to this output column
134. model.microsoft_ads.microsoft_ads__account_report
  • Input Column: 143. model.microsoft_ads_source.stg_microsoft_ads__account_history[account_name]
    • Direct directly copied to the output
    • Output Columns:
      • account_name: directly copied
135. model.microsoft_ads.microsoft_ads__ad_group_report
  • Input Column: 143. model.microsoft_ads_source.stg_microsoft_ads__account_history[account_name]
    • Direct directly copied to the output
    • Output Columns:
      • account_name: directly copied
136. model.microsoft_ads.microsoft_ads__ad_report
  • Input Column: 143. model.microsoft_ads_source.stg_microsoft_ads__account_history[account_name]
    • Direct directly copied to the output
    • Output Columns:
      • account_name: directly copied
137. model.microsoft_ads.microsoft_ads__campaign_report
  • Input Column: 143. model.microsoft_ads_source.stg_microsoft_ads__account_history[account_name]
    • Direct directly copied to the output
    • Output Columns:
      • account_name: directly copied
138. model.microsoft_ads.microsoft_ads__keyword_report
  • Input Column: 143. model.microsoft_ads_source.stg_microsoft_ads__account_history[account_name]
    • Direct directly copied to the output
    • Output Columns:
      • account_name: directly copied
139. model.microsoft_ads.microsoft_ads__search_report
  • Input Column: 143. model.microsoft_ads_source.stg_microsoft_ads__account_history[account_name]
    • Direct Directly copied to the output
    • Output Columns:
      • account_name: Directly copied
140. model.microsoft_ads.microsoft_ads__url_report
  • Input Column: 143. model.microsoft_ads_source.stg_microsoft_ads__account_history[account_name]
    • Direct copied directly to the output
    • Output Columns:
      • account_name: directly copied
Column Lineage
%3 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp last_modified_time 143. model.microsoft_ads_source.stg_microsoft_ads__account_history 143. model.microsoft_ads_source.stg_microsoft_ads__account_history modified_at 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp:f0->143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0
143. model.microsoft_ads_source.stg_microsoft_ads__account_history
  • Input Column: 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp[last_modified_time]
    • Direct The column is directly copied without transformation
    • Deduplication Used in the ORDER BY clause of the ROW_NUMBER() function to determine the most recent record
    • Output Columns:
      • modified_at: Directly mapped to this output column
Column Lineage
%3 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp time_zone 143. model.microsoft_ads_source.stg_microsoft_ads__account_history 143. model.microsoft_ads_source.stg_microsoft_ads__account_history time_zone 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp:f0->143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0 134. model.microsoft_ads.microsoft_ads__account_report 134. model.microsoft_ads.microsoft_ads__account_report account_timezone 143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0->134. model.microsoft_ads.microsoft_ads__account_report:f0
143. model.microsoft_ads_source.stg_microsoft_ads__account_history
  • Input Column: 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp[time_zone]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • time_zone: Directly mapped to this output column
134. model.microsoft_ads.microsoft_ads__account_report
  • Input Column: 143. model.microsoft_ads_source.stg_microsoft_ads__account_history[time_zone]
    • Direct directly copied to the output
    • Output Columns:
      • account_timezone: directly copied and renamed
Column Lineage
%3 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp currency_code 143. model.microsoft_ads_source.stg_microsoft_ads__account_history 143. model.microsoft_ads_source.stg_microsoft_ads__account_history currency_code 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp:f0->143. model.microsoft_ads_source.stg_microsoft_ads__account_history:f0
143. model.microsoft_ads_source.stg_microsoft_ads__account_history
  • Input Column: 144. model.microsoft_ads_source.stg_microsoft_ads__account_history_tmp[currency_code]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • currency_code: Directly mapped to this output column
145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report

This SQL query creates a staging table for Microsoft Ads daily ad reports. It starts by selecting all columns from a temporary table, then defines a set of fields with specific data types (mostly set to NULL or empty strings), and finally reorganizes and renames some columns in the final select statement. The query appears to be setting up a structure for data that will be populated later, rather than actually transforming or aggregating data.

CleaningOther
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp
), fields AS (
  SELECT
    CAST(NULL AS INT) AS account_id,
    CAST(NULL AS TEXT) AS ad_distribution,
    CAST(NULL AS INT) AS ad_group_id,
    CAST(NULL AS INT) AS ad_id,
    CAST(NULL AS TEXT) AS bid_match_type,
    CAST(NULL AS INT) AS campaign_id,
    CAST(NULL AS INT) AS clicks,
    CAST(NULL AS TEXT) AS currency_code,
    CAST(NULL AS DATE) AS date,
    CAST(NULL AS TEXT) AS delivered_match_type,
    CAST(NULL AS TEXT) AS device_os,
    CAST(NULL AS TEXT) AS device_type,
    CAST(NULL AS INT) AS impressions,
    CAST(NULL AS TEXT) AS language,
    CAST(NULL AS TEXT) AS network,
    CAST(NULL AS FLOAT) AS spend,
    CAST(NULL AS TEXT) AS top_vs_other,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    date AS date_day,
    account_id,
    campaign_id,
    ad_group_id,
    ad_id,
    currency_code,
    device_os,
    device_type,
    network,
    language,
    ad_distribution,
    bid_match_type,
    delivered_match_type,
    top_vs_other,
    clicks,
    impressions,
    spend
  FROM fields
)
SELECT
  *
FROM final
%3 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report source_relation date_day account_id campaign_id ad_group_id ad_id currency_code device_os device_type network language ad_distribution bid_match_type delivered_match_type top_vs_other clicks impressions spend 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp date account_id campaign_id ad_group_id ad_id currency_code device_os device_type network language ad_distribution bid_match_type delivered_match_type top_vs_other clicks impressions spend 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp:f0->145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f1 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp:f1->145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f2 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp:f2->145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f3 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp:f3->145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f4 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp:f4->145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f5 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp:f5->145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f6 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp:f6->145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f7 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp:f7->145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f8 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp:f8->145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f9 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp:f9->145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f10 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp:f10->145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f11 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp:f11->145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f12 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp:f12->145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f13 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp:f13->145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f14 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp:f14->145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f15 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp:f15->145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f16 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp:f16->145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f17
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
date_day date The date of the report.
account_id bigint The ID representing the account.
campaign_id bigint The ID representing the campaign, if present in the source data.
ad_group_id bigint The ID representing the ad group, if present in the source data.
ad_id bigint The ID representing the ad, if present in the source data.
currency_code text The currency code associated with spend and, if applicable, other metrics associated with currency.
device_os text The device operating system associated with this record; values include but may not be limited to 'Windows', 'iOS', 'Android', 'Other', 'BlackBerry' and 'Unknown'.
device_type text The device type associated with this record; values include but may not be limited to 'Computer', 'Smartphone', 'Tablet' and 'Unknown'.
network text The network associated with this record.
language text The language that the associated ad was viewed in.
ad_distribution text The distribution medium associated with this record.
bid_match_type text The bid match type associated with this record; values include 'Broad', 'Exact', 'Phrase'.
delivered_match_type text The delivered match type associated with this record; values include 'Broad', 'Exact', 'Phrase'.
top_vs_other text The position of the ad associated with this record. For more information, refer to Microsoft [documentation](https://help.ads.microsoft.com/apex/index/22/en/14009).
clicks integer The count of clicks.
impressions integer The count of impressions.
spend double precision The cost of the ads.
Column Lineage
%3 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report source_relation 136. model.microsoft_ads.microsoft_ads__ad_report 136. model.microsoft_ads.microsoft_ads__ad_report source_relation 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0->136. model.microsoft_ads.microsoft_ads__ad_report:f0 140. model.microsoft_ads.microsoft_ads__url_report 140. model.microsoft_ads.microsoft_ads__url_report source_relation 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0
136. model.microsoft_ads.microsoft_ads__ad_report
  • Input Column: 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with other tables
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
140. model.microsoft_ads.microsoft_ads__url_report
  • Input Column: 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with other tables
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
Column Lineage
%3 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp date 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report date_day 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp:f0->145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0 136. model.microsoft_ads.microsoft_ads__ad_report 136. model.microsoft_ads.microsoft_ads__ad_report date_day 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0->136. model.microsoft_ads.microsoft_ads__ad_report:f0 140. model.microsoft_ads.microsoft_ads__url_report 140. model.microsoft_ads.microsoft_ads__url_report date_day 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0
145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report
  • Input Column: 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp[date]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as DATE type
    • Output Columns:
      • date_day: Directly mapped and renamed
136. model.microsoft_ads.microsoft_ads__ad_report
  • Input Column: 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
140. model.microsoft_ads.microsoft_ads__url_report
  • Input Column: 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp account_id 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report account_id 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp:f0->145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0 136. model.microsoft_ads.microsoft_ads__ad_report 136. model.microsoft_ads.microsoft_ads__ad_report account_id 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0->136. model.microsoft_ads.microsoft_ads__ad_report:f0 140. model.microsoft_ads.microsoft_ads__url_report 140. model.microsoft_ads.microsoft_ads__url_report account_id 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0
145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report
  • Input Column: 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp[account_id]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as INT type
    • Output Columns:
      • account_id: Directly mapped
136. model.microsoft_ads.microsoft_ads__ad_report
  • Input Column: 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report[account_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with the accounts table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • account_id: Directly copied to the output
140. model.microsoft_ads.microsoft_ads__url_report
  • Input Column: 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report[account_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a join key with the accounts table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • account_id: Directly copied to the output
Column Lineage
%3 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp campaign_id 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report campaign_id 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp:f0->145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0 136. model.microsoft_ads.microsoft_ads__ad_report 136. model.microsoft_ads.microsoft_ads__ad_report campaign_id 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0->136. model.microsoft_ads.microsoft_ads__ad_report:f0 140. model.microsoft_ads.microsoft_ads__url_report 140. model.microsoft_ads.microsoft_ads__url_report campaign_id 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0
145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report
  • Input Column: 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp[campaign_id]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as INT type
    • Output Columns:
      • campaign_id: Directly mapped
136. model.microsoft_ads.microsoft_ads__ad_report
  • Input Column: 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report[campaign_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with the campaigns table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • campaign_id: Directly copied to the output
140. model.microsoft_ads.microsoft_ads__url_report
  • Input Column: 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report[campaign_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a join key with the campaigns table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • campaign_id: Directly copied to the output
Column Lineage
%3 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp ad_group_id 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report ad_group_id 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp:f0->145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0 136. model.microsoft_ads.microsoft_ads__ad_report 136. model.microsoft_ads.microsoft_ads__ad_report ad_group_id 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0->136. model.microsoft_ads.microsoft_ads__ad_report:f0 140. model.microsoft_ads.microsoft_ads__url_report 140. model.microsoft_ads.microsoft_ads__url_report ad_group_id 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0
145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report
  • Input Column: 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp[ad_group_id]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as INT type
    • Output Columns:
      • ad_group_id: Directly mapped
136. model.microsoft_ads.microsoft_ads__ad_report
  • Input Column: 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report[ad_group_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with the ad_groups table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • ad_group_id: Directly copied to the output
140. model.microsoft_ads.microsoft_ads__url_report
  • Input Column: 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report[ad_group_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a join key with the ad_groups table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • ad_group_id: Directly copied to the output
Column Lineage
%3 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp ad_id 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report ad_id 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp:f0->145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0 136. model.microsoft_ads.microsoft_ads__ad_report 136. model.microsoft_ads.microsoft_ads__ad_report ad_id 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0->136. model.microsoft_ads.microsoft_ads__ad_report:f0 140. model.microsoft_ads.microsoft_ads__url_report 140. model.microsoft_ads.microsoft_ads__url_report ad_id 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0
145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report
  • Input Column: 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp[ad_id]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as INT type
    • Output Columns:
      • ad_id: Directly mapped
136. model.microsoft_ads.microsoft_ads__ad_report
  • Input Column: 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report[ad_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with the ads table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • ad_id: Directly copied to the output
140. model.microsoft_ads.microsoft_ads__url_report
  • Input Column: 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report[ad_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a join key with the ads table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • ad_id: Directly copied to the output
Column Lineage
%3 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp currency_code 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report currency_code 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp:f0->145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0 136. model.microsoft_ads.microsoft_ads__ad_report 136. model.microsoft_ads.microsoft_ads__ad_report currency_code 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0->136. model.microsoft_ads.microsoft_ads__ad_report:f0 140. model.microsoft_ads.microsoft_ads__url_report 140. model.microsoft_ads.microsoft_ads__url_report currency_code 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0
145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report
  • Input Column: 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp[currency_code]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • currency_code: Directly mapped
136. model.microsoft_ads.microsoft_ads__ad_report
  • Input Column: 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report[currency_code]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • currency_code: Directly copied to the output
140. model.microsoft_ads.microsoft_ads__url_report
  • Input Column: 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report[currency_code]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • currency_code: Directly copied to the output
Column Lineage
%3 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp device_os 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report device_os 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp:f0->145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0 136. model.microsoft_ads.microsoft_ads__ad_report 136. model.microsoft_ads.microsoft_ads__ad_report device_os 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0->136. model.microsoft_ads.microsoft_ads__ad_report:f0 140. model.microsoft_ads.microsoft_ads__url_report 140. model.microsoft_ads.microsoft_ads__url_report device_os 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0
145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report
  • Input Column: 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp[device_os]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • device_os: Directly mapped
136. model.microsoft_ads.microsoft_ads__ad_report
  • Input Column: 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report[device_os]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • device_os: Directly copied to the output
140. model.microsoft_ads.microsoft_ads__url_report
  • Input Column: 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report[device_os]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • device_os: Directly copied to the output
Column Lineage
%3 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp device_type 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report device_type 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp:f0->145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0 136. model.microsoft_ads.microsoft_ads__ad_report 136. model.microsoft_ads.microsoft_ads__ad_report device_type 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0->136. model.microsoft_ads.microsoft_ads__ad_report:f0 140. model.microsoft_ads.microsoft_ads__url_report 140. model.microsoft_ads.microsoft_ads__url_report device_type 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0
145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report
  • Input Column: 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp[device_type]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • device_type: Directly mapped
136. model.microsoft_ads.microsoft_ads__ad_report
  • Input Column: 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report[device_type]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • device_type: Directly copied to the output
140. model.microsoft_ads.microsoft_ads__url_report
  • Input Column: 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report[device_type]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • device_type: Directly copied to the output
Column Lineage
%3 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp network 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report network 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp:f0->145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0 136. model.microsoft_ads.microsoft_ads__ad_report 136. model.microsoft_ads.microsoft_ads__ad_report network 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0->136. model.microsoft_ads.microsoft_ads__ad_report:f0 140. model.microsoft_ads.microsoft_ads__url_report 140. model.microsoft_ads.microsoft_ads__url_report network 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0
145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report
  • Input Column: 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp[network]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • network: Directly mapped
136. model.microsoft_ads.microsoft_ads__ad_report
  • Input Column: 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report[network]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • network: Directly copied to the output
140. model.microsoft_ads.microsoft_ads__url_report
  • Input Column: 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report[network]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • network: Directly copied to the output
Column Lineage
%3 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp language 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report language 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp:f0->145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0
145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report
  • Input Column: 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp[language]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • language: Directly mapped
Column Lineage
%3 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp ad_distribution 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report ad_distribution 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp:f0->145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0
145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report
  • Input Column: 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp[ad_distribution]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • ad_distribution: Directly copied to the output column
Column Lineage
%3 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp bid_match_type 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report bid_match_type 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp:f0->145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0
145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report
  • Input Column: 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp[bid_match_type]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • bid_match_type: Directly copied to the output column
Column Lineage
%3 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp delivered_match_type 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report delivered_match_type 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp:f0->145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0
145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report
  • Input Column: 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp[delivered_match_type]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • delivered_match_type: Directly copied to the output column
Column Lineage
%3 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp top_vs_other 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report top_vs_other 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp:f0->145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0
145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report
  • Input Column: 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp[top_vs_other]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • top_vs_other: Directly copied to the output column
Column Lineage
%3 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp clicks 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report clicks 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp:f0->145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0 136. model.microsoft_ads.microsoft_ads__ad_report 136. model.microsoft_ads.microsoft_ads__ad_report clicks 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0->136. model.microsoft_ads.microsoft_ads__ad_report:f0 140. model.microsoft_ads.microsoft_ads__url_report 140. model.microsoft_ads.microsoft_ads__url_report clicks 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0
145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report
  • Input Column: 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp[clicks]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT
    • Output Columns:
      • clicks: Directly copied to the output column after casting
136. model.microsoft_ads.microsoft_ads__ad_report
  • Input Column: 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report[clicks]
    • Aggregation The clicks are summed up in the GROUP BY clause
    • Output Columns:
      • clicks: Summed up in the SELECT statement
140. model.microsoft_ads.microsoft_ads__url_report
  • Input Column: 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report[clicks]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • clicks: The sum of clicks is mapped to the output 'clicks' column
Column Lineage
%3 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp impressions 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report impressions 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp:f0->145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0 136. model.microsoft_ads.microsoft_ads__ad_report 136. model.microsoft_ads.microsoft_ads__ad_report impressions 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0->136. model.microsoft_ads.microsoft_ads__ad_report:f0 140. model.microsoft_ads.microsoft_ads__url_report 140. model.microsoft_ads.microsoft_ads__url_report impressions 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0
145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report
  • Input Column: 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp[impressions]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT
    • Output Columns:
      • impressions: Directly copied to the output column after casting
136. model.microsoft_ads.microsoft_ads__ad_report
  • Input Column: 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report[impressions]
    • Aggregation The impressions are summed up in the GROUP BY clause
    • Output Columns:
      • impressions: Summed up in the SELECT statement
140. model.microsoft_ads.microsoft_ads__url_report
  • Input Column: 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report[impressions]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • impressions: The sum of impressions is mapped to the output 'impressions' column
Column Lineage
%3 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp spend 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report spend 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp:f0->145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0 136. model.microsoft_ads.microsoft_ads__ad_report 136. model.microsoft_ads.microsoft_ads__ad_report spend 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0->136. model.microsoft_ads.microsoft_ads__ad_report:f0 140. model.microsoft_ads.microsoft_ads__url_report 140. model.microsoft_ads.microsoft_ads__url_report spend 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0
145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report
  • Input Column: 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp[spend]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as FLOAT
    • Output Columns:
      • spend: Directly copied to the output column after casting
136. model.microsoft_ads.microsoft_ads__ad_report
  • Input Column: 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report[spend]
    • Aggregation The spend is summed up in the GROUP BY clause
    • Output Columns:
      • spend: Summed up in the SELECT statement
140. model.microsoft_ads.microsoft_ads__url_report
  • Input Column: 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report[spend]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • spend: The sum of spend is mapped to the output 'spend' column
146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of type TEXT, initialized to NULL. The query is likely used as a placeholder or template for further development or testing purposes.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp date account_id campaign_id ad_group_id ad_id currency_code device_os device_type network language ad_distribution bid_match_type delivered_match_type top_vs_other clicks impressions spend 327. source.microsoft_ads_source.microsoft_ads.ad_performance_daily_report 327. source.microsoft_ads_source.microsoft_ads.ad_performance_daily_report
Name Type Comment
date date None
account_id bigint None
campaign_id bigint None
ad_group_id bigint None
ad_id bigint None
currency_code text None
device_os text None
device_type text None
network text None
language text None
ad_distribution text None
bid_match_type text None
delivered_match_type text None
top_vs_other text None
clicks integer None
impressions integer None
spend double precision None
Column Lineage
%3 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp date 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report date_day 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp:f0->145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0 136. model.microsoft_ads.microsoft_ads__ad_report 136. model.microsoft_ads.microsoft_ads__ad_report date_day 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0->136. model.microsoft_ads.microsoft_ads__ad_report:f0 140. model.microsoft_ads.microsoft_ads__url_report 140. model.microsoft_ads.microsoft_ads__url_report date_day 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0
145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report
  • Input Column: 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp[date]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as DATE type
    • Output Columns:
      • date_day: Directly mapped and renamed
136. model.microsoft_ads.microsoft_ads__ad_report
  • Input Column: 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
140. model.microsoft_ads.microsoft_ads__url_report
  • Input Column: 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp account_id 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report account_id 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp:f0->145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0 136. model.microsoft_ads.microsoft_ads__ad_report 136. model.microsoft_ads.microsoft_ads__ad_report account_id 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0->136. model.microsoft_ads.microsoft_ads__ad_report:f0 140. model.microsoft_ads.microsoft_ads__url_report 140. model.microsoft_ads.microsoft_ads__url_report account_id 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0
145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report
  • Input Column: 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp[account_id]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as INT type
    • Output Columns:
      • account_id: Directly mapped
136. model.microsoft_ads.microsoft_ads__ad_report
  • Input Column: 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report[account_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with the accounts table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • account_id: Directly copied to the output
140. model.microsoft_ads.microsoft_ads__url_report
  • Input Column: 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report[account_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a join key with the accounts table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • account_id: Directly copied to the output
Column Lineage
%3 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp campaign_id 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report campaign_id 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp:f0->145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0 136. model.microsoft_ads.microsoft_ads__ad_report 136. model.microsoft_ads.microsoft_ads__ad_report campaign_id 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0->136. model.microsoft_ads.microsoft_ads__ad_report:f0 140. model.microsoft_ads.microsoft_ads__url_report 140. model.microsoft_ads.microsoft_ads__url_report campaign_id 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0
145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report
  • Input Column: 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp[campaign_id]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as INT type
    • Output Columns:
      • campaign_id: Directly mapped
136. model.microsoft_ads.microsoft_ads__ad_report
  • Input Column: 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report[campaign_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with the campaigns table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • campaign_id: Directly copied to the output
140. model.microsoft_ads.microsoft_ads__url_report
  • Input Column: 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report[campaign_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a join key with the campaigns table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • campaign_id: Directly copied to the output
Column Lineage
%3 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp ad_group_id 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report ad_group_id 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp:f0->145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0 136. model.microsoft_ads.microsoft_ads__ad_report 136. model.microsoft_ads.microsoft_ads__ad_report ad_group_id 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0->136. model.microsoft_ads.microsoft_ads__ad_report:f0 140. model.microsoft_ads.microsoft_ads__url_report 140. model.microsoft_ads.microsoft_ads__url_report ad_group_id 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0
145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report
  • Input Column: 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp[ad_group_id]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as INT type
    • Output Columns:
      • ad_group_id: Directly mapped
136. model.microsoft_ads.microsoft_ads__ad_report
  • Input Column: 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report[ad_group_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with the ad_groups table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • ad_group_id: Directly copied to the output
140. model.microsoft_ads.microsoft_ads__url_report
  • Input Column: 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report[ad_group_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a join key with the ad_groups table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • ad_group_id: Directly copied to the output
Column Lineage
%3 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp ad_id 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report ad_id 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp:f0->145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0 136. model.microsoft_ads.microsoft_ads__ad_report 136. model.microsoft_ads.microsoft_ads__ad_report ad_id 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0->136. model.microsoft_ads.microsoft_ads__ad_report:f0 140. model.microsoft_ads.microsoft_ads__url_report 140. model.microsoft_ads.microsoft_ads__url_report ad_id 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0
145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report
  • Input Column: 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp[ad_id]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as INT type
    • Output Columns:
      • ad_id: Directly mapped
136. model.microsoft_ads.microsoft_ads__ad_report
  • Input Column: 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report[ad_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with the ads table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • ad_id: Directly copied to the output
140. model.microsoft_ads.microsoft_ads__url_report
  • Input Column: 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report[ad_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a join key with the ads table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • ad_id: Directly copied to the output
Column Lineage
%3 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp currency_code 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report currency_code 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp:f0->145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0 136. model.microsoft_ads.microsoft_ads__ad_report 136. model.microsoft_ads.microsoft_ads__ad_report currency_code 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0->136. model.microsoft_ads.microsoft_ads__ad_report:f0 140. model.microsoft_ads.microsoft_ads__url_report 140. model.microsoft_ads.microsoft_ads__url_report currency_code 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0
145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report
  • Input Column: 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp[currency_code]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • currency_code: Directly mapped
136. model.microsoft_ads.microsoft_ads__ad_report
  • Input Column: 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report[currency_code]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • currency_code: Directly copied to the output
140. model.microsoft_ads.microsoft_ads__url_report
  • Input Column: 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report[currency_code]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • currency_code: Directly copied to the output
Column Lineage
%3 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp device_os 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report device_os 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp:f0->145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0 136. model.microsoft_ads.microsoft_ads__ad_report 136. model.microsoft_ads.microsoft_ads__ad_report device_os 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0->136. model.microsoft_ads.microsoft_ads__ad_report:f0 140. model.microsoft_ads.microsoft_ads__url_report 140. model.microsoft_ads.microsoft_ads__url_report device_os 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0
145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report
  • Input Column: 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp[device_os]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • device_os: Directly mapped
136. model.microsoft_ads.microsoft_ads__ad_report
  • Input Column: 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report[device_os]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • device_os: Directly copied to the output
140. model.microsoft_ads.microsoft_ads__url_report
  • Input Column: 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report[device_os]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • device_os: Directly copied to the output
Column Lineage
%3 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp device_type 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report device_type 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp:f0->145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0 136. model.microsoft_ads.microsoft_ads__ad_report 136. model.microsoft_ads.microsoft_ads__ad_report device_type 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0->136. model.microsoft_ads.microsoft_ads__ad_report:f0 140. model.microsoft_ads.microsoft_ads__url_report 140. model.microsoft_ads.microsoft_ads__url_report device_type 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0
145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report
  • Input Column: 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp[device_type]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • device_type: Directly mapped
136. model.microsoft_ads.microsoft_ads__ad_report
  • Input Column: 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report[device_type]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • device_type: Directly copied to the output
140. model.microsoft_ads.microsoft_ads__url_report
  • Input Column: 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report[device_type]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • device_type: Directly copied to the output
Column Lineage
%3 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp network 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report network 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp:f0->145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0 136. model.microsoft_ads.microsoft_ads__ad_report 136. model.microsoft_ads.microsoft_ads__ad_report network 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0->136. model.microsoft_ads.microsoft_ads__ad_report:f0 140. model.microsoft_ads.microsoft_ads__url_report 140. model.microsoft_ads.microsoft_ads__url_report network 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0
145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report
  • Input Column: 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp[network]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • network: Directly mapped
136. model.microsoft_ads.microsoft_ads__ad_report
  • Input Column: 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report[network]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • network: Directly copied to the output
140. model.microsoft_ads.microsoft_ads__url_report
  • Input Column: 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report[network]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • network: Directly copied to the output
Column Lineage
%3 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp language 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report language 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp:f0->145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0
145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report
  • Input Column: 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp[language]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • language: Directly mapped
Column Lineage
%3 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp ad_distribution 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report ad_distribution 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp:f0->145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0
145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report
  • Input Column: 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp[ad_distribution]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • ad_distribution: Directly copied to the output column
Column Lineage
%3 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp bid_match_type 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report bid_match_type 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp:f0->145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0
145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report
  • Input Column: 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp[bid_match_type]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • bid_match_type: Directly copied to the output column
Column Lineage
%3 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp delivered_match_type 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report delivered_match_type 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp:f0->145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0
145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report
  • Input Column: 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp[delivered_match_type]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • delivered_match_type: Directly copied to the output column
Column Lineage
%3 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp top_vs_other 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report top_vs_other 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp:f0->145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0
145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report
  • Input Column: 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp[top_vs_other]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • top_vs_other: Directly copied to the output column
Column Lineage
%3 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp clicks 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report clicks 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp:f0->145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0 136. model.microsoft_ads.microsoft_ads__ad_report 136. model.microsoft_ads.microsoft_ads__ad_report clicks 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0->136. model.microsoft_ads.microsoft_ads__ad_report:f0 140. model.microsoft_ads.microsoft_ads__url_report 140. model.microsoft_ads.microsoft_ads__url_report clicks 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0
145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report
  • Input Column: 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp[clicks]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT
    • Output Columns:
      • clicks: Directly copied to the output column after casting
136. model.microsoft_ads.microsoft_ads__ad_report
  • Input Column: 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report[clicks]
    • Aggregation The clicks are summed up in the GROUP BY clause
    • Output Columns:
      • clicks: Summed up in the SELECT statement
140. model.microsoft_ads.microsoft_ads__url_report
  • Input Column: 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report[clicks]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • clicks: The sum of clicks is mapped to the output 'clicks' column
Column Lineage
%3 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp impressions 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report impressions 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp:f0->145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0 136. model.microsoft_ads.microsoft_ads__ad_report 136. model.microsoft_ads.microsoft_ads__ad_report impressions 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0->136. model.microsoft_ads.microsoft_ads__ad_report:f0 140. model.microsoft_ads.microsoft_ads__url_report 140. model.microsoft_ads.microsoft_ads__url_report impressions 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0
145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report
  • Input Column: 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp[impressions]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT
    • Output Columns:
      • impressions: Directly copied to the output column after casting
136. model.microsoft_ads.microsoft_ads__ad_report
  • Input Column: 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report[impressions]
    • Aggregation The impressions are summed up in the GROUP BY clause
    • Output Columns:
      • impressions: Summed up in the SELECT statement
140. model.microsoft_ads.microsoft_ads__url_report
  • Input Column: 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report[impressions]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • impressions: The sum of impressions is mapped to the output 'impressions' column
Column Lineage
%3 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp spend 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report spend 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp:f0->145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0 136. model.microsoft_ads.microsoft_ads__ad_report 136. model.microsoft_ads.microsoft_ads__ad_report spend 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0->136. model.microsoft_ads.microsoft_ads__ad_report:f0 140. model.microsoft_ads.microsoft_ads__url_report 140. model.microsoft_ads.microsoft_ads__url_report spend 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0
145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report
  • Input Column: 146. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report_tmp[spend]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as FLOAT
    • Output Columns:
      • spend: Directly copied to the output column after casting
136. model.microsoft_ads.microsoft_ads__ad_report
  • Input Column: 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report[spend]
    • Aggregation The spend is summed up in the GROUP BY clause
    • Output Columns:
      • spend: Summed up in the SELECT statement
140. model.microsoft_ads.microsoft_ads__url_report
  • Input Column: 145. model.microsoft_ads_source.stg_microsoft_ads__ad_daily_report[spend]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • spend: The sum of spend is mapped to the output 'spend' column
147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report

This SQL query is designed to create a staging table for Microsoft Ads ad group daily reports. It starts by selecting all columns from a temporary table, then defines a set of fields with specific data types (mostly set to NULL or empty string), and finally reorganizes and renames some columns in the final select statement. The query doesn't perform any actual data transformation or filtering, suggesting it's primarily used to set up a consistent structure for the staging table.

CleaningOther
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp
), fields AS (
  SELECT
    CAST(NULL AS INT) AS account_id,
    CAST(NULL AS TEXT) AS ad_distribution,
    CAST(NULL AS INT) AS ad_group_id,
    CAST(NULL AS TEXT) AS bid_match_type,
    CAST(NULL AS INT) AS campaign_id,
    CAST(NULL AS INT) AS clicks,
    CAST(NULL AS TEXT) AS currency_code,
    CAST(NULL AS DATE) AS date,
    CAST(NULL AS TEXT) AS delivered_match_type,
    CAST(NULL AS TEXT) AS device_os,
    CAST(NULL AS TEXT) AS device_type,
    CAST(NULL AS INT) AS impressions,
    CAST(NULL AS TEXT) AS language,
    CAST(NULL AS TEXT) AS network,
    CAST(NULL AS FLOAT) AS spend,
    CAST(NULL AS TEXT) AS top_vs_other,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    date AS date_day,
    account_id,
    campaign_id,
    ad_group_id,
    currency_code,
    device_os,
    device_type,
    network,
    language,
    ad_distribution,
    bid_match_type,
    delivered_match_type,
    top_vs_other,
    clicks,
    impressions,
    spend
  FROM fields
)
SELECT
  *
FROM final
%3 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report source_relation date_day account_id campaign_id ad_group_id currency_code device_os device_type network language ad_distribution bid_match_type delivered_match_type top_vs_other clicks impressions spend 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp date account_id campaign_id ad_group_id currency_code device_os device_type network language ad_distribution bid_match_type delivered_match_type top_vs_other clicks impressions spend 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp:f0->147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f1 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp:f1->147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f2 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp:f2->147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f3 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp:f3->147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f4 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp:f4->147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f5 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp:f5->147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f6 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp:f6->147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f7 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp:f7->147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f8 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp:f8->147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f9 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp:f9->147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f10 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp:f10->147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f11 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp:f11->147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f12 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp:f12->147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f13 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp:f13->147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f14 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp:f14->147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f15 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp:f15->147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f16
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
date_day date The date of the report.
account_id bigint The ID representing the account.
campaign_id bigint The ID representing the campaign, if present in the source data.
ad_group_id bigint The ID representing the ad group, if present in the source data.
currency_code text The currency code associated with spend and, if applicable, other metrics associated with currency.
device_os text The device operating system associated with this record; values include but may not be limited to 'Windows', 'iOS', 'Android', 'Other', 'BlackBerry' and 'Unknown'.
device_type text The device type associated with this record; values include but may not be limited to 'Computer', 'Smartphone', 'Tablet' and 'Unknown'.
network text The network associated with this record.
language text The language that the associated ad was viewed in.
ad_distribution text The distribution medium associated with this record.
bid_match_type text The bid match type associated with this record; values include 'Broad', 'Exact', 'Phrase'.
delivered_match_type text The delivered match type associated with this record; values include 'Broad', 'Exact', 'Phrase'.
top_vs_other text The position of the ad associated with this record. For more information, refer to Microsoft [documentation](https://help.ads.microsoft.com/apex/index/22/en/14009).
clicks integer The count of clicks.
impressions integer The count of impressions.
spend double precision The cost of the ads.
Column Lineage
%3 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report source_relation 135. model.microsoft_ads.microsoft_ads__ad_group_report 135. model.microsoft_ads.microsoft_ads__ad_group_report source_relation 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f0->135. model.microsoft_ads.microsoft_ads__ad_group_report:f0
135. model.microsoft_ads.microsoft_ads__ad_group_report
  • Input Column: 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with other tables
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
Column Lineage
%3 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp date 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report date_day 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp:f0->147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f0 135. model.microsoft_ads.microsoft_ads__ad_group_report 135. model.microsoft_ads.microsoft_ads__ad_group_report date_day 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f0->135. model.microsoft_ads.microsoft_ads__ad_group_report:f0
147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report
  • Input Column: 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp[date]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as DATE type
    • Output Columns:
      • date_day: Directly mapped and renamed
135. model.microsoft_ads.microsoft_ads__ad_group_report
  • Input Column: 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp account_id 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report account_id 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp:f0->147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f0 135. model.microsoft_ads.microsoft_ads__ad_group_report 135. model.microsoft_ads.microsoft_ads__ad_group_report account_id 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f0->135. model.microsoft_ads.microsoft_ads__ad_group_report:f0
147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report
  • Input Column: 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp[account_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT type
    • Output Columns:
      • account_id: Directly mapped
135. model.microsoft_ads.microsoft_ads__ad_group_report
  • Input Column: 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report[account_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a join key with the accounts table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • account_id: Directly copied to the output
Column Lineage
%3 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp campaign_id 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report campaign_id 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp:f0->147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f0 135. model.microsoft_ads.microsoft_ads__ad_group_report 135. model.microsoft_ads.microsoft_ads__ad_group_report campaign_id 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f0->135. model.microsoft_ads.microsoft_ads__ad_group_report:f0
147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report
  • Input Column: 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp[campaign_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT type
    • Output Columns:
      • campaign_id: Directly mapped
135. model.microsoft_ads.microsoft_ads__ad_group_report
  • Input Column: 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report[campaign_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a join key with the campaigns table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • campaign_id: Directly copied to the output
Column Lineage
%3 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp ad_group_id 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report ad_group_id 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp:f0->147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f0 135. model.microsoft_ads.microsoft_ads__ad_group_report 135. model.microsoft_ads.microsoft_ads__ad_group_report ad_group_id 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f0->135. model.microsoft_ads.microsoft_ads__ad_group_report:f0
147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report
  • Input Column: 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp[ad_group_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT type
    • Output Columns:
      • ad_group_id: Directly mapped
135. model.microsoft_ads.microsoft_ads__ad_group_report
  • Input Column: 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report[ad_group_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a join key with the ad_groups table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • ad_group_id: Directly copied to the output
Column Lineage
%3 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp currency_code 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report currency_code 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp:f0->147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f0 135. model.microsoft_ads.microsoft_ads__ad_group_report 135. model.microsoft_ads.microsoft_ads__ad_group_report currency_code 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f0->135. model.microsoft_ads.microsoft_ads__ad_group_report:f0
147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report
  • Input Column: 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp[currency_code]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • currency_code: Directly mapped
135. model.microsoft_ads.microsoft_ads__ad_group_report
  • Input Column: 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report[currency_code]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • currency_code: Directly copied to the output
Column Lineage
%3 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp device_os 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report device_os 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp:f0->147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f0 135. model.microsoft_ads.microsoft_ads__ad_group_report 135. model.microsoft_ads.microsoft_ads__ad_group_report device_os 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f0->135. model.microsoft_ads.microsoft_ads__ad_group_report:f0
147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report
  • Input Column: 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp[device_os]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • device_os: Directly mapped
135. model.microsoft_ads.microsoft_ads__ad_group_report
  • Input Column: 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report[device_os]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • device_os: Directly copied to the output
Column Lineage
%3 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp device_type 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report device_type 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp:f0->147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f0 135. model.microsoft_ads.microsoft_ads__ad_group_report 135. model.microsoft_ads.microsoft_ads__ad_group_report device_type 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f0->135. model.microsoft_ads.microsoft_ads__ad_group_report:f0
147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report
  • Input Column: 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp[device_type]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • device_type: Directly mapped
135. model.microsoft_ads.microsoft_ads__ad_group_report
  • Input Column: 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report[device_type]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • device_type: Directly copied to the output
Column Lineage
%3 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp network 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report network 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp:f0->147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f0 135. model.microsoft_ads.microsoft_ads__ad_group_report 135. model.microsoft_ads.microsoft_ads__ad_group_report network 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f0->135. model.microsoft_ads.microsoft_ads__ad_group_report:f0
147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report
  • Input Column: 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp[network]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • network: Directly mapped
135. model.microsoft_ads.microsoft_ads__ad_group_report
  • Input Column: 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report[network]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • network: Directly copied to the output
Column Lineage
%3 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp language 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report language 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp:f0->147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f0
147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report
  • Input Column: 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp[language]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • language: Directly mapped
Column Lineage
%3 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp ad_distribution 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report ad_distribution 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp:f0->147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f0
147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report
  • Input Column: 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp[ad_distribution]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • ad_distribution: Directly mapped
Column Lineage
%3 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp bid_match_type 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report bid_match_type 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp:f0->147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f0
147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report
  • Input Column: 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp[bid_match_type]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • bid_match_type: Directly copied to the output column of the same name
Column Lineage
%3 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp delivered_match_type 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report delivered_match_type 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp:f0->147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f0
147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report
  • Input Column: 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp[delivered_match_type]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • delivered_match_type: Directly copied to the output column of the same name
Column Lineage
%3 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp top_vs_other 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report top_vs_other 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp:f0->147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f0
147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report
  • Input Column: 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp[top_vs_other]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • top_vs_other: Directly copied to the output column of the same name
Column Lineage
%3 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp clicks 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report clicks 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp:f0->147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f0 135. model.microsoft_ads.microsoft_ads__ad_group_report 135. model.microsoft_ads.microsoft_ads__ad_group_report clicks 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f0->135. model.microsoft_ads.microsoft_ads__ad_group_report:f0
147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report
  • Input Column: 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp[clicks]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • clicks: Directly copied to the output column of the same name
135. model.microsoft_ads.microsoft_ads__ad_group_report
  • Input Column: 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report[clicks]
    • Aggregation The clicks are summed up in the GROUP BY clause
    • Output Columns:
      • clicks: Summed up in the SELECT statement as SUM(report.clicks)
Column Lineage
%3 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp impressions 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report impressions 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp:f0->147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f0 135. model.microsoft_ads.microsoft_ads__ad_group_report 135. model.microsoft_ads.microsoft_ads__ad_group_report impressions 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f0->135. model.microsoft_ads.microsoft_ads__ad_group_report:f0
147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report
  • Input Column: 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp[impressions]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • impressions: Directly copied to the output column of the same name
135. model.microsoft_ads.microsoft_ads__ad_group_report
  • Input Column: 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report[impressions]
    • Aggregation The impressions are summed up in the GROUP BY clause
    • Output Columns:
      • impressions: Summed up in the SELECT statement as SUM(report.impressions)
Column Lineage
%3 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp spend 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report spend 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp:f0->147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f0 135. model.microsoft_ads.microsoft_ads__ad_group_report 135. model.microsoft_ads.microsoft_ads__ad_group_report spend 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f0->135. model.microsoft_ads.microsoft_ads__ad_group_report:f0
147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report
  • Input Column: 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp[spend]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • spend: Directly copied to the output column of the same name
135. model.microsoft_ads.microsoft_ads__ad_group_report
  • Input Column: 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report[spend]
    • Aggregation The spend is summed up in the GROUP BY clause
    • Output Columns:
      • spend: Summed up in the SELECT statement as SUM(report.spend)
148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of type TEXT, initialized to NULL. The LIMIT 0 clause ensures no rows are returned. This appears to be a template or placeholder query, possibly used to define the structure of a temporary table or view without populating it with data.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp date account_id campaign_id ad_group_id currency_code device_os device_type network language ad_distribution bid_match_type delivered_match_type top_vs_other clicks impressions spend 325. source.microsoft_ads_source.microsoft_ads.ad_group_performance_daily_report 325. source.microsoft_ads_source.microsoft_ads.ad_group_performance_daily_report
Name Type Comment
date date None
account_id bigint None
campaign_id bigint None
ad_group_id bigint None
currency_code text None
device_os text None
device_type text None
network text None
language text None
ad_distribution text None
bid_match_type text None
delivered_match_type text None
top_vs_other text None
clicks integer None
impressions integer None
spend double precision None
Column Lineage
%3 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp date 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report date_day 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp:f0->147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f0 135. model.microsoft_ads.microsoft_ads__ad_group_report 135. model.microsoft_ads.microsoft_ads__ad_group_report date_day 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f0->135. model.microsoft_ads.microsoft_ads__ad_group_report:f0
147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report
  • Input Column: 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp[date]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as DATE type
    • Output Columns:
      • date_day: Directly mapped and renamed
135. model.microsoft_ads.microsoft_ads__ad_group_report
  • Input Column: 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp account_id 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report account_id 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp:f0->147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f0 135. model.microsoft_ads.microsoft_ads__ad_group_report 135. model.microsoft_ads.microsoft_ads__ad_group_report account_id 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f0->135. model.microsoft_ads.microsoft_ads__ad_group_report:f0
147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report
  • Input Column: 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp[account_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT type
    • Output Columns:
      • account_id: Directly mapped
135. model.microsoft_ads.microsoft_ads__ad_group_report
  • Input Column: 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report[account_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a join key with the accounts table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • account_id: Directly copied to the output
Column Lineage
%3 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp campaign_id 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report campaign_id 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp:f0->147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f0 135. model.microsoft_ads.microsoft_ads__ad_group_report 135. model.microsoft_ads.microsoft_ads__ad_group_report campaign_id 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f0->135. model.microsoft_ads.microsoft_ads__ad_group_report:f0
147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report
  • Input Column: 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp[campaign_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT type
    • Output Columns:
      • campaign_id: Directly mapped
135. model.microsoft_ads.microsoft_ads__ad_group_report
  • Input Column: 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report[campaign_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a join key with the campaigns table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • campaign_id: Directly copied to the output
Column Lineage
%3 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp ad_group_id 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report ad_group_id 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp:f0->147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f0 135. model.microsoft_ads.microsoft_ads__ad_group_report 135. model.microsoft_ads.microsoft_ads__ad_group_report ad_group_id 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f0->135. model.microsoft_ads.microsoft_ads__ad_group_report:f0
147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report
  • Input Column: 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp[ad_group_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT type
    • Output Columns:
      • ad_group_id: Directly mapped
135. model.microsoft_ads.microsoft_ads__ad_group_report
  • Input Column: 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report[ad_group_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a join key with the ad_groups table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • ad_group_id: Directly copied to the output
Column Lineage
%3 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp currency_code 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report currency_code 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp:f0->147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f0 135. model.microsoft_ads.microsoft_ads__ad_group_report 135. model.microsoft_ads.microsoft_ads__ad_group_report currency_code 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f0->135. model.microsoft_ads.microsoft_ads__ad_group_report:f0
147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report
  • Input Column: 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp[currency_code]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • currency_code: Directly mapped
135. model.microsoft_ads.microsoft_ads__ad_group_report
  • Input Column: 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report[currency_code]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • currency_code: Directly copied to the output
Column Lineage
%3 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp device_os 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report device_os 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp:f0->147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f0 135. model.microsoft_ads.microsoft_ads__ad_group_report 135. model.microsoft_ads.microsoft_ads__ad_group_report device_os 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f0->135. model.microsoft_ads.microsoft_ads__ad_group_report:f0
147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report
  • Input Column: 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp[device_os]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • device_os: Directly mapped
135. model.microsoft_ads.microsoft_ads__ad_group_report
  • Input Column: 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report[device_os]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • device_os: Directly copied to the output
Column Lineage
%3 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp device_type 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report device_type 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp:f0->147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f0 135. model.microsoft_ads.microsoft_ads__ad_group_report 135. model.microsoft_ads.microsoft_ads__ad_group_report device_type 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f0->135. model.microsoft_ads.microsoft_ads__ad_group_report:f0
147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report
  • Input Column: 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp[device_type]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • device_type: Directly mapped
135. model.microsoft_ads.microsoft_ads__ad_group_report
  • Input Column: 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report[device_type]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • device_type: Directly copied to the output
Column Lineage
%3 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp network 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report network 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp:f0->147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f0 135. model.microsoft_ads.microsoft_ads__ad_group_report 135. model.microsoft_ads.microsoft_ads__ad_group_report network 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f0->135. model.microsoft_ads.microsoft_ads__ad_group_report:f0
147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report
  • Input Column: 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp[network]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • network: Directly mapped
135. model.microsoft_ads.microsoft_ads__ad_group_report
  • Input Column: 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report[network]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • network: Directly copied to the output
Column Lineage
%3 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp language 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report language 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp:f0->147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f0
147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report
  • Input Column: 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp[language]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • language: Directly mapped
Column Lineage
%3 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp ad_distribution 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report ad_distribution 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp:f0->147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f0
147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report
  • Input Column: 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp[ad_distribution]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • ad_distribution: Directly mapped
Column Lineage
%3 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp bid_match_type 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report bid_match_type 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp:f0->147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f0
147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report
  • Input Column: 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp[bid_match_type]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • bid_match_type: Directly copied to the output column of the same name
Column Lineage
%3 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp delivered_match_type 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report delivered_match_type 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp:f0->147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f0
147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report
  • Input Column: 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp[delivered_match_type]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • delivered_match_type: Directly copied to the output column of the same name
Column Lineage
%3 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp top_vs_other 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report top_vs_other 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp:f0->147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f0
147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report
  • Input Column: 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp[top_vs_other]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • top_vs_other: Directly copied to the output column of the same name
Column Lineage
%3 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp clicks 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report clicks 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp:f0->147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f0 135. model.microsoft_ads.microsoft_ads__ad_group_report 135. model.microsoft_ads.microsoft_ads__ad_group_report clicks 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f0->135. model.microsoft_ads.microsoft_ads__ad_group_report:f0
147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report
  • Input Column: 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp[clicks]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • clicks: Directly copied to the output column of the same name
135. model.microsoft_ads.microsoft_ads__ad_group_report
  • Input Column: 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report[clicks]
    • Aggregation The clicks are summed up in the GROUP BY clause
    • Output Columns:
      • clicks: Summed up in the SELECT statement as SUM(report.clicks)
Column Lineage
%3 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp impressions 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report impressions 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp:f0->147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f0 135. model.microsoft_ads.microsoft_ads__ad_group_report 135. model.microsoft_ads.microsoft_ads__ad_group_report impressions 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f0->135. model.microsoft_ads.microsoft_ads__ad_group_report:f0
147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report
  • Input Column: 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp[impressions]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • impressions: Directly copied to the output column of the same name
135. model.microsoft_ads.microsoft_ads__ad_group_report
  • Input Column: 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report[impressions]
    • Aggregation The impressions are summed up in the GROUP BY clause
    • Output Columns:
      • impressions: Summed up in the SELECT statement as SUM(report.impressions)
Column Lineage
%3 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp spend 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report spend 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp:f0->147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f0 135. model.microsoft_ads.microsoft_ads__ad_group_report 135. model.microsoft_ads.microsoft_ads__ad_group_report spend 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report:f0->135. model.microsoft_ads.microsoft_ads__ad_group_report:f0
147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report
  • Input Column: 148. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report_tmp[spend]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • spend: Directly copied to the output column of the same name
135. model.microsoft_ads.microsoft_ads__ad_group_report
  • Input Column: 147. model.microsoft_ads_source.stg_microsoft_ads__ad_group_daily_report[spend]
    • Aggregation The spend is summed up in the GROUP BY clause
    • Output Columns:
      • spend: Summed up in the SELECT statement as SUM(report.spend)
149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history

This SQL query stages data from a temporary table for Microsoft Ads ad group history. It casts fields to specific data types, renames some columns, and adds a flag to identify the most recent record for each ad group across different source relations. The query doesn't actually filter or aggregate data but prepares it for further processing.

CleaningDeduplicationOther
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp
), fields AS (
  SELECT
    CAST(NULL AS INT) AS id,
    CAST(NULL AS TEXT) AS name,
    CAST(NULL AS INT) AS campaign_id,
    CAST(NULL AS TIMESTAMP) AS modified_time,
    CAST(NULL AS DATE) AS start_date,
    CAST(NULL AS DATE) AS end_date,
    CAST(NULL AS TEXT) AS status,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    id AS ad_group_id,
    name AS ad_group_name,
    campaign_id,
    modified_time AS modified_at,
    start_date,
    end_date,
    status,
    ROW_NUMBER() OVER (PARTITION BY source_relation, id ORDER BY modified_time DESC) = 1 AS is_most_recent_record
  FROM fields
)
SELECT
  *
FROM final
%3 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history source_relation ad_group_id ad_group_name campaign_id modified_at start_date end_date status is_most_recent_record 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp id name campaign_id modified_time start_date end_date status 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp:f0->149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f1 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp:f1->149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f2 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp:f2->149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f3 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp:f3->149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f4 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp:f4->149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f5 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp:f5->149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f6 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp:f6->149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f7
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
ad_group_id bigint The ID representing the ad group, if present in the source data.
ad_group_name text The name of the ad group, if present in the source data.
campaign_id bigint The ID representing the campaign, if present in the source data.
modified_at timestamp without time zone The time each version of the object was last modified, i.e. when that version of the object was 'created'.
start_date date The date in which an ad group starts running.
end_date integer The date in which this ad group will no longer run.
status text The status of this ad group; see the following [documentation](https://help.ads.microsoft.com/apex/index/3/en/53094) for more information on values and definitions.
is_most_recent_record boolean Boolean representing whether a record is the most recent version of that record.
Column Lineage
%3 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history source_relation 136. model.microsoft_ads.microsoft_ads__ad_report 136. model.microsoft_ads.microsoft_ads__ad_report source_relation 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f0->136. model.microsoft_ads.microsoft_ads__ad_report:f0 139. model.microsoft_ads.microsoft_ads__search_report 139. model.microsoft_ads.microsoft_ads__search_report source_relation 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0 135. model.microsoft_ads.microsoft_ads__ad_group_report 135. model.microsoft_ads.microsoft_ads__ad_group_report source_relation 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f0->135. model.microsoft_ads.microsoft_ads__ad_group_report:f0 140. model.microsoft_ads.microsoft_ads__url_report 140. model.microsoft_ads.microsoft_ads__url_report source_relation 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0 138. model.microsoft_ads.microsoft_ads__keyword_report 138. model.microsoft_ads.microsoft_ads__keyword_report source_relation 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0
135. model.microsoft_ads.microsoft_ads__ad_group_report
  • Input Column: 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history[source_relation]
    • Integration used as a key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
136. model.microsoft_ads.microsoft_ads__ad_report
  • Input Column: 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history[source_relation]
    • Integration used as part of the join condition with the report table
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
138. model.microsoft_ads.microsoft_ads__keyword_report
  • Input Column: 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history[source_relation]
    • Integration used as part of the join condition with the report table
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
139. model.microsoft_ads.microsoft_ads__search_report
  • Input Column: 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history[source_relation]
    • Integration used as a join key with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
140. model.microsoft_ads.microsoft_ads__url_report
  • Input Column: 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history[source_relation]
    • Integration used as part of the join condition with the report table
    • Direct copied directly to the output
    • Output Columns:
      • source_relation: directly copied
Column Lineage
%3 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp id 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history ad_group_id 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp:f0->149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f0 136. model.microsoft_ads.microsoft_ads__ad_report 136. model.microsoft_ads.microsoft_ads__ad_report ad_group_id 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f0->136. model.microsoft_ads.microsoft_ads__ad_report:f0 139. model.microsoft_ads.microsoft_ads__search_report 139. model.microsoft_ads.microsoft_ads__search_report ad_group_id 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0 135. model.microsoft_ads.microsoft_ads__ad_group_report 135. model.microsoft_ads.microsoft_ads__ad_group_report ad_group_id 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f0->135. model.microsoft_ads.microsoft_ads__ad_group_report:f0 140. model.microsoft_ads.microsoft_ads__url_report 140. model.microsoft_ads.microsoft_ads__url_report ad_group_id 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0 138. model.microsoft_ads.microsoft_ads__keyword_report 138. model.microsoft_ads.microsoft_ads__keyword_report ad_group_id 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0
149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history
  • Input Column: 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp[id]
    • Direct The column is directly copied without transformation
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • ad_group_id: Directly mapped to this output column
135. model.microsoft_ads.microsoft_ads__ad_group_report
  • Input Column: 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history[ad_group_id]
    • Integration used as a key to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_id: directly copied
136. model.microsoft_ads.microsoft_ads__ad_report
  • Input Column: 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history[ad_group_id]
    • Integration used as the key to join with the report table
    • Output Columns:
      • ad_group_id: directly copied
138. model.microsoft_ads.microsoft_ads__keyword_report
  • Input Column: 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history[ad_group_id]
    • Integration used as the key to join with the report table
    • Output Columns:
      • ad_group_id: directly copied
139. model.microsoft_ads.microsoft_ads__search_report
  • Input Column: 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history[ad_group_id]
    • Integration used as a join key with the report table
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_id: directly copied
140. model.microsoft_ads.microsoft_ads__url_report
  • Input Column: 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history[ad_group_id]
    • Integration used as part of the join condition with the report table
    • Output Columns:
      • ad_group_id: directly copied from the report table
Column Lineage
%3 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp name 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history ad_group_name 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp:f0->149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f0 136. model.microsoft_ads.microsoft_ads__ad_report 136. model.microsoft_ads.microsoft_ads__ad_report ad_group_name 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f0->136. model.microsoft_ads.microsoft_ads__ad_report:f0 139. model.microsoft_ads.microsoft_ads__search_report 139. model.microsoft_ads.microsoft_ads__search_report ad_group_name 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0 135. model.microsoft_ads.microsoft_ads__ad_group_report 135. model.microsoft_ads.microsoft_ads__ad_group_report ad_group_name 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f0->135. model.microsoft_ads.microsoft_ads__ad_group_report:f0 140. model.microsoft_ads.microsoft_ads__url_report 140. model.microsoft_ads.microsoft_ads__url_report ad_group_name 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0 138. model.microsoft_ads.microsoft_ads__keyword_report 138. model.microsoft_ads.microsoft_ads__keyword_report ad_group_name 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0
149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history
  • Input Column: 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • ad_group_name: Directly mapped to this output column
135. model.microsoft_ads.microsoft_ads__ad_group_report
  • Input Column: 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history[ad_group_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_name: directly copied
136. model.microsoft_ads.microsoft_ads__ad_report
  • Input Column: 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history[ad_group_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_name: directly copied
138. model.microsoft_ads.microsoft_ads__keyword_report
  • Input Column: 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history[ad_group_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_name: directly copied
139. model.microsoft_ads.microsoft_ads__search_report
  • Input Column: 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history[ad_group_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_name: directly copied
140. model.microsoft_ads.microsoft_ads__url_report
  • Input Column: 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history[ad_group_name]
    • Direct copied directly to the output
    • Output Columns:
      • ad_group_name: directly copied
Column Lineage
%3 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp campaign_id 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history campaign_id 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp:f0->149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f0
149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history
  • Input Column: 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp[campaign_id]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • campaign_id: Directly mapped to this output column
Column Lineage
%3 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp modified_time 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history modified_at 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp:f0->149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f0
149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history
  • Input Column: 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp[modified_time]
    • Direct The column is directly copied without transformation
    • Deduplication Used in the ROW_NUMBER() function to order and identify the most recent record
    • Output Columns:
      • modified_at: Directly mapped to this output column
Column Lineage
%3 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp start_date 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history start_date 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp:f0->149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f0
149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history
  • Input Column: 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp[start_date]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • start_date: Directly mapped to this output column
Column Lineage
%3 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp end_date 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history end_date 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp:f0->149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f0
149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history
  • Input Column: 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp[end_date]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • end_date: Directly mapped to this output column
Column Lineage
%3 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp status 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history status 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp:f0->149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f0
149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history
  • Input Column: 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp[status]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • status: Directly mapped to this output column
150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of type TEXT, which is set to NULL. The query is limited to 0 rows, effectively creating a template or schema for the column without any actual data.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp id name campaign_id modified_time start_date end_date status 324. source.microsoft_ads_source.microsoft_ads.ad_group_history 324. source.microsoft_ads_source.microsoft_ads.ad_group_history
Name Type Comment
id bigint None
name text None
campaign_id bigint None
modified_time timestamp without time zone None
start_date date None
end_date integer None
status text None
Column Lineage
%3 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp id 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history ad_group_id 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp:f0->149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f0 136. model.microsoft_ads.microsoft_ads__ad_report 136. model.microsoft_ads.microsoft_ads__ad_report ad_group_id 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f0->136. model.microsoft_ads.microsoft_ads__ad_report:f0 139. model.microsoft_ads.microsoft_ads__search_report 139. model.microsoft_ads.microsoft_ads__search_report ad_group_id 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0 135. model.microsoft_ads.microsoft_ads__ad_group_report 135. model.microsoft_ads.microsoft_ads__ad_group_report ad_group_id 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f0->135. model.microsoft_ads.microsoft_ads__ad_group_report:f0 140. model.microsoft_ads.microsoft_ads__url_report 140. model.microsoft_ads.microsoft_ads__url_report ad_group_id 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0 138. model.microsoft_ads.microsoft_ads__keyword_report 138. model.microsoft_ads.microsoft_ads__keyword_report ad_group_id 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0
149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history
  • Input Column: 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp[id]
    • Direct The column is directly copied without transformation
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • ad_group_id: Directly mapped to this output column
135. model.microsoft_ads.microsoft_ads__ad_group_report
  • Input Column: 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history[ad_group_id]
    • Integration used as a key to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_id: directly copied
136. model.microsoft_ads.microsoft_ads__ad_report
  • Input Column: 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history[ad_group_id]
    • Integration used as the key to join with the report table
    • Output Columns:
      • ad_group_id: directly copied
138. model.microsoft_ads.microsoft_ads__keyword_report
  • Input Column: 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history[ad_group_id]
    • Integration used as the key to join with the report table
    • Output Columns:
      • ad_group_id: directly copied
139. model.microsoft_ads.microsoft_ads__search_report
  • Input Column: 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history[ad_group_id]
    • Integration used as a join key with the report table
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_id: directly copied
140. model.microsoft_ads.microsoft_ads__url_report
  • Input Column: 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history[ad_group_id]
    • Integration used as part of the join condition with the report table
    • Output Columns:
      • ad_group_id: directly copied from the report table
Column Lineage
%3 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp name 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history ad_group_name 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp:f0->149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f0 136. model.microsoft_ads.microsoft_ads__ad_report 136. model.microsoft_ads.microsoft_ads__ad_report ad_group_name 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f0->136. model.microsoft_ads.microsoft_ads__ad_report:f0 139. model.microsoft_ads.microsoft_ads__search_report 139. model.microsoft_ads.microsoft_ads__search_report ad_group_name 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0 135. model.microsoft_ads.microsoft_ads__ad_group_report 135. model.microsoft_ads.microsoft_ads__ad_group_report ad_group_name 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f0->135. model.microsoft_ads.microsoft_ads__ad_group_report:f0 140. model.microsoft_ads.microsoft_ads__url_report 140. model.microsoft_ads.microsoft_ads__url_report ad_group_name 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0 138. model.microsoft_ads.microsoft_ads__keyword_report 138. model.microsoft_ads.microsoft_ads__keyword_report ad_group_name 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0
149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history
  • Input Column: 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • ad_group_name: Directly mapped to this output column
135. model.microsoft_ads.microsoft_ads__ad_group_report
  • Input Column: 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history[ad_group_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_name: directly copied
136. model.microsoft_ads.microsoft_ads__ad_report
  • Input Column: 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history[ad_group_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_name: directly copied
138. model.microsoft_ads.microsoft_ads__keyword_report
  • Input Column: 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history[ad_group_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_name: directly copied
139. model.microsoft_ads.microsoft_ads__search_report
  • Input Column: 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history[ad_group_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_name: directly copied
140. model.microsoft_ads.microsoft_ads__url_report
  • Input Column: 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history[ad_group_name]
    • Direct copied directly to the output
    • Output Columns:
      • ad_group_name: directly copied
Column Lineage
%3 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp campaign_id 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history campaign_id 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp:f0->149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f0
149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history
  • Input Column: 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp[campaign_id]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • campaign_id: Directly mapped to this output column
Column Lineage
%3 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp modified_time 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history modified_at 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp:f0->149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f0
149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history
  • Input Column: 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp[modified_time]
    • Direct The column is directly copied without transformation
    • Deduplication Used in the ROW_NUMBER() function to order and identify the most recent record
    • Output Columns:
      • modified_at: Directly mapped to this output column
Column Lineage
%3 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp start_date 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history start_date 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp:f0->149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f0
149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history
  • Input Column: 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp[start_date]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • start_date: Directly mapped to this output column
Column Lineage
%3 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp end_date 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history end_date 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp:f0->149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f0
149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history
  • Input Column: 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp[end_date]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • end_date: Directly mapped to this output column
Column Lineage
%3 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp status 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history 149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history status 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp:f0->149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history:f0
149. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history
  • Input Column: 150. model.microsoft_ads_source.stg_microsoft_ads__ad_group_history_tmp[status]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • status: Directly mapped to this output column
151. model.microsoft_ads_source.stg_microsoft_ads__ad_history

This SQL query creates a staging table for Microsoft Ads ad history data. It starts with a base CTE that selects all columns from a temporary table. Then, it defines a fields CTE with null or empty values for specific columns. Finally, it selects and renames columns from the fields CTE, adds a row number to identify the most recent record for each ad, and includes a source relation column.

CleaningDeduplicationOther
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_microsoft_ads_source.stg_microsoft_ads__ad_history_tmp
), fields AS (
  SELECT
    CAST(NULL AS INT) AS id,
    CAST(NULL AS TEXT) AS title_part_1,
    CAST(NULL AS TEXT) AS final_url,
    CAST(NULL AS INT) AS ad_group_id,
    CAST(NULL AS TIMESTAMP) AS modified_time,
    CAST(NULL AS TEXT) AS status,
    CAST(NULL AS TEXT) AS type,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    id AS ad_id,
    title_part_1 AS ad_name,
    final_url,
    ad_group_id,
    modified_time AS modified_at,
    status,
    type,
    ROW_NUMBER() OVER (PARTITION BY source_relation, id ORDER BY modified_time DESC) = 1 AS is_most_recent_record
  FROM fields
)
SELECT
  *
FROM final
%3 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history source_relation ad_id ad_name final_url ad_group_id modified_at status type is_most_recent_record 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp id title_part_1 final_url ad_group_id modified_time status type 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp:f0->151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f1 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp:f1->151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f2 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp:f2->151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f3 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp:f3->151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f4 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp:f4->151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f5 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp:f5->151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f6 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp:f6->151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f7
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
ad_id bigint The ID representing the ad, if present in the source data.
ad_name text The name of the ad, if present in the source data.
final_url text The full URL that the ad links to.
ad_group_id bigint The ID representing the ad group, if present in the source data.
modified_at timestamp without time zone The time each version of the object was last modified, i.e. when that version of the object was 'created'.
status text The status of this ad; see the following [documentation](https://docs.microsoft.com/en-us/advertising/campaign-management-service/adstatus?view=bingads-13) for more information on values and definitions.
type text The ad type associated with this record; see the following [documentation](https://docs.microsoft.com/en-us/advertising/campaign-management-service/adtype?view=bingads-13) for more information on values and definitions.
is_most_recent_record boolean Boolean representing whether a record is the most recent version of that record.
Column Lineage
%3 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history source_relation 136. model.microsoft_ads.microsoft_ads__ad_report 136. model.microsoft_ads.microsoft_ads__ad_report source_relation 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->136. model.microsoft_ads.microsoft_ads__ad_report:f0 139. model.microsoft_ads.microsoft_ads__search_report 139. model.microsoft_ads.microsoft_ads__search_report source_relation 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0 140. model.microsoft_ads.microsoft_ads__url_report 140. model.microsoft_ads.microsoft_ads__url_report source_relation 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0 138. model.microsoft_ads.microsoft_ads__keyword_report 138. model.microsoft_ads.microsoft_ads__keyword_report source_relation 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0
136. model.microsoft_ads.microsoft_ads__ad_report
  • Input Column: 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
138. model.microsoft_ads.microsoft_ads__keyword_report
  • Input Column: 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history[source_relation]
    • Integration used as a key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
139. model.microsoft_ads.microsoft_ads__search_report
  • Input Column: 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history[source_relation]
    • Integration used as part of the JOIN condition with the report table
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
140. model.microsoft_ads.microsoft_ads__url_report
  • Input Column: 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
Column Lineage
%3 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp id 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history ad_id 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp:f0->151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0 136. model.microsoft_ads.microsoft_ads__ad_report 136. model.microsoft_ads.microsoft_ads__ad_report ad_id 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->136. model.microsoft_ads.microsoft_ads__ad_report:f0 139. model.microsoft_ads.microsoft_ads__search_report 139. model.microsoft_ads.microsoft_ads__search_report ad_id 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0 140. model.microsoft_ads.microsoft_ads__url_report 140. model.microsoft_ads.microsoft_ads__url_report ad_id 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0 138. model.microsoft_ads.microsoft_ads__keyword_report 138. model.microsoft_ads.microsoft_ads__keyword_report ad_id 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0
151. model.microsoft_ads_source.stg_microsoft_ads__ad_history
  • Input Column: 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp[id]
    • Direct The column is directly copied without transformation
    • Deduplication Used in the PARTITION BY clause of ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • ad_id: Directly mapped and renamed
136. model.microsoft_ads.microsoft_ads__ad_report
  • Input Column: 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history[ad_id]
    • Integration used as the key to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • ad_id: directly copied
138. model.microsoft_ads.microsoft_ads__keyword_report
  • Input Column: 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history[ad_id]
    • Integration used as a key to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • ad_id: directly copied
139. model.microsoft_ads.microsoft_ads__search_report
  • Input Column: 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history[ad_id]
    • Integration used as the key to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • ad_id: directly copied
140. model.microsoft_ads.microsoft_ads__url_report
  • Input Column: 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history[ad_id]
    • Integration used as the key to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • ad_id: directly copied
Column Lineage
%3 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp title_part_1 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history ad_name 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp:f0->151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0 136. model.microsoft_ads.microsoft_ads__ad_report 136. model.microsoft_ads.microsoft_ads__ad_report ad_name 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->136. model.microsoft_ads.microsoft_ads__ad_report:f0 139. model.microsoft_ads.microsoft_ads__search_report 139. model.microsoft_ads.microsoft_ads__search_report ad_name 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0 140. model.microsoft_ads.microsoft_ads__url_report 140. model.microsoft_ads.microsoft_ads__url_report ad_name 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0 138. model.microsoft_ads.microsoft_ads__keyword_report 138. model.microsoft_ads.microsoft_ads__keyword_report ad_name 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0
151. model.microsoft_ads_source.stg_microsoft_ads__ad_history
  • Input Column: 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp[title_part_1]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • ad_name: Directly mapped and renamed
136. model.microsoft_ads.microsoft_ads__ad_report
  • Input Column: 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history[ad_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_name: directly copied
138. model.microsoft_ads.microsoft_ads__keyword_report
  • Input Column: 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history[ad_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_name: directly copied
139. model.microsoft_ads.microsoft_ads__search_report
  • Input Column: 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history[ad_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_name: directly copied
140. model.microsoft_ads.microsoft_ads__url_report
  • Input Column: 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history[ad_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_name: directly copied
Column Lineage
%3 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp final_url 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history final_url 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp:f0->151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0 140. model.microsoft_ads.microsoft_ads__url_report 140. model.microsoft_ads.microsoft_ads__url_report base_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f1 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f2 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f6 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f5 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f3 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f4 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f7
151. model.microsoft_ads_source.stg_microsoft_ads__ad_history
  • Input Column: 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp[final_url]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • final_url: Directly mapped without renaming
140. model.microsoft_ads.microsoft_ads__url_report
  • Input Column: 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history[final_url]
    • Featurization various URL components and UTM parameters are extracted from this column
    • Cleaning the URL is cleaned and processed to extract different parts
    • Output Columns:
      • base_url: extracted from final_url
      • url_host: extracted and cleaned from final_url
      • url_path: extracted and cleaned from final_url
      • utm_source: extracted from final_url
      • utm_medium: extracted from final_url
      • utm_campaign: extracted from final_url
      • utm_content: extracted from final_url
      • utm_term: extracted from final_url
Column Lineage
%3 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp ad_group_id 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history ad_group_id 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp:f0->151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0
151. model.microsoft_ads_source.stg_microsoft_ads__ad_history
  • Input Column: 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp[ad_group_id]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • ad_group_id: Directly mapped without renaming
Column Lineage
%3 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp modified_time 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history modified_at 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp:f0->151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0
151. model.microsoft_ads_source.stg_microsoft_ads__ad_history
  • Input Column: 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp[modified_time]
    • Direct The column is directly copied without transformation
    • Deduplication Used in the ORDER BY clause of ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • modified_at: Directly mapped and renamed
Column Lineage
%3 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp status 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history status 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp:f0->151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0
151. model.microsoft_ads_source.stg_microsoft_ads__ad_history
  • Input Column: 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp[status]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • status: Directly mapped without renaming
Column Lineage
%3 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp type 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history type 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp:f0->151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0 136. model.microsoft_ads.microsoft_ads__ad_report 136. model.microsoft_ads.microsoft_ads__ad_report ad_type 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->136. model.microsoft_ads.microsoft_ads__ad_report:f0
151. model.microsoft_ads_source.stg_microsoft_ads__ad_history
  • Input Column: 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp[type]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • type: Directly mapped without renaming
136. model.microsoft_ads.microsoft_ads__ad_report
  • Input Column: 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history[type]
    • Direct directly copied to the output
    • Output Columns:
      • ad_type: directly copied
152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of type TEXT. It's likely used as a placeholder or template for further operations in a dbt (data build tool) project, specifically for staging data from Microsoft Ads.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp id title_part_1 final_url ad_group_id modified_time status type 326. source.microsoft_ads_source.microsoft_ads.ad_history 326. source.microsoft_ads_source.microsoft_ads.ad_history
Name Type Comment
id bigint None
title_part_1 text None
final_url text None
ad_group_id bigint None
modified_time timestamp without time zone None
status text None
type text None
Column Lineage
%3 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp id 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history ad_id 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp:f0->151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0 136. model.microsoft_ads.microsoft_ads__ad_report 136. model.microsoft_ads.microsoft_ads__ad_report ad_id 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->136. model.microsoft_ads.microsoft_ads__ad_report:f0 139. model.microsoft_ads.microsoft_ads__search_report 139. model.microsoft_ads.microsoft_ads__search_report ad_id 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0 140. model.microsoft_ads.microsoft_ads__url_report 140. model.microsoft_ads.microsoft_ads__url_report ad_id 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0 138. model.microsoft_ads.microsoft_ads__keyword_report 138. model.microsoft_ads.microsoft_ads__keyword_report ad_id 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0
151. model.microsoft_ads_source.stg_microsoft_ads__ad_history
  • Input Column: 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp[id]
    • Direct The column is directly copied without transformation
    • Deduplication Used in the PARTITION BY clause of ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • ad_id: Directly mapped and renamed
136. model.microsoft_ads.microsoft_ads__ad_report
  • Input Column: 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history[ad_id]
    • Integration used as the key to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • ad_id: directly copied
138. model.microsoft_ads.microsoft_ads__keyword_report
  • Input Column: 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history[ad_id]
    • Integration used as a key to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • ad_id: directly copied
139. model.microsoft_ads.microsoft_ads__search_report
  • Input Column: 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history[ad_id]
    • Integration used as the key to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • ad_id: directly copied
140. model.microsoft_ads.microsoft_ads__url_report
  • Input Column: 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history[ad_id]
    • Integration used as the key to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • ad_id: directly copied
Column Lineage
%3 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp title_part_1 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history ad_name 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp:f0->151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0 136. model.microsoft_ads.microsoft_ads__ad_report 136. model.microsoft_ads.microsoft_ads__ad_report ad_name 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->136. model.microsoft_ads.microsoft_ads__ad_report:f0 139. model.microsoft_ads.microsoft_ads__search_report 139. model.microsoft_ads.microsoft_ads__search_report ad_name 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0 140. model.microsoft_ads.microsoft_ads__url_report 140. model.microsoft_ads.microsoft_ads__url_report ad_name 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0 138. model.microsoft_ads.microsoft_ads__keyword_report 138. model.microsoft_ads.microsoft_ads__keyword_report ad_name 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0
151. model.microsoft_ads_source.stg_microsoft_ads__ad_history
  • Input Column: 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp[title_part_1]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • ad_name: Directly mapped and renamed
136. model.microsoft_ads.microsoft_ads__ad_report
  • Input Column: 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history[ad_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_name: directly copied
138. model.microsoft_ads.microsoft_ads__keyword_report
  • Input Column: 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history[ad_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_name: directly copied
139. model.microsoft_ads.microsoft_ads__search_report
  • Input Column: 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history[ad_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_name: directly copied
140. model.microsoft_ads.microsoft_ads__url_report
  • Input Column: 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history[ad_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_name: directly copied
Column Lineage
%3 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp final_url 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history final_url 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp:f0->151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0 140. model.microsoft_ads.microsoft_ads__url_report 140. model.microsoft_ads.microsoft_ads__url_report base_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f1 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f2 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f6 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f5 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f3 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f4 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f7
151. model.microsoft_ads_source.stg_microsoft_ads__ad_history
  • Input Column: 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp[final_url]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • final_url: Directly mapped without renaming
140. model.microsoft_ads.microsoft_ads__url_report
  • Input Column: 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history[final_url]
    • Featurization various URL components and UTM parameters are extracted from this column
    • Cleaning the URL is cleaned and processed to extract different parts
    • Output Columns:
      • base_url: extracted from final_url
      • url_host: extracted and cleaned from final_url
      • url_path: extracted and cleaned from final_url
      • utm_source: extracted from final_url
      • utm_medium: extracted from final_url
      • utm_campaign: extracted from final_url
      • utm_content: extracted from final_url
      • utm_term: extracted from final_url
Column Lineage
%3 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp ad_group_id 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history ad_group_id 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp:f0->151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0
151. model.microsoft_ads_source.stg_microsoft_ads__ad_history
  • Input Column: 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp[ad_group_id]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • ad_group_id: Directly mapped without renaming
Column Lineage
%3 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp modified_time 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history modified_at 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp:f0->151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0
151. model.microsoft_ads_source.stg_microsoft_ads__ad_history
  • Input Column: 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp[modified_time]
    • Direct The column is directly copied without transformation
    • Deduplication Used in the ORDER BY clause of ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • modified_at: Directly mapped and renamed
Column Lineage
%3 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp status 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history status 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp:f0->151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0
151. model.microsoft_ads_source.stg_microsoft_ads__ad_history
  • Input Column: 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp[status]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • status: Directly mapped without renaming
Column Lineage
%3 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp type 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history type 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp:f0->151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0 136. model.microsoft_ads.microsoft_ads__ad_report 136. model.microsoft_ads.microsoft_ads__ad_report ad_type 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history:f0->136. model.microsoft_ads.microsoft_ads__ad_report:f0
151. model.microsoft_ads_source.stg_microsoft_ads__ad_history
  • Input Column: 152. model.microsoft_ads_source.stg_microsoft_ads__ad_history_tmp[type]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • type: Directly mapped without renaming
136. model.microsoft_ads.microsoft_ads__ad_report
  • Input Column: 151. model.microsoft_ads_source.stg_microsoft_ads__ad_history[type]
    • Direct directly copied to the output
    • Output Columns:
      • ad_type: directly copied
153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report

This SQL query stages data from a temporary table, casts columns to specific data types, renames some columns, and reorganizes the column order. It doesn't perform any data transformation, filtering, or aggregation. The query appears to be preparing the data for further processing or analysis by standardizing the structure and data types.

Cleaning
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp
), fields AS (
  SELECT
    CAST(NULL AS INT) AS account_id,
    CAST(NULL AS TEXT) AS ad_distribution,
    CAST(NULL AS TEXT) AS bid_match_type,
    CAST(NULL AS INT) AS campaign_id,
    CAST(NULL AS INT) AS clicks,
    CAST(NULL AS TEXT) AS currency_code,
    CAST(NULL AS DATE) AS date,
    CAST(NULL AS TEXT) AS delivered_match_type,
    CAST(NULL AS TEXT) AS device_os,
    CAST(NULL AS TEXT) AS device_type,
    CAST(NULL AS INT) AS impressions,
    CAST(NULL AS TEXT) AS network,
    CAST(NULL AS FLOAT) AS spend,
    CAST(NULL AS TEXT) AS top_vs_other,
    CAST(NULL AS TEXT) AS budget_association_status,
    CAST(NULL AS TEXT) AS budget_name,
    CAST(NULL AS TEXT) AS budget_status,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    date AS date_day,
    account_id,
    campaign_id,
    currency_code,
    device_os,
    device_type,
    network,
    ad_distribution,
    bid_match_type,
    delivered_match_type,
    top_vs_other,
    budget_association_status,
    budget_name,
    budget_status,
    clicks,
    impressions,
    spend
  FROM fields
)
SELECT
  *
FROM final
%3 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report source_relation date_day account_id campaign_id currency_code device_os device_type network ad_distribution bid_match_type delivered_match_type top_vs_other budget_association_status budget_name budget_status clicks impressions spend 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp date account_id campaign_id currency_code device_os device_type network ad_distribution bid_match_type delivered_match_type top_vs_other budget_association_status clicks impressions spend 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp:f0->153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f1 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp:f1->153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f2 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp:f2->153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f3 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp:f3->153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f4 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp:f4->153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f5 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp:f5->153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f6 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp:f6->153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f7 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp:f7->153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f8 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp:f8->153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f9 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp:f9->153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f10 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp:f10->153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f11 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp:f11->153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f12 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp:f12->153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f15 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp:f13->153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f16 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp:f14->153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f17
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
date_day date The date of the report.
account_id bigint The ID representing the account.
campaign_id bigint The ID representing the campaign, if present in the source data.
currency_code text The currency code associated with spend and, if applicable, other metrics associated with currency.
device_os text The device operating system associated with this record; values include but may not be limited to 'Windows', 'iOS', 'Android', 'Other', 'BlackBerry' and 'Unknown'.
device_type text The device type associated with this record; values include but may not be limited to 'Computer', 'Smartphone', 'Tablet' and 'Unknown'.
network text The network associated with this record.
ad_distribution text The distribution medium associated with this record.
bid_match_type text The bid match type associated with this record; values include 'Broad', 'Exact', 'Phrase'.
delivered_match_type text The delivered match type associated with this record; values include 'Broad', 'Exact', 'Phrase'.
top_vs_other text The position of the ad associated with this record. For more information, refer to Microsoft [documentation](https://help.ads.microsoft.com/apex/index/22/en/14009).
budget_association_status text Indicates whether or not the campaign is currently spending from the budget mentioned in the BudgetName column. The possible values are `Current` and `Ended`.
budget_name text The name of the budget. This column will be empty for unshared budgets.
budget_status text The budget status. The possible values are `Active` and `Deleted`. This column will be empty for unshared budgets.
clicks integer The count of clicks.
impressions integer The count of impressions.
spend double precision The cost of the ads.
Column Lineage
%3 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report source_relation 137. model.microsoft_ads.microsoft_ads__campaign_report 137. model.microsoft_ads.microsoft_ads__campaign_report source_relation 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f0->137. model.microsoft_ads.microsoft_ads__campaign_report:f0
137. model.microsoft_ads.microsoft_ads__campaign_report
  • Input Column: 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with other tables
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
Column Lineage
%3 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp date 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report date_day 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp:f0->153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f0 137. model.microsoft_ads.microsoft_ads__campaign_report 137. model.microsoft_ads.microsoft_ads__campaign_report date_day 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f0->137. model.microsoft_ads.microsoft_ads__campaign_report:f0
153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report
  • Input Column: 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp[date]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to DATE type
    • Output Columns:
      • date_day: Directly mapped and renamed
137. model.microsoft_ads.microsoft_ads__campaign_report
  • Input Column: 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp account_id 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report account_id 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp:f0->153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f0 137. model.microsoft_ads.microsoft_ads__campaign_report 137. model.microsoft_ads.microsoft_ads__campaign_report account_id 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f0->137. model.microsoft_ads.microsoft_ads__campaign_report:f0
153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report
  • Input Column: 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp[account_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to INT type
    • Output Columns:
      • account_id: Directly mapped
137. model.microsoft_ads.microsoft_ads__campaign_report
  • Input Column: 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report[account_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with the accounts table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • account_id: Directly copied to the output
Column Lineage
%3 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp campaign_id 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report campaign_id 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp:f0->153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f0 137. model.microsoft_ads.microsoft_ads__campaign_report 137. model.microsoft_ads.microsoft_ads__campaign_report campaign_id 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f0->137. model.microsoft_ads.microsoft_ads__campaign_report:f0
153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report
  • Input Column: 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp[campaign_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to INT type
    • Output Columns:
      • campaign_id: Directly mapped
137. model.microsoft_ads.microsoft_ads__campaign_report
  • Input Column: 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report[campaign_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with the campaigns table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • campaign_id: Directly copied to the output
Column Lineage
%3 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp currency_code 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report currency_code 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp:f0->153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f0 137. model.microsoft_ads.microsoft_ads__campaign_report 137. model.microsoft_ads.microsoft_ads__campaign_report currency_code 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f0->137. model.microsoft_ads.microsoft_ads__campaign_report:f0
153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report
  • Input Column: 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp[currency_code]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • currency_code: Directly mapped
137. model.microsoft_ads.microsoft_ads__campaign_report
  • Input Column: 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report[currency_code]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • currency_code: Directly copied to the output
Column Lineage
%3 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp device_os 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report device_os 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp:f0->153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f0 137. model.microsoft_ads.microsoft_ads__campaign_report 137. model.microsoft_ads.microsoft_ads__campaign_report device_os 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f0->137. model.microsoft_ads.microsoft_ads__campaign_report:f0
153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report
  • Input Column: 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp[device_os]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • device_os: Directly mapped
137. model.microsoft_ads.microsoft_ads__campaign_report
  • Input Column: 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report[device_os]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • device_os: Directly copied to the output
Column Lineage
%3 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp device_type 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report device_type 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp:f0->153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f0 137. model.microsoft_ads.microsoft_ads__campaign_report 137. model.microsoft_ads.microsoft_ads__campaign_report device_type 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f0->137. model.microsoft_ads.microsoft_ads__campaign_report:f0
153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report
  • Input Column: 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp[device_type]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • device_type: Directly mapped
137. model.microsoft_ads.microsoft_ads__campaign_report
  • Input Column: 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report[device_type]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • device_type: Directly copied to the output
Column Lineage
%3 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp network 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report network 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp:f0->153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f0 137. model.microsoft_ads.microsoft_ads__campaign_report 137. model.microsoft_ads.microsoft_ads__campaign_report network 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f0->137. model.microsoft_ads.microsoft_ads__campaign_report:f0
153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report
  • Input Column: 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp[network]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • network: Directly mapped
137. model.microsoft_ads.microsoft_ads__campaign_report
  • Input Column: 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report[network]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • network: Directly copied to the output
Column Lineage
%3 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp ad_distribution 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report ad_distribution 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp:f0->153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f0
153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report
  • Input Column: 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp[ad_distribution]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • ad_distribution: Directly mapped
Column Lineage
%3 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp bid_match_type 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report bid_match_type 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp:f0->153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f0
153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report
  • Input Column: 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp[bid_match_type]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • bid_match_type: Directly mapped
Column Lineage
%3 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp delivered_match_type 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report delivered_match_type 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp:f0->153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f0
153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report
  • Input Column: 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp[delivered_match_type]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • delivered_match_type: Directly mapped
Column Lineage
%3 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp top_vs_other 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report top_vs_other 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp:f0->153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f0
153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report
  • Input Column: 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp[top_vs_other]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the 'fields' CTE
    • Output Columns:
      • top_vs_other: Directly mapped to the output column
Column Lineage
%3 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp budget_association_status 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report budget_association_status 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp:f0->153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f0
153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report
  • Input Column: 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp[budget_association_status]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the 'fields' CTE
    • Output Columns:
      • budget_association_status: Directly mapped to the output column
Column Lineage
%3 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp clicks 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report clicks 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp:f0->153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f0 137. model.microsoft_ads.microsoft_ads__campaign_report 137. model.microsoft_ads.microsoft_ads__campaign_report clicks 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f0->137. model.microsoft_ads.microsoft_ads__campaign_report:f0
153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report
  • Input Column: 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp[clicks]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT in the 'fields' CTE
    • Output Columns:
      • clicks: Directly mapped to the output column
137. model.microsoft_ads.microsoft_ads__campaign_report
  • Input Column: 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report[clicks]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • clicks: Summed up and directly mapped to the output 'clicks' column
Column Lineage
%3 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp impressions 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report impressions 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp:f0->153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f0 137. model.microsoft_ads.microsoft_ads__campaign_report 137. model.microsoft_ads.microsoft_ads__campaign_report impressions 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f0->137. model.microsoft_ads.microsoft_ads__campaign_report:f0
153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report
  • Input Column: 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp[impressions]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT in the 'fields' CTE
    • Output Columns:
      • impressions: Directly mapped to the output column
137. model.microsoft_ads.microsoft_ads__campaign_report
  • Input Column: 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report[impressions]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • impressions: Summed up and directly mapped to the output 'impressions' column
Column Lineage
%3 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp spend 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report spend 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp:f0->153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f0 137. model.microsoft_ads.microsoft_ads__campaign_report 137. model.microsoft_ads.microsoft_ads__campaign_report spend 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f0->137. model.microsoft_ads.microsoft_ads__campaign_report:f0
153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report
  • Input Column: 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp[spend]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as FLOAT in the 'fields' CTE
    • Output Columns:
      • spend: Directly mapped to the output column
137. model.microsoft_ads.microsoft_ads__campaign_report
  • Input Column: 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report[spend]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • spend: Summed up and directly mapped to the output 'spend' column
154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of type TEXT, which is set to NULL. The LIMIT 0 clause ensures no rows are returned. This appears to be a template or placeholder query, possibly used for schema definition or testing purposes in a dbt (data build tool) project.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp date account_id campaign_id currency_code device_os device_type network ad_distribution bid_match_type delivered_match_type top_vs_other budget_association_status clicks impressions spend 329. source.microsoft_ads_source.microsoft_ads.campaign_performance_daily_report 329. source.microsoft_ads_source.microsoft_ads.campaign_performance_daily_report
Name Type Comment
date date None
account_id bigint None
campaign_id bigint None
currency_code text None
device_os text None
device_type text None
network text None
ad_distribution text None
bid_match_type text None
delivered_match_type text None
top_vs_other text None
budget_association_status text None
clicks integer None
impressions integer None
spend double precision None
Column Lineage
%3 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp date 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report date_day 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp:f0->153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f0 137. model.microsoft_ads.microsoft_ads__campaign_report 137. model.microsoft_ads.microsoft_ads__campaign_report date_day 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f0->137. model.microsoft_ads.microsoft_ads__campaign_report:f0
153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report
  • Input Column: 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp[date]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to DATE type
    • Output Columns:
      • date_day: Directly mapped and renamed
137. model.microsoft_ads.microsoft_ads__campaign_report
  • Input Column: 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp account_id 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report account_id 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp:f0->153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f0 137. model.microsoft_ads.microsoft_ads__campaign_report 137. model.microsoft_ads.microsoft_ads__campaign_report account_id 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f0->137. model.microsoft_ads.microsoft_ads__campaign_report:f0
153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report
  • Input Column: 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp[account_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to INT type
    • Output Columns:
      • account_id: Directly mapped
137. model.microsoft_ads.microsoft_ads__campaign_report
  • Input Column: 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report[account_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with the accounts table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • account_id: Directly copied to the output
Column Lineage
%3 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp campaign_id 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report campaign_id 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp:f0->153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f0 137. model.microsoft_ads.microsoft_ads__campaign_report 137. model.microsoft_ads.microsoft_ads__campaign_report campaign_id 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f0->137. model.microsoft_ads.microsoft_ads__campaign_report:f0
153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report
  • Input Column: 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp[campaign_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to INT type
    • Output Columns:
      • campaign_id: Directly mapped
137. model.microsoft_ads.microsoft_ads__campaign_report
  • Input Column: 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report[campaign_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with the campaigns table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • campaign_id: Directly copied to the output
Column Lineage
%3 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp currency_code 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report currency_code 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp:f0->153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f0 137. model.microsoft_ads.microsoft_ads__campaign_report 137. model.microsoft_ads.microsoft_ads__campaign_report currency_code 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f0->137. model.microsoft_ads.microsoft_ads__campaign_report:f0
153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report
  • Input Column: 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp[currency_code]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • currency_code: Directly mapped
137. model.microsoft_ads.microsoft_ads__campaign_report
  • Input Column: 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report[currency_code]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • currency_code: Directly copied to the output
Column Lineage
%3 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp device_os 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report device_os 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp:f0->153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f0 137. model.microsoft_ads.microsoft_ads__campaign_report 137. model.microsoft_ads.microsoft_ads__campaign_report device_os 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f0->137. model.microsoft_ads.microsoft_ads__campaign_report:f0
153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report
  • Input Column: 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp[device_os]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • device_os: Directly mapped
137. model.microsoft_ads.microsoft_ads__campaign_report
  • Input Column: 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report[device_os]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • device_os: Directly copied to the output
Column Lineage
%3 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp device_type 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report device_type 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp:f0->153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f0 137. model.microsoft_ads.microsoft_ads__campaign_report 137. model.microsoft_ads.microsoft_ads__campaign_report device_type 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f0->137. model.microsoft_ads.microsoft_ads__campaign_report:f0
153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report
  • Input Column: 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp[device_type]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • device_type: Directly mapped
137. model.microsoft_ads.microsoft_ads__campaign_report
  • Input Column: 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report[device_type]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • device_type: Directly copied to the output
Column Lineage
%3 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp network 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report network 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp:f0->153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f0 137. model.microsoft_ads.microsoft_ads__campaign_report 137. model.microsoft_ads.microsoft_ads__campaign_report network 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f0->137. model.microsoft_ads.microsoft_ads__campaign_report:f0
153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report
  • Input Column: 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp[network]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • network: Directly mapped
137. model.microsoft_ads.microsoft_ads__campaign_report
  • Input Column: 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report[network]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • network: Directly copied to the output
Column Lineage
%3 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp ad_distribution 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report ad_distribution 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp:f0->153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f0
153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report
  • Input Column: 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp[ad_distribution]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • ad_distribution: Directly mapped
Column Lineage
%3 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp bid_match_type 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report bid_match_type 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp:f0->153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f0
153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report
  • Input Column: 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp[bid_match_type]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • bid_match_type: Directly mapped
Column Lineage
%3 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp delivered_match_type 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report delivered_match_type 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp:f0->153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f0
153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report
  • Input Column: 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp[delivered_match_type]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • delivered_match_type: Directly mapped
Column Lineage
%3 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp top_vs_other 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report top_vs_other 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp:f0->153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f0
153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report
  • Input Column: 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp[top_vs_other]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the 'fields' CTE
    • Output Columns:
      • top_vs_other: Directly mapped to the output column
Column Lineage
%3 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp budget_association_status 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report budget_association_status 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp:f0->153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f0
153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report
  • Input Column: 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp[budget_association_status]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the 'fields' CTE
    • Output Columns:
      • budget_association_status: Directly mapped to the output column
Column Lineage
%3 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp clicks 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report clicks 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp:f0->153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f0 137. model.microsoft_ads.microsoft_ads__campaign_report 137. model.microsoft_ads.microsoft_ads__campaign_report clicks 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f0->137. model.microsoft_ads.microsoft_ads__campaign_report:f0
153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report
  • Input Column: 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp[clicks]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT in the 'fields' CTE
    • Output Columns:
      • clicks: Directly mapped to the output column
137. model.microsoft_ads.microsoft_ads__campaign_report
  • Input Column: 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report[clicks]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • clicks: Summed up and directly mapped to the output 'clicks' column
Column Lineage
%3 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp impressions 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report impressions 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp:f0->153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f0 137. model.microsoft_ads.microsoft_ads__campaign_report 137. model.microsoft_ads.microsoft_ads__campaign_report impressions 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f0->137. model.microsoft_ads.microsoft_ads__campaign_report:f0
153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report
  • Input Column: 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp[impressions]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT in the 'fields' CTE
    • Output Columns:
      • impressions: Directly mapped to the output column
137. model.microsoft_ads.microsoft_ads__campaign_report
  • Input Column: 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report[impressions]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • impressions: Summed up and directly mapped to the output 'impressions' column
Column Lineage
%3 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp spend 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report spend 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp:f0->153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f0 137. model.microsoft_ads.microsoft_ads__campaign_report 137. model.microsoft_ads.microsoft_ads__campaign_report spend 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report:f0->137. model.microsoft_ads.microsoft_ads__campaign_report:f0
153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report
  • Input Column: 154. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report_tmp[spend]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as FLOAT in the 'fields' CTE
    • Output Columns:
      • spend: Directly mapped to the output column
137. model.microsoft_ads.microsoft_ads__campaign_report
  • Input Column: 153. model.microsoft_ads_source.stg_microsoft_ads__campaign_daily_report[spend]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • spend: Summed up and directly mapped to the output 'spend' column
155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history

This SQL query creates a staging table for Microsoft Ads campaign history data. It starts with a base table, then defines a fields structure with specific data types. The final select statement renames some columns, adds a source_relation column, and includes a row number to identify the most recent record for each campaign. The query focuses on structuring and preparing the data for further use.

CleaningDeduplication
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp
), fields AS (
  SELECT
    CAST(NULL AS INT) AS id,
    CAST(NULL AS TEXT) AS name,
    CAST(NULL AS INT) AS account_id,
    CAST(NULL AS TIMESTAMP) AS modified_time,
    CAST(NULL AS TEXT) AS type,
    CAST(NULL AS TEXT) AS time_zone,
    CAST(NULL AS TEXT) AS status,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    id AS campaign_id,
    name AS campaign_name,
    account_id,
    modified_time AS modified_at,
    type,
    time_zone,
    status,
    ROW_NUMBER() OVER (PARTITION BY source_relation, id ORDER BY modified_time DESC) = 1 AS is_most_recent_record
  FROM fields
)
SELECT
  *
FROM final
%3 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history source_relation campaign_id campaign_name account_id modified_at type time_zone status is_most_recent_record 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp id name account_id modified_time type time_zone status 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp:f0->155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f1 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp:f1->155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f2 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp:f2->155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f3 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp:f3->155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f4 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp:f4->155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f5 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp:f5->155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f6 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp:f6->155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f7
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
campaign_id integer The ID representing the campaign, if present in the source data.
campaign_name text The name of the campaign, if present in the source data.
account_id integer The ID representing the account.
modified_at timestamp without time zone The time each version of the object was last modified, i.e. when that version of the object was 'created'.
type text The campaign type associated with this record; see the following [documentation](https://docs.microsoft.com/en-us/advertising/campaign-management-service/campaigntype?view=bingads-13) for more information on values and definitions.
time_zone text The time zone associated with this record.
status text The status of this campaign; see the following [documentation](https://docs.microsoft.com/en-us/advertising/campaign-management-service/campaignstatus?view=bingads-13) for more information on values and definitions.
is_most_recent_record boolean Boolean representing whether a record is the most recent version of that record.
Column Lineage
%3 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history source_relation 136. model.microsoft_ads.microsoft_ads__ad_report 136. model.microsoft_ads.microsoft_ads__ad_report source_relation 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0->136. model.microsoft_ads.microsoft_ads__ad_report:f0 137. model.microsoft_ads.microsoft_ads__campaign_report 137. model.microsoft_ads.microsoft_ads__campaign_report source_relation 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0->137. model.microsoft_ads.microsoft_ads__campaign_report:f0 139. model.microsoft_ads.microsoft_ads__search_report 139. model.microsoft_ads.microsoft_ads__search_report source_relation 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0 135. model.microsoft_ads.microsoft_ads__ad_group_report 135. model.microsoft_ads.microsoft_ads__ad_group_report source_relation 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0->135. model.microsoft_ads.microsoft_ads__ad_group_report:f0 140. model.microsoft_ads.microsoft_ads__url_report 140. model.microsoft_ads.microsoft_ads__url_report source_relation 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0 138. model.microsoft_ads.microsoft_ads__keyword_report 138. model.microsoft_ads.microsoft_ads__keyword_report source_relation 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0
135. model.microsoft_ads.microsoft_ads__ad_group_report
  • Input Column: 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history[source_relation]
    • Integration used as a key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
136. model.microsoft_ads.microsoft_ads__ad_report
  • Input Column: 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
137. model.microsoft_ads.microsoft_ads__campaign_report
  • Input Column: 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
138. model.microsoft_ads.microsoft_ads__keyword_report
  • Input Column: 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history[source_relation]
    • Integration used as part of the join condition with report table
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
139. model.microsoft_ads.microsoft_ads__search_report
  • Input Column: 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history[source_relation]
    • Integration used as part of the join condition with the report table
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
140. model.microsoft_ads.microsoft_ads__url_report
  • Input Column: 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
Column Lineage
%3 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp id 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history campaign_id 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp:f0->155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0 136. model.microsoft_ads.microsoft_ads__ad_report 136. model.microsoft_ads.microsoft_ads__ad_report campaign_id 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0->136. model.microsoft_ads.microsoft_ads__ad_report:f0 137. model.microsoft_ads.microsoft_ads__campaign_report 137. model.microsoft_ads.microsoft_ads__campaign_report campaign_id 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0->137. model.microsoft_ads.microsoft_ads__campaign_report:f0 139. model.microsoft_ads.microsoft_ads__search_report 139. model.microsoft_ads.microsoft_ads__search_report campaign_id 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0 135. model.microsoft_ads.microsoft_ads__ad_group_report 135. model.microsoft_ads.microsoft_ads__ad_group_report campaign_id 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0->135. model.microsoft_ads.microsoft_ads__ad_group_report:f0 140. model.microsoft_ads.microsoft_ads__url_report 140. model.microsoft_ads.microsoft_ads__url_report campaign_id 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0 138. model.microsoft_ads.microsoft_ads__keyword_report 138. model.microsoft_ads.microsoft_ads__keyword_report campaign_id 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0
155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history
  • Input Column: 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp[id]
    • Direct The column is directly copied without transformation
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • campaign_id: Directly mapped
135. model.microsoft_ads.microsoft_ads__ad_group_report
  • Input Column: 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history[campaign_id]
    • Integration used as a key to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
136. model.microsoft_ads.microsoft_ads__ad_report
  • Input Column: 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history[campaign_id]
    • Integration used as the key to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
137. model.microsoft_ads.microsoft_ads__campaign_report
  • Input Column: 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history[campaign_id]
    • Integration used as part of the join condition with the report table
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
138. model.microsoft_ads.microsoft_ads__keyword_report
  • Input Column: 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history[campaign_id]
    • Integration used as part of the join condition with report table
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
139. model.microsoft_ads.microsoft_ads__search_report
  • Input Column: 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history[campaign_id]
    • Integration used as the key to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
140. model.microsoft_ads.microsoft_ads__url_report
  • Input Column: 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history[campaign_id]
    • Integration used as the key to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
Column Lineage
%3 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp name 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history campaign_name 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp:f0->155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0 136. model.microsoft_ads.microsoft_ads__ad_report 136. model.microsoft_ads.microsoft_ads__ad_report campaign_name 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0->136. model.microsoft_ads.microsoft_ads__ad_report:f0 137. model.microsoft_ads.microsoft_ads__campaign_report 137. model.microsoft_ads.microsoft_ads__campaign_report campaign_name 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0->137. model.microsoft_ads.microsoft_ads__campaign_report:f0 139. model.microsoft_ads.microsoft_ads__search_report 139. model.microsoft_ads.microsoft_ads__search_report campaign_name 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0 135. model.microsoft_ads.microsoft_ads__ad_group_report 135. model.microsoft_ads.microsoft_ads__ad_group_report campaign_name 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0->135. model.microsoft_ads.microsoft_ads__ad_group_report:f0 140. model.microsoft_ads.microsoft_ads__url_report 140. model.microsoft_ads.microsoft_ads__url_report campaign_name 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0 138. model.microsoft_ads.microsoft_ads__keyword_report 138. model.microsoft_ads.microsoft_ads__keyword_report campaign_name 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0
155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history
  • Input Column: 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • campaign_name: Directly mapped
135. model.microsoft_ads.microsoft_ads__ad_group_report
  • Input Column: 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history[campaign_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_name: directly copied
136. model.microsoft_ads.microsoft_ads__ad_report
  • Input Column: 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history[campaign_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_name: directly copied
137. model.microsoft_ads.microsoft_ads__campaign_report
  • Input Column: 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history[campaign_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_name: directly copied
138. model.microsoft_ads.microsoft_ads__keyword_report
  • Input Column: 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history[campaign_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_name: directly copied
139. model.microsoft_ads.microsoft_ads__search_report
  • Input Column: 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history[campaign_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_name: directly copied
140. model.microsoft_ads.microsoft_ads__url_report
  • Input Column: 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history[campaign_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_name: directly copied
Column Lineage
%3 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp account_id 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history account_id 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp:f0->155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0
155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history
  • Input Column: 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp[account_id]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • account_id: Directly mapped
Column Lineage
%3 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp modified_time 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history modified_at 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp:f0->155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0
155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history
  • Input Column: 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp[modified_time]
    • Direct The column is directly copied without transformation
    • Deduplication Used in the ROW_NUMBER() function to order and identify the most recent record
    • Output Columns:
      • modified_at: Directly mapped
Column Lineage
%3 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp type 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history type 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp:f0->155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0 137. model.microsoft_ads.microsoft_ads__campaign_report 137. model.microsoft_ads.microsoft_ads__campaign_report campaign_type 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0->137. model.microsoft_ads.microsoft_ads__campaign_report:f0
155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history
  • Input Column: 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp[type]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • type: Directly mapped
137. model.microsoft_ads.microsoft_ads__campaign_report
  • Input Column: 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history[type]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_type: directly copied
Column Lineage
%3 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp time_zone 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history time_zone 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp:f0->155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0 137. model.microsoft_ads.microsoft_ads__campaign_report 137. model.microsoft_ads.microsoft_ads__campaign_report campaign_timezone 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0->137. model.microsoft_ads.microsoft_ads__campaign_report:f0
155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history
  • Input Column: 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp[time_zone]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • time_zone: Directly mapped
137. model.microsoft_ads.microsoft_ads__campaign_report
  • Input Column: 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history[time_zone]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_timezone: directly copied
Column Lineage
%3 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp status 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history status 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp:f0->155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0 137. model.microsoft_ads.microsoft_ads__campaign_report 137. model.microsoft_ads.microsoft_ads__campaign_report campaign_status 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0->137. model.microsoft_ads.microsoft_ads__campaign_report:f0
155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history
  • Input Column: 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp[status]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • status: Directly mapped
137. model.microsoft_ads.microsoft_ads__campaign_report
  • Input Column: 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history[status]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_status: directly copied
156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of type TEXT, which is set to NULL. The LIMIT 0 clause ensures no rows are returned. This is likely used as a template or placeholder for a staging table in a dbt (data build tool) project, specifically for Microsoft Ads campaign history data.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp id name account_id modified_time type time_zone status 328. source.microsoft_ads_source.microsoft_ads.campaign_history 328. source.microsoft_ads_source.microsoft_ads.campaign_history
Name Type Comment
id integer None
name text None
account_id integer None
modified_time timestamp without time zone None
type text None
time_zone text None
status text None
Column Lineage
%3 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp id 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history campaign_id 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp:f0->155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0 136. model.microsoft_ads.microsoft_ads__ad_report 136. model.microsoft_ads.microsoft_ads__ad_report campaign_id 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0->136. model.microsoft_ads.microsoft_ads__ad_report:f0 137. model.microsoft_ads.microsoft_ads__campaign_report 137. model.microsoft_ads.microsoft_ads__campaign_report campaign_id 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0->137. model.microsoft_ads.microsoft_ads__campaign_report:f0 139. model.microsoft_ads.microsoft_ads__search_report 139. model.microsoft_ads.microsoft_ads__search_report campaign_id 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0 135. model.microsoft_ads.microsoft_ads__ad_group_report 135. model.microsoft_ads.microsoft_ads__ad_group_report campaign_id 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0->135. model.microsoft_ads.microsoft_ads__ad_group_report:f0 140. model.microsoft_ads.microsoft_ads__url_report 140. model.microsoft_ads.microsoft_ads__url_report campaign_id 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0 138. model.microsoft_ads.microsoft_ads__keyword_report 138. model.microsoft_ads.microsoft_ads__keyword_report campaign_id 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0
155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history
  • Input Column: 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp[id]
    • Direct The column is directly copied without transformation
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • campaign_id: Directly mapped
135. model.microsoft_ads.microsoft_ads__ad_group_report
  • Input Column: 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history[campaign_id]
    • Integration used as a key to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
136. model.microsoft_ads.microsoft_ads__ad_report
  • Input Column: 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history[campaign_id]
    • Integration used as the key to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
137. model.microsoft_ads.microsoft_ads__campaign_report
  • Input Column: 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history[campaign_id]
    • Integration used as part of the join condition with the report table
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
138. model.microsoft_ads.microsoft_ads__keyword_report
  • Input Column: 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history[campaign_id]
    • Integration used as part of the join condition with report table
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
139. model.microsoft_ads.microsoft_ads__search_report
  • Input Column: 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history[campaign_id]
    • Integration used as the key to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
140. model.microsoft_ads.microsoft_ads__url_report
  • Input Column: 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history[campaign_id]
    • Integration used as the key to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
Column Lineage
%3 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp name 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history campaign_name 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp:f0->155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0 136. model.microsoft_ads.microsoft_ads__ad_report 136. model.microsoft_ads.microsoft_ads__ad_report campaign_name 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0->136. model.microsoft_ads.microsoft_ads__ad_report:f0 137. model.microsoft_ads.microsoft_ads__campaign_report 137. model.microsoft_ads.microsoft_ads__campaign_report campaign_name 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0->137. model.microsoft_ads.microsoft_ads__campaign_report:f0 139. model.microsoft_ads.microsoft_ads__search_report 139. model.microsoft_ads.microsoft_ads__search_report campaign_name 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0 135. model.microsoft_ads.microsoft_ads__ad_group_report 135. model.microsoft_ads.microsoft_ads__ad_group_report campaign_name 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0->135. model.microsoft_ads.microsoft_ads__ad_group_report:f0 140. model.microsoft_ads.microsoft_ads__url_report 140. model.microsoft_ads.microsoft_ads__url_report campaign_name 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0->140. model.microsoft_ads.microsoft_ads__url_report:f0 138. model.microsoft_ads.microsoft_ads__keyword_report 138. model.microsoft_ads.microsoft_ads__keyword_report campaign_name 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0
155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history
  • Input Column: 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • campaign_name: Directly mapped
135. model.microsoft_ads.microsoft_ads__ad_group_report
  • Input Column: 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history[campaign_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_name: directly copied
136. model.microsoft_ads.microsoft_ads__ad_report
  • Input Column: 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history[campaign_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_name: directly copied
137. model.microsoft_ads.microsoft_ads__campaign_report
  • Input Column: 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history[campaign_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_name: directly copied
138. model.microsoft_ads.microsoft_ads__keyword_report
  • Input Column: 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history[campaign_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_name: directly copied
139. model.microsoft_ads.microsoft_ads__search_report
  • Input Column: 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history[campaign_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_name: directly copied
140. model.microsoft_ads.microsoft_ads__url_report
  • Input Column: 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history[campaign_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_name: directly copied
Column Lineage
%3 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp account_id 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history account_id 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp:f0->155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0
155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history
  • Input Column: 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp[account_id]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • account_id: Directly mapped
Column Lineage
%3 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp modified_time 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history modified_at 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp:f0->155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0
155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history
  • Input Column: 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp[modified_time]
    • Direct The column is directly copied without transformation
    • Deduplication Used in the ROW_NUMBER() function to order and identify the most recent record
    • Output Columns:
      • modified_at: Directly mapped
Column Lineage
%3 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp type 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history type 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp:f0->155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0 137. model.microsoft_ads.microsoft_ads__campaign_report 137. model.microsoft_ads.microsoft_ads__campaign_report campaign_type 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0->137. model.microsoft_ads.microsoft_ads__campaign_report:f0
155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history
  • Input Column: 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp[type]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • type: Directly mapped
137. model.microsoft_ads.microsoft_ads__campaign_report
  • Input Column: 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history[type]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_type: directly copied
Column Lineage
%3 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp time_zone 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history time_zone 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp:f0->155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0 137. model.microsoft_ads.microsoft_ads__campaign_report 137. model.microsoft_ads.microsoft_ads__campaign_report campaign_timezone 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0->137. model.microsoft_ads.microsoft_ads__campaign_report:f0
155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history
  • Input Column: 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp[time_zone]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • time_zone: Directly mapped
137. model.microsoft_ads.microsoft_ads__campaign_report
  • Input Column: 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history[time_zone]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_timezone: directly copied
Column Lineage
%3 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp status 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history status 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp:f0->155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0 137. model.microsoft_ads.microsoft_ads__campaign_report 137. model.microsoft_ads.microsoft_ads__campaign_report campaign_status 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history:f0->137. model.microsoft_ads.microsoft_ads__campaign_report:f0
155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history
  • Input Column: 156. model.microsoft_ads_source.stg_microsoft_ads__campaign_history_tmp[status]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • status: Directly mapped
137. model.microsoft_ads.microsoft_ads__campaign_report
  • Input Column: 155. model.microsoft_ads_source.stg_microsoft_ads__campaign_history[status]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_status: directly copied
157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report

This SQL query stages data for the Microsoft Ads keyword daily report. It selects data from a temporary table, casts columns to specific data types, renames some columns, and reorganizes the column order. The query doesn't perform any filtering, cleaning, deduplication, featurization, integration, or aggregation. It's primarily focused on structuring the data for further use.

Other
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp
), fields AS (
  SELECT
    CAST(NULL AS INT) AS account_id,
    CAST(NULL AS TEXT) AS ad_distribution,
    CAST(NULL AS INT) AS ad_group_id,
    CAST(NULL AS INT) AS ad_id,
    CAST(NULL AS TEXT) AS bid_match_type,
    CAST(NULL AS INT) AS campaign_id,
    CAST(NULL AS INT) AS clicks,
    CAST(NULL AS TEXT) AS currency_code,
    CAST(NULL AS DATE) AS date,
    CAST(NULL AS TEXT) AS delivered_match_type,
    CAST(NULL AS TEXT) AS device_os,
    CAST(NULL AS TEXT) AS device_type,
    CAST(NULL AS INT) AS impressions,
    CAST(NULL AS INT) AS keyword_id,
    CAST(NULL AS TEXT) AS language,
    CAST(NULL AS TEXT) AS network,
    CAST(NULL AS FLOAT) AS spend,
    CAST(NULL AS TEXT) AS top_vs_other,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    date AS date_day,
    account_id,
    campaign_id,
    ad_group_id,
    ad_id,
    keyword_id,
    currency_code,
    device_os,
    device_type,
    network,
    language,
    ad_distribution,
    bid_match_type,
    delivered_match_type,
    top_vs_other,
    clicks,
    impressions,
    spend
  FROM fields
)
SELECT
  *
FROM final
%3 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report source_relation date_day account_id campaign_id ad_group_id ad_id keyword_id currency_code device_os device_type network language ad_distribution bid_match_type delivered_match_type top_vs_other clicks impressions spend 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp date account_id campaign_id ad_group_id ad_id keyword_id currency_code device_os device_type network language ad_distribution bid_match_type delivered_match_type top_vs_other clicks impressions spend 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp:f0->157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f1 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp:f1->157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f2 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp:f2->157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f3 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp:f3->157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f4 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp:f4->157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f5 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp:f5->157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f6 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp:f6->157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f7 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp:f7->157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f8 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp:f8->157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f9 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp:f9->157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f10 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp:f10->157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f11 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp:f11->157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f12 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp:f12->157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f13 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp:f13->157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f14 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp:f14->157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f15 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp:f15->157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f16 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp:f16->157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f17 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp:f17->157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f18
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
date_day date The date of the report.
account_id bigint The ID representing the account.
campaign_id bigint The ID representing the campaign, if present in the source data.
ad_group_id bigint The ID representing the ad group, if present in the source data.
ad_id bigint The ID representing the ad, if present in the source data.
keyword_id bigint The ID representing the keyword, if present in the source data.
currency_code text The currency code associated with spend and, if applicable, other metrics associated with currency.
device_os text The device operating system associated with this record; values include but may not be limited to 'Windows', 'iOS', 'Android', 'Other', 'BlackBerry' and 'Unknown'.
device_type text The device type associated with this record; values include but may not be limited to 'Computer', 'Smartphone', 'Tablet' and 'Unknown'.
network text The network associated with this record.
language text The language that the associated ad was viewed in.
ad_distribution text The distribution medium associated with this record.
bid_match_type text The bid match type associated with this record; values include 'Broad', 'Exact', 'Phrase'.
delivered_match_type text The delivered match type associated with this record; values include 'Broad', 'Exact', 'Phrase'.
top_vs_other text The position of the ad associated with this record. For more information, refer to Microsoft [documentation](https://help.ads.microsoft.com/apex/index/22/en/14009).
clicks integer The count of clicks.
impressions integer The count of impressions.
spend double precision The cost of the ads.
Column Lineage
%3 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report source_relation 138. model.microsoft_ads.microsoft_ads__keyword_report 138. model.microsoft_ads.microsoft_ads__keyword_report source_relation 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0
138. model.microsoft_ads.microsoft_ads__keyword_report
  • Input Column: 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with other tables
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
Column Lineage
%3 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp date 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report date_day 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp:f0->157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0 138. model.microsoft_ads.microsoft_ads__keyword_report 138. model.microsoft_ads.microsoft_ads__keyword_report date_day 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0
157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report
  • Input Column: 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp[date]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast to DATE type
    • Output Columns:
      • date_day: Directly mapped after casting
138. model.microsoft_ads.microsoft_ads__keyword_report
  • Input Column: 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp account_id 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report account_id 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp:f0->157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0 138. model.microsoft_ads.microsoft_ads__keyword_report 138. model.microsoft_ads.microsoft_ads__keyword_report account_id 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0
157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report
  • Input Column: 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp[account_id]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast to INT type
    • Output Columns:
      • account_id: Directly mapped after casting
138. model.microsoft_ads.microsoft_ads__keyword_report
  • Input Column: 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report[account_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with the accounts table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • account_id: Directly copied to the output
Column Lineage
%3 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp campaign_id 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report campaign_id 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp:f0->157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0 138. model.microsoft_ads.microsoft_ads__keyword_report 138. model.microsoft_ads.microsoft_ads__keyword_report campaign_id 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0
157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report
  • Input Column: 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp[campaign_id]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast to INT type
    • Output Columns:
      • campaign_id: Directly mapped after casting
138. model.microsoft_ads.microsoft_ads__keyword_report
  • Input Column: 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report[campaign_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with the campaigns table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • campaign_id: Directly copied to the output
Column Lineage
%3 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp ad_group_id 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report ad_group_id 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp:f0->157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0 138. model.microsoft_ads.microsoft_ads__keyword_report 138. model.microsoft_ads.microsoft_ads__keyword_report ad_group_id 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0
157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report
  • Input Column: 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp[ad_group_id]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast to INT type
    • Output Columns:
      • ad_group_id: Directly mapped after casting
138. model.microsoft_ads.microsoft_ads__keyword_report
  • Input Column: 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report[ad_group_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with the ad_groups table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • ad_group_id: Directly copied to the output
Column Lineage
%3 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp ad_id 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report ad_id 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp:f0->157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0 138. model.microsoft_ads.microsoft_ads__keyword_report 138. model.microsoft_ads.microsoft_ads__keyword_report ad_id 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0
157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report
  • Input Column: 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp[ad_id]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast to INT type
    • Output Columns:
      • ad_id: Directly mapped after casting
138. model.microsoft_ads.microsoft_ads__keyword_report
  • Input Column: 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report[ad_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with the ads table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • ad_id: Directly copied to the output
Column Lineage
%3 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp keyword_id 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report keyword_id 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp:f0->157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0 138. model.microsoft_ads.microsoft_ads__keyword_report 138. model.microsoft_ads.microsoft_ads__keyword_report keyword_id 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0
157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report
  • Input Column: 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp[keyword_id]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast to INT type
    • Output Columns:
      • keyword_id: Directly mapped after casting
138. model.microsoft_ads.microsoft_ads__keyword_report
  • Input Column: 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report[keyword_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with the keywords table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • keyword_id: Directly copied to the output
Column Lineage
%3 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp currency_code 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report currency_code 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp:f0->157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0 138. model.microsoft_ads.microsoft_ads__keyword_report 138. model.microsoft_ads.microsoft_ads__keyword_report currency_code 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0
157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report
  • Input Column: 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp[currency_code]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • currency_code: Directly mapped after casting
138. model.microsoft_ads.microsoft_ads__keyword_report
  • Input Column: 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report[currency_code]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • currency_code: Directly copied to the output
Column Lineage
%3 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp device_os 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report device_os 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp:f0->157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0 138. model.microsoft_ads.microsoft_ads__keyword_report 138. model.microsoft_ads.microsoft_ads__keyword_report device_os 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0
157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report
  • Input Column: 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp[device_os]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • device_os: Directly mapped after casting
138. model.microsoft_ads.microsoft_ads__keyword_report
  • Input Column: 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report[device_os]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • device_os: Directly copied to the output
Column Lineage
%3 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp device_type 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report device_type 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp:f0->157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0 138. model.microsoft_ads.microsoft_ads__keyword_report 138. model.microsoft_ads.microsoft_ads__keyword_report device_type 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0
157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report
  • Input Column: 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp[device_type]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • device_type: Directly mapped after casting
138. model.microsoft_ads.microsoft_ads__keyword_report
  • Input Column: 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report[device_type]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • device_type: Directly copied to the output
Column Lineage
%3 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp network 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report network 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp:f0->157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0 138. model.microsoft_ads.microsoft_ads__keyword_report 138. model.microsoft_ads.microsoft_ads__keyword_report network 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0
157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report
  • Input Column: 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp[network]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • network: Directly mapped after casting
138. model.microsoft_ads.microsoft_ads__keyword_report
  • Input Column: 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report[network]
    • Direct The column is directly copied without any transformation
    • Aggregation The column is grouped by in the final SELECT statement
    • Output Columns:
      • network: Directly copied to the output
Column Lineage
%3 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp language 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report language 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp:f0->157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0
157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report
  • Input Column: 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp[language]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to TEXT data type
    • Output Columns:
      • language: Directly mapped after casting
Column Lineage
%3 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp ad_distribution 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report ad_distribution 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp:f0->157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0
157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report
  • Input Column: 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp[ad_distribution]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to TEXT data type
    • Output Columns:
      • ad_distribution: Directly mapped after casting
Column Lineage
%3 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp bid_match_type 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report bid_match_type 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp:f0->157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0
157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report
  • Input Column: 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp[bid_match_type]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to TEXT data type
    • Output Columns:
      • bid_match_type: Directly mapped after casting
Column Lineage
%3 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp delivered_match_type 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report delivered_match_type 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp:f0->157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0
157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report
  • Input Column: 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp[delivered_match_type]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to TEXT data type
    • Output Columns:
      • delivered_match_type: Directly mapped after casting
Column Lineage
%3 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp top_vs_other 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report top_vs_other 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp:f0->157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0
157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report
  • Input Column: 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp[top_vs_other]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to TEXT data type
    • Output Columns:
      • top_vs_other: Directly mapped after casting
Column Lineage
%3 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp clicks 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report clicks 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp:f0->157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0 138. model.microsoft_ads.microsoft_ads__keyword_report 138. model.microsoft_ads.microsoft_ads__keyword_report clicks 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0
157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report
  • Input Column: 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp[clicks]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to INT data type
    • Output Columns:
      • clicks: Directly mapped after casting
138. model.microsoft_ads.microsoft_ads__keyword_report
  • Input Column: 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report[clicks]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • clicks: Aggregated sum in the output
Column Lineage
%3 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp impressions 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report impressions 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp:f0->157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0 138. model.microsoft_ads.microsoft_ads__keyword_report 138. model.microsoft_ads.microsoft_ads__keyword_report impressions 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0
157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report
  • Input Column: 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp[impressions]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to INT data type
    • Output Columns:
      • impressions: Directly mapped after casting
138. model.microsoft_ads.microsoft_ads__keyword_report
  • Input Column: 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report[impressions]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • impressions: Aggregated sum in the output
Column Lineage
%3 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp spend 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report spend 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp:f0->157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0 138. model.microsoft_ads.microsoft_ads__keyword_report 138. model.microsoft_ads.microsoft_ads__keyword_report spend 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0
157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report
  • Input Column: 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp[spend]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to FLOAT data type
    • Output Columns:
      • spend: Directly mapped after casting
138. model.microsoft_ads.microsoft_ads__keyword_report
  • Input Column: 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report[spend]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • spend: Aggregated sum in the output
158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of type TEXT. The query doesn't retrieve any actual data, as it uses LIMIT 0 to return no rows. This is likely used as a template or placeholder for a staging table in a dbt (data build tool) project.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp date account_id campaign_id ad_group_id ad_id keyword_id currency_code device_os device_type network language ad_distribution bid_match_type delivered_match_type top_vs_other clicks impressions spend 331. source.microsoft_ads_source.microsoft_ads.keyword_performance_daily_report 331. source.microsoft_ads_source.microsoft_ads.keyword_performance_daily_report
Name Type Comment
date date None
account_id bigint None
campaign_id bigint None
ad_group_id bigint None
ad_id bigint None
keyword_id bigint None
currency_code text None
device_os text None
device_type text None
network text None
language text None
ad_distribution text None
bid_match_type text None
delivered_match_type text None
top_vs_other text None
clicks integer None
impressions integer None
spend double precision None
Column Lineage
%3 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp date 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report date_day 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp:f0->157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0 138. model.microsoft_ads.microsoft_ads__keyword_report 138. model.microsoft_ads.microsoft_ads__keyword_report date_day 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0
157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report
  • Input Column: 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp[date]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast to DATE type
    • Output Columns:
      • date_day: Directly mapped after casting
138. model.microsoft_ads.microsoft_ads__keyword_report
  • Input Column: 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp account_id 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report account_id 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp:f0->157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0 138. model.microsoft_ads.microsoft_ads__keyword_report 138. model.microsoft_ads.microsoft_ads__keyword_report account_id 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0
157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report
  • Input Column: 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp[account_id]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast to INT type
    • Output Columns:
      • account_id: Directly mapped after casting
138. model.microsoft_ads.microsoft_ads__keyword_report
  • Input Column: 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report[account_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with the accounts table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • account_id: Directly copied to the output
Column Lineage
%3 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp campaign_id 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report campaign_id 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp:f0->157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0 138. model.microsoft_ads.microsoft_ads__keyword_report 138. model.microsoft_ads.microsoft_ads__keyword_report campaign_id 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0
157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report
  • Input Column: 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp[campaign_id]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast to INT type
    • Output Columns:
      • campaign_id: Directly mapped after casting
138. model.microsoft_ads.microsoft_ads__keyword_report
  • Input Column: 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report[campaign_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with the campaigns table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • campaign_id: Directly copied to the output
Column Lineage
%3 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp ad_group_id 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report ad_group_id 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp:f0->157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0 138. model.microsoft_ads.microsoft_ads__keyword_report 138. model.microsoft_ads.microsoft_ads__keyword_report ad_group_id 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0
157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report
  • Input Column: 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp[ad_group_id]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast to INT type
    • Output Columns:
      • ad_group_id: Directly mapped after casting
138. model.microsoft_ads.microsoft_ads__keyword_report
  • Input Column: 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report[ad_group_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with the ad_groups table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • ad_group_id: Directly copied to the output
Column Lineage
%3 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp ad_id 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report ad_id 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp:f0->157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0 138. model.microsoft_ads.microsoft_ads__keyword_report 138. model.microsoft_ads.microsoft_ads__keyword_report ad_id 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0
157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report
  • Input Column: 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp[ad_id]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast to INT type
    • Output Columns:
      • ad_id: Directly mapped after casting
138. model.microsoft_ads.microsoft_ads__keyword_report
  • Input Column: 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report[ad_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with the ads table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • ad_id: Directly copied to the output
Column Lineage
%3 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp keyword_id 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report keyword_id 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp:f0->157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0 138. model.microsoft_ads.microsoft_ads__keyword_report 138. model.microsoft_ads.microsoft_ads__keyword_report keyword_id 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0
157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report
  • Input Column: 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp[keyword_id]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast to INT type
    • Output Columns:
      • keyword_id: Directly mapped after casting
138. model.microsoft_ads.microsoft_ads__keyword_report
  • Input Column: 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report[keyword_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with the keywords table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • keyword_id: Directly copied to the output
Column Lineage
%3 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp currency_code 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report currency_code 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp:f0->157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0 138. model.microsoft_ads.microsoft_ads__keyword_report 138. model.microsoft_ads.microsoft_ads__keyword_report currency_code 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0
157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report
  • Input Column: 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp[currency_code]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • currency_code: Directly mapped after casting
138. model.microsoft_ads.microsoft_ads__keyword_report
  • Input Column: 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report[currency_code]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • currency_code: Directly copied to the output
Column Lineage
%3 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp device_os 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report device_os 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp:f0->157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0 138. model.microsoft_ads.microsoft_ads__keyword_report 138. model.microsoft_ads.microsoft_ads__keyword_report device_os 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0
157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report
  • Input Column: 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp[device_os]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • device_os: Directly mapped after casting
138. model.microsoft_ads.microsoft_ads__keyword_report
  • Input Column: 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report[device_os]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • device_os: Directly copied to the output
Column Lineage
%3 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp device_type 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report device_type 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp:f0->157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0 138. model.microsoft_ads.microsoft_ads__keyword_report 138. model.microsoft_ads.microsoft_ads__keyword_report device_type 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0
157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report
  • Input Column: 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp[device_type]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • device_type: Directly mapped after casting
138. model.microsoft_ads.microsoft_ads__keyword_report
  • Input Column: 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report[device_type]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • device_type: Directly copied to the output
Column Lineage
%3 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp network 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report network 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp:f0->157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0 138. model.microsoft_ads.microsoft_ads__keyword_report 138. model.microsoft_ads.microsoft_ads__keyword_report network 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0
157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report
  • Input Column: 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp[network]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • network: Directly mapped after casting
138. model.microsoft_ads.microsoft_ads__keyword_report
  • Input Column: 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report[network]
    • Direct The column is directly copied without any transformation
    • Aggregation The column is grouped by in the final SELECT statement
    • Output Columns:
      • network: Directly copied to the output
Column Lineage
%3 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp language 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report language 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp:f0->157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0
157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report
  • Input Column: 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp[language]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to TEXT data type
    • Output Columns:
      • language: Directly mapped after casting
Column Lineage
%3 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp ad_distribution 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report ad_distribution 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp:f0->157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0
157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report
  • Input Column: 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp[ad_distribution]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to TEXT data type
    • Output Columns:
      • ad_distribution: Directly mapped after casting
Column Lineage
%3 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp bid_match_type 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report bid_match_type 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp:f0->157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0
157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report
  • Input Column: 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp[bid_match_type]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to TEXT data type
    • Output Columns:
      • bid_match_type: Directly mapped after casting
Column Lineage
%3 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp delivered_match_type 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report delivered_match_type 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp:f0->157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0
157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report
  • Input Column: 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp[delivered_match_type]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to TEXT data type
    • Output Columns:
      • delivered_match_type: Directly mapped after casting
Column Lineage
%3 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp top_vs_other 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report top_vs_other 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp:f0->157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0
157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report
  • Input Column: 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp[top_vs_other]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to TEXT data type
    • Output Columns:
      • top_vs_other: Directly mapped after casting
Column Lineage
%3 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp clicks 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report clicks 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp:f0->157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0 138. model.microsoft_ads.microsoft_ads__keyword_report 138. model.microsoft_ads.microsoft_ads__keyword_report clicks 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0
157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report
  • Input Column: 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp[clicks]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to INT data type
    • Output Columns:
      • clicks: Directly mapped after casting
138. model.microsoft_ads.microsoft_ads__keyword_report
  • Input Column: 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report[clicks]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • clicks: Aggregated sum in the output
Column Lineage
%3 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp impressions 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report impressions 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp:f0->157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0 138. model.microsoft_ads.microsoft_ads__keyword_report 138. model.microsoft_ads.microsoft_ads__keyword_report impressions 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0
157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report
  • Input Column: 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp[impressions]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to INT data type
    • Output Columns:
      • impressions: Directly mapped after casting
138. model.microsoft_ads.microsoft_ads__keyword_report
  • Input Column: 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report[impressions]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • impressions: Aggregated sum in the output
Column Lineage
%3 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp spend 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report spend 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp:f0->157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0 138. model.microsoft_ads.microsoft_ads__keyword_report 138. model.microsoft_ads.microsoft_ads__keyword_report spend 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0
157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report
  • Input Column: 158. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report_tmp[spend]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to FLOAT data type
    • Output Columns:
      • spend: Directly mapped after casting
138. model.microsoft_ads.microsoft_ads__keyword_report
  • Input Column: 157. model.microsoft_ads_source.stg_microsoft_ads__keyword_daily_report[spend]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • spend: Aggregated sum in the output
159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history

This SQL query creates a staging table for Microsoft Ads keyword history. It starts with a base table, then creates a fields CTE with NULL or empty values for specific columns. The final CTE selects and renames columns from the fields CTE, adds a source_relation column, and includes a row number to identify the most recent record for each keyword. The query ends by selecting all columns from the final CTE.

CleaningDeduplicationOther
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp
), fields AS (
  SELECT
    CAST(NULL AS INT) AS id,
    CAST(NULL AS TEXT) AS name,
    CAST(NULL AS TIMESTAMP) AS modified_time,
    CAST(NULL AS INT) AS ad_group_id,
    CAST(NULL AS TEXT) AS match_type,
    CAST(NULL AS TEXT) AS status,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    id AS keyword_id,
    name AS keyword_name,
    modified_time AS modified_at,
    ad_group_id,
    match_type,
    status,
    ROW_NUMBER() OVER (PARTITION BY source_relation, id ORDER BY modified_time DESC) = 1 AS is_most_recent_record
  FROM fields
)
SELECT
  *
FROM final
%3 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history source_relation keyword_id keyword_name modified_at ad_group_id match_type status is_most_recent_record 160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp 160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp id name modified_time ad_group_id match_type status 160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp:f0->159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history:f1 160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp:f1->159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history:f2 160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp:f2->159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history:f3 160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp:f3->159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history:f4 160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp:f4->159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history:f5 160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp:f5->159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history:f6
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
keyword_id bigint The ID representing the keyword, if present in the source data.
keyword_name text The keyword(s) associated with this record.
modified_at timestamp without time zone The time each version of the object was last modified, i.e. when that version of the object was 'created'.
ad_group_id bigint The ID representing the ad group, if present in the source data.
match_type text The match type associated with this record; values contain but may not be limited to 'Broad', 'Exact', 'Phrase'. Please refer to Microsoft Ad's [documentation](https://help.ads.microsoft.com/#apex/ads/en/50822/1).
status text The status of this keyword; see the following [documentation](https://docs.microsoft.com/en-us/advertising/campaign-management-service/keywordstatus?view=bingads-13) for more information on values and definitions.
is_most_recent_record boolean Boolean representing whether a record is the most recent version of that record.
Column Lineage
%3 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history source_relation 139. model.microsoft_ads.microsoft_ads__search_report 139. model.microsoft_ads.microsoft_ads__search_report source_relation 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0 138. model.microsoft_ads.microsoft_ads__keyword_report 138. model.microsoft_ads.microsoft_ads__keyword_report source_relation 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0
138. model.microsoft_ads.microsoft_ads__keyword_report
  • Input Column: 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history[source_relation]
    • Integration used as part of the join condition with the report table
    • Direct directly selected in the final output
    • Output Columns:
      • source_relation: directly copied to the output
139. model.microsoft_ads.microsoft_ads__search_report
  • Input Column: 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history[source_relation]
    • Integration used as a key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
Column Lineage
%3 160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp 160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp id 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history keyword_id 160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp:f0->159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history:f0 139. model.microsoft_ads.microsoft_ads__search_report 139. model.microsoft_ads.microsoft_ads__search_report keyword_id 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0 138. model.microsoft_ads.microsoft_ads__keyword_report 138. model.microsoft_ads.microsoft_ads__keyword_report keyword_id 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0
159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history
  • Input Column: 160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp[id]
    • Direct The column is directly copied to the output
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • keyword_id: Directly mapped to this output column
138. model.microsoft_ads.microsoft_ads__keyword_report
  • Input Column: 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history[keyword_id]
    • Integration used as part of the join condition with the report table
    • Output Columns:
      • keyword_id: directly copied to the output
139. model.microsoft_ads.microsoft_ads__search_report
  • Input Column: 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history[keyword_id]
    • Integration used as a key to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • keyword_id: directly copied
Column Lineage
%3 160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp 160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp name 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history keyword_name 160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp:f0->159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history:f0 139. model.microsoft_ads.microsoft_ads__search_report 139. model.microsoft_ads.microsoft_ads__search_report keyword_name 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0 138. model.microsoft_ads.microsoft_ads__keyword_report 138. model.microsoft_ads.microsoft_ads__keyword_report keyword_name 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0
159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history
  • Input Column: 160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp[name]
    • Direct The column is directly copied to the output
    • Output Columns:
      • keyword_name: Directly mapped to this output column
138. model.microsoft_ads.microsoft_ads__keyword_report
  • Input Column: 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history[keyword_name]
    • Direct directly selected in the final output
    • Output Columns:
      • keyword_name: directly copied to the output
139. model.microsoft_ads.microsoft_ads__search_report
  • Input Column: 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history[keyword_name]
    • Direct directly copied to the output
    • Output Columns:
      • keyword_name: directly copied
Column Lineage
%3 160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp 160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp modified_time 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history modified_at 160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp:f0->159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history:f0
159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history
  • Input Column: 160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp[modified_time]
    • Direct The column is directly copied to the output
    • Deduplication Used in the ROW_NUMBER() function to order and identify the most recent record
    • Output Columns:
      • modified_at: Directly mapped to this output column
Column Lineage
%3 160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp 160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp ad_group_id 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history ad_group_id 160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp:f0->159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history:f0
159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history
  • Input Column: 160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp[ad_group_id]
    • Direct The column is directly copied to the output
    • Output Columns:
      • ad_group_id: Directly mapped to this output column
Column Lineage
%3 160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp 160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp match_type 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history match_type 160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp:f0->159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history:f0 138. model.microsoft_ads.microsoft_ads__keyword_report 138. model.microsoft_ads.microsoft_ads__keyword_report match_type 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0
159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history
  • Input Column: 160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp[match_type]
    • Direct The column is directly copied to the output
    • Output Columns:
      • match_type: Directly mapped to this output column
138. model.microsoft_ads.microsoft_ads__keyword_report
  • Input Column: 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history[match_type]
    • Direct directly selected in the final output
    • Output Columns:
      • match_type: directly copied to the output
Column Lineage
%3 160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp 160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp status 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history status 160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp:f0->159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history:f0
159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history
  • Input Column: 160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp[status]
    • Direct The column is directly copied to the output
    • Output Columns:
      • status: Directly mapped to this output column
160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of type TEXT. It's likely used as a placeholder or template for a staging table in a dbt (data build tool) project, specifically for Microsoft Ads keyword history data.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp 160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp id name modified_time ad_group_id match_type status 330. source.microsoft_ads_source.microsoft_ads.keyword_history 330. source.microsoft_ads_source.microsoft_ads.keyword_history
Name Type Comment
id bigint None
name text None
modified_time timestamp without time zone None
ad_group_id bigint None
match_type text None
status text None
Column Lineage
%3 160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp 160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp id 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history keyword_id 160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp:f0->159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history:f0 139. model.microsoft_ads.microsoft_ads__search_report 139. model.microsoft_ads.microsoft_ads__search_report keyword_id 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0 138. model.microsoft_ads.microsoft_ads__keyword_report 138. model.microsoft_ads.microsoft_ads__keyword_report keyword_id 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0
159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history
  • Input Column: 160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp[id]
    • Direct The column is directly copied to the output
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • keyword_id: Directly mapped to this output column
138. model.microsoft_ads.microsoft_ads__keyword_report
  • Input Column: 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history[keyword_id]
    • Integration used as part of the join condition with the report table
    • Output Columns:
      • keyword_id: directly copied to the output
139. model.microsoft_ads.microsoft_ads__search_report
  • Input Column: 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history[keyword_id]
    • Integration used as a key to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • keyword_id: directly copied
Column Lineage
%3 160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp 160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp name 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history keyword_name 160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp:f0->159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history:f0 139. model.microsoft_ads.microsoft_ads__search_report 139. model.microsoft_ads.microsoft_ads__search_report keyword_name 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0 138. model.microsoft_ads.microsoft_ads__keyword_report 138. model.microsoft_ads.microsoft_ads__keyword_report keyword_name 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0
159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history
  • Input Column: 160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp[name]
    • Direct The column is directly copied to the output
    • Output Columns:
      • keyword_name: Directly mapped to this output column
138. model.microsoft_ads.microsoft_ads__keyword_report
  • Input Column: 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history[keyword_name]
    • Direct directly selected in the final output
    • Output Columns:
      • keyword_name: directly copied to the output
139. model.microsoft_ads.microsoft_ads__search_report
  • Input Column: 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history[keyword_name]
    • Direct directly copied to the output
    • Output Columns:
      • keyword_name: directly copied
Column Lineage
%3 160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp 160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp modified_time 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history modified_at 160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp:f0->159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history:f0
159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history
  • Input Column: 160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp[modified_time]
    • Direct The column is directly copied to the output
    • Deduplication Used in the ROW_NUMBER() function to order and identify the most recent record
    • Output Columns:
      • modified_at: Directly mapped to this output column
Column Lineage
%3 160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp 160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp ad_group_id 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history ad_group_id 160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp:f0->159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history:f0
159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history
  • Input Column: 160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp[ad_group_id]
    • Direct The column is directly copied to the output
    • Output Columns:
      • ad_group_id: Directly mapped to this output column
Column Lineage
%3 160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp 160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp match_type 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history match_type 160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp:f0->159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history:f0 138. model.microsoft_ads.microsoft_ads__keyword_report 138. model.microsoft_ads.microsoft_ads__keyword_report match_type 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history:f0->138. model.microsoft_ads.microsoft_ads__keyword_report:f0
159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history
  • Input Column: 160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp[match_type]
    • Direct The column is directly copied to the output
    • Output Columns:
      • match_type: Directly mapped to this output column
138. model.microsoft_ads.microsoft_ads__keyword_report
  • Input Column: 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history[match_type]
    • Direct directly selected in the final output
    • Output Columns:
      • match_type: directly copied to the output
Column Lineage
%3 160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp 160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp status 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history 159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history status 160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp:f0->159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history:f0
159. model.microsoft_ads_source.stg_microsoft_ads__keyword_history
  • Input Column: 160. model.microsoft_ads_source.stg_microsoft_ads__keyword_history_tmp[status]
    • Direct The column is directly copied to the output
    • Output Columns:
      • status: Directly mapped to this output column
161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report

This SQL query performs a data transformation and type casting operation on the 'microsoft_ads__search_daily_report' data. It selects all columns from a temporary table, casts them to specific data types, renames some columns, and reorganizes the column order in the final output. The query doesn't perform any filtering, aggregation, or complex transformations.

Cleaning
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp
), fields AS (
  SELECT
    CAST(NULL AS INT) AS account_id,
    CAST(NULL AS INT) AS ad_group_id,
    CAST(NULL AS INT) AS ad_id,
    CAST(NULL AS TEXT) AS bid_match_type,
    CAST(NULL AS INT) AS campaign_id,
    CAST(NULL AS INT) AS clicks,
    CAST(NULL AS DATE) AS date,
    CAST(NULL AS TEXT) AS delivered_match_type,
    CAST(NULL AS TEXT) AS device_os,
    CAST(NULL AS TEXT) AS device_type,
    CAST(NULL AS INT) AS impressions,
    CAST(NULL AS INT) AS keyword_id,
    CAST(NULL AS TEXT) AS language,
    CAST(NULL AS TEXT) AS network,
    CAST(NULL AS TEXT) AS search_query,
    CAST(NULL AS FLOAT) AS spend,
    CAST(NULL AS TEXT) AS top_vs_other,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    date AS date_day,
    account_id,
    campaign_id,
    ad_group_id,
    ad_id,
    keyword_id,
    search_query,
    device_os,
    device_type,
    network,
    language,
    bid_match_type,
    delivered_match_type,
    top_vs_other,
    clicks,
    impressions,
    spend
  FROM fields
)
SELECT
  *
FROM final
%3 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report source_relation date_day account_id campaign_id ad_group_id ad_id keyword_id search_query device_os device_type network language ad_distribution bid_match_type delivered_match_type top_vs_other clicks impressions spend 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp date account_id campaign_id ad_group_id ad_id keyword_id search_query device_os device_type network language bid_match_type delivered_match_type top_vs_other clicks impressions spend 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp:f0->161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f1 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp:f1->161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f2 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp:f2->161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f3 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp:f3->161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f4 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp:f4->161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f5 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp:f5->161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f6 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp:f6->161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f7 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp:f7->161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f8 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp:f8->161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f9 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp:f9->161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f10 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp:f10->161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f11 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp:f11->161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f13 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp:f12->161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f14 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp:f13->161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f15 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp:f14->161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f16 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp:f15->161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f17 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp:f16->161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f18
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
date_day date The date of the report.
account_id bigint The ID representing the account.
campaign_id bigint The ID representing the campaign, if present in the source data.
ad_group_id bigint The ID representing the ad group, if present in the source data.
ad_id bigint The ID representing the ad, if present in the source data.
keyword_id bigint The ID representing the keyword, if present in the source data.
search_query text The position of the ad associated with this record. For more information, refer to Microsoft [documentation](https://help.ads.microsoft.com/apex/index/22/en/14009).
device_os text The device operating system associated with this record; values include but may not be limited to 'Windows', 'iOS', 'Android', 'Other', 'BlackBerry' and 'Unknown'.
device_type text The device type associated with this record; values include but may not be limited to 'Computer', 'Smartphone', 'Tablet' and 'Unknown'.
network text The network associated with this record.
language text The language that the associated ad was viewed in.
ad_distribution None The distribution medium associated with this record.
bid_match_type text The bid match type associated with this record; values include 'Broad', 'Exact', 'Phrase'.
delivered_match_type text The delivered match type associated with this record; values include 'Broad', 'Exact', 'Phrase'.
top_vs_other text The position of the ad associated with this record. For more information, refer to Microsoft [documentation](https://help.ads.microsoft.com/apex/index/22/en/14009).
clicks integer The count of clicks.
impressions integer The count of impressions.
spend double precision The cost of the ads.
Column Lineage
%3 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report source_relation 139. model.microsoft_ads.microsoft_ads__search_report 139. model.microsoft_ads.microsoft_ads__search_report source_relation 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0
139. model.microsoft_ads.microsoft_ads__search_report
  • Input Column: 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with other tables
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
Column Lineage
%3 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp date 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report date_day 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp:f0->161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0 139. model.microsoft_ads.microsoft_ads__search_report 139. model.microsoft_ads.microsoft_ads__search_report date_day 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0
161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report
  • Input Column: 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp[date]
    • Cleaning The column is cast to DATE type
    • Output Columns:
      • date_day: It is directly mapped to date_day after casting
139. model.microsoft_ads.microsoft_ads__search_report
  • Input Column: 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp account_id 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report account_id 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp:f0->161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0 139. model.microsoft_ads.microsoft_ads__search_report 139. model.microsoft_ads.microsoft_ads__search_report account_id 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0
161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report
  • Input Column: 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp[account_id]
    • Cleaning The column is cast to INT type
    • Output Columns:
      • account_id: It is directly mapped to account_id after casting
139. model.microsoft_ads.microsoft_ads__search_report
  • Input Column: 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report[account_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a join key with the accounts table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • account_id: Directly copied to the output
Column Lineage
%3 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp campaign_id 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report campaign_id 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp:f0->161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0 139. model.microsoft_ads.microsoft_ads__search_report 139. model.microsoft_ads.microsoft_ads__search_report campaign_id 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0
161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report
  • Input Column: 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp[campaign_id]
    • Cleaning The column is cast to INT type
    • Output Columns:
      • campaign_id: It is directly mapped to campaign_id after casting
139. model.microsoft_ads.microsoft_ads__search_report
  • Input Column: 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report[campaign_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a join key with the campaigns table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • campaign_id: Directly copied to the output
Column Lineage
%3 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp ad_group_id 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report ad_group_id 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp:f0->161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0 139. model.microsoft_ads.microsoft_ads__search_report 139. model.microsoft_ads.microsoft_ads__search_report ad_group_id 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0
161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report
  • Input Column: 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp[ad_group_id]
    • Cleaning The column is cast to INT type
    • Output Columns:
      • ad_group_id: It is directly mapped to ad_group_id after casting
139. model.microsoft_ads.microsoft_ads__search_report
  • Input Column: 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report[ad_group_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a join key with the ad_groups table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • ad_group_id: Directly copied to the output
Column Lineage
%3 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp ad_id 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report ad_id 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp:f0->161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0 139. model.microsoft_ads.microsoft_ads__search_report 139. model.microsoft_ads.microsoft_ads__search_report ad_id 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0
161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report
  • Input Column: 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp[ad_id]
    • Cleaning The column is cast to INT type
    • Output Columns:
      • ad_id: It is directly mapped to ad_id after casting
139. model.microsoft_ads.microsoft_ads__search_report
  • Input Column: 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report[ad_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a join key with the ads table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • ad_id: Directly copied to the output
Column Lineage
%3 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp keyword_id 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report keyword_id 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp:f0->161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0 139. model.microsoft_ads.microsoft_ads__search_report 139. model.microsoft_ads.microsoft_ads__search_report keyword_id 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0
161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report
  • Input Column: 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp[keyword_id]
    • Cleaning The column is cast to INT type
    • Output Columns:
      • keyword_id: It is directly mapped to keyword_id after casting
139. model.microsoft_ads.microsoft_ads__search_report
  • Input Column: 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report[keyword_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a join key with the keywords table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • keyword_id: Directly copied to the output
Column Lineage
%3 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp search_query 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report search_query 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp:f0->161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0 139. model.microsoft_ads.microsoft_ads__search_report 139. model.microsoft_ads.microsoft_ads__search_report search_query 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0
161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report
  • Input Column: 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp[search_query]
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • search_query: It is directly mapped to search_query after casting
139. model.microsoft_ads.microsoft_ads__search_report
  • Input Column: 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report[search_query]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • search_query: Directly copied to the output
Column Lineage
%3 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp device_os 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report device_os 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp:f0->161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0 139. model.microsoft_ads.microsoft_ads__search_report 139. model.microsoft_ads.microsoft_ads__search_report device_os 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0
161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report
  • Input Column: 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp[device_os]
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • device_os: It is directly mapped to device_os after casting
139. model.microsoft_ads.microsoft_ads__search_report
  • Input Column: 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report[device_os]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • device_os: Directly copied to the output
Column Lineage
%3 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp device_type 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report device_type 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp:f0->161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0 139. model.microsoft_ads.microsoft_ads__search_report 139. model.microsoft_ads.microsoft_ads__search_report device_type 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0
161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report
  • Input Column: 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp[device_type]
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • device_type: It is directly mapped to device_type after casting
139. model.microsoft_ads.microsoft_ads__search_report
  • Input Column: 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report[device_type]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • device_type: Directly copied to the output
Column Lineage
%3 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp network 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report network 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp:f0->161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0 139. model.microsoft_ads.microsoft_ads__search_report 139. model.microsoft_ads.microsoft_ads__search_report network 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0
161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report
  • Input Column: 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp[network]
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • network: It is directly mapped to network after casting
139. model.microsoft_ads.microsoft_ads__search_report
  • Input Column: 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report[network]
    • Direct The column is directly copied without any transformation
    • Aggregation The column is grouped by in the final SELECT statement
    • Output Columns:
      • network: Directly copied to the output
Column Lineage
%3 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp language 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report language 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp:f0->161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0
161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report
  • Input Column: 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp[language]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to TEXT data type
    • Output Columns:
      • language: Directly mapped after casting
Column Lineage
%3 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp bid_match_type 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report bid_match_type 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp:f0->161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0 139. model.microsoft_ads.microsoft_ads__search_report 139. model.microsoft_ads.microsoft_ads__search_report match_type 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0
161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report
  • Input Column: 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp[bid_match_type]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to TEXT data type
    • Output Columns:
      • bid_match_type: Directly mapped after casting
139. model.microsoft_ads.microsoft_ads__search_report
  • Input Column: 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report[bid_match_type]
    • Cleaning Used in COALESCE function to determine match_type
    • Output Columns:
      • match_type: Used as fallback in COALESCE(report.delivered_match_type, report.bid_match_type)
Column Lineage
%3 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp delivered_match_type 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report delivered_match_type 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp:f0->161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0 139. model.microsoft_ads.microsoft_ads__search_report 139. model.microsoft_ads.microsoft_ads__search_report match_type 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0
161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report
  • Input Column: 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp[delivered_match_type]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to TEXT data type
    • Output Columns:
      • delivered_match_type: Directly mapped after casting
139. model.microsoft_ads.microsoft_ads__search_report
  • Input Column: 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report[delivered_match_type]
    • Cleaning Used in COALESCE function to determine match_type
    • Output Columns:
      • match_type: Primary source in COALESCE(report.delivered_match_type, report.bid_match_type)
Column Lineage
%3 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp top_vs_other 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report top_vs_other 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp:f0->161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0
161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report
  • Input Column: 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp[top_vs_other]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to TEXT data type
    • Output Columns:
      • top_vs_other: Directly mapped after casting
Column Lineage
%3 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp clicks 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report clicks 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp:f0->161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0 139. model.microsoft_ads.microsoft_ads__search_report 139. model.microsoft_ads.microsoft_ads__search_report clicks 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0
161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report
  • Input Column: 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp[clicks]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to INT data type
    • Output Columns:
      • clicks: Directly mapped after casting
139. model.microsoft_ads.microsoft_ads__search_report
  • Input Column: 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report[clicks]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • clicks: Aggregated sum in the output
Column Lineage
%3 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp impressions 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report impressions 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp:f0->161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0 139. model.microsoft_ads.microsoft_ads__search_report 139. model.microsoft_ads.microsoft_ads__search_report impressions 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0
161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report
  • Input Column: 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp[impressions]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to INT data type
    • Output Columns:
      • impressions: Directly mapped after casting
139. model.microsoft_ads.microsoft_ads__search_report
  • Input Column: 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report[impressions]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • impressions: Aggregated sum in the output
Column Lineage
%3 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp spend 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report spend 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp:f0->161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0 139. model.microsoft_ads.microsoft_ads__search_report 139. model.microsoft_ads.microsoft_ads__search_report spend 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0
161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report
  • Input Column: 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp[spend]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to FLOAT data type
    • Output Columns:
      • spend: Directly mapped after casting
139. model.microsoft_ads.microsoft_ads__search_report
  • Input Column: 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report[spend]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • spend: Aggregated sum in the output
162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of type TEXT, which is set to NULL. The LIMIT 0 clause ensures no rows are returned. This appears to be a template or placeholder query, possibly used for schema definition or testing purposes in a dbt (data build tool) project.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp date account_id campaign_id ad_group_id ad_id keyword_id search_query device_os device_type network language bid_match_type delivered_match_type top_vs_other clicks impressions spend 332. source.microsoft_ads_source.microsoft_ads.search_query_performance_daily_report 332. source.microsoft_ads_source.microsoft_ads.search_query_performance_daily_report
Name Type Comment
date date None
account_id bigint None
campaign_id bigint None
ad_group_id bigint None
ad_id bigint None
keyword_id bigint None
search_query text None
device_os text None
device_type text None
network text None
language text None
bid_match_type text None
delivered_match_type text None
top_vs_other text None
clicks integer None
impressions integer None
spend double precision None
Column Lineage
%3 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp date 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report date_day 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp:f0->161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0 139. model.microsoft_ads.microsoft_ads__search_report 139. model.microsoft_ads.microsoft_ads__search_report date_day 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0
161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report
  • Input Column: 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp[date]
    • Cleaning The column is cast to DATE type
    • Output Columns:
      • date_day: It is directly mapped to date_day after casting
139. model.microsoft_ads.microsoft_ads__search_report
  • Input Column: 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp account_id 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report account_id 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp:f0->161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0 139. model.microsoft_ads.microsoft_ads__search_report 139. model.microsoft_ads.microsoft_ads__search_report account_id 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0
161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report
  • Input Column: 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp[account_id]
    • Cleaning The column is cast to INT type
    • Output Columns:
      • account_id: It is directly mapped to account_id after casting
139. model.microsoft_ads.microsoft_ads__search_report
  • Input Column: 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report[account_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a join key with the accounts table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • account_id: Directly copied to the output
Column Lineage
%3 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp campaign_id 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report campaign_id 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp:f0->161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0 139. model.microsoft_ads.microsoft_ads__search_report 139. model.microsoft_ads.microsoft_ads__search_report campaign_id 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0
161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report
  • Input Column: 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp[campaign_id]
    • Cleaning The column is cast to INT type
    • Output Columns:
      • campaign_id: It is directly mapped to campaign_id after casting
139. model.microsoft_ads.microsoft_ads__search_report
  • Input Column: 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report[campaign_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a join key with the campaigns table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • campaign_id: Directly copied to the output
Column Lineage
%3 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp ad_group_id 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report ad_group_id 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp:f0->161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0 139. model.microsoft_ads.microsoft_ads__search_report 139. model.microsoft_ads.microsoft_ads__search_report ad_group_id 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0
161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report
  • Input Column: 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp[ad_group_id]
    • Cleaning The column is cast to INT type
    • Output Columns:
      • ad_group_id: It is directly mapped to ad_group_id after casting
139. model.microsoft_ads.microsoft_ads__search_report
  • Input Column: 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report[ad_group_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a join key with the ad_groups table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • ad_group_id: Directly copied to the output
Column Lineage
%3 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp ad_id 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report ad_id 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp:f0->161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0 139. model.microsoft_ads.microsoft_ads__search_report 139. model.microsoft_ads.microsoft_ads__search_report ad_id 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0
161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report
  • Input Column: 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp[ad_id]
    • Cleaning The column is cast to INT type
    • Output Columns:
      • ad_id: It is directly mapped to ad_id after casting
139. model.microsoft_ads.microsoft_ads__search_report
  • Input Column: 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report[ad_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a join key with the ads table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • ad_id: Directly copied to the output
Column Lineage
%3 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp keyword_id 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report keyword_id 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp:f0->161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0 139. model.microsoft_ads.microsoft_ads__search_report 139. model.microsoft_ads.microsoft_ads__search_report keyword_id 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0
161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report
  • Input Column: 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp[keyword_id]
    • Cleaning The column is cast to INT type
    • Output Columns:
      • keyword_id: It is directly mapped to keyword_id after casting
139. model.microsoft_ads.microsoft_ads__search_report
  • Input Column: 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report[keyword_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a join key with the keywords table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • keyword_id: Directly copied to the output
Column Lineage
%3 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp search_query 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report search_query 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp:f0->161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0 139. model.microsoft_ads.microsoft_ads__search_report 139. model.microsoft_ads.microsoft_ads__search_report search_query 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0
161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report
  • Input Column: 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp[search_query]
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • search_query: It is directly mapped to search_query after casting
139. model.microsoft_ads.microsoft_ads__search_report
  • Input Column: 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report[search_query]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • search_query: Directly copied to the output
Column Lineage
%3 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp device_os 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report device_os 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp:f0->161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0 139. model.microsoft_ads.microsoft_ads__search_report 139. model.microsoft_ads.microsoft_ads__search_report device_os 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0
161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report
  • Input Column: 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp[device_os]
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • device_os: It is directly mapped to device_os after casting
139. model.microsoft_ads.microsoft_ads__search_report
  • Input Column: 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report[device_os]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • device_os: Directly copied to the output
Column Lineage
%3 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp device_type 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report device_type 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp:f0->161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0 139. model.microsoft_ads.microsoft_ads__search_report 139. model.microsoft_ads.microsoft_ads__search_report device_type 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0
161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report
  • Input Column: 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp[device_type]
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • device_type: It is directly mapped to device_type after casting
139. model.microsoft_ads.microsoft_ads__search_report
  • Input Column: 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report[device_type]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • device_type: Directly copied to the output
Column Lineage
%3 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp network 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report network 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp:f0->161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0 139. model.microsoft_ads.microsoft_ads__search_report 139. model.microsoft_ads.microsoft_ads__search_report network 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0
161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report
  • Input Column: 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp[network]
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • network: It is directly mapped to network after casting
139. model.microsoft_ads.microsoft_ads__search_report
  • Input Column: 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report[network]
    • Direct The column is directly copied without any transformation
    • Aggregation The column is grouped by in the final SELECT statement
    • Output Columns:
      • network: Directly copied to the output
Column Lineage
%3 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp language 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report language 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp:f0->161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0
161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report
  • Input Column: 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp[language]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to TEXT data type
    • Output Columns:
      • language: Directly mapped after casting
Column Lineage
%3 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp bid_match_type 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report bid_match_type 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp:f0->161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0 139. model.microsoft_ads.microsoft_ads__search_report 139. model.microsoft_ads.microsoft_ads__search_report match_type 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0
161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report
  • Input Column: 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp[bid_match_type]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to TEXT data type
    • Output Columns:
      • bid_match_type: Directly mapped after casting
139. model.microsoft_ads.microsoft_ads__search_report
  • Input Column: 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report[bid_match_type]
    • Cleaning Used in COALESCE function to determine match_type
    • Output Columns:
      • match_type: Used as fallback in COALESCE(report.delivered_match_type, report.bid_match_type)
Column Lineage
%3 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp delivered_match_type 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report delivered_match_type 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp:f0->161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0 139. model.microsoft_ads.microsoft_ads__search_report 139. model.microsoft_ads.microsoft_ads__search_report match_type 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0
161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report
  • Input Column: 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp[delivered_match_type]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to TEXT data type
    • Output Columns:
      • delivered_match_type: Directly mapped after casting
139. model.microsoft_ads.microsoft_ads__search_report
  • Input Column: 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report[delivered_match_type]
    • Cleaning Used in COALESCE function to determine match_type
    • Output Columns:
      • match_type: Primary source in COALESCE(report.delivered_match_type, report.bid_match_type)
Column Lineage
%3 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp top_vs_other 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report top_vs_other 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp:f0->161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0
161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report
  • Input Column: 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp[top_vs_other]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to TEXT data type
    • Output Columns:
      • top_vs_other: Directly mapped after casting
Column Lineage
%3 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp clicks 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report clicks 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp:f0->161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0 139. model.microsoft_ads.microsoft_ads__search_report 139. model.microsoft_ads.microsoft_ads__search_report clicks 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0
161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report
  • Input Column: 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp[clicks]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to INT data type
    • Output Columns:
      • clicks: Directly mapped after casting
139. model.microsoft_ads.microsoft_ads__search_report
  • Input Column: 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report[clicks]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • clicks: Aggregated sum in the output
Column Lineage
%3 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp impressions 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report impressions 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp:f0->161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0 139. model.microsoft_ads.microsoft_ads__search_report 139. model.microsoft_ads.microsoft_ads__search_report impressions 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0
161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report
  • Input Column: 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp[impressions]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to INT data type
    • Output Columns:
      • impressions: Directly mapped after casting
139. model.microsoft_ads.microsoft_ads__search_report
  • Input Column: 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report[impressions]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • impressions: Aggregated sum in the output
Column Lineage
%3 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp spend 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report spend 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp:f0->161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0 139. model.microsoft_ads.microsoft_ads__search_report 139. model.microsoft_ads.microsoft_ads__search_report spend 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report:f0->139. model.microsoft_ads.microsoft_ads__search_report:f0
161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report
  • Input Column: 162. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report_tmp[spend]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to FLOAT data type
    • Output Columns:
      • spend: Directly mapped after casting
139. model.microsoft_ads.microsoft_ads__search_report
  • Input Column: 161. model.microsoft_ads_source.stg_microsoft_ads__search_daily_report[spend]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • spend: Aggregated sum in the output
163. model.pinterest.pinterest_ads__ad_group_report

This SQL query integrates data from multiple Pinterest Ads-related tables (ad group report, advertisers, campaigns, and ad groups) to create a comprehensive view of ad performance. It joins these tables based on relevant IDs and source relations, filters for the most recent records in some tables, and aggregates spend, clicks, and impressions data at the ad group level. The result is a detailed report that includes information about advertisers, campaigns, ad groups, and their performance metrics.

FilteringIntegrationAggregation
SQL Query
WITH report AS (
  SELECT
    *
  FROM TEST.PUBLIC_pinterest_source.stg_pinterest_ads__ad_group_report
), advertisers AS (
  SELECT
    *
  FROM TEST.PUBLIC_pinterest_source.stg_pinterest_ads__advertiser_history
  WHERE
    is_most_recent_record = TRUE
), campaigns AS (
  SELECT
    *
  FROM TEST.PUBLIC_pinterest_source.stg_pinterest_ads__campaign_history
  WHERE
    is_most_recent_record = TRUE
), ad_groups AS (
  SELECT
    *
  FROM TEST.PUBLIC_pinterest_source.stg_pinterest_ads__ad_group_history
  WHERE
    is_most_recent_record = TRUE
), fields AS (
  SELECT
    report.source_relation,
    report.date_day,
    advertisers.advertiser_name,
    advertisers.advertiser_id,
    campaigns.campaign_name,
    campaigns.campaign_status,
    campaigns.campaign_id,
    ad_groups.ad_group_name,
    report.ad_group_id,
    ad_groups.created_at,
    ad_groups.start_time,
    ad_groups.end_time,
    ad_groups.ad_group_status,
    SUM(report.spend) AS spend,
    SUM(report.clicks) AS clicks,
    SUM(report.impressions) AS impressions
  FROM report
  LEFT JOIN ad_groups
    ON report.ad_group_id = ad_groups.ad_group_id
    AND report.source_relation = ad_groups.source_relation
  LEFT JOIN campaigns
    ON ad_groups.campaign_id = campaigns.campaign_id
    AND ad_groups.source_relation = campaigns.source_relation
  LEFT JOIN advertisers
    ON campaigns.advertiser_id = advertisers.advertiser_id
    AND campaigns.source_relation = advertisers.source_relation
  GROUP BY
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10,
    11,
    12,
    13
)
SELECT
  *
FROM fields
%3 163. model.pinterest.pinterest_ads__ad_group_report 163. model.pinterest.pinterest_ads__ad_group_report source_relation date_day advertiser_id advertiser_name campaign_id campaign_name campaign_status ad_group_id ad_group_name ad_group_status created_at start_time end_time impressions clicks spend 169. model.pinterest_source.stg_pinterest_ads__ad_group_history 169. model.pinterest_source.stg_pinterest_ads__ad_group_history source_relation ad_group_id created_at ad_group_name ad_group_status start_time end_time 169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0->163. model.pinterest.pinterest_ads__ad_group_report:f0 169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f1->163. model.pinterest.pinterest_ads__ad_group_report:f7 169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f2->163. model.pinterest.pinterest_ads__ad_group_report:f10 169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f3->163. model.pinterest.pinterest_ads__ad_group_report:f8 169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f4->163. model.pinterest.pinterest_ads__ad_group_report:f9 169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f5->163. model.pinterest.pinterest_ads__ad_group_report:f11 169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f6->163. model.pinterest.pinterest_ads__ad_group_report:f12 171. model.pinterest_source.stg_pinterest_ads__ad_group_report 171. model.pinterest_source.stg_pinterest_ads__ad_group_report source_relation date_day ad_group_id impressions clicks spend 171. model.pinterest_source.stg_pinterest_ads__ad_group_report:f0->163. model.pinterest.pinterest_ads__ad_group_report:f0 171. model.pinterest_source.stg_pinterest_ads__ad_group_report:f1->163. model.pinterest.pinterest_ads__ad_group_report:f1 171. model.pinterest_source.stg_pinterest_ads__ad_group_report:f2->163. model.pinterest.pinterest_ads__ad_group_report:f7 171. model.pinterest_source.stg_pinterest_ads__ad_group_report:f3->163. model.pinterest.pinterest_ads__ad_group_report:f13 171. model.pinterest_source.stg_pinterest_ads__ad_group_report:f4->163. model.pinterest.pinterest_ads__ad_group_report:f14 171. model.pinterest_source.stg_pinterest_ads__ad_group_report:f5->163. model.pinterest.pinterest_ads__ad_group_report:f15 173. model.pinterest_source.stg_pinterest_ads__advertiser_history 173. model.pinterest_source.stg_pinterest_ads__advertiser_history source_relation advertiser_id advertiser_name 173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0->163. model.pinterest.pinterest_ads__ad_group_report:f0 173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f1->163. model.pinterest.pinterest_ads__ad_group_report:f2 173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f2->163. model.pinterest.pinterest_ads__ad_group_report:f3 177. model.pinterest_source.stg_pinterest_ads__campaign_history 177. model.pinterest_source.stg_pinterest_ads__campaign_history source_relation campaign_id campaign_name campaign_status 177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0->163. model.pinterest.pinterest_ads__ad_group_report:f0 177. model.pinterest_source.stg_pinterest_ads__campaign_history:f1->163. model.pinterest.pinterest_ads__ad_group_report:f4 177. model.pinterest_source.stg_pinterest_ads__campaign_history:f2->163. model.pinterest.pinterest_ads__ad_group_report:f5 177. model.pinterest_source.stg_pinterest_ads__campaign_history:f3->163. model.pinterest.pinterest_ads__ad_group_report:f6
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
date_day timestamp without time zone The date of the report.
advertiser_id bigint The ID of the related Advertiser.
advertiser_name text Name of the advertiser.
campaign_id bigint The ID representing the campaign, if present in the source data.
campaign_name text The name of the related Campaign.
campaign_status text Status of the campaign.
ad_group_id bigint The ID representing the ad group, if present in the source data.
ad_group_name text The name of the related Ad group.
ad_group_status text Status of the ad group.
created_at text Ad group creation time.
start_time text Ad group start time.
end_time integer Ad group end time.
impressions bigint The count of impressions.
clicks bigint The count of clicks.
spend numeric The cost of the ads.
Column Lineage
%3 169. model.pinterest_source.stg_pinterest_ads__ad_group_history 169. model.pinterest_source.stg_pinterest_ads__ad_group_history source_relation 163. model.pinterest.pinterest_ads__ad_group_report 163. model.pinterest.pinterest_ads__ad_group_report source_relation 169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0->163. model.pinterest.pinterest_ads__ad_group_report:f0 171. model.pinterest_source.stg_pinterest_ads__ad_group_report 171. model.pinterest_source.stg_pinterest_ads__ad_group_report source_relation 171. model.pinterest_source.stg_pinterest_ads__ad_group_report:f0->163. model.pinterest.pinterest_ads__ad_group_report:f0 173. model.pinterest_source.stg_pinterest_ads__advertiser_history 173. model.pinterest_source.stg_pinterest_ads__advertiser_history source_relation 173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0->163. model.pinterest.pinterest_ads__ad_group_report:f0 177. model.pinterest_source.stg_pinterest_ads__campaign_history 177. model.pinterest_source.stg_pinterest_ads__campaign_history source_relation 177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0->163. model.pinterest.pinterest_ads__ad_group_report:f0
163. model.pinterest.pinterest_ads__ad_group_report
  • Input Column: 169. model.pinterest_source.stg_pinterest_ads__ad_group_history[source_relation]
    • Integration used as a key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 171. model.pinterest_source.stg_pinterest_ads__ad_group_report[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with other tables
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
  • Input Column: 173. model.pinterest_source.stg_pinterest_ads__advertiser_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 177. model.pinterest_source.stg_pinterest_ads__campaign_history[source_relation]
    • Integration used to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
Column Lineage
%3 171. model.pinterest_source.stg_pinterest_ads__ad_group_report 171. model.pinterest_source.stg_pinterest_ads__ad_group_report date_day 163. model.pinterest.pinterest_ads__ad_group_report 163. model.pinterest.pinterest_ads__ad_group_report date_day 171. model.pinterest_source.stg_pinterest_ads__ad_group_report:f0->163. model.pinterest.pinterest_ads__ad_group_report:f0 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp date 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp:f0->171. model.pinterest_source.stg_pinterest_ads__ad_group_report:f0
171. model.pinterest_source.stg_pinterest_ads__ad_group_report
  • Input Column: 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp[date]
    • Cleaning The column is cast as TIMESTAMP in the fields CTE
    • Featurization The date is truncated to day-level granularity
    • Output Columns:
      • date_day: Transformed to day-level granularity using DATE_TRUNC
163. model.pinterest.pinterest_ads__ad_group_report
  • Input Column: 171. model.pinterest_source.stg_pinterest_ads__ad_group_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 173. model.pinterest_source.stg_pinterest_ads__advertiser_history 173. model.pinterest_source.stg_pinterest_ads__advertiser_history advertiser_id 163. model.pinterest.pinterest_ads__ad_group_report 163. model.pinterest.pinterest_ads__ad_group_report advertiser_id 173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0->163. model.pinterest.pinterest_ads__ad_group_report:f0 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp id 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp:f0->173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0
173. model.pinterest_source.stg_pinterest_ads__advertiser_history
  • Input Column: 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp[id]
    • Direct The column is directly copied without transformation
    • Deduplication Used in the PARTITION BY clause of ROW_NUMBER() function for deduplication
    • Output Columns:
      • advertiser_id: Directly mapped to this output column
163. model.pinterest.pinterest_ads__ad_group_report
  • Input Column: 173. model.pinterest_source.stg_pinterest_ads__advertiser_history[advertiser_id]
    • Integration used as the key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • advertiser_id: directly copied
Column Lineage
%3 173. model.pinterest_source.stg_pinterest_ads__advertiser_history 173. model.pinterest_source.stg_pinterest_ads__advertiser_history advertiser_name 163. model.pinterest.pinterest_ads__ad_group_report 163. model.pinterest.pinterest_ads__ad_group_report advertiser_name 173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0->163. model.pinterest.pinterest_ads__ad_group_report:f0 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp name 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp:f0->173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0
173. model.pinterest_source.stg_pinterest_ads__advertiser_history
  • Input Column: 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • advertiser_name: Directly mapped to this output column
163. model.pinterest.pinterest_ads__ad_group_report
  • Input Column: 173. model.pinterest_source.stg_pinterest_ads__advertiser_history[advertiser_name]
    • Direct directly copied to the output
    • Output Columns:
      • advertiser_name: directly copied
Column Lineage
%3 177. model.pinterest_source.stg_pinterest_ads__campaign_history 177. model.pinterest_source.stg_pinterest_ads__campaign_history campaign_id 163. model.pinterest.pinterest_ads__ad_group_report 163. model.pinterest.pinterest_ads__ad_group_report campaign_id 177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0->163. model.pinterest.pinterest_ads__ad_group_report:f0 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp id 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp:f0->177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0
177. model.pinterest_source.stg_pinterest_ads__campaign_history
  • Input Column: 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp[id]
    • Direct The column is directly copied without transformation
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • campaign_id: Directly mapped to this output column
163. model.pinterest.pinterest_ads__ad_group_report
  • Input Column: 177. model.pinterest_source.stg_pinterest_ads__campaign_history[campaign_id]
    • Integration used to join with ad_groups table
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
Column Lineage
%3 177. model.pinterest_source.stg_pinterest_ads__campaign_history 177. model.pinterest_source.stg_pinterest_ads__campaign_history campaign_name 163. model.pinterest.pinterest_ads__ad_group_report 163. model.pinterest.pinterest_ads__ad_group_report campaign_name 177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0->163. model.pinterest.pinterest_ads__ad_group_report:f0 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp name 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp:f0->177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0
177. model.pinterest_source.stg_pinterest_ads__campaign_history
  • Input Column: 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • campaign_name: Directly mapped to this output column
163. model.pinterest.pinterest_ads__ad_group_report
  • Input Column: 177. model.pinterest_source.stg_pinterest_ads__campaign_history[campaign_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_name: directly copied
Column Lineage
%3 177. model.pinterest_source.stg_pinterest_ads__campaign_history 177. model.pinterest_source.stg_pinterest_ads__campaign_history campaign_status 163. model.pinterest.pinterest_ads__ad_group_report 163. model.pinterest.pinterest_ads__ad_group_report campaign_status 177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0->163. model.pinterest.pinterest_ads__ad_group_report:f0 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp status 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp:f0->177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0
177. model.pinterest_source.stg_pinterest_ads__campaign_history
  • Input Column: 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp[status]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • campaign_status: Directly mapped to this output column
163. model.pinterest.pinterest_ads__ad_group_report
  • Input Column: 177. model.pinterest_source.stg_pinterest_ads__campaign_history[campaign_status]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_status: directly copied
Column Lineage
%3 169. model.pinterest_source.stg_pinterest_ads__ad_group_history 169. model.pinterest_source.stg_pinterest_ads__ad_group_history ad_group_id 163. model.pinterest.pinterest_ads__ad_group_report 163. model.pinterest.pinterest_ads__ad_group_report ad_group_id 169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0->163. model.pinterest.pinterest_ads__ad_group_report:f0 171. model.pinterest_source.stg_pinterest_ads__ad_group_report 171. model.pinterest_source.stg_pinterest_ads__ad_group_report ad_group_id 171. model.pinterest_source.stg_pinterest_ads__ad_group_report:f0->163. model.pinterest.pinterest_ads__ad_group_report:f0 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp id 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp:f0->169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp ad_group_id 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp:f0->171. model.pinterest_source.stg_pinterest_ads__ad_group_report:f0
169. model.pinterest_source.stg_pinterest_ads__ad_group_history
  • Input Column: 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp[id]
    • Direct The column is directly copied without transformation
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • ad_group_id: Directly mapped
171. model.pinterest_source.stg_pinterest_ads__ad_group_report
  • Input Column: 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp[ad_group_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • ad_group_id: Directly copied to the output
163. model.pinterest.pinterest_ads__ad_group_report
  • Input Column: 169. model.pinterest_source.stg_pinterest_ads__ad_group_history[ad_group_id]
    • Integration used as a key to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_id: directly copied
  • Input Column: 171. model.pinterest_source.stg_pinterest_ads__ad_group_report[ad_group_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as the key to join with the ad_groups table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • ad_group_id: Directly copied to the output
Column Lineage
%3 169. model.pinterest_source.stg_pinterest_ads__ad_group_history 169. model.pinterest_source.stg_pinterest_ads__ad_group_history ad_group_name 163. model.pinterest.pinterest_ads__ad_group_report 163. model.pinterest.pinterest_ads__ad_group_report ad_group_name 169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0->163. model.pinterest.pinterest_ads__ad_group_report:f0 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp name 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp:f0->169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0
169. model.pinterest_source.stg_pinterest_ads__ad_group_history
  • Input Column: 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • ad_group_name: Directly mapped
163. model.pinterest.pinterest_ads__ad_group_report
  • Input Column: 169. model.pinterest_source.stg_pinterest_ads__ad_group_history[ad_group_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_name: directly copied
Column Lineage
%3 169. model.pinterest_source.stg_pinterest_ads__ad_group_history 169. model.pinterest_source.stg_pinterest_ads__ad_group_history ad_group_status 163. model.pinterest.pinterest_ads__ad_group_report 163. model.pinterest.pinterest_ads__ad_group_report ad_group_status 169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0->163. model.pinterest.pinterest_ads__ad_group_report:f0 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp status 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp:f0->169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0
169. model.pinterest_source.stg_pinterest_ads__ad_group_history
  • Input Column: 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp[status]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • ad_group_status: Directly mapped
163. model.pinterest.pinterest_ads__ad_group_report
  • Input Column: 169. model.pinterest_source.stg_pinterest_ads__ad_group_history[ad_group_status]
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_status: directly copied
Column Lineage
%3 169. model.pinterest_source.stg_pinterest_ads__ad_group_history 169. model.pinterest_source.stg_pinterest_ads__ad_group_history created_at 163. model.pinterest.pinterest_ads__ad_group_report 163. model.pinterest.pinterest_ads__ad_group_report created_at 169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0->163. model.pinterest.pinterest_ads__ad_group_report:f0 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp created_time 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp:f0->169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0
169. model.pinterest_source.stg_pinterest_ads__ad_group_history
  • Input Column: 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp[created_time]
    • Direct The column is directly copied without transformation
    • Cleaning Cast to TIMESTAMP type
    • Output Columns:
      • created_at: Directly mapped after casting
163. model.pinterest.pinterest_ads__ad_group_report
  • Input Column: 169. model.pinterest_source.stg_pinterest_ads__ad_group_history[created_at]
    • Direct directly copied to the output
    • Output Columns:
      • created_at: directly copied
Column Lineage
%3 169. model.pinterest_source.stg_pinterest_ads__ad_group_history 169. model.pinterest_source.stg_pinterest_ads__ad_group_history start_time 163. model.pinterest.pinterest_ads__ad_group_report 163. model.pinterest.pinterest_ads__ad_group_report start_time 169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0->163. model.pinterest.pinterest_ads__ad_group_report:f0 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp start_time 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp:f0->169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0
169. model.pinterest_source.stg_pinterest_ads__ad_group_history
  • Input Column: 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp[start_time]
    • Direct The column is directly copied without transformation
    • Cleaning Cast to TIMESTAMP type
    • Output Columns:
      • start_time: Directly mapped after casting
163. model.pinterest.pinterest_ads__ad_group_report
  • Input Column: 169. model.pinterest_source.stg_pinterest_ads__ad_group_history[start_time]
    • Direct directly copied to the output
    • Output Columns:
      • start_time: directly copied
Column Lineage
%3 169. model.pinterest_source.stg_pinterest_ads__ad_group_history 169. model.pinterest_source.stg_pinterest_ads__ad_group_history end_time 163. model.pinterest.pinterest_ads__ad_group_report 163. model.pinterest.pinterest_ads__ad_group_report end_time 169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0->163. model.pinterest.pinterest_ads__ad_group_report:f0 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp end_time 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp:f0->169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0
169. model.pinterest_source.stg_pinterest_ads__ad_group_history
  • Input Column: 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp[end_time]
    • Direct The column is directly copied without transformation
    • Cleaning Cast to TIMESTAMP type
    • Output Columns:
      • end_time: Directly mapped after casting
163. model.pinterest.pinterest_ads__ad_group_report
  • Input Column: 169. model.pinterest_source.stg_pinterest_ads__ad_group_history[end_time]
    • Direct directly copied to the output
    • Output Columns:
      • end_time: directly copied
Column Lineage
%3 171. model.pinterest_source.stg_pinterest_ads__ad_group_report 171. model.pinterest_source.stg_pinterest_ads__ad_group_report impressions 163. model.pinterest.pinterest_ads__ad_group_report 163. model.pinterest.pinterest_ads__ad_group_report impressions 171. model.pinterest_source.stg_pinterest_ads__ad_group_report:f0->163. model.pinterest.pinterest_ads__ad_group_report:f0 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp impression_1 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp:f0->171. model.pinterest_source.stg_pinterest_ads__ad_group_report:f0
171. model.pinterest_source.stg_pinterest_ads__ad_group_report
  • Input Column: 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp[impression_1]
    • Aggregation Combined with impression_2 to calculate total impressions
    • Cleaning Cast to INT and COALESCE used to handle NULL values
    • Output Columns:
      • impressions: Summed with impression_2 to create total impressions
163. model.pinterest.pinterest_ads__ad_group_report
  • Input Column: 171. model.pinterest_source.stg_pinterest_ads__ad_group_report[impressions]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • impressions: Aggregated sum in the output
Column Lineage
%3 171. model.pinterest_source.stg_pinterest_ads__ad_group_report 171. model.pinterest_source.stg_pinterest_ads__ad_group_report clicks 163. model.pinterest.pinterest_ads__ad_group_report 163. model.pinterest.pinterest_ads__ad_group_report clicks 171. model.pinterest_source.stg_pinterest_ads__ad_group_report:f0->163. model.pinterest.pinterest_ads__ad_group_report:f0 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp clickthrough_1 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp:f0->171. model.pinterest_source.stg_pinterest_ads__ad_group_report:f0
171. model.pinterest_source.stg_pinterest_ads__ad_group_report
  • Input Column: 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp[clickthrough_1]
    • Aggregation This column is summed with clickthrough_2 to calculate total clicks
    • Output Columns:
      • clicks: Summed with clickthrough_2 and coalesced with 0
163. model.pinterest.pinterest_ads__ad_group_report
  • Input Column: 171. model.pinterest_source.stg_pinterest_ads__ad_group_report[clicks]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • clicks: Aggregated sum in the output
Column Lineage
%3 171. model.pinterest_source.stg_pinterest_ads__ad_group_report 171. model.pinterest_source.stg_pinterest_ads__ad_group_report spend 163. model.pinterest.pinterest_ads__ad_group_report 163. model.pinterest.pinterest_ads__ad_group_report spend 171. model.pinterest_source.stg_pinterest_ads__ad_group_report:f0->163. model.pinterest.pinterest_ads__ad_group_report:f0 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp spend_in_micro_dollar 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp:f0->171. model.pinterest_source.stg_pinterest_ads__ad_group_report:f0
171. model.pinterest_source.stg_pinterest_ads__ad_group_report
  • Input Column: 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp[spend_in_micro_dollar]
    • Cleaning Cast to INT and divided by 1,000,000 to convert to dollars
    • Output Columns:
      • spend: Transformed from micro-dollars to dollars
163. model.pinterest.pinterest_ads__ad_group_report
  • Input Column: 171. model.pinterest_source.stg_pinterest_ads__ad_group_report[spend]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • spend: Aggregated sum in the output
164. model.pinterest.pinterest_ads__advertiser_report

This SQL query combines advertiser report data with advertiser history data, joining them on advertiser_id and source_relation. It filters the advertiser history to only include the most recent records. The query then aggregates spend, clicks, and impressions by date, advertiser, currency, and country, providing a comprehensive summary of advertising performance for each advertiser.

FilteringIntegrationAggregation
SQL Query
WITH report AS (
  SELECT
    *
  FROM TEST.PUBLIC_pinterest_source.stg_pinterest_ads__advertiser_report
), advertisers AS (
  SELECT
    *
  FROM TEST.PUBLIC_pinterest_source.stg_pinterest_ads__advertiser_history
  WHERE
    is_most_recent_record = TRUE
), fields AS (
  SELECT
    report.source_relation,
    report.date_day,
    advertisers.advertiser_name,
    report.advertiser_id,
    advertisers.currency_code,
    advertisers.country,
    SUM(report.spend) AS spend,
    SUM(report.clicks) AS clicks,
    SUM(report.impressions) AS impressions
  FROM report
  LEFT JOIN advertisers
    ON report.advertiser_id = advertisers.advertiser_id
    AND report.source_relation = advertisers.source_relation
  GROUP BY
    1,
    2,
    3,
    4,
    5,
    6
)
SELECT
  *
FROM fields
%3 164. model.pinterest.pinterest_ads__advertiser_report 164. model.pinterest.pinterest_ads__advertiser_report source_relation date_day advertiser_name advertiser_id currency_code country spend clicks impressions 173. model.pinterest_source.stg_pinterest_ads__advertiser_history 173. model.pinterest_source.stg_pinterest_ads__advertiser_history source_relation advertiser_id advertiser_name country currency_code 173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0->164. model.pinterest.pinterest_ads__advertiser_report:f0 173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f1->164. model.pinterest.pinterest_ads__advertiser_report:f3 173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f2->164. model.pinterest.pinterest_ads__advertiser_report:f2 173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f3->164. model.pinterest.pinterest_ads__advertiser_report:f5 173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f4->164. model.pinterest.pinterest_ads__advertiser_report:f4 175. model.pinterest_source.stg_pinterest_ads__advertiser_report 175. model.pinterest_source.stg_pinterest_ads__advertiser_report source_relation date_day advertiser_id impressions clicks spend 175. model.pinterest_source.stg_pinterest_ads__advertiser_report:f0->164. model.pinterest.pinterest_ads__advertiser_report:f0 175. model.pinterest_source.stg_pinterest_ads__advertiser_report:f1->164. model.pinterest.pinterest_ads__advertiser_report:f1 175. model.pinterest_source.stg_pinterest_ads__advertiser_report:f2->164. model.pinterest.pinterest_ads__advertiser_report:f3 175. model.pinterest_source.stg_pinterest_ads__advertiser_report:f3->164. model.pinterest.pinterest_ads__advertiser_report:f8 175. model.pinterest_source.stg_pinterest_ads__advertiser_report:f4->164. model.pinterest.pinterest_ads__advertiser_report:f7 175. model.pinterest_source.stg_pinterest_ads__advertiser_report:f5->164. model.pinterest.pinterest_ads__advertiser_report:f6
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
date_day timestamp without time zone The date of the report.
advertiser_name text Name of the advertiser.
advertiser_id bigint The ID of the related Advertiser.
currency_code text The currency code which the advertiser is set up using.
country text The country code where the advertiser is located.
spend numeric The cost of the ads.
clicks bigint The count of clicks.
impressions bigint The count of impressions.
Column Lineage
%3 173. model.pinterest_source.stg_pinterest_ads__advertiser_history 173. model.pinterest_source.stg_pinterest_ads__advertiser_history source_relation 164. model.pinterest.pinterest_ads__advertiser_report 164. model.pinterest.pinterest_ads__advertiser_report source_relation 173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0->164. model.pinterest.pinterest_ads__advertiser_report:f0 175. model.pinterest_source.stg_pinterest_ads__advertiser_report 175. model.pinterest_source.stg_pinterest_ads__advertiser_report source_relation 175. model.pinterest_source.stg_pinterest_ads__advertiser_report:f0->164. model.pinterest.pinterest_ads__advertiser_report:f0
164. model.pinterest.pinterest_ads__advertiser_report
  • Input Column: 173. model.pinterest_source.stg_pinterest_ads__advertiser_history[source_relation]
    • Direct The column is directly copied without transformation
    • Integration Used as part of the join condition with the report table
    • Aggregation Part of the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
  • Input Column: 175. model.pinterest_source.stg_pinterest_ads__advertiser_report[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the key to join with the advertisers table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly mapped to the output column
Column Lineage
%3 175. model.pinterest_source.stg_pinterest_ads__advertiser_report 175. model.pinterest_source.stg_pinterest_ads__advertiser_report date_day 164. model.pinterest.pinterest_ads__advertiser_report 164. model.pinterest.pinterest_ads__advertiser_report date_day 175. model.pinterest_source.stg_pinterest_ads__advertiser_report:f0->164. model.pinterest.pinterest_ads__advertiser_report:f0 176. model.pinterest_source.stg_pinterest_ads__advertiser_report_tmp 176. model.pinterest_source.stg_pinterest_ads__advertiser_report_tmp date 176. model.pinterest_source.stg_pinterest_ads__advertiser_report_tmp:f0->175. model.pinterest_source.stg_pinterest_ads__advertiser_report:f0
175. model.pinterest_source.stg_pinterest_ads__advertiser_report
  • Input Column: 176. model.pinterest_source.stg_pinterest_ads__advertiser_report_tmp[date]
    • Cleaning The column is cast as TIMESTAMP in the fields CTE
    • Featurization The date is truncated to day level using DATE_TRUNC function
    • Output Columns:
      • date_day: Transformed to day level and mapped to this output column
164. model.pinterest.pinterest_ads__advertiser_report
  • Input Column: 175. model.pinterest_source.stg_pinterest_ads__advertiser_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly mapped to the output column
Column Lineage
%3 173. model.pinterest_source.stg_pinterest_ads__advertiser_history 173. model.pinterest_source.stg_pinterest_ads__advertiser_history advertiser_name 164. model.pinterest.pinterest_ads__advertiser_report 164. model.pinterest.pinterest_ads__advertiser_report advertiser_name 173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0->164. model.pinterest.pinterest_ads__advertiser_report:f0 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp name 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp:f0->173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0
173. model.pinterest_source.stg_pinterest_ads__advertiser_history
  • Input Column: 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • advertiser_name: Directly mapped to this output column
164. model.pinterest.pinterest_ads__advertiser_report
  • Input Column: 173. model.pinterest_source.stg_pinterest_ads__advertiser_history[advertiser_name]
    • Direct The column is directly copied without transformation
    • Aggregation Part of the GROUP BY clause
    • Output Columns:
      • advertiser_name: Directly copied to the output
Column Lineage
%3 173. model.pinterest_source.stg_pinterest_ads__advertiser_history 173. model.pinterest_source.stg_pinterest_ads__advertiser_history advertiser_id 164. model.pinterest.pinterest_ads__advertiser_report 164. model.pinterest.pinterest_ads__advertiser_report advertiser_id 173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0->164. model.pinterest.pinterest_ads__advertiser_report:f0 175. model.pinterest_source.stg_pinterest_ads__advertiser_report 175. model.pinterest_source.stg_pinterest_ads__advertiser_report advertiser_id 175. model.pinterest_source.stg_pinterest_ads__advertiser_report:f0->164. model.pinterest.pinterest_ads__advertiser_report:f0 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp id 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp:f0->173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0 176. model.pinterest_source.stg_pinterest_ads__advertiser_report_tmp 176. model.pinterest_source.stg_pinterest_ads__advertiser_report_tmp advertiser_id 176. model.pinterest_source.stg_pinterest_ads__advertiser_report_tmp:f0->175. model.pinterest_source.stg_pinterest_ads__advertiser_report:f0
173. model.pinterest_source.stg_pinterest_ads__advertiser_history
  • Input Column: 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp[id]
    • Direct The column is directly copied without transformation
    • Deduplication Used in the PARTITION BY clause of ROW_NUMBER() function for deduplication
    • Output Columns:
      • advertiser_id: Directly mapped to this output column
175. model.pinterest_source.stg_pinterest_ads__advertiser_report
  • Input Column: 176. model.pinterest_source.stg_pinterest_ads__advertiser_report_tmp[advertiser_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • advertiser_id: Directly copied to the output
164. model.pinterest.pinterest_ads__advertiser_report
  • Input Column: 173. model.pinterest_source.stg_pinterest_ads__advertiser_history[advertiser_id]
    • Direct The column is directly copied without transformation
    • Integration Used as the key to join with the report table
    • Aggregation Part of the GROUP BY clause
    • Output Columns:
      • advertiser_id: Directly copied to the output
  • Input Column: 175. model.pinterest_source.stg_pinterest_ads__advertiser_report[advertiser_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as the key to join with the advertisers table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • advertiser_id: Directly mapped to the output column
Column Lineage
%3 173. model.pinterest_source.stg_pinterest_ads__advertiser_history 173. model.pinterest_source.stg_pinterest_ads__advertiser_history currency_code 164. model.pinterest.pinterest_ads__advertiser_report 164. model.pinterest.pinterest_ads__advertiser_report currency_code 173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0->164. model.pinterest.pinterest_ads__advertiser_report:f0 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp currency 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp:f0->173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0
173. model.pinterest_source.stg_pinterest_ads__advertiser_history
  • Input Column: 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp[currency]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • currency_code: Directly mapped to this output column
164. model.pinterest.pinterest_ads__advertiser_report
  • Input Column: 173. model.pinterest_source.stg_pinterest_ads__advertiser_history[currency_code]
    • Direct The column is directly copied without transformation
    • Aggregation Part of the GROUP BY clause
    • Output Columns:
      • currency_code: Directly copied to the output
Column Lineage
%3 173. model.pinterest_source.stg_pinterest_ads__advertiser_history 173. model.pinterest_source.stg_pinterest_ads__advertiser_history country 164. model.pinterest.pinterest_ads__advertiser_report 164. model.pinterest.pinterest_ads__advertiser_report country 173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0->164. model.pinterest.pinterest_ads__advertiser_report:f0 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp country 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp:f0->173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0
173. model.pinterest_source.stg_pinterest_ads__advertiser_history
  • Input Column: 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp[country]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • country: Directly mapped to this output column
164. model.pinterest.pinterest_ads__advertiser_report
  • Input Column: 173. model.pinterest_source.stg_pinterest_ads__advertiser_history[country]
    • Direct The column is directly copied without transformation
    • Aggregation Part of the GROUP BY clause
    • Output Columns:
      • country: Directly copied to the output
Column Lineage
%3 175. model.pinterest_source.stg_pinterest_ads__advertiser_report 175. model.pinterest_source.stg_pinterest_ads__advertiser_report spend 164. model.pinterest.pinterest_ads__advertiser_report 164. model.pinterest.pinterest_ads__advertiser_report spend 175. model.pinterest_source.stg_pinterest_ads__advertiser_report:f0->164. model.pinterest.pinterest_ads__advertiser_report:f0 176. model.pinterest_source.stg_pinterest_ads__advertiser_report_tmp 176. model.pinterest_source.stg_pinterest_ads__advertiser_report_tmp spend_in_micro_dollar 176. model.pinterest_source.stg_pinterest_ads__advertiser_report_tmp:f0->175. model.pinterest_source.stg_pinterest_ads__advertiser_report:f0
175. model.pinterest_source.stg_pinterest_ads__advertiser_report
  • Input Column: 176. model.pinterest_source.stg_pinterest_ads__advertiser_report_tmp[spend_in_micro_dollar]
    • Cleaning The value is divided by 1,000,000 to convert from micro-dollars to dollars
    • Output Columns:
      • spend: Transformed from micro-dollars to dollars
164. model.pinterest.pinterest_ads__advertiser_report
  • Input Column: 175. model.pinterest_source.stg_pinterest_ads__advertiser_report[spend]
    • Aggregation The column is summed up in the SELECT clause
    • Output Columns:
      • spend: Aggregated sum is mapped to the output column
Column Lineage
%3 175. model.pinterest_source.stg_pinterest_ads__advertiser_report 175. model.pinterest_source.stg_pinterest_ads__advertiser_report clicks 164. model.pinterest.pinterest_ads__advertiser_report 164. model.pinterest.pinterest_ads__advertiser_report clicks 175. model.pinterest_source.stg_pinterest_ads__advertiser_report:f0->164. model.pinterest.pinterest_ads__advertiser_report:f0 176. model.pinterest_source.stg_pinterest_ads__advertiser_report_tmp 176. model.pinterest_source.stg_pinterest_ads__advertiser_report_tmp clickthrough_1 176. model.pinterest_source.stg_pinterest_ads__advertiser_report_tmp:f0->175. model.pinterest_source.stg_pinterest_ads__advertiser_report:f0
175. model.pinterest_source.stg_pinterest_ads__advertiser_report
  • Input Column: 176. model.pinterest_source.stg_pinterest_ads__advertiser_report_tmp[clickthrough_1]
    • Cleaning The column is cast as INT in the fields CTE
    • Aggregation It's combined with clickthrough_2 using COALESCE and addition
    • Output Columns:
      • clicks: Part of the calculation for the clicks output
164. model.pinterest.pinterest_ads__advertiser_report
  • Input Column: 175. model.pinterest_source.stg_pinterest_ads__advertiser_report[clicks]
    • Aggregation The column is summed up in the SELECT clause
    • Output Columns:
      • clicks: Aggregated sum is mapped to the output column
Column Lineage
%3 175. model.pinterest_source.stg_pinterest_ads__advertiser_report 175. model.pinterest_source.stg_pinterest_ads__advertiser_report impressions 164. model.pinterest.pinterest_ads__advertiser_report 164. model.pinterest.pinterest_ads__advertiser_report impressions 175. model.pinterest_source.stg_pinterest_ads__advertiser_report:f0->164. model.pinterest.pinterest_ads__advertiser_report:f0 176. model.pinterest_source.stg_pinterest_ads__advertiser_report_tmp 176. model.pinterest_source.stg_pinterest_ads__advertiser_report_tmp impression_1 176. model.pinterest_source.stg_pinterest_ads__advertiser_report_tmp:f0->175. model.pinterest_source.stg_pinterest_ads__advertiser_report:f0
175. model.pinterest_source.stg_pinterest_ads__advertiser_report
  • Input Column: 176. model.pinterest_source.stg_pinterest_ads__advertiser_report_tmp[impression_1]
    • Aggregation This column is summed with impression_2 to calculate total impressions
    • Output Columns:
      • impressions: Aggregated with impression_2
164. model.pinterest.pinterest_ads__advertiser_report
  • Input Column: 175. model.pinterest_source.stg_pinterest_ads__advertiser_report[impressions]
    • Aggregation The column is summed up in the SELECT clause
    • Output Columns:
      • impressions: Aggregated sum is mapped to the output column
165. model.pinterest.pinterest_ads__campaign_report

This SQL query combines data from three tables (campaign report, campaign history, and advertiser history) to create a comprehensive report on Pinterest ad campaigns. It joins the most recent campaign and advertiser data with daily report data, aggregates spend, clicks, and impressions, and includes relevant information such as advertiser name, campaign name, and status.

FilteringIntegrationAggregation
SQL Query
WITH report AS (
  SELECT
    *
  FROM TEST.PUBLIC_pinterest_source.stg_pinterest_ads__campaign_report
), campaigns AS (
  SELECT
    *
  FROM TEST.PUBLIC_pinterest_source.stg_pinterest_ads__campaign_history
  WHERE
    is_most_recent_record = TRUE
), advertisers AS (
  SELECT
    *
  FROM TEST.PUBLIC_pinterest_source.stg_pinterest_ads__advertiser_history
  WHERE
    is_most_recent_record = TRUE
), fields AS (
  SELECT
    report.source_relation,
    report.date_day,
    advertisers.advertiser_name,
    advertisers.advertiser_id,
    campaigns.campaign_name,
    report.campaign_id,
    campaigns.campaign_status,
    SUM(report.spend) AS spend,
    SUM(report.clicks) AS clicks,
    SUM(report.impressions) AS impressions
  FROM report
  LEFT JOIN campaigns
    ON report.campaign_id = campaigns.campaign_id
    AND report.source_relation = campaigns.source_relation
  LEFT JOIN advertisers
    ON campaigns.advertiser_id = advertisers.advertiser_id
    AND campaigns.source_relation = advertisers.source_relation
  GROUP BY
    1,
    2,
    3,
    4,
    5,
    6,
    7
)
SELECT
  *
FROM fields
%3 165. model.pinterest.pinterest_ads__campaign_report 165. model.pinterest.pinterest_ads__campaign_report source_relation date_day advertiser_id advertiser_name campaign_id campaign_name campaign_status impressions clicks spend 173. model.pinterest_source.stg_pinterest_ads__advertiser_history 173. model.pinterest_source.stg_pinterest_ads__advertiser_history source_relation advertiser_id advertiser_name 173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0->165. model.pinterest.pinterest_ads__campaign_report:f0 173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f1->165. model.pinterest.pinterest_ads__campaign_report:f2 173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f2->165. model.pinterest.pinterest_ads__campaign_report:f3 177. model.pinterest_source.stg_pinterest_ads__campaign_history 177. model.pinterest_source.stg_pinterest_ads__campaign_history source_relation campaign_id campaign_name campaign_status 177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0->165. model.pinterest.pinterest_ads__campaign_report:f0 177. model.pinterest_source.stg_pinterest_ads__campaign_history:f1->165. model.pinterest.pinterest_ads__campaign_report:f4 177. model.pinterest_source.stg_pinterest_ads__campaign_history:f2->165. model.pinterest.pinterest_ads__campaign_report:f5 177. model.pinterest_source.stg_pinterest_ads__campaign_history:f3->165. model.pinterest.pinterest_ads__campaign_report:f6 179. model.pinterest_source.stg_pinterest_ads__campaign_report 179. model.pinterest_source.stg_pinterest_ads__campaign_report source_relation date_day campaign_id impressions clicks spend 179. model.pinterest_source.stg_pinterest_ads__campaign_report:f0->165. model.pinterest.pinterest_ads__campaign_report:f0 179. model.pinterest_source.stg_pinterest_ads__campaign_report:f1->165. model.pinterest.pinterest_ads__campaign_report:f1 179. model.pinterest_source.stg_pinterest_ads__campaign_report:f2->165. model.pinterest.pinterest_ads__campaign_report:f4 179. model.pinterest_source.stg_pinterest_ads__campaign_report:f3->165. model.pinterest.pinterest_ads__campaign_report:f7 179. model.pinterest_source.stg_pinterest_ads__campaign_report:f4->165. model.pinterest.pinterest_ads__campaign_report:f8 179. model.pinterest_source.stg_pinterest_ads__campaign_report:f5->165. model.pinterest.pinterest_ads__campaign_report:f9
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
date_day timestamp without time zone The date of the report.
advertiser_id bigint The ID of the related Advertiser.
advertiser_name text Name of the advertiser.
campaign_id bigint The ID representing the campaign, if present in the source data.
campaign_name text The name of the related Campaign.
campaign_status text Status of the campaign.
impressions bigint The count of impressions.
clicks bigint The count of clicks.
spend numeric The cost of the ads.
Column Lineage
%3 173. model.pinterest_source.stg_pinterest_ads__advertiser_history 173. model.pinterest_source.stg_pinterest_ads__advertiser_history source_relation 165. model.pinterest.pinterest_ads__campaign_report 165. model.pinterest.pinterest_ads__campaign_report source_relation 173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0->165. model.pinterest.pinterest_ads__campaign_report:f0 177. model.pinterest_source.stg_pinterest_ads__campaign_history 177. model.pinterest_source.stg_pinterest_ads__campaign_history source_relation 177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0->165. model.pinterest.pinterest_ads__campaign_report:f0 179. model.pinterest_source.stg_pinterest_ads__campaign_report 179. model.pinterest_source.stg_pinterest_ads__campaign_report source_relation 179. model.pinterest_source.stg_pinterest_ads__campaign_report:f0->165. model.pinterest.pinterest_ads__campaign_report:f0
165. model.pinterest.pinterest_ads__campaign_report
  • Input Column: 173. model.pinterest_source.stg_pinterest_ads__advertiser_history[source_relation]
    • Direct The column is directly copied without transformation
    • Integration Used as part of the join condition with other tables
    • Output Columns:
      • source_relation: Directly copied to the output
  • Input Column: 177. model.pinterest_source.stg_pinterest_ads__campaign_history[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as a key to join with other tables
    • Output Columns:
      • source_relation: Directly copied to the output
  • Input Column: 179. model.pinterest_source.stg_pinterest_ads__campaign_report[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with other tables
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
Column Lineage
%3 179. model.pinterest_source.stg_pinterest_ads__campaign_report 179. model.pinterest_source.stg_pinterest_ads__campaign_report date_day 165. model.pinterest.pinterest_ads__campaign_report 165. model.pinterest.pinterest_ads__campaign_report date_day 179. model.pinterest_source.stg_pinterest_ads__campaign_report:f0->165. model.pinterest.pinterest_ads__campaign_report:f0 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp date 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp:f0->179. model.pinterest_source.stg_pinterest_ads__campaign_report:f0
179. model.pinterest_source.stg_pinterest_ads__campaign_report
  • Input Column: 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp[date]
    • Cleaning The column is cast as TIMESTAMP and then truncated to day level
    • Featurization The date is transformed to represent the day level
    • Output Columns:
      • date_day: It is mapped to this output column after transformation
165. model.pinterest.pinterest_ads__campaign_report
  • Input Column: 179. model.pinterest_source.stg_pinterest_ads__campaign_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 173. model.pinterest_source.stg_pinterest_ads__advertiser_history 173. model.pinterest_source.stg_pinterest_ads__advertiser_history advertiser_id 165. model.pinterest.pinterest_ads__campaign_report 165. model.pinterest.pinterest_ads__campaign_report advertiser_id 173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0->165. model.pinterest.pinterest_ads__campaign_report:f0 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp id 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp:f0->173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0
173. model.pinterest_source.stg_pinterest_ads__advertiser_history
  • Input Column: 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp[id]
    • Direct The column is directly copied without transformation
    • Deduplication Used in the PARTITION BY clause of ROW_NUMBER() function for deduplication
    • Output Columns:
      • advertiser_id: Directly mapped to this output column
165. model.pinterest.pinterest_ads__campaign_report
  • Input Column: 173. model.pinterest_source.stg_pinterest_ads__advertiser_history[advertiser_id]
    • Direct The column is directly copied without transformation
    • Integration Used as part of the join condition with the campaigns table
    • Output Columns:
      • advertiser_id: Directly copied to the output
Column Lineage
%3 173. model.pinterest_source.stg_pinterest_ads__advertiser_history 173. model.pinterest_source.stg_pinterest_ads__advertiser_history advertiser_name 165. model.pinterest.pinterest_ads__campaign_report 165. model.pinterest.pinterest_ads__campaign_report advertiser_name 173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0->165. model.pinterest.pinterest_ads__campaign_report:f0 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp name 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp:f0->173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0
173. model.pinterest_source.stg_pinterest_ads__advertiser_history
  • Input Column: 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • advertiser_name: Directly mapped to this output column
165. model.pinterest.pinterest_ads__campaign_report
  • Input Column: 173. model.pinterest_source.stg_pinterest_ads__advertiser_history[advertiser_name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • advertiser_name: Directly copied to the output
Column Lineage
%3 177. model.pinterest_source.stg_pinterest_ads__campaign_history 177. model.pinterest_source.stg_pinterest_ads__campaign_history campaign_id 165. model.pinterest.pinterest_ads__campaign_report 165. model.pinterest.pinterest_ads__campaign_report campaign_id 177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0->165. model.pinterest.pinterest_ads__campaign_report:f0 179. model.pinterest_source.stg_pinterest_ads__campaign_report 179. model.pinterest_source.stg_pinterest_ads__campaign_report campaign_id 179. model.pinterest_source.stg_pinterest_ads__campaign_report:f0->165. model.pinterest.pinterest_ads__campaign_report:f0 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp id 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp:f0->177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp campaign_id 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp:f0->179. model.pinterest_source.stg_pinterest_ads__campaign_report:f0
177. model.pinterest_source.stg_pinterest_ads__campaign_history
  • Input Column: 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp[id]
    • Direct The column is directly copied without transformation
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • campaign_id: Directly mapped to this output column
179. model.pinterest_source.stg_pinterest_ads__campaign_report
  • Input Column: 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp[campaign_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • campaign_id: It is directly mapped to this output column
165. model.pinterest.pinterest_ads__campaign_report
  • Input Column: 177. model.pinterest_source.stg_pinterest_ads__campaign_history[campaign_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with the report table
    • Output Columns:
      • campaign_id: Directly copied to the output
  • Input Column: 179. model.pinterest_source.stg_pinterest_ads__campaign_report[campaign_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as the key to join with the campaigns table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • campaign_id: Directly copied to the output
Column Lineage
%3 177. model.pinterest_source.stg_pinterest_ads__campaign_history 177. model.pinterest_source.stg_pinterest_ads__campaign_history campaign_name 165. model.pinterest.pinterest_ads__campaign_report 165. model.pinterest.pinterest_ads__campaign_report campaign_name 177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0->165. model.pinterest.pinterest_ads__campaign_report:f0 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp name 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp:f0->177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0
177. model.pinterest_source.stg_pinterest_ads__campaign_history
  • Input Column: 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • campaign_name: Directly mapped to this output column
165. model.pinterest.pinterest_ads__campaign_report
  • Input Column: 177. model.pinterest_source.stg_pinterest_ads__campaign_history[campaign_name]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • campaign_name: Directly copied to the output
Column Lineage
%3 177. model.pinterest_source.stg_pinterest_ads__campaign_history 177. model.pinterest_source.stg_pinterest_ads__campaign_history campaign_status 165. model.pinterest.pinterest_ads__campaign_report 165. model.pinterest.pinterest_ads__campaign_report campaign_status 177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0->165. model.pinterest.pinterest_ads__campaign_report:f0 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp status 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp:f0->177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0
177. model.pinterest_source.stg_pinterest_ads__campaign_history
  • Input Column: 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp[status]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • campaign_status: Directly mapped to this output column
165. model.pinterest.pinterest_ads__campaign_report
  • Input Column: 177. model.pinterest_source.stg_pinterest_ads__campaign_history[campaign_status]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • campaign_status: Directly copied to the output
Column Lineage
%3 179. model.pinterest_source.stg_pinterest_ads__campaign_report 179. model.pinterest_source.stg_pinterest_ads__campaign_report impressions 165. model.pinterest.pinterest_ads__campaign_report 165. model.pinterest.pinterest_ads__campaign_report impressions 179. model.pinterest_source.stg_pinterest_ads__campaign_report:f0->165. model.pinterest.pinterest_ads__campaign_report:f0 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp impression_1 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp:f0->179. model.pinterest_source.stg_pinterest_ads__campaign_report:f0
179. model.pinterest_source.stg_pinterest_ads__campaign_report
  • Input Column: 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp[impression_1]
    • Aggregation This column is used in a COALESCE function to calculate the total impressions
    • Output Columns:
      • impressions: It's part of the calculation for the impressions output column
165. model.pinterest.pinterest_ads__campaign_report
  • Input Column: 179. model.pinterest_source.stg_pinterest_ads__campaign_report[impressions]
    • Aggregation The column is summed up in the SELECT statement
    • Output Columns:
      • impressions: Aggregated sum of impressions
Column Lineage
%3 179. model.pinterest_source.stg_pinterest_ads__campaign_report 179. model.pinterest_source.stg_pinterest_ads__campaign_report clicks 165. model.pinterest.pinterest_ads__campaign_report 165. model.pinterest.pinterest_ads__campaign_report clicks 179. model.pinterest_source.stg_pinterest_ads__campaign_report:f0->165. model.pinterest.pinterest_ads__campaign_report:f0 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp clickthrough_1 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp:f0->179. model.pinterest_source.stg_pinterest_ads__campaign_report:f0
179. model.pinterest_source.stg_pinterest_ads__campaign_report
  • Input Column: 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp[clickthrough_1]
    • Cleaning The column is cast as INT
    • Aggregation It is combined with clickthrough_2 to calculate total clicks
    • Output Columns:
      • clicks: It contributes to this output column after aggregation
165. model.pinterest.pinterest_ads__campaign_report
  • Input Column: 179. model.pinterest_source.stg_pinterest_ads__campaign_report[clicks]
    • Aggregation The column is summed up in the SELECT statement
    • Output Columns:
      • clicks: Aggregated sum of clicks
Column Lineage
%3 179. model.pinterest_source.stg_pinterest_ads__campaign_report 179. model.pinterest_source.stg_pinterest_ads__campaign_report spend 165. model.pinterest.pinterest_ads__campaign_report 165. model.pinterest.pinterest_ads__campaign_report spend 179. model.pinterest_source.stg_pinterest_ads__campaign_report:f0->165. model.pinterest.pinterest_ads__campaign_report:f0 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp spend_in_micro_dollar 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp:f0->179. model.pinterest_source.stg_pinterest_ads__campaign_report:f0
179. model.pinterest_source.stg_pinterest_ads__campaign_report
  • Input Column: 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp[spend_in_micro_dollar]
    • Cleaning The column is cast to INT type in the 'fields' CTE.
    • Featurization The value is divided by 1,000,000 to convert micro-dollars to dollars.
    • Output Columns:
      • spend: The spend_in_micro_dollar is divided by 1,000,000 to calculate the spend in dollars.
165. model.pinterest.pinterest_ads__campaign_report
  • Input Column: 179. model.pinterest_source.stg_pinterest_ads__campaign_report[spend]
    • Aggregation The column is summed up in the SELECT statement
    • Output Columns:
      • spend: Aggregated sum of spend
166. model.pinterest.pinterest_ads__keyword_report

This SQL query combines data from multiple Pinterest Ads-related tables to create a comprehensive keyword report. It joins keyword performance data with advertiser, campaign, ad group, and keyword information. The query filters for the most recent records in the history tables, aggregates spend, clicks, and impressions data, and presents a detailed view of keyword performance across the advertising hierarchy.

FilteringIntegrationAggregation
SQL Query
WITH report AS (
  SELECT
    *
  FROM TEST.PUBLIC_pinterest_source.stg_pinterest_ads__keyword_report
), advertisers AS (
  SELECT
    *
  FROM TEST.PUBLIC_pinterest_source.stg_pinterest_ads__advertiser_history
  WHERE
    is_most_recent_record = TRUE
), campaigns AS (
  SELECT
    *
  FROM TEST.PUBLIC_pinterest_source.stg_pinterest_ads__campaign_history
  WHERE
    is_most_recent_record = TRUE
), ad_groups AS (
  SELECT
    *
  FROM TEST.PUBLIC_pinterest_source.stg_pinterest_ads__ad_group_history
  WHERE
    is_most_recent_record = TRUE
), keywords AS (
  SELECT
    *
  FROM TEST.PUBLIC_pinterest_source.stg_pinterest_ads__keyword_history
  WHERE
    is_most_recent_record = TRUE
), fields AS (
  SELECT
    report.source_relation,
    report.date_day,
    advertisers.advertiser_name,
    advertisers.advertiser_id,
    campaigns.campaign_name,
    campaigns.campaign_id,
    ad_groups.ad_group_name,
    ad_groups.ad_group_id,
    report.keyword_id,
    keywords.match_type,
    keywords.parent_type,
    keywords.keyword_value,
    SUM(report.spend) AS spend,
    SUM(report.clicks) AS clicks,
    SUM(report.impressions) AS impressions
  FROM report
  LEFT JOIN keywords
    ON report.keyword_id = keywords.keyword_id
    AND report.source_relation = keywords.source_relation
  LEFT JOIN ad_groups
    ON keywords.ad_group_id = ad_groups.ad_group_id
    AND keywords.source_relation = ad_groups.source_relation
  LEFT JOIN campaigns
    ON ad_groups.campaign_id = campaigns.campaign_id
    AND ad_groups.source_relation = campaigns.source_relation
  LEFT JOIN advertisers
    ON campaigns.advertiser_id = advertisers.advertiser_id
    AND campaigns.source_relation = advertisers.source_relation
  GROUP BY
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10,
    11,
    12
)
SELECT
  *
FROM fields
%3 166. model.pinterest.pinterest_ads__keyword_report 166. model.pinterest.pinterest_ads__keyword_report source_relation date_day advertiser_name advertiser_id campaign_name campaign_id ad_group_name ad_group_id keyword_id match_type parent_type keyword_value spend clicks impressions 169. model.pinterest_source.stg_pinterest_ads__ad_group_history 169. model.pinterest_source.stg_pinterest_ads__ad_group_history source_relation ad_group_id ad_group_name 169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0->166. model.pinterest.pinterest_ads__keyword_report:f0 169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f1->166. model.pinterest.pinterest_ads__keyword_report:f7 169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f2->166. model.pinterest.pinterest_ads__keyword_report:f6 173. model.pinterest_source.stg_pinterest_ads__advertiser_history 173. model.pinterest_source.stg_pinterest_ads__advertiser_history source_relation advertiser_id advertiser_name 173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0->166. model.pinterest.pinterest_ads__keyword_report:f0 173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f1->166. model.pinterest.pinterest_ads__keyword_report:f3 173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f2->166. model.pinterest.pinterest_ads__keyword_report:f2 177. model.pinterest_source.stg_pinterest_ads__campaign_history 177. model.pinterest_source.stg_pinterest_ads__campaign_history source_relation campaign_id campaign_name 177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0->166. model.pinterest.pinterest_ads__keyword_report:f0 177. model.pinterest_source.stg_pinterest_ads__campaign_history:f1->166. model.pinterest.pinterest_ads__keyword_report:f5 177. model.pinterest_source.stg_pinterest_ads__campaign_history:f2->166. model.pinterest.pinterest_ads__keyword_report:f4 181. model.pinterest_source.stg_pinterest_ads__keyword_history 181. model.pinterest_source.stg_pinterest_ads__keyword_history source_relation keyword_id keyword_value match_type parent_type 181. model.pinterest_source.stg_pinterest_ads__keyword_history:f0->166. model.pinterest.pinterest_ads__keyword_report:f0 181. model.pinterest_source.stg_pinterest_ads__keyword_history:f1->166. model.pinterest.pinterest_ads__keyword_report:f8 181. model.pinterest_source.stg_pinterest_ads__keyword_history:f2->166. model.pinterest.pinterest_ads__keyword_report:f11 181. model.pinterest_source.stg_pinterest_ads__keyword_history:f3->166. model.pinterest.pinterest_ads__keyword_report:f9 181. model.pinterest_source.stg_pinterest_ads__keyword_history:f4->166. model.pinterest.pinterest_ads__keyword_report:f10 183. model.pinterest_source.stg_pinterest_ads__keyword_report 183. model.pinterest_source.stg_pinterest_ads__keyword_report source_relation date_day keyword_id impressions clicks spend 183. model.pinterest_source.stg_pinterest_ads__keyword_report:f0->166. model.pinterest.pinterest_ads__keyword_report:f0 183. model.pinterest_source.stg_pinterest_ads__keyword_report:f1->166. model.pinterest.pinterest_ads__keyword_report:f1 183. model.pinterest_source.stg_pinterest_ads__keyword_report:f2->166. model.pinterest.pinterest_ads__keyword_report:f8 183. model.pinterest_source.stg_pinterest_ads__keyword_report:f3->166. model.pinterest.pinterest_ads__keyword_report:f14 183. model.pinterest_source.stg_pinterest_ads__keyword_report:f4->166. model.pinterest.pinterest_ads__keyword_report:f13 183. model.pinterest_source.stg_pinterest_ads__keyword_report:f5->166. model.pinterest.pinterest_ads__keyword_report:f12
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
date_day timestamp without time zone The date of the report.
advertiser_name text Name of the advertiser.
advertiser_id bigint The ID of the related Advertiser.
campaign_name text Name of the campaign.
campaign_id bigint The ID representing the campaign, if present in the source data.
ad_group_name text Name of the ad group.
ad_group_id bigint The ID representing the ad group, if present in the source data.
keyword_id bigint Unique identifier of the keyword.
match_type text Type of match the keyword is tied to. Either Exact or Broad.
parent_type text Identifier of what grain the parent type is. Ad group or campaign.
keyword_value text The text value that makes upd the keyword.
spend numeric The cost of the ads.
clicks bigint The count of clicks.
impressions bigint The count of impressions.
Column Lineage
%3 169. model.pinterest_source.stg_pinterest_ads__ad_group_history 169. model.pinterest_source.stg_pinterest_ads__ad_group_history source_relation 166. model.pinterest.pinterest_ads__keyword_report 166. model.pinterest.pinterest_ads__keyword_report source_relation 169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0->166. model.pinterest.pinterest_ads__keyword_report:f0 173. model.pinterest_source.stg_pinterest_ads__advertiser_history 173. model.pinterest_source.stg_pinterest_ads__advertiser_history source_relation 173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0->166. model.pinterest.pinterest_ads__keyword_report:f0 177. model.pinterest_source.stg_pinterest_ads__campaign_history 177. model.pinterest_source.stg_pinterest_ads__campaign_history source_relation 177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0->166. model.pinterest.pinterest_ads__keyword_report:f0 181. model.pinterest_source.stg_pinterest_ads__keyword_history 181. model.pinterest_source.stg_pinterest_ads__keyword_history source_relation 181. model.pinterest_source.stg_pinterest_ads__keyword_history:f0->166. model.pinterest.pinterest_ads__keyword_report:f0 183. model.pinterest_source.stg_pinterest_ads__keyword_report 183. model.pinterest_source.stg_pinterest_ads__keyword_report source_relation 183. model.pinterest_source.stg_pinterest_ads__keyword_report:f0->166. model.pinterest.pinterest_ads__keyword_report:f0
166. model.pinterest.pinterest_ads__keyword_report
  • Input Column: 169. model.pinterest_source.stg_pinterest_ads__ad_group_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 173. model.pinterest_source.stg_pinterest_ads__advertiser_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 177. model.pinterest_source.stg_pinterest_ads__campaign_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 181. model.pinterest_source.stg_pinterest_ads__keyword_history[source_relation]
    • Direct The column is directly copied without transformation
    • Integration Used as part of the join conditions with other tables
    • Output Columns:
      • source_relation: Directly copied to the output
  • Input Column: 183. model.pinterest_source.stg_pinterest_ads__keyword_report[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with other tables
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
Column Lineage
%3 183. model.pinterest_source.stg_pinterest_ads__keyword_report 183. model.pinterest_source.stg_pinterest_ads__keyword_report date_day 166. model.pinterest.pinterest_ads__keyword_report 166. model.pinterest.pinterest_ads__keyword_report date_day 183. model.pinterest_source.stg_pinterest_ads__keyword_report:f0->166. model.pinterest.pinterest_ads__keyword_report:f0 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp date 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp:f0->183. model.pinterest_source.stg_pinterest_ads__keyword_report:f0
183. model.pinterest_source.stg_pinterest_ads__keyword_report
  • Input Column: 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp[date]
    • Cleaning The column is cast as TIMESTAMP and truncated to day level
    • Featurization The date is transformed to represent the day level
    • Output Columns:
      • date_day: Mapped after casting and truncating to day level
166. model.pinterest.pinterest_ads__keyword_report
  • Input Column: 183. model.pinterest_source.stg_pinterest_ads__keyword_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 173. model.pinterest_source.stg_pinterest_ads__advertiser_history 173. model.pinterest_source.stg_pinterest_ads__advertiser_history advertiser_name 166. model.pinterest.pinterest_ads__keyword_report 166. model.pinterest.pinterest_ads__keyword_report advertiser_name 173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0->166. model.pinterest.pinterest_ads__keyword_report:f0 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp name 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp:f0->173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0
173. model.pinterest_source.stg_pinterest_ads__advertiser_history
  • Input Column: 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • advertiser_name: Directly mapped to this output column
166. model.pinterest.pinterest_ads__keyword_report
  • Input Column: 173. model.pinterest_source.stg_pinterest_ads__advertiser_history[advertiser_name]
    • Direct directly copied to the output
    • Output Columns:
      • advertiser_name: directly copied
Column Lineage
%3 173. model.pinterest_source.stg_pinterest_ads__advertiser_history 173. model.pinterest_source.stg_pinterest_ads__advertiser_history advertiser_id 166. model.pinterest.pinterest_ads__keyword_report 166. model.pinterest.pinterest_ads__keyword_report advertiser_id 173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0->166. model.pinterest.pinterest_ads__keyword_report:f0 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp id 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp:f0->173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0
173. model.pinterest_source.stg_pinterest_ads__advertiser_history
  • Input Column: 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp[id]
    • Direct The column is directly copied without transformation
    • Deduplication Used in the PARTITION BY clause of ROW_NUMBER() function for deduplication
    • Output Columns:
      • advertiser_id: Directly mapped to this output column
166. model.pinterest.pinterest_ads__keyword_report
  • Input Column: 173. model.pinterest_source.stg_pinterest_ads__advertiser_history[advertiser_id]
    • Integration used as the key to join with the campaigns table
    • Direct directly copied to the output
    • Output Columns:
      • advertiser_id: directly copied
Column Lineage
%3 177. model.pinterest_source.stg_pinterest_ads__campaign_history 177. model.pinterest_source.stg_pinterest_ads__campaign_history campaign_name 166. model.pinterest.pinterest_ads__keyword_report 166. model.pinterest.pinterest_ads__keyword_report campaign_name 177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0->166. model.pinterest.pinterest_ads__keyword_report:f0 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp name 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp:f0->177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0
177. model.pinterest_source.stg_pinterest_ads__campaign_history
  • Input Column: 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • campaign_name: Directly mapped to this output column
166. model.pinterest.pinterest_ads__keyword_report
  • Input Column: 177. model.pinterest_source.stg_pinterest_ads__campaign_history[campaign_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_name: directly copied
Column Lineage
%3 177. model.pinterest_source.stg_pinterest_ads__campaign_history 177. model.pinterest_source.stg_pinterest_ads__campaign_history campaign_id 166. model.pinterest.pinterest_ads__keyword_report 166. model.pinterest.pinterest_ads__keyword_report campaign_id 177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0->166. model.pinterest.pinterest_ads__keyword_report:f0 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp id 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp:f0->177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0
177. model.pinterest_source.stg_pinterest_ads__campaign_history
  • Input Column: 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp[id]
    • Direct The column is directly copied without transformation
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • campaign_id: Directly mapped to this output column
166. model.pinterest.pinterest_ads__keyword_report
  • Input Column: 177. model.pinterest_source.stg_pinterest_ads__campaign_history[campaign_id]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
Column Lineage
%3 169. model.pinterest_source.stg_pinterest_ads__ad_group_history 169. model.pinterest_source.stg_pinterest_ads__ad_group_history ad_group_name 166. model.pinterest.pinterest_ads__keyword_report 166. model.pinterest.pinterest_ads__keyword_report ad_group_name 169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0->166. model.pinterest.pinterest_ads__keyword_report:f0 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp name 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp:f0->169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0
169. model.pinterest_source.stg_pinterest_ads__ad_group_history
  • Input Column: 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • ad_group_name: Directly mapped
166. model.pinterest.pinterest_ads__keyword_report
  • Input Column: 169. model.pinterest_source.stg_pinterest_ads__ad_group_history[ad_group_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_name: directly copied
Column Lineage
%3 169. model.pinterest_source.stg_pinterest_ads__ad_group_history 169. model.pinterest_source.stg_pinterest_ads__ad_group_history ad_group_id 166. model.pinterest.pinterest_ads__keyword_report 166. model.pinterest.pinterest_ads__keyword_report ad_group_id 169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0->166. model.pinterest.pinterest_ads__keyword_report:f0 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp id 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp:f0->169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0
169. model.pinterest_source.stg_pinterest_ads__ad_group_history
  • Input Column: 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp[id]
    • Direct The column is directly copied without transformation
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • ad_group_id: Directly mapped
166. model.pinterest.pinterest_ads__keyword_report
  • Input Column: 169. model.pinterest_source.stg_pinterest_ads__ad_group_history[ad_group_id]
    • Integration used as the key to join with the keywords table
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_id: directly copied
Column Lineage
%3 181. model.pinterest_source.stg_pinterest_ads__keyword_history 181. model.pinterest_source.stg_pinterest_ads__keyword_history keyword_id 166. model.pinterest.pinterest_ads__keyword_report 166. model.pinterest.pinterest_ads__keyword_report keyword_id 181. model.pinterest_source.stg_pinterest_ads__keyword_history:f0->166. model.pinterest.pinterest_ads__keyword_report:f0 183. model.pinterest_source.stg_pinterest_ads__keyword_report 183. model.pinterest_source.stg_pinterest_ads__keyword_report keyword_id 183. model.pinterest_source.stg_pinterest_ads__keyword_report:f0->166. model.pinterest.pinterest_ads__keyword_report:f0 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp id 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp:f0->181. model.pinterest_source.stg_pinterest_ads__keyword_history:f0 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp keyword_id 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp:f0->183. model.pinterest_source.stg_pinterest_ads__keyword_report:f0
181. model.pinterest_source.stg_pinterest_ads__keyword_history
  • Input Column: 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp[id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Deduplication Used in the PARTITION BY clause of the window function
    • Output Columns:
      • keyword_id: Renamed and directly copied after casting
183. model.pinterest_source.stg_pinterest_ads__keyword_report
  • Input Column: 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp[keyword_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • keyword_id: Directly mapped after casting
166. model.pinterest.pinterest_ads__keyword_report
  • Input Column: 181. model.pinterest_source.stg_pinterest_ads__keyword_history[keyword_id]
    • Direct The column is directly copied without transformation
    • Integration Used as a key to join with the report table
    • Output Columns:
      • keyword_id: Directly copied to the output
  • Input Column: 183. model.pinterest_source.stg_pinterest_ads__keyword_report[keyword_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as the key to join with the keywords table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • keyword_id: Directly copied to the output
Column Lineage
%3 181. model.pinterest_source.stg_pinterest_ads__keyword_history 181. model.pinterest_source.stg_pinterest_ads__keyword_history match_type 166. model.pinterest.pinterest_ads__keyword_report 166. model.pinterest.pinterest_ads__keyword_report match_type 181. model.pinterest_source.stg_pinterest_ads__keyword_history:f0->166. model.pinterest.pinterest_ads__keyword_report:f0 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp match_type 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp:f0->181. model.pinterest_source.stg_pinterest_ads__keyword_history:f0
181. model.pinterest_source.stg_pinterest_ads__keyword_history
  • Input Column: 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp[match_type]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • match_type: Directly copied after casting
166. model.pinterest.pinterest_ads__keyword_report
  • Input Column: 181. model.pinterest_source.stg_pinterest_ads__keyword_history[match_type]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the report table
    • Output Columns:
      • match_type: It is directly copied to the output column 'match_type'
Column Lineage
%3 181. model.pinterest_source.stg_pinterest_ads__keyword_history 181. model.pinterest_source.stg_pinterest_ads__keyword_history parent_type 166. model.pinterest.pinterest_ads__keyword_report 166. model.pinterest.pinterest_ads__keyword_report parent_type 181. model.pinterest_source.stg_pinterest_ads__keyword_history:f0->166. model.pinterest.pinterest_ads__keyword_report:f0 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp parent_type 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp:f0->181. model.pinterest_source.stg_pinterest_ads__keyword_history:f0
181. model.pinterest_source.stg_pinterest_ads__keyword_history
  • Input Column: 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp[parent_type]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • parent_type: Directly copied after casting
166. model.pinterest.pinterest_ads__keyword_report
  • Input Column: 181. model.pinterest_source.stg_pinterest_ads__keyword_history[parent_type]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the report table
    • Output Columns:
      • parent_type: It is directly copied to the output column 'parent_type'
Column Lineage
%3 181. model.pinterest_source.stg_pinterest_ads__keyword_history 181. model.pinterest_source.stg_pinterest_ads__keyword_history keyword_value 166. model.pinterest.pinterest_ads__keyword_report 166. model.pinterest.pinterest_ads__keyword_report keyword_value 181. model.pinterest_source.stg_pinterest_ads__keyword_history:f0->166. model.pinterest.pinterest_ads__keyword_report:f0 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp value 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp:f0->181. model.pinterest_source.stg_pinterest_ads__keyword_history:f0
181. model.pinterest_source.stg_pinterest_ads__keyword_history
  • Input Column: 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp[value]
    • Direct The 'value' column is directly copied to the 'keyword_value' column in the output without any transformation.
    • Cleaning The column is cast as TEXT in the 'fields' CTE.
    • Output Columns:
      • keyword_value: The 'value' column is directly mapped to 'keyword_value' in the final output.
166. model.pinterest.pinterest_ads__keyword_report
  • Input Column: 181. model.pinterest_source.stg_pinterest_ads__keyword_history[keyword_value]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • keyword_value: Directly copied to the output
Column Lineage
%3 183. model.pinterest_source.stg_pinterest_ads__keyword_report 183. model.pinterest_source.stg_pinterest_ads__keyword_report spend 166. model.pinterest.pinterest_ads__keyword_report 166. model.pinterest.pinterest_ads__keyword_report spend 183. model.pinterest_source.stg_pinterest_ads__keyword_report:f0->166. model.pinterest.pinterest_ads__keyword_report:f0 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp spend_in_micro_dollar 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp:f0->183. model.pinterest_source.stg_pinterest_ads__keyword_report:f0
183. model.pinterest_source.stg_pinterest_ads__keyword_report
  • Input Column: 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp[spend_in_micro_dollar]
    • Cleaning The column is transformed from micro-dollars to dollars
    • Output Columns:
      • spend: Divided by 1,000,000 to convert from micro-dollars to dollars
166. model.pinterest.pinterest_ads__keyword_report
  • Input Column: 183. model.pinterest_source.stg_pinterest_ads__keyword_report[spend]
    • Aggregation The spend is summed up in the GROUP BY clause
    • Output Columns:
      • spend: The sum of spend is mapped to the output 'spend' column
Column Lineage
%3 183. model.pinterest_source.stg_pinterest_ads__keyword_report 183. model.pinterest_source.stg_pinterest_ads__keyword_report clicks 166. model.pinterest.pinterest_ads__keyword_report 166. model.pinterest.pinterest_ads__keyword_report clicks 183. model.pinterest_source.stg_pinterest_ads__keyword_report:f0->166. model.pinterest.pinterest_ads__keyword_report:f0 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp clickthrough_1 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp:f0->183. model.pinterest_source.stg_pinterest_ads__keyword_report:f0
183. model.pinterest_source.stg_pinterest_ads__keyword_report
  • Input Column: 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp[clickthrough_1]
    • Aggregation This column is used in a COALESCE function and summed with clickthrough_2
    • Output Columns:
      • clicks: Summed with clickthrough_2 to calculate total clicks
166. model.pinterest.pinterest_ads__keyword_report
  • Input Column: 183. model.pinterest_source.stg_pinterest_ads__keyword_report[clicks]
    • Aggregation The clicks are summed up in the GROUP BY clause
    • Output Columns:
      • clicks: The sum of clicks is mapped to the output 'clicks' column
Column Lineage
%3 183. model.pinterest_source.stg_pinterest_ads__keyword_report 183. model.pinterest_source.stg_pinterest_ads__keyword_report impressions 166. model.pinterest.pinterest_ads__keyword_report 166. model.pinterest.pinterest_ads__keyword_report impressions 183. model.pinterest_source.stg_pinterest_ads__keyword_report:f0->166. model.pinterest.pinterest_ads__keyword_report:f0 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp impression_1 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp:f0->183. model.pinterest_source.stg_pinterest_ads__keyword_report:f0
183. model.pinterest_source.stg_pinterest_ads__keyword_report
  • Input Column: 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp[impression_1]
    • Aggregation This column is combined with impression_2 to calculate total impressions
    • Output Columns:
      • impressions: Combined with impression_2 using COALESCE and addition
166. model.pinterest.pinterest_ads__keyword_report
  • Input Column: 183. model.pinterest_source.stg_pinterest_ads__keyword_report[impressions]
    • Aggregation The column is summed up in the SELECT clause
    • Output Columns:
      • impressions: Aggregated sum of impressions
167. model.pinterest.pinterest_ads__pin_promotion_report

This SQL query integrates data from multiple Pinterest Ads-related tables (pin promotion report, pin promotion history, ad group history, campaign history, and advertiser history) to create a comprehensive report. It joins these tables based on various IDs and source relations, filters for the most recent records in the history tables, and aggregates metrics such as clicks, impressions, and spend. The result is a detailed view of Pinterest ad performance across different levels of the advertising hierarchy (advertiser, campaign, ad group, and pin).

FilteringIntegrationAggregation
SQL Query
WITH report AS (
  SELECT
    *
  FROM TEST.PUBLIC_pinterest_source.stg_pinterest_ads__pin_promotion_report
), pins AS (
  SELECT
    *
  FROM TEST.PUBLIC_pinterest_source.stg_pinterest_ads__pin_promotion_history
  WHERE
    is_most_recent_record = TRUE
), ad_groups AS (
  SELECT
    *
  FROM TEST.PUBLIC_pinterest_source.stg_pinterest_ads__ad_group_history
  WHERE
    is_most_recent_record = TRUE
), campaigns AS (
  SELECT
    *
  FROM TEST.PUBLIC_pinterest_source.stg_pinterest_ads__campaign_history
  WHERE
    is_most_recent_record = TRUE
), advertisers AS (
  SELECT
    *
  FROM TEST.PUBLIC_pinterest_source.stg_pinterest_ads__advertiser_history
  WHERE
    is_most_recent_record = TRUE
), joined AS (
  SELECT
    report.source_relation,
    report.date_day,
    campaigns.advertiser_id,
    advertisers.advertiser_name,
    report.campaign_id,
    campaigns.campaign_name,
    campaigns.campaign_status,
    report.ad_group_id,
    ad_groups.ad_group_name,
    ad_groups.ad_group_status,
    pins.creative_type,
    report.pin_promotion_id,
    pins.pin_name,
    pins.pin_status,
    pins.destination_url,
    pins.base_url,
    SUM(report.clicks) AS clicks,
    SUM(report.impressions) AS impressions,
    SUM(report.spend) AS spend
  FROM report
  LEFT JOIN pins
    ON report.pin_promotion_id = pins.pin_promotion_id
    AND report.source_relation = pins.source_relation
  LEFT JOIN ad_groups
    ON report.ad_group_id = ad_groups.ad_group_id
    AND report.source_relation = ad_groups.source_relation
  LEFT JOIN campaigns
    ON report.campaign_id = campaigns.campaign_id
    AND report.source_relation = campaigns.source_relation
  LEFT JOIN advertisers
    ON campaigns.advertiser_id = advertisers.advertiser_id
    AND campaigns.source_relation = advertisers.source_relation
  GROUP BY
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10,
    11,
    12,
    13,
    14,
    15,
    16
)
SELECT
  *
FROM joined
%3 167. model.pinterest.pinterest_ads__pin_promotion_report 167. model.pinterest.pinterest_ads__pin_promotion_report source_relation date_day advertiser_id advertiser_name campaign_id campaign_name campaign_status ad_group_id ad_group_name ad_group_status creative_type pin_promotion_id pin_name pin_status destination_url base_url clicks impressions spend 169. model.pinterest_source.stg_pinterest_ads__ad_group_history 169. model.pinterest_source.stg_pinterest_ads__ad_group_history source_relation ad_group_id ad_group_name ad_group_status 169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0->167. model.pinterest.pinterest_ads__pin_promotion_report:f0 169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f1->167. model.pinterest.pinterest_ads__pin_promotion_report:f7 169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f2->167. model.pinterest.pinterest_ads__pin_promotion_report:f8 169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f3->167. model.pinterest.pinterest_ads__pin_promotion_report:f9 173. model.pinterest_source.stg_pinterest_ads__advertiser_history 173. model.pinterest_source.stg_pinterest_ads__advertiser_history source_relation advertiser_id advertiser_name 173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0->167. model.pinterest.pinterest_ads__pin_promotion_report:f0 173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f1->167. model.pinterest.pinterest_ads__pin_promotion_report:f2 173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f2->167. model.pinterest.pinterest_ads__pin_promotion_report:f3 177. model.pinterest_source.stg_pinterest_ads__campaign_history 177. model.pinterest_source.stg_pinterest_ads__campaign_history source_relation campaign_id advertiser_id campaign_name campaign_status 177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0->167. model.pinterest.pinterest_ads__pin_promotion_report:f0 177. model.pinterest_source.stg_pinterest_ads__campaign_history:f1->167. model.pinterest.pinterest_ads__pin_promotion_report:f4 177. model.pinterest_source.stg_pinterest_ads__campaign_history:f2->167. model.pinterest.pinterest_ads__pin_promotion_report:f2 177. model.pinterest_source.stg_pinterest_ads__campaign_history:f3->167. model.pinterest.pinterest_ads__pin_promotion_report:f5 177. model.pinterest_source.stg_pinterest_ads__campaign_history:f4->167. model.pinterest.pinterest_ads__pin_promotion_report:f6 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history source_relation pin_promotion_id destination_url pin_name pin_status creative_type base_url 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0->167. model.pinterest.pinterest_ads__pin_promotion_report:f0 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->167. model.pinterest.pinterest_ads__pin_promotion_report:f11 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f2->167. model.pinterest.pinterest_ads__pin_promotion_report:f14 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f3->167. model.pinterest.pinterest_ads__pin_promotion_report:f12 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f4->167. model.pinterest.pinterest_ads__pin_promotion_report:f13 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f5->167. model.pinterest.pinterest_ads__pin_promotion_report:f10 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f6->167. model.pinterest.pinterest_ads__pin_promotion_report:f15 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report source_relation date_day pin_promotion_id ad_group_id campaign_id impressions clicks spend 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0->167. model.pinterest.pinterest_ads__pin_promotion_report:f0 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f1->167. model.pinterest.pinterest_ads__pin_promotion_report:f1 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f2->167. model.pinterest.pinterest_ads__pin_promotion_report:f11 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f3->167. model.pinterest.pinterest_ads__pin_promotion_report:f7 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f4->167. model.pinterest.pinterest_ads__pin_promotion_report:f4 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f5->167. model.pinterest.pinterest_ads__pin_promotion_report:f17 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f6->167. model.pinterest.pinterest_ads__pin_promotion_report:f16 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f7->167. model.pinterest.pinterest_ads__pin_promotion_report:f18
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
date_day timestamp without time zone The date of the report.
advertiser_id bigint The ID of the related Advertiser.
advertiser_name text Name of the advertiser.
campaign_id bigint The ID representing the campaign, if present in the source data.
campaign_name text Name of the campaign.
campaign_status text Status of the campaign.
ad_group_id bigint The ID representing the ad group, if present in the source data.
ad_group_name text Name of the ad group.
ad_group_status text Status of the ad group.
creative_type text The creative type. One of "APP", "APP_VIDEO", "BOARD", "CAROUSEL", "CINEMATIC", "COMMERCE", "MAX_VIDEO", "NATIVE_VIDEO", "REGULAR", "SEARCH_PROMINENCE", "SEARCH_PROMINENCE_CAROUSEL", "SHOPPING", "SHOP_THE_PIN", "THIRD_PARTY", or "VIDEO".
pin_promotion_id bigint The ID of the related Pin promotion.
pin_name text Name of the pin.
pin_status text Status of the pin.
destination_url text Pin destination URL.
base_url text The base URL of the ad, extracted from the `destination_url`.
clicks bigint The count of clicks.
impressions bigint The count of impressions.
spend numeric The cost of the ads.
Column Lineage
%3 169. model.pinterest_source.stg_pinterest_ads__ad_group_history 169. model.pinterest_source.stg_pinterest_ads__ad_group_history source_relation 167. model.pinterest.pinterest_ads__pin_promotion_report 167. model.pinterest.pinterest_ads__pin_promotion_report source_relation 169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0->167. model.pinterest.pinterest_ads__pin_promotion_report:f0 173. model.pinterest_source.stg_pinterest_ads__advertiser_history 173. model.pinterest_source.stg_pinterest_ads__advertiser_history source_relation 173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0->167. model.pinterest.pinterest_ads__pin_promotion_report:f0 177. model.pinterest_source.stg_pinterest_ads__campaign_history 177. model.pinterest_source.stg_pinterest_ads__campaign_history source_relation 177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0->167. model.pinterest.pinterest_ads__pin_promotion_report:f0 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history source_relation 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0->167. model.pinterest.pinterest_ads__pin_promotion_report:f0 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report source_relation 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0->167. model.pinterest.pinterest_ads__pin_promotion_report:f0
167. model.pinterest.pinterest_ads__pin_promotion_report
  • Input Column: 169. model.pinterest_source.stg_pinterest_ads__ad_group_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 173. model.pinterest_source.stg_pinterest_ads__advertiser_history[source_relation]
    • Integration Used as part of the join condition with other tables
    • Direct Directly copied to the output
    • Output Columns:
      • source_relation: Directly copied
  • Input Column: 177. model.pinterest_source.stg_pinterest_ads__campaign_history[source_relation]
    • Direct The column is directly copied without transformation
    • Integration Used as part of the join condition with other tables
    • Output Columns:
      • source_relation: Directly copied to the output
  • Input Column: 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history[source_relation]
    • Integration used as a key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report[source_relation]
    • Direct The column is directly copied without transformation
    • Integration Used as part of the join condition with other tables
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
Column Lineage
%3 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report date_day 167. model.pinterest.pinterest_ads__pin_promotion_report 167. model.pinterest.pinterest_ads__pin_promotion_report date_day 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0->167. model.pinterest.pinterest_ads__pin_promotion_report:f0 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp date 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp:f0->187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0
187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report
  • Input Column: 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp[date]
    • Cleaning The date is truncated to the day level using DATE_TRUNC('DAY', date)
    • Output Columns:
      • date_day: Truncated to day level
167. model.pinterest.pinterest_ads__pin_promotion_report
  • Input Column: 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report[date_day]
    • Direct The column is directly copied without transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 173. model.pinterest_source.stg_pinterest_ads__advertiser_history 173. model.pinterest_source.stg_pinterest_ads__advertiser_history advertiser_id 167. model.pinterest.pinterest_ads__pin_promotion_report 167. model.pinterest.pinterest_ads__pin_promotion_report advertiser_id 173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0->167. model.pinterest.pinterest_ads__pin_promotion_report:f0 177. model.pinterest_source.stg_pinterest_ads__campaign_history 177. model.pinterest_source.stg_pinterest_ads__campaign_history advertiser_id 177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0->167. model.pinterest.pinterest_ads__pin_promotion_report:f0 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp id 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp:f0->173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp advertiser_id 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp:f0->177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0
173. model.pinterest_source.stg_pinterest_ads__advertiser_history
  • Input Column: 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp[id]
    • Direct The column is directly copied without transformation
    • Deduplication Used in the PARTITION BY clause of ROW_NUMBER() function for deduplication
    • Output Columns:
      • advertiser_id: Directly mapped to this output column
177. model.pinterest_source.stg_pinterest_ads__campaign_history
  • Input Column: 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp[advertiser_id]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • advertiser_id: Directly mapped to this output column
167. model.pinterest.pinterest_ads__pin_promotion_report
  • Input Column: 173. model.pinterest_source.stg_pinterest_ads__advertiser_history[advertiser_id]
    • Integration Used as the key to join with the campaigns table
    • Direct Directly copied to the output
    • Output Columns:
      • advertiser_id: Directly copied
  • Input Column: 177. model.pinterest_source.stg_pinterest_ads__campaign_history[advertiser_id]
    • Direct The column is directly copied without transformation
    • Integration Used to join with the advertisers table
    • Output Columns:
      • advertiser_id: Directly copied to the output
Column Lineage
%3 173. model.pinterest_source.stg_pinterest_ads__advertiser_history 173. model.pinterest_source.stg_pinterest_ads__advertiser_history advertiser_name 167. model.pinterest.pinterest_ads__pin_promotion_report 167. model.pinterest.pinterest_ads__pin_promotion_report advertiser_name 173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0->167. model.pinterest.pinterest_ads__pin_promotion_report:f0 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp name 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp:f0->173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0
173. model.pinterest_source.stg_pinterest_ads__advertiser_history
  • Input Column: 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • advertiser_name: Directly mapped to this output column
167. model.pinterest.pinterest_ads__pin_promotion_report
  • Input Column: 173. model.pinterest_source.stg_pinterest_ads__advertiser_history[advertiser_name]
    • Direct Directly copied to the output
    • Output Columns:
      • advertiser_name: Directly copied
Column Lineage
%3 177. model.pinterest_source.stg_pinterest_ads__campaign_history 177. model.pinterest_source.stg_pinterest_ads__campaign_history campaign_id 167. model.pinterest.pinterest_ads__pin_promotion_report 167. model.pinterest.pinterest_ads__pin_promotion_report campaign_id 177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0->167. model.pinterest.pinterest_ads__pin_promotion_report:f0 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report campaign_id 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0->167. model.pinterest.pinterest_ads__pin_promotion_report:f0 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp id 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp:f0->177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp campaign_id 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp:f0->187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0
177. model.pinterest_source.stg_pinterest_ads__campaign_history
  • Input Column: 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp[id]
    • Direct The column is directly copied without transformation
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • campaign_id: Directly mapped to this output column
187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report
  • Input Column: 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp[campaign_id]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • campaign_id: Directly copied
167. model.pinterest.pinterest_ads__pin_promotion_report
  • Input Column: 177. model.pinterest_source.stg_pinterest_ads__campaign_history[campaign_id]
    • Direct The column is directly copied without transformation
    • Integration Used as the key to join with the report table
    • Output Columns:
      • campaign_id: Directly copied to the output
  • Input Column: 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report[campaign_id]
    • Integration Used as a key to join with the campaigns table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • campaign_id: Directly copied to the output
Column Lineage
%3 177. model.pinterest_source.stg_pinterest_ads__campaign_history 177. model.pinterest_source.stg_pinterest_ads__campaign_history campaign_name 167. model.pinterest.pinterest_ads__pin_promotion_report 167. model.pinterest.pinterest_ads__pin_promotion_report campaign_name 177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0->167. model.pinterest.pinterest_ads__pin_promotion_report:f0 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp name 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp:f0->177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0
177. model.pinterest_source.stg_pinterest_ads__campaign_history
  • Input Column: 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • campaign_name: Directly mapped to this output column
167. model.pinterest.pinterest_ads__pin_promotion_report
  • Input Column: 177. model.pinterest_source.stg_pinterest_ads__campaign_history[campaign_name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • campaign_name: Directly copied to the output
Column Lineage
%3 177. model.pinterest_source.stg_pinterest_ads__campaign_history 177. model.pinterest_source.stg_pinterest_ads__campaign_history campaign_status 167. model.pinterest.pinterest_ads__pin_promotion_report 167. model.pinterest.pinterest_ads__pin_promotion_report campaign_status 177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0->167. model.pinterest.pinterest_ads__pin_promotion_report:f0 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp status 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp:f0->177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0
177. model.pinterest_source.stg_pinterest_ads__campaign_history
  • Input Column: 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp[status]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • campaign_status: Directly mapped to this output column
167. model.pinterest.pinterest_ads__pin_promotion_report
  • Input Column: 177. model.pinterest_source.stg_pinterest_ads__campaign_history[campaign_status]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • campaign_status: Directly copied to the output
Column Lineage
%3 169. model.pinterest_source.stg_pinterest_ads__ad_group_history 169. model.pinterest_source.stg_pinterest_ads__ad_group_history ad_group_id 167. model.pinterest.pinterest_ads__pin_promotion_report 167. model.pinterest.pinterest_ads__pin_promotion_report ad_group_id 169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0->167. model.pinterest.pinterest_ads__pin_promotion_report:f0 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report ad_group_id 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0->167. model.pinterest.pinterest_ads__pin_promotion_report:f0 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp id 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp:f0->169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp ad_group_id 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp:f0->187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0
169. model.pinterest_source.stg_pinterest_ads__ad_group_history
  • Input Column: 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp[id]
    • Direct The column is directly copied without transformation
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • ad_group_id: Directly mapped
187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report
  • Input Column: 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp[ad_group_id]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • ad_group_id: Directly copied
167. model.pinterest.pinterest_ads__pin_promotion_report
  • Input Column: 169. model.pinterest_source.stg_pinterest_ads__ad_group_history[ad_group_id]
    • Integration used as the key to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_id: directly copied
  • Input Column: 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report[ad_group_id]
    • Integration Used as a key to join with the ad_groups table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • ad_group_id: Directly copied to the output
Column Lineage
%3 169. model.pinterest_source.stg_pinterest_ads__ad_group_history 169. model.pinterest_source.stg_pinterest_ads__ad_group_history ad_group_name 167. model.pinterest.pinterest_ads__pin_promotion_report 167. model.pinterest.pinterest_ads__pin_promotion_report ad_group_name 169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0->167. model.pinterest.pinterest_ads__pin_promotion_report:f0 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp name 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp:f0->169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0
169. model.pinterest_source.stg_pinterest_ads__ad_group_history
  • Input Column: 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • ad_group_name: Directly mapped
167. model.pinterest.pinterest_ads__pin_promotion_report
  • Input Column: 169. model.pinterest_source.stg_pinterest_ads__ad_group_history[ad_group_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_name: directly copied
Column Lineage
%3 169. model.pinterest_source.stg_pinterest_ads__ad_group_history 169. model.pinterest_source.stg_pinterest_ads__ad_group_history ad_group_status 167. model.pinterest.pinterest_ads__pin_promotion_report 167. model.pinterest.pinterest_ads__pin_promotion_report ad_group_status 169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0->167. model.pinterest.pinterest_ads__pin_promotion_report:f0 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp status 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp:f0->169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0
169. model.pinterest_source.stg_pinterest_ads__ad_group_history
  • Input Column: 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp[status]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • ad_group_status: Directly mapped
167. model.pinterest.pinterest_ads__pin_promotion_report
  • Input Column: 169. model.pinterest_source.stg_pinterest_ads__ad_group_history[ad_group_status]
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_status: directly copied
Column Lineage
%3 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history creative_type 167. model.pinterest.pinterest_ads__pin_promotion_report 167. model.pinterest.pinterest_ads__pin_promotion_report creative_type 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0->167. model.pinterest.pinterest_ads__pin_promotion_report:f0 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp creative_type 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0
185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history
  • Input Column: 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp[creative_type]
    • Direct The column is directly copied to the output
    • Output Columns:
      • creative_type: Directly copied
167. model.pinterest.pinterest_ads__pin_promotion_report
  • Input Column: 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history[creative_type]
    • Direct directly copied to the output
    • Output Columns:
      • creative_type: directly copied
Column Lineage
%3 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history pin_promotion_id 167. model.pinterest.pinterest_ads__pin_promotion_report 167. model.pinterest.pinterest_ads__pin_promotion_report pin_promotion_id 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0->167. model.pinterest.pinterest_ads__pin_promotion_report:f0 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report pin_promotion_id 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0->167. model.pinterest.pinterest_ads__pin_promotion_report:f0 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp id 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp pin_promotion_id 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp:f0->187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0
185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history
  • Input Column: 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp[id]
    • Direct The column is directly copied to the output
    • Deduplication Used in ROW_NUMBER() function for identifying the most recent record
    • Output Columns:
      • pin_promotion_id: Directly copied
187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report
  • Input Column: 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp[pin_promotion_id]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • pin_promotion_id: Directly copied
167. model.pinterest.pinterest_ads__pin_promotion_report
  • Input Column: 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history[pin_promotion_id]
    • Integration used as a key to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • pin_promotion_id: directly copied
  • Input Column: 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report[pin_promotion_id]
    • Integration Used as a key to join with the pins table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • pin_promotion_id: Directly copied to the output
Column Lineage
%3 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history pin_name 167. model.pinterest.pinterest_ads__pin_promotion_report 167. model.pinterest.pinterest_ads__pin_promotion_report pin_name 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0->167. model.pinterest.pinterest_ads__pin_promotion_report:f0 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp name 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0
185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history
  • Input Column: 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp[name]
    • Direct The column is directly copied to the output
    • Output Columns:
      • pin_name: Directly copied
167. model.pinterest.pinterest_ads__pin_promotion_report
  • Input Column: 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history[pin_name]
    • Direct directly copied to the output
    • Output Columns:
      • pin_name: directly copied
Column Lineage
%3 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history pin_status 167. model.pinterest.pinterest_ads__pin_promotion_report 167. model.pinterest.pinterest_ads__pin_promotion_report pin_status 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0->167. model.pinterest.pinterest_ads__pin_promotion_report:f0 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp status 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0
185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history
  • Input Column: 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp[status]
    • Direct The column is directly copied to the output
    • Output Columns:
      • pin_status: Directly copied
167. model.pinterest.pinterest_ads__pin_promotion_report
  • Input Column: 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history[pin_status]
    • Direct directly copied to the output
    • Output Columns:
      • pin_status: directly copied
Column Lineage
%3 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history base_url destination_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 167. model.pinterest.pinterest_ads__pin_promotion_report 167. model.pinterest.pinterest_ads__pin_promotion_report destination_url 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->167. model.pinterest.pinterest_ads__pin_promotion_report:f0 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp destination_url 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f2 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f3 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f7 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f6 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f4 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f5 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f8
185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history
  • Input Column: 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp[destination_url]
    • Direct The column is directly copied to the output
    • Featurization Used to extract various URL components and UTM parameters
    • Output Columns:
      • destination_url: Directly copied
      • base_url: Extracted from destination_url
      • url_host: Extracted from destination_url
      • url_path: Extracted from destination_url
      • utm_source: Extracted from destination_url
      • utm_medium: Extracted from destination_url
      • utm_campaign: Extracted from destination_url
      • utm_content: Extracted from destination_url
      • utm_term: Extracted from destination_url
167. model.pinterest.pinterest_ads__pin_promotion_report
  • Input Column: 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history[destination_url]
    • Direct directly copied to the output
    • Output Columns:
      • destination_url: directly copied
Column Lineage
%3 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history base_url destination_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 167. model.pinterest.pinterest_ads__pin_promotion_report 167. model.pinterest.pinterest_ads__pin_promotion_report base_url 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0->167. model.pinterest.pinterest_ads__pin_promotion_report:f0 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp destination_url 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f2 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f3 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f7 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f6 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f4 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f5 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f8
185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history
  • Input Column: 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp[destination_url]
    • Direct The column is directly copied to the output
    • Featurization Used to extract various URL components and UTM parameters
    • Output Columns:
      • destination_url: Directly copied
      • base_url: Extracted from destination_url
      • url_host: Extracted from destination_url
      • url_path: Extracted from destination_url
      • utm_source: Extracted from destination_url
      • utm_medium: Extracted from destination_url
      • utm_campaign: Extracted from destination_url
      • utm_content: Extracted from destination_url
      • utm_term: Extracted from destination_url
167. model.pinterest.pinterest_ads__pin_promotion_report
  • Input Column: 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history[base_url]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • base_url: Directly mapped to the output column
Column Lineage
%3 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report clicks 167. model.pinterest.pinterest_ads__pin_promotion_report 167. model.pinterest.pinterest_ads__pin_promotion_report clicks 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0->167. model.pinterest.pinterest_ads__pin_promotion_report:f0 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp clickthrough_1 clickthrough_2 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp:f0->187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp:f1->187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0
187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report
  • Input Column: 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp[clickthrough_1]
    • Aggregation Combined with clickthrough_2 using COALESCE and addition
    • Output Columns:
      • clicks: Combined with clickthrough_2
  • Input Column: 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp[clickthrough_2]
    • Aggregation Combined with clickthrough_1 using COALESCE and addition
    • Output Columns:
      • clicks: Combined with clickthrough_1
167. model.pinterest.pinterest_ads__pin_promotion_report
  • Input Column: 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report[clicks]
    • Aggregation Summed up in the SELECT statement
    • Output Columns:
      • clicks: Aggregated sum of clicks
Column Lineage
%3 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report impressions 167. model.pinterest.pinterest_ads__pin_promotion_report 167. model.pinterest.pinterest_ads__pin_promotion_report impressions 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0->167. model.pinterest.pinterest_ads__pin_promotion_report:f0 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp impression_1 impression_2 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp:f0->187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp:f1->187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0
187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report
  • Input Column: 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp[impression_1]
    • Aggregation Combined with impression_2 using COALESCE and addition
    • Output Columns:
      • impressions: Combined with impression_2
  • Input Column: 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp[impression_2]
    • Aggregation Combined with impression_1 using COALESCE and addition
    • Output Columns:
      • impressions: Combined with impression_1
167. model.pinterest.pinterest_ads__pin_promotion_report
  • Input Column: 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report[impressions]
    • Aggregation Summed up in the SELECT statement
    • Output Columns:
      • impressions: Aggregated sum of impressions
Column Lineage
%3 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report spend 167. model.pinterest.pinterest_ads__pin_promotion_report 167. model.pinterest.pinterest_ads__pin_promotion_report spend 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0->167. model.pinterest.pinterest_ads__pin_promotion_report:f0 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp spend_in_micro_dollar 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp:f0->187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0
187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report
  • Input Column: 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp[spend_in_micro_dollar]
    • Cleaning The column is cleaned by casting it to DECIMAL(28, 6) and then divided by 1,000,000 to convert micro-dollars to dollars.
    • Output Columns:
      • spend: The column is transformed by dividing it by 1,000,000 to convert micro-dollars to dollars, and the result is mapped to the 'spend' output column.
167. model.pinterest.pinterest_ads__pin_promotion_report
  • Input Column: 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report[spend]
    • Aggregation Summed up in the SELECT statement
    • Output Columns:
      • spend: Aggregated sum of spend
168. model.pinterest.pinterest_ads__url_report

This SQL query integrates data from multiple Pinterest advertising tables (pin promotion report, pin promotion history, ad group history, campaign history, and advertiser history) to create a comprehensive URL report. It joins these tables, filters for the most recent records in the history tables, and aggregates metrics like clicks, impressions, and spend. The query provides a detailed view of advertising performance across various dimensions such as advertiser, campaign, ad group, and pin levels, including URL-related information and UTM parameters.

IntegrationFilteringAggregation
SQL Query
WITH report AS (
  SELECT
    *
  FROM TEST.PUBLIC_pinterest_source.stg_pinterest_ads__pin_promotion_report
), pins AS (
  SELECT
    *
  FROM TEST.PUBLIC_pinterest_source.stg_pinterest_ads__pin_promotion_history
  WHERE
    is_most_recent_record = TRUE
), ad_groups AS (
  SELECT
    *
  FROM TEST.PUBLIC_pinterest_source.stg_pinterest_ads__ad_group_history
  WHERE
    is_most_recent_record = TRUE
), campaigns AS (
  SELECT
    *
  FROM TEST.PUBLIC_pinterest_source.stg_pinterest_ads__campaign_history
  WHERE
    is_most_recent_record = TRUE
), advertisers AS (
  SELECT
    *
  FROM TEST.PUBLIC_pinterest_source.stg_pinterest_ads__advertiser_history
  WHERE
    is_most_recent_record = TRUE
), joined AS (
  SELECT
    report.source_relation,
    report.date_day,
    campaigns.advertiser_id,
    advertisers.advertiser_name,
    report.campaign_id,
    campaigns.campaign_name,
    campaigns.campaign_status,
    report.ad_group_id,
    ad_groups.ad_group_name,
    ad_groups.ad_group_status,
    pins.destination_url,
    pins.creative_type,
    report.pin_promotion_id,
    pins.pin_name,
    pins.pin_status,
    pins.base_url,
    pins.url_host,
    pins.url_path,
    pins.utm_source,
    pins.utm_medium,
    pins.utm_campaign,
    pins.utm_content,
    pins.utm_term,
    SUM(report.clicks) AS clicks,
    SUM(report.impressions) AS impressions,
    SUM(report.spend) AS spend
  FROM report
  LEFT JOIN pins
    ON report.pin_promotion_id = pins.pin_promotion_id
    AND report.source_relation = pins.source_relation
  LEFT JOIN ad_groups
    ON report.ad_group_id = ad_groups.ad_group_id
    AND report.source_relation = ad_groups.source_relation
  LEFT JOIN campaigns
    ON report.campaign_id = campaigns.campaign_id
    AND report.source_relation = campaigns.source_relation
  LEFT JOIN advertisers
    ON campaigns.advertiser_id = advertisers.advertiser_id
    AND campaigns.source_relation = advertisers.source_relation
  WHERE
    NOT pins.destination_url IS NULL
  GROUP BY
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10,
    11,
    12,
    13,
    14,
    15,
    16,
    17,
    18,
    19,
    20,
    21,
    22,
    23
)
SELECT
  *
FROM joined
%3 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report source_relation date_day advertiser_id advertiser_name campaign_status ad_group_status destination_url pin_promotion_id pin_name pin_status creative_type base_url url_host url_path utm_source utm_medium utm_campaign utm_content utm_term campaign_id campaign_name ad_group_id ad_group_name impressions clicks spend 169. model.pinterest_source.stg_pinterest_ads__ad_group_history 169. model.pinterest_source.stg_pinterest_ads__ad_group_history source_relation ad_group_id ad_group_name ad_group_status 169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0->168. model.pinterest.pinterest_ads__url_report:f0 169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f1->168. model.pinterest.pinterest_ads__url_report:f21 169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f2->168. model.pinterest.pinterest_ads__url_report:f22 169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f3->168. model.pinterest.pinterest_ads__url_report:f5 173. model.pinterest_source.stg_pinterest_ads__advertiser_history 173. model.pinterest_source.stg_pinterest_ads__advertiser_history source_relation advertiser_id advertiser_name 173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0->168. model.pinterest.pinterest_ads__url_report:f0 173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f1->168. model.pinterest.pinterest_ads__url_report:f2 173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f2->168. model.pinterest.pinterest_ads__url_report:f3 177. model.pinterest_source.stg_pinterest_ads__campaign_history 177. model.pinterest_source.stg_pinterest_ads__campaign_history source_relation campaign_id advertiser_id campaign_name campaign_status 177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0->168. model.pinterest.pinterest_ads__url_report:f0 177. model.pinterest_source.stg_pinterest_ads__campaign_history:f1->168. model.pinterest.pinterest_ads__url_report:f19 177. model.pinterest_source.stg_pinterest_ads__campaign_history:f2->168. model.pinterest.pinterest_ads__url_report:f2 177. model.pinterest_source.stg_pinterest_ads__campaign_history:f3->168. model.pinterest.pinterest_ads__url_report:f20 177. model.pinterest_source.stg_pinterest_ads__campaign_history:f4->168. model.pinterest.pinterest_ads__url_report:f4 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history source_relation pin_promotion_id destination_url pin_name pin_status creative_type base_url url_host url_path utm_source utm_medium utm_campaign utm_content utm_term 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0->168. model.pinterest.pinterest_ads__url_report:f0 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f7 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f2->168. model.pinterest.pinterest_ads__url_report:f6 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f2->168. model.pinterest.pinterest_ads__url_report:f11 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f2->168. model.pinterest.pinterest_ads__url_report:f12 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f2->168. model.pinterest.pinterest_ads__url_report:f13 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f2->168. model.pinterest.pinterest_ads__url_report:f14 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f2->168. model.pinterest.pinterest_ads__url_report:f15 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f2->168. model.pinterest.pinterest_ads__url_report:f16 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f2->168. model.pinterest.pinterest_ads__url_report:f17 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f2->168. model.pinterest.pinterest_ads__url_report:f18 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f3->168. model.pinterest.pinterest_ads__url_report:f8 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f4->168. model.pinterest.pinterest_ads__url_report:f9 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f5->168. model.pinterest.pinterest_ads__url_report:f10 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f6->168. model.pinterest.pinterest_ads__url_report:f11 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f7->168. model.pinterest.pinterest_ads__url_report:f12 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f8->168. model.pinterest.pinterest_ads__url_report:f13 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f9->168. model.pinterest.pinterest_ads__url_report:f14 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f10->168. model.pinterest.pinterest_ads__url_report:f15 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f11->168. model.pinterest.pinterest_ads__url_report:f16 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f12->168. model.pinterest.pinterest_ads__url_report:f17 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f13->168. model.pinterest.pinterest_ads__url_report:f18 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report source_relation date_day pin_promotion_id ad_group_id campaign_id impressions clicks spend 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0->168. model.pinterest.pinterest_ads__url_report:f0 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f1->168. model.pinterest.pinterest_ads__url_report:f1 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f2->168. model.pinterest.pinterest_ads__url_report:f7 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f3->168. model.pinterest.pinterest_ads__url_report:f21 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f4->168. model.pinterest.pinterest_ads__url_report:f19 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f5->168. model.pinterest.pinterest_ads__url_report:f23 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f6->168. model.pinterest.pinterest_ads__url_report:f24 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f7->168. model.pinterest.pinterest_ads__url_report:f25
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
date_day timestamp without time zone The date of the report.
advertiser_id bigint The ID of the related Advertiser.
advertiser_name text Name of the advertiser.
campaign_status text Status of the campaign.
ad_group_status text Status of the ad group.
destination_url text Pin destination URL.
pin_promotion_id bigint The ID of the related Pin promotion.
pin_name text Pin promotion name.
pin_status text The status of the Pin promotion. One of "ACTIVE", "ARCHIVED", "PAUSED"
creative_type text The creative type. One of "APP", "APP_VIDEO", "BOARD", "CAROUSEL", "CINEMATIC", "COMMERCE", "MAX_VIDEO", "NATIVE_VIDEO", "REGULAR", "SEARCH_PROMINENCE", "SEARCH_PROMINENCE_CAROUSEL", "SHOPPING", "SHOP_THE_PIN", "THIRD_PARTY", or "VIDEO".
base_url text The base URL of the ad, extracted from the `destination_url`.
url_host text The URL host of the ad, extracted from the `destination_url`.
url_path text The URL path of the ad, extracted from the `destination_url`.
utm_source text The utm_source parameter of the ad, extracted from the `destination_url`.
utm_medium text The utm_medium parameter of the ad, extracted from the `destination_url`.
utm_campaign text The utm_campaign parameter of the ad, extracted from the `destination_url`.
utm_content text The utm_content parameter of the ad, extracted from the `destination_url`.
utm_term text The utm_term parameter of the ad, extracted from the `destination_url`.
campaign_id bigint The ID representing the campaign, if present in the source data.
campaign_name text The name of the related Campaign.
ad_group_id bigint The ID representing the ad group, if present in the source data.
ad_group_name text The name of the related Ad group.
impressions bigint The count of impressions.
clicks bigint The count of clicks.
spend numeric The cost of the ads.
Column Lineage
%3 169. model.pinterest_source.stg_pinterest_ads__ad_group_history 169. model.pinterest_source.stg_pinterest_ads__ad_group_history source_relation 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report source_relation 169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0->168. model.pinterest.pinterest_ads__url_report:f0 173. model.pinterest_source.stg_pinterest_ads__advertiser_history 173. model.pinterest_source.stg_pinterest_ads__advertiser_history source_relation 173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0->168. model.pinterest.pinterest_ads__url_report:f0 177. model.pinterest_source.stg_pinterest_ads__campaign_history 177. model.pinterest_source.stg_pinterest_ads__campaign_history source_relation 177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0->168. model.pinterest.pinterest_ads__url_report:f0 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history source_relation 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0->168. model.pinterest.pinterest_ads__url_report:f0 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report source_relation 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0->168. model.pinterest.pinterest_ads__url_report:f0
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 169. model.pinterest_source.stg_pinterest_ads__ad_group_history[source_relation]
    • Integration used as part of the join condition with the report table
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 173. model.pinterest_source.stg_pinterest_ads__advertiser_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 177. model.pinterest_source.stg_pinterest_ads__campaign_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history[source_relation]
    • Direct The column is directly copied without transformation
    • Integration Used as part of the join condition with other tables
    • Output Columns:
      • source_relation: Directly copied to the output
  • Input Column: 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with other tables
    • Output Columns:
      • source_relation: Directly copied to the output
Column Lineage
%3 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report date_day 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report date_day 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0->168. model.pinterest.pinterest_ads__url_report:f0 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp date 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp:f0->187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0
187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report
  • Input Column: 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp[date]
    • Cleaning The date is truncated to the day level using DATE_TRUNC('DAY', date)
    • Output Columns:
      • date_day: Truncated to day level
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 173. model.pinterest_source.stg_pinterest_ads__advertiser_history 173. model.pinterest_source.stg_pinterest_ads__advertiser_history advertiser_id 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report advertiser_id 173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0->168. model.pinterest.pinterest_ads__url_report:f0 177. model.pinterest_source.stg_pinterest_ads__campaign_history 177. model.pinterest_source.stg_pinterest_ads__campaign_history advertiser_id 177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0->168. model.pinterest.pinterest_ads__url_report:f0 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp id 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp:f0->173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp advertiser_id 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp:f0->177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0
173. model.pinterest_source.stg_pinterest_ads__advertiser_history
  • Input Column: 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp[id]
    • Direct The column is directly copied without transformation
    • Deduplication Used in the PARTITION BY clause of ROW_NUMBER() function for deduplication
    • Output Columns:
      • advertiser_id: Directly mapped to this output column
177. model.pinterest_source.stg_pinterest_ads__campaign_history
  • Input Column: 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp[advertiser_id]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • advertiser_id: Directly mapped to this output column
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 173. model.pinterest_source.stg_pinterest_ads__advertiser_history[advertiser_id]
    • Integration used as the key to join with the campaigns table
    • Direct directly copied to the output
    • Output Columns:
      • advertiser_id: directly copied
  • Input Column: 177. model.pinterest_source.stg_pinterest_ads__campaign_history[advertiser_id]
    • Integration used to join with the advertisers table
    • Direct directly copied to the output
    • Output Columns:
      • advertiser_id: directly copied
Column Lineage
%3 173. model.pinterest_source.stg_pinterest_ads__advertiser_history 173. model.pinterest_source.stg_pinterest_ads__advertiser_history advertiser_name 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report advertiser_name 173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0->168. model.pinterest.pinterest_ads__url_report:f0 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp name 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp:f0->173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0
173. model.pinterest_source.stg_pinterest_ads__advertiser_history
  • Input Column: 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • advertiser_name: Directly mapped to this output column
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 173. model.pinterest_source.stg_pinterest_ads__advertiser_history[advertiser_name]
    • Direct directly copied to the output
    • Output Columns:
      • advertiser_name: directly copied
Column Lineage
%3 177. model.pinterest_source.stg_pinterest_ads__campaign_history 177. model.pinterest_source.stg_pinterest_ads__campaign_history campaign_status 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report campaign_status 177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0->168. model.pinterest.pinterest_ads__url_report:f0 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp status 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp:f0->177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0
177. model.pinterest_source.stg_pinterest_ads__campaign_history
  • Input Column: 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp[status]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • campaign_status: Directly mapped to this output column
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 177. model.pinterest_source.stg_pinterest_ads__campaign_history[campaign_status]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_status: directly copied
Column Lineage
%3 169. model.pinterest_source.stg_pinterest_ads__ad_group_history 169. model.pinterest_source.stg_pinterest_ads__ad_group_history ad_group_status 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report ad_group_status 169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0->168. model.pinterest.pinterest_ads__url_report:f0 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp status 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp:f0->169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0
169. model.pinterest_source.stg_pinterest_ads__ad_group_history
  • Input Column: 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp[status]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • ad_group_status: Directly mapped
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 169. model.pinterest_source.stg_pinterest_ads__ad_group_history[ad_group_status]
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_status: directly copied
Column Lineage
%3 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history base_url destination_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report base_url destination_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f1 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f0 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f2 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f3 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f7 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f6 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f4 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f5 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f8 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp destination_url 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f2 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f3 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f7 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f6 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f4 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f5 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f8
185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history
  • Input Column: 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp[destination_url]
    • Direct The column is directly copied to the output
    • Featurization Used to extract various URL components and UTM parameters
    • Output Columns:
      • destination_url: Directly copied
      • base_url: Extracted from destination_url
      • url_host: Extracted from destination_url
      • url_path: Extracted from destination_url
      • utm_source: Extracted from destination_url
      • utm_medium: Extracted from destination_url
      • utm_campaign: Extracted from destination_url
      • utm_content: Extracted from destination_url
      • utm_term: Extracted from destination_url
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history[destination_url]
    • Direct Directly copied to the output
    • Filtering Used in the WHERE clause to filter out null values
    • Featurization Base for extracting URL components and UTM parameters
    • Output Columns:
      • destination_url: Directly copied to the output
      • base_url: Extracted from this column
      • url_host: Extracted from this column
      • url_path: Extracted from this column
      • utm_source: Extracted from this column
      • utm_medium: Extracted from this column
      • utm_campaign: Extracted from this column
      • utm_content: Extracted from this column
      • utm_term: Extracted from this column
Column Lineage
%3 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history pin_promotion_id 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report pin_promotion_id 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0->168. model.pinterest.pinterest_ads__url_report:f0 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report pin_promotion_id 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0->168. model.pinterest.pinterest_ads__url_report:f0 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp id 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp pin_promotion_id 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp:f0->187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0
185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history
  • Input Column: 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp[id]
    • Direct The column is directly copied to the output
    • Deduplication Used in ROW_NUMBER() function for identifying the most recent record
    • Output Columns:
      • pin_promotion_id: Directly copied
187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report
  • Input Column: 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp[pin_promotion_id]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • pin_promotion_id: Directly copied
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history[pin_promotion_id]
    • Integration Used as the key to join with the report table
    • Direct Directly copied to the output
    • Output Columns:
      • pin_promotion_id: Directly copied to the output
  • Input Column: 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report[pin_promotion_id]
    • Integration Used as the key to join with the pins table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • pin_promotion_id: Directly copied to the output
Column Lineage
%3 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history pin_name 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report pin_name 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0->168. model.pinterest.pinterest_ads__url_report:f0 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp name 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0
185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history
  • Input Column: 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp[name]
    • Direct The column is directly copied to the output
    • Output Columns:
      • pin_name: Directly copied
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history[pin_name]
    • Direct Directly copied to the output
    • Output Columns:
      • pin_name: Directly copied to the output
Column Lineage
%3 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history pin_status 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report pin_status 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0->168. model.pinterest.pinterest_ads__url_report:f0 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp status 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0
185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history
  • Input Column: 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp[status]
    • Direct The column is directly copied to the output
    • Output Columns:
      • pin_status: Directly copied
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history[pin_status]
    • Direct Directly copied to the output
    • Output Columns:
      • pin_status: Directly copied to the output
Column Lineage
%3 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history creative_type 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report creative_type 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0->168. model.pinterest.pinterest_ads__url_report:f0 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp creative_type 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0
185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history
  • Input Column: 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp[creative_type]
    • Direct The column is directly copied to the output
    • Output Columns:
      • creative_type: Directly copied
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history[creative_type]
    • Direct Directly copied to the output
    • Output Columns:
      • creative_type: Directly copied to the output
Column Lineage
%3 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history base_url destination_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report base_url destination_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f1 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f0 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f2 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f3 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f7 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f6 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f4 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f5 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f8 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0->168. model.pinterest.pinterest_ads__url_report:f0 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp destination_url 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f2 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f3 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f7 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f6 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f4 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f5 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f8 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f2 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f3 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f7 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f6 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f4 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f5 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f8
185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history
  • Input Column: 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp[destination_url]
    • Direct The column is directly copied to the output
    • Featurization Used to extract various URL components and UTM parameters
    • Output Columns:
      • destination_url: Directly copied
      • base_url: Extracted from destination_url
      • url_host: Extracted from destination_url
      • url_path: Extracted from destination_url
      • utm_source: Extracted from destination_url
      • utm_medium: Extracted from destination_url
      • utm_campaign: Extracted from destination_url
      • utm_content: Extracted from destination_url
      • utm_term: Extracted from destination_url
  • Input Column: 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp[destination_url]
    • Direct The column is directly copied to the output
    • Featurization Used to extract various URL components and UTM parameters
    • Output Columns:
      • destination_url: Directly copied
      • base_url: Extracted from destination_url
      • url_host: Extracted from destination_url
      • url_path: Extracted from destination_url
      • utm_source: Extracted from destination_url
      • utm_medium: Extracted from destination_url
      • utm_campaign: Extracted from destination_url
      • utm_content: Extracted from destination_url
      • utm_term: Extracted from destination_url
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history[destination_url]
    • Direct Directly copied to the output
    • Filtering Used in the WHERE clause to filter out null values
    • Featurization Base for extracting URL components and UTM parameters
    • Output Columns:
      • destination_url: Directly copied to the output
      • base_url: Extracted from this column
      • url_host: Extracted from this column
      • url_path: Extracted from this column
      • utm_source: Extracted from this column
      • utm_medium: Extracted from this column
      • utm_campaign: Extracted from this column
      • utm_content: Extracted from this column
      • utm_term: Extracted from this column
  • Input Column: 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history[base_url]
    • Direct This column is directly copied to the output without transformation.
    • Output Columns:
      • base_url: Directly copied
Column Lineage
%3 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history base_url destination_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report base_url destination_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f1 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f0 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f2 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f3 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f7 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f6 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f4 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f5 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f8 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f2->168. model.pinterest.pinterest_ads__url_report:f2 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp destination_url 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f2 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f3 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f7 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f6 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f4 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f5 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f8 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f2 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f3 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f7 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f6 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f4 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f5 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f8
185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history
  • Input Column: 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp[destination_url]
    • Direct The column is directly copied to the output
    • Featurization Used to extract various URL components and UTM parameters
    • Output Columns:
      • destination_url: Directly copied
      • base_url: Extracted from destination_url
      • url_host: Extracted from destination_url
      • url_path: Extracted from destination_url
      • utm_source: Extracted from destination_url
      • utm_medium: Extracted from destination_url
      • utm_campaign: Extracted from destination_url
      • utm_content: Extracted from destination_url
      • utm_term: Extracted from destination_url
  • Input Column: 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp[destination_url]
    • Direct The column is directly copied to the output
    • Featurization Used to extract various URL components and UTM parameters
    • Output Columns:
      • destination_url: Directly copied
      • base_url: Extracted from destination_url
      • url_host: Extracted from destination_url
      • url_path: Extracted from destination_url
      • utm_source: Extracted from destination_url
      • utm_medium: Extracted from destination_url
      • utm_campaign: Extracted from destination_url
      • utm_content: Extracted from destination_url
      • utm_term: Extracted from destination_url
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history[destination_url]
    • Direct Directly copied to the output
    • Filtering Used in the WHERE clause to filter out null values
    • Featurization Base for extracting URL components and UTM parameters
    • Output Columns:
      • destination_url: Directly copied to the output
      • base_url: Extracted from this column
      • url_host: Extracted from this column
      • url_path: Extracted from this column
      • utm_source: Extracted from this column
      • utm_medium: Extracted from this column
      • utm_campaign: Extracted from this column
      • utm_content: Extracted from this column
      • utm_term: Extracted from this column
  • Input Column: 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history[url_host]
    • Direct This column is directly copied to the output without transformation.
    • Output Columns:
      • url_host: Directly copied
Column Lineage
%3 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history base_url destination_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report base_url destination_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f1 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f0 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f2 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f3 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f7 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f6 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f4 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f5 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f8 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f3->168. model.pinterest.pinterest_ads__url_report:f3 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp destination_url 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f2 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f3 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f7 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f6 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f4 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f5 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f8 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f2 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f3 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f7 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f6 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f4 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f5 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f8
185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history
  • Input Column: 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp[destination_url]
    • Direct The column is directly copied to the output
    • Featurization Used to extract various URL components and UTM parameters
    • Output Columns:
      • destination_url: Directly copied
      • base_url: Extracted from destination_url
      • url_host: Extracted from destination_url
      • url_path: Extracted from destination_url
      • utm_source: Extracted from destination_url
      • utm_medium: Extracted from destination_url
      • utm_campaign: Extracted from destination_url
      • utm_content: Extracted from destination_url
      • utm_term: Extracted from destination_url
  • Input Column: 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp[destination_url]
    • Direct The column is directly copied to the output
    • Featurization Used to extract various URL components and UTM parameters
    • Output Columns:
      • destination_url: Directly copied
      • base_url: Extracted from destination_url
      • url_host: Extracted from destination_url
      • url_path: Extracted from destination_url
      • utm_source: Extracted from destination_url
      • utm_medium: Extracted from destination_url
      • utm_campaign: Extracted from destination_url
      • utm_content: Extracted from destination_url
      • utm_term: Extracted from destination_url
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history[destination_url]
    • Direct Directly copied to the output
    • Filtering Used in the WHERE clause to filter out null values
    • Featurization Base for extracting URL components and UTM parameters
    • Output Columns:
      • destination_url: Directly copied to the output
      • base_url: Extracted from this column
      • url_host: Extracted from this column
      • url_path: Extracted from this column
      • utm_source: Extracted from this column
      • utm_medium: Extracted from this column
      • utm_campaign: Extracted from this column
      • utm_content: Extracted from this column
      • utm_term: Extracted from this column
  • Input Column: 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history[url_path]
    • Direct This column is directly copied to the output without transformation.
    • Output Columns:
      • url_path: Directly copied
Column Lineage
%3 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history base_url destination_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report base_url destination_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f1 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f0 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f2 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f3 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f7 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f6 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f4 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f5 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f8 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f7->168. model.pinterest.pinterest_ads__url_report:f7 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp destination_url 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f2 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f3 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f7 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f6 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f4 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f5 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f8 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f2 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f3 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f7 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f6 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f4 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f5 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f8
185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history
  • Input Column: 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp[destination_url]
    • Direct The column is directly copied to the output
    • Featurization Used to extract various URL components and UTM parameters
    • Output Columns:
      • destination_url: Directly copied
      • base_url: Extracted from destination_url
      • url_host: Extracted from destination_url
      • url_path: Extracted from destination_url
      • utm_source: Extracted from destination_url
      • utm_medium: Extracted from destination_url
      • utm_campaign: Extracted from destination_url
      • utm_content: Extracted from destination_url
      • utm_term: Extracted from destination_url
  • Input Column: 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp[destination_url]
    • Direct The column is directly copied to the output
    • Featurization Used to extract various URL components and UTM parameters
    • Output Columns:
      • destination_url: Directly copied
      • base_url: Extracted from destination_url
      • url_host: Extracted from destination_url
      • url_path: Extracted from destination_url
      • utm_source: Extracted from destination_url
      • utm_medium: Extracted from destination_url
      • utm_campaign: Extracted from destination_url
      • utm_content: Extracted from destination_url
      • utm_term: Extracted from destination_url
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history[destination_url]
    • Direct Directly copied to the output
    • Filtering Used in the WHERE clause to filter out null values
    • Featurization Base for extracting URL components and UTM parameters
    • Output Columns:
      • destination_url: Directly copied to the output
      • base_url: Extracted from this column
      • url_host: Extracted from this column
      • url_path: Extracted from this column
      • utm_source: Extracted from this column
      • utm_medium: Extracted from this column
      • utm_campaign: Extracted from this column
      • utm_content: Extracted from this column
      • utm_term: Extracted from this column
  • Input Column: 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history[utm_source]
    • Direct This column is directly copied to the output without transformation.
    • Output Columns:
      • utm_source: Directly copied
Column Lineage
%3 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history base_url destination_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report base_url destination_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f1 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f0 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f2 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f3 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f7 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f6 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f4 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f5 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f8 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f6->168. model.pinterest.pinterest_ads__url_report:f6 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp destination_url 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f2 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f3 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f7 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f6 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f4 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f5 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f8 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f2 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f3 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f7 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f6 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f4 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f5 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f8
185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history
  • Input Column: 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp[destination_url]
    • Direct The column is directly copied to the output
    • Featurization Used to extract various URL components and UTM parameters
    • Output Columns:
      • destination_url: Directly copied
      • base_url: Extracted from destination_url
      • url_host: Extracted from destination_url
      • url_path: Extracted from destination_url
      • utm_source: Extracted from destination_url
      • utm_medium: Extracted from destination_url
      • utm_campaign: Extracted from destination_url
      • utm_content: Extracted from destination_url
      • utm_term: Extracted from destination_url
  • Input Column: 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp[destination_url]
    • Direct The column is directly copied to the output
    • Featurization Used to extract various URL components and UTM parameters
    • Output Columns:
      • destination_url: Directly copied
      • base_url: Extracted from destination_url
      • url_host: Extracted from destination_url
      • url_path: Extracted from destination_url
      • utm_source: Extracted from destination_url
      • utm_medium: Extracted from destination_url
      • utm_campaign: Extracted from destination_url
      • utm_content: Extracted from destination_url
      • utm_term: Extracted from destination_url
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history[destination_url]
    • Direct Directly copied to the output
    • Filtering Used in the WHERE clause to filter out null values
    • Featurization Base for extracting URL components and UTM parameters
    • Output Columns:
      • destination_url: Directly copied to the output
      • base_url: Extracted from this column
      • url_host: Extracted from this column
      • url_path: Extracted from this column
      • utm_source: Extracted from this column
      • utm_medium: Extracted from this column
      • utm_campaign: Extracted from this column
      • utm_content: Extracted from this column
      • utm_term: Extracted from this column
  • Input Column: 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history[utm_medium]
    • Direct This column is directly copied to the output without transformation.
    • Output Columns:
      • utm_medium: Directly copied
Column Lineage
%3 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history base_url destination_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report base_url destination_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f1 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f0 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f2 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f3 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f7 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f6 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f4 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f5 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f8 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f4->168. model.pinterest.pinterest_ads__url_report:f4 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp destination_url 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f2 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f3 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f7 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f6 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f4 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f5 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f8 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f2 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f3 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f7 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f6 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f4 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f5 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f8
185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history
  • Input Column: 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp[destination_url]
    • Direct The column is directly copied to the output
    • Featurization Used to extract various URL components and UTM parameters
    • Output Columns:
      • destination_url: Directly copied
      • base_url: Extracted from destination_url
      • url_host: Extracted from destination_url
      • url_path: Extracted from destination_url
      • utm_source: Extracted from destination_url
      • utm_medium: Extracted from destination_url
      • utm_campaign: Extracted from destination_url
      • utm_content: Extracted from destination_url
      • utm_term: Extracted from destination_url
  • Input Column: 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp[destination_url]
    • Direct The column is directly copied to the output
    • Featurization Used to extract various URL components and UTM parameters
    • Output Columns:
      • destination_url: Directly copied
      • base_url: Extracted from destination_url
      • url_host: Extracted from destination_url
      • url_path: Extracted from destination_url
      • utm_source: Extracted from destination_url
      • utm_medium: Extracted from destination_url
      • utm_campaign: Extracted from destination_url
      • utm_content: Extracted from destination_url
      • utm_term: Extracted from destination_url
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history[destination_url]
    • Direct Directly copied to the output
    • Filtering Used in the WHERE clause to filter out null values
    • Featurization Base for extracting URL components and UTM parameters
    • Output Columns:
      • destination_url: Directly copied to the output
      • base_url: Extracted from this column
      • url_host: Extracted from this column
      • url_path: Extracted from this column
      • utm_source: Extracted from this column
      • utm_medium: Extracted from this column
      • utm_campaign: Extracted from this column
      • utm_content: Extracted from this column
      • utm_term: Extracted from this column
  • Input Column: 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history[utm_campaign]
    • Direct This column is directly copied to the output without transformation.
    • Output Columns:
      • utm_campaign: Directly copied
Column Lineage
%3 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history base_url destination_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report base_url destination_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f1 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f0 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f2 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f3 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f7 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f6 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f4 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f5 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f8 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f5->168. model.pinterest.pinterest_ads__url_report:f5 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp destination_url 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f2 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f3 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f7 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f6 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f4 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f5 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f8 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f2 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f3 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f7 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f6 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f4 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f5 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f8
185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history
  • Input Column: 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp[destination_url]
    • Direct The column is directly copied to the output
    • Featurization Used to extract various URL components and UTM parameters
    • Output Columns:
      • destination_url: Directly copied
      • base_url: Extracted from destination_url
      • url_host: Extracted from destination_url
      • url_path: Extracted from destination_url
      • utm_source: Extracted from destination_url
      • utm_medium: Extracted from destination_url
      • utm_campaign: Extracted from destination_url
      • utm_content: Extracted from destination_url
      • utm_term: Extracted from destination_url
  • Input Column: 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp[destination_url]
    • Direct The column is directly copied to the output
    • Featurization Used to extract various URL components and UTM parameters
    • Output Columns:
      • destination_url: Directly copied
      • base_url: Extracted from destination_url
      • url_host: Extracted from destination_url
      • url_path: Extracted from destination_url
      • utm_source: Extracted from destination_url
      • utm_medium: Extracted from destination_url
      • utm_campaign: Extracted from destination_url
      • utm_content: Extracted from destination_url
      • utm_term: Extracted from destination_url
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history[destination_url]
    • Direct Directly copied to the output
    • Filtering Used in the WHERE clause to filter out null values
    • Featurization Base for extracting URL components and UTM parameters
    • Output Columns:
      • destination_url: Directly copied to the output
      • base_url: Extracted from this column
      • url_host: Extracted from this column
      • url_path: Extracted from this column
      • utm_source: Extracted from this column
      • utm_medium: Extracted from this column
      • utm_campaign: Extracted from this column
      • utm_content: Extracted from this column
      • utm_term: Extracted from this column
  • Input Column: 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history[utm_content]
    • Direct This column is directly copied to the output without transformation.
    • Output Columns:
      • utm_content: Directly copied
Column Lineage
%3 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history base_url destination_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report base_url destination_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f1 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f0 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f2 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f3 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f7 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f6 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f4 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f5 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f8 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f8->168. model.pinterest.pinterest_ads__url_report:f8 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp destination_url 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f2 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f3 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f7 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f6 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f4 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f5 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f8 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f2 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f3 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f7 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f6 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f4 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f5 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f8
185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history
  • Input Column: 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp[destination_url]
    • Direct The column is directly copied to the output
    • Featurization Used to extract various URL components and UTM parameters
    • Output Columns:
      • destination_url: Directly copied
      • base_url: Extracted from destination_url
      • url_host: Extracted from destination_url
      • url_path: Extracted from destination_url
      • utm_source: Extracted from destination_url
      • utm_medium: Extracted from destination_url
      • utm_campaign: Extracted from destination_url
      • utm_content: Extracted from destination_url
      • utm_term: Extracted from destination_url
  • Input Column: 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp[destination_url]
    • Direct The column is directly copied to the output
    • Featurization Used to extract various URL components and UTM parameters
    • Output Columns:
      • destination_url: Directly copied
      • base_url: Extracted from destination_url
      • url_host: Extracted from destination_url
      • url_path: Extracted from destination_url
      • utm_source: Extracted from destination_url
      • utm_medium: Extracted from destination_url
      • utm_campaign: Extracted from destination_url
      • utm_content: Extracted from destination_url
      • utm_term: Extracted from destination_url
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history[destination_url]
    • Direct Directly copied to the output
    • Filtering Used in the WHERE clause to filter out null values
    • Featurization Base for extracting URL components and UTM parameters
    • Output Columns:
      • destination_url: Directly copied to the output
      • base_url: Extracted from this column
      • url_host: Extracted from this column
      • url_path: Extracted from this column
      • utm_source: Extracted from this column
      • utm_medium: Extracted from this column
      • utm_campaign: Extracted from this column
      • utm_content: Extracted from this column
      • utm_term: Extracted from this column
  • Input Column: 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history[utm_term]
    • Direct This column is directly copied to the output without transformation.
    • Output Columns:
      • utm_term: Directly copied
Column Lineage
%3 177. model.pinterest_source.stg_pinterest_ads__campaign_history 177. model.pinterest_source.stg_pinterest_ads__campaign_history campaign_id 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report campaign_id 177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0->168. model.pinterest.pinterest_ads__url_report:f0 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report campaign_id 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0->168. model.pinterest.pinterest_ads__url_report:f0 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp id 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp:f0->177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp campaign_id 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp:f0->187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0
177. model.pinterest_source.stg_pinterest_ads__campaign_history
  • Input Column: 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp[id]
    • Direct The column is directly copied without transformation
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • campaign_id: Directly mapped to this output column
187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report
  • Input Column: 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp[campaign_id]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • campaign_id: Directly copied
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 177. model.pinterest_source.stg_pinterest_ads__campaign_history[campaign_id]
    • Integration used as the key to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
  • Input Column: 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report[campaign_id]
    • Integration Used as the key to join with the campaigns table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • campaign_id: Directly copied to the output
Column Lineage
%3 177. model.pinterest_source.stg_pinterest_ads__campaign_history 177. model.pinterest_source.stg_pinterest_ads__campaign_history campaign_name 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report campaign_name 177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0->168. model.pinterest.pinterest_ads__url_report:f0 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp name 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp:f0->177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0
177. model.pinterest_source.stg_pinterest_ads__campaign_history
  • Input Column: 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • campaign_name: Directly mapped to this output column
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 177. model.pinterest_source.stg_pinterest_ads__campaign_history[campaign_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_name: directly copied
Column Lineage
%3 169. model.pinterest_source.stg_pinterest_ads__ad_group_history 169. model.pinterest_source.stg_pinterest_ads__ad_group_history ad_group_id 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report ad_group_id 169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0->168. model.pinterest.pinterest_ads__url_report:f0 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report ad_group_id 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0->168. model.pinterest.pinterest_ads__url_report:f0 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp id 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp:f0->169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp ad_group_id 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp:f0->187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0
169. model.pinterest_source.stg_pinterest_ads__ad_group_history
  • Input Column: 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp[id]
    • Direct The column is directly copied without transformation
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • ad_group_id: Directly mapped
187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report
  • Input Column: 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp[ad_group_id]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • ad_group_id: Directly copied
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 169. model.pinterest_source.stg_pinterest_ads__ad_group_history[ad_group_id]
    • Integration used as the key to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_id: directly copied
  • Input Column: 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report[ad_group_id]
    • Integration Used as the key to join with the ad_groups table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • ad_group_id: Directly copied to the output
Column Lineage
%3 169. model.pinterest_source.stg_pinterest_ads__ad_group_history 169. model.pinterest_source.stg_pinterest_ads__ad_group_history ad_group_name 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report ad_group_name 169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0->168. model.pinterest.pinterest_ads__url_report:f0 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp name 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp:f0->169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0
169. model.pinterest_source.stg_pinterest_ads__ad_group_history
  • Input Column: 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • ad_group_name: Directly mapped
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 169. model.pinterest_source.stg_pinterest_ads__ad_group_history[ad_group_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_name: directly copied
Column Lineage
%3 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report impressions 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report impressions 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0->168. model.pinterest.pinterest_ads__url_report:f0 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp impression_1 impression_2 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp:f0->187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp:f1->187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0
187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report
  • Input Column: 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp[impression_1]
    • Aggregation Combined with impression_2 using COALESCE and addition
    • Output Columns:
      • impressions: Combined with impression_2
  • Input Column: 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp[impression_2]
    • Aggregation Combined with impression_1 using COALESCE and addition
    • Output Columns:
      • impressions: Combined with impression_1
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report[impressions]
    • Aggregation Summed up in the SELECT clause
    • Output Columns:
      • impressions: Aggregated sum in the output
Column Lineage
%3 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report clicks 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report clicks 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0->168. model.pinterest.pinterest_ads__url_report:f0 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp clickthrough_1 clickthrough_2 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp:f0->187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp:f1->187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0
187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report
  • Input Column: 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp[clickthrough_1]
    • Aggregation Combined with clickthrough_2 using COALESCE and addition
    • Output Columns:
      • clicks: Combined with clickthrough_2
  • Input Column: 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp[clickthrough_2]
    • Aggregation Combined with clickthrough_1 using COALESCE and addition
    • Output Columns:
      • clicks: Combined with clickthrough_1
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report[clicks]
    • Aggregation Summed up in the SELECT clause
    • Output Columns:
      • clicks: Aggregated sum in the output
Column Lineage
%3 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report spend 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report spend 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0->168. model.pinterest.pinterest_ads__url_report:f0 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp spend_in_micro_dollar 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp:f0->187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0
187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report
  • Input Column: 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp[spend_in_micro_dollar]
    • Cleaning The column is cleaned by casting it to DECIMAL(28, 6) and then divided by 1,000,000 to convert micro-dollars to dollars.
    • Output Columns:
      • spend: The column is transformed by dividing it by 1,000,000 to convert micro-dollars to dollars, and the result is mapped to the 'spend' output column.
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report[spend]
    • Aggregation Summed up in the SELECT clause
    • Output Columns:
      • spend: Aggregated sum in the output
169. model.pinterest_source.stg_pinterest_ads__ad_group_history

This SQL query performs a series of transformations on data from the 'pinterest_source.stg_pinterest_ads__ad_group_history' table. It starts by casting columns to specific data types, renames some columns, and adds a 'source_relation' column. The query then selects and reorganizes these fields, adding a 'is_most_recent_record' flag based on the most recent '_fivetran_synced' timestamp for each unique combination of 'source_relation' and 'id'.

CleaningDeduplicationOther
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_pinterest_source.stg_pinterest_ads__ad_group_history_tmp
), fields AS (
  SELECT
    CAST(NULL AS TIMESTAMP) AS _fivetran_synced,
    CAST(NULL AS TEXT) AS campaign_id,
    CAST(NULL AS TIMESTAMP) AS created_time,
    CAST(NULL AS TIMESTAMP) AS end_time,
    CAST(NULL AS TEXT) AS id,
    CAST(NULL AS TEXT) AS ad_account_id,
    CAST(NULL AS TEXT) AS name,
    CAST(NULL AS TEXT) AS pacing_delivery_type,
    CAST(NULL AS TEXT) AS placement_group,
    CAST(NULL AS TIMESTAMP) AS start_time,
    CAST(NULL AS TEXT) AS status,
    CAST(NULL AS TEXT) AS summary_status,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    id AS ad_group_id,
    name AS ad_group_name,
    status AS ad_group_status,
    ad_account_id AS advertiser_id,
    _fivetran_synced,
    campaign_id,
    created_time AS created_at,
    end_time,
    pacing_delivery_type,
    placement_group,
    start_time,
    summary_status,
    ROW_NUMBER() OVER (PARTITION BY source_relation, id ORDER BY _fivetran_synced DESC) = 1 AS is_most_recent_record
  FROM fields
)
SELECT
  *
FROM final
%3 169. model.pinterest_source.stg_pinterest_ads__ad_group_history 169. model.pinterest_source.stg_pinterest_ads__ad_group_history source_relation ad_group_id campaign_id created_at ad_group_name ad_group_status advertiser_id start_time end_time pacing_delivery_type placement_group summary_status _fivetran_synced is_most_recent_record 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp id campaign_id created_time name status start_time end_time _fivetran_synced pacing_delivery_type placement_group summary_status ad_account_id 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp:f0->169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f1 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp:f1->169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f2 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp:f2->169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f3 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp:f3->169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f4 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp:f4->169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f5 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp:f5->169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f7 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp:f6->169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f8 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp:f7->169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f12 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp:f8->169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f9 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp:f9->169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f10 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp:f10->169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f11 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp:f11->169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f6
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
ad_group_id bigint Ad group ID.
campaign_id bigint Parent Campaign ID.
created_at text Ad group creation time.
ad_group_name text Ad group name.
ad_group_status text The status of the Ad group. One of "ACTIVE", "ARCHIVED", "PAUSED"
advertiser_id bigint The ID of the related Advertiser.
start_time text Ad group start time.
end_time integer Ad group end time.
pacing_delivery_type text Ad group pacing delivery type. With ACCELERATED, an ad group budget is spent as fast as possible. With STANDARD, an ad group budget is spent smoothly over a day. When using CBO, only the STANDARD pacing delivery type is allowed.
placement_group text The placement group. "ALL", "SEARCH", "BROWSE", or "OTHER"
summary_status text Summary status. "RUNNING", "PAUSED", "NOT_STARTED", "COMPLETED", "ADVERTISER_DISABLED", "ARCHIVED"
_fivetran_synced text Timestamp of when a record was last synced.
is_most_recent_record boolean Boolean representing whether the record is the most recent version of the object.
Column Lineage
%3 169. model.pinterest_source.stg_pinterest_ads__ad_group_history 169. model.pinterest_source.stg_pinterest_ads__ad_group_history source_relation 167. model.pinterest.pinterest_ads__pin_promotion_report 167. model.pinterest.pinterest_ads__pin_promotion_report source_relation 169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0->167. model.pinterest.pinterest_ads__pin_promotion_report:f0 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report source_relation 169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0->168. model.pinterest.pinterest_ads__url_report:f0 166. model.pinterest.pinterest_ads__keyword_report 166. model.pinterest.pinterest_ads__keyword_report source_relation 169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0->166. model.pinterest.pinterest_ads__keyword_report:f0 163. model.pinterest.pinterest_ads__ad_group_report 163. model.pinterest.pinterest_ads__ad_group_report source_relation 169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0->163. model.pinterest.pinterest_ads__ad_group_report:f0
163. model.pinterest.pinterest_ads__ad_group_report
  • Input Column: 169. model.pinterest_source.stg_pinterest_ads__ad_group_history[source_relation]
    • Integration used as a key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
166. model.pinterest.pinterest_ads__keyword_report
  • Input Column: 169. model.pinterest_source.stg_pinterest_ads__ad_group_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
167. model.pinterest.pinterest_ads__pin_promotion_report
  • Input Column: 169. model.pinterest_source.stg_pinterest_ads__ad_group_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 169. model.pinterest_source.stg_pinterest_ads__ad_group_history[source_relation]
    • Integration used as part of the join condition with the report table
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
Column Lineage
%3 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp id 169. model.pinterest_source.stg_pinterest_ads__ad_group_history 169. model.pinterest_source.stg_pinterest_ads__ad_group_history ad_group_id 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp:f0->169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0 167. model.pinterest.pinterest_ads__pin_promotion_report 167. model.pinterest.pinterest_ads__pin_promotion_report ad_group_id 169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0->167. model.pinterest.pinterest_ads__pin_promotion_report:f0 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report ad_group_id 169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0->168. model.pinterest.pinterest_ads__url_report:f0 166. model.pinterest.pinterest_ads__keyword_report 166. model.pinterest.pinterest_ads__keyword_report ad_group_id 169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0->166. model.pinterest.pinterest_ads__keyword_report:f0 163. model.pinterest.pinterest_ads__ad_group_report 163. model.pinterest.pinterest_ads__ad_group_report ad_group_id 169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0->163. model.pinterest.pinterest_ads__ad_group_report:f0
169. model.pinterest_source.stg_pinterest_ads__ad_group_history
  • Input Column: 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp[id]
    • Direct The column is directly copied without transformation
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • ad_group_id: Directly mapped
163. model.pinterest.pinterest_ads__ad_group_report
  • Input Column: 169. model.pinterest_source.stg_pinterest_ads__ad_group_history[ad_group_id]
    • Integration used as a key to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_id: directly copied
166. model.pinterest.pinterest_ads__keyword_report
  • Input Column: 169. model.pinterest_source.stg_pinterest_ads__ad_group_history[ad_group_id]
    • Integration used as the key to join with the keywords table
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_id: directly copied
167. model.pinterest.pinterest_ads__pin_promotion_report
  • Input Column: 169. model.pinterest_source.stg_pinterest_ads__ad_group_history[ad_group_id]
    • Integration used as the key to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_id: directly copied
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 169. model.pinterest_source.stg_pinterest_ads__ad_group_history[ad_group_id]
    • Integration used as the key to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_id: directly copied
Column Lineage
%3 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp campaign_id 169. model.pinterest_source.stg_pinterest_ads__ad_group_history 169. model.pinterest_source.stg_pinterest_ads__ad_group_history campaign_id 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp:f0->169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0
169. model.pinterest_source.stg_pinterest_ads__ad_group_history
  • Input Column: 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp[campaign_id]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • campaign_id: Directly mapped
Column Lineage
%3 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp created_time 169. model.pinterest_source.stg_pinterest_ads__ad_group_history 169. model.pinterest_source.stg_pinterest_ads__ad_group_history created_at 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp:f0->169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0 163. model.pinterest.pinterest_ads__ad_group_report 163. model.pinterest.pinterest_ads__ad_group_report created_at 169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0->163. model.pinterest.pinterest_ads__ad_group_report:f0
169. model.pinterest_source.stg_pinterest_ads__ad_group_history
  • Input Column: 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp[created_time]
    • Direct The column is directly copied without transformation
    • Cleaning Cast to TIMESTAMP type
    • Output Columns:
      • created_at: Directly mapped after casting
163. model.pinterest.pinterest_ads__ad_group_report
  • Input Column: 169. model.pinterest_source.stg_pinterest_ads__ad_group_history[created_at]
    • Direct directly copied to the output
    • Output Columns:
      • created_at: directly copied
Column Lineage
%3 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp name 169. model.pinterest_source.stg_pinterest_ads__ad_group_history 169. model.pinterest_source.stg_pinterest_ads__ad_group_history ad_group_name 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp:f0->169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0 167. model.pinterest.pinterest_ads__pin_promotion_report 167. model.pinterest.pinterest_ads__pin_promotion_report ad_group_name 169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0->167. model.pinterest.pinterest_ads__pin_promotion_report:f0 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report ad_group_name 169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0->168. model.pinterest.pinterest_ads__url_report:f0 166. model.pinterest.pinterest_ads__keyword_report 166. model.pinterest.pinterest_ads__keyword_report ad_group_name 169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0->166. model.pinterest.pinterest_ads__keyword_report:f0 163. model.pinterest.pinterest_ads__ad_group_report 163. model.pinterest.pinterest_ads__ad_group_report ad_group_name 169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0->163. model.pinterest.pinterest_ads__ad_group_report:f0
169. model.pinterest_source.stg_pinterest_ads__ad_group_history
  • Input Column: 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • ad_group_name: Directly mapped
163. model.pinterest.pinterest_ads__ad_group_report
  • Input Column: 169. model.pinterest_source.stg_pinterest_ads__ad_group_history[ad_group_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_name: directly copied
166. model.pinterest.pinterest_ads__keyword_report
  • Input Column: 169. model.pinterest_source.stg_pinterest_ads__ad_group_history[ad_group_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_name: directly copied
167. model.pinterest.pinterest_ads__pin_promotion_report
  • Input Column: 169. model.pinterest_source.stg_pinterest_ads__ad_group_history[ad_group_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_name: directly copied
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 169. model.pinterest_source.stg_pinterest_ads__ad_group_history[ad_group_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_name: directly copied
Column Lineage
%3 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp status 169. model.pinterest_source.stg_pinterest_ads__ad_group_history 169. model.pinterest_source.stg_pinterest_ads__ad_group_history ad_group_status 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp:f0->169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0 167. model.pinterest.pinterest_ads__pin_promotion_report 167. model.pinterest.pinterest_ads__pin_promotion_report ad_group_status 169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0->167. model.pinterest.pinterest_ads__pin_promotion_report:f0 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report ad_group_status 169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0->168. model.pinterest.pinterest_ads__url_report:f0 163. model.pinterest.pinterest_ads__ad_group_report 163. model.pinterest.pinterest_ads__ad_group_report ad_group_status 169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0->163. model.pinterest.pinterest_ads__ad_group_report:f0
169. model.pinterest_source.stg_pinterest_ads__ad_group_history
  • Input Column: 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp[status]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • ad_group_status: Directly mapped
163. model.pinterest.pinterest_ads__ad_group_report
  • Input Column: 169. model.pinterest_source.stg_pinterest_ads__ad_group_history[ad_group_status]
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_status: directly copied
167. model.pinterest.pinterest_ads__pin_promotion_report
  • Input Column: 169. model.pinterest_source.stg_pinterest_ads__ad_group_history[ad_group_status]
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_status: directly copied
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 169. model.pinterest_source.stg_pinterest_ads__ad_group_history[ad_group_status]
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_status: directly copied
Column Lineage
%3 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp ad_account_id 169. model.pinterest_source.stg_pinterest_ads__ad_group_history 169. model.pinterest_source.stg_pinterest_ads__ad_group_history advertiser_id 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp:f0->169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0
169. model.pinterest_source.stg_pinterest_ads__ad_group_history
  • Input Column: 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp[ad_account_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the 'fields' CTE
    • Output Columns:
      • advertiser_id: Renamed from 'ad_account_id' to 'advertiser_id' in the final SELECT statement
Column Lineage
%3 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp start_time 169. model.pinterest_source.stg_pinterest_ads__ad_group_history 169. model.pinterest_source.stg_pinterest_ads__ad_group_history start_time 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp:f0->169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0 163. model.pinterest.pinterest_ads__ad_group_report 163. model.pinterest.pinterest_ads__ad_group_report start_time 169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0->163. model.pinterest.pinterest_ads__ad_group_report:f0
169. model.pinterest_source.stg_pinterest_ads__ad_group_history
  • Input Column: 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp[start_time]
    • Direct The column is directly copied without transformation
    • Cleaning Cast to TIMESTAMP type
    • Output Columns:
      • start_time: Directly mapped after casting
163. model.pinterest.pinterest_ads__ad_group_report
  • Input Column: 169. model.pinterest_source.stg_pinterest_ads__ad_group_history[start_time]
    • Direct directly copied to the output
    • Output Columns:
      • start_time: directly copied
Column Lineage
%3 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp end_time 169. model.pinterest_source.stg_pinterest_ads__ad_group_history 169. model.pinterest_source.stg_pinterest_ads__ad_group_history end_time 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp:f0->169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0 163. model.pinterest.pinterest_ads__ad_group_report 163. model.pinterest.pinterest_ads__ad_group_report end_time 169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0->163. model.pinterest.pinterest_ads__ad_group_report:f0
169. model.pinterest_source.stg_pinterest_ads__ad_group_history
  • Input Column: 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp[end_time]
    • Direct The column is directly copied without transformation
    • Cleaning Cast to TIMESTAMP type
    • Output Columns:
      • end_time: Directly mapped after casting
163. model.pinterest.pinterest_ads__ad_group_report
  • Input Column: 169. model.pinterest_source.stg_pinterest_ads__ad_group_history[end_time]
    • Direct directly copied to the output
    • Output Columns:
      • end_time: directly copied
Column Lineage
%3 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp pacing_delivery_type 169. model.pinterest_source.stg_pinterest_ads__ad_group_history 169. model.pinterest_source.stg_pinterest_ads__ad_group_history pacing_delivery_type 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp:f0->169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0
169. model.pinterest_source.stg_pinterest_ads__ad_group_history
  • Input Column: 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp[pacing_delivery_type]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • pacing_delivery_type: Directly mapped
Column Lineage
%3 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp placement_group 169. model.pinterest_source.stg_pinterest_ads__ad_group_history 169. model.pinterest_source.stg_pinterest_ads__ad_group_history placement_group 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp:f0->169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0
169. model.pinterest_source.stg_pinterest_ads__ad_group_history
  • Input Column: 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp[placement_group]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • placement_group: Directly mapped
Column Lineage
%3 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp summary_status 169. model.pinterest_source.stg_pinterest_ads__ad_group_history 169. model.pinterest_source.stg_pinterest_ads__ad_group_history summary_status 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp:f0->169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0
169. model.pinterest_source.stg_pinterest_ads__ad_group_history
  • Input Column: 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp[summary_status]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the 'fields' CTE
    • Output Columns:
      • summary_status: Directly mapped to the output column of the same name
Column Lineage
%3 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp _fivetran_synced 169. model.pinterest_source.stg_pinterest_ads__ad_group_history 169. model.pinterest_source.stg_pinterest_ads__ad_group_history _fivetran_synced 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp:f0->169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0
169. model.pinterest_source.stg_pinterest_ads__ad_group_history
  • Input Column: 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp[_fivetran_synced]
    • Direct The column is directly copied without transformation
    • Cleaning Cast to TIMESTAMP type
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • _fivetran_synced: Directly mapped after casting
170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of type TEXT. It's likely used as a placeholder or template for further development or testing purposes.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp id campaign_id created_time name status start_time end_time _fivetran_synced pacing_delivery_type placement_group summary_status ad_account_id 333. source.pinterest_source.pinterest_ads.ad_group_history 333. source.pinterest_source.pinterest_ads.ad_group_history
Name Type Comment
id bigint None
campaign_id bigint None
created_time text None
name text None
status text None
start_time text None
end_time integer None
_fivetran_synced text None
pacing_delivery_type text None
placement_group text None
summary_status text None
ad_account_id bigint None
Column Lineage
%3 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp id 169. model.pinterest_source.stg_pinterest_ads__ad_group_history 169. model.pinterest_source.stg_pinterest_ads__ad_group_history ad_group_id 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp:f0->169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0 167. model.pinterest.pinterest_ads__pin_promotion_report 167. model.pinterest.pinterest_ads__pin_promotion_report ad_group_id 169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0->167. model.pinterest.pinterest_ads__pin_promotion_report:f0 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report ad_group_id 169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0->168. model.pinterest.pinterest_ads__url_report:f0 166. model.pinterest.pinterest_ads__keyword_report 166. model.pinterest.pinterest_ads__keyword_report ad_group_id 169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0->166. model.pinterest.pinterest_ads__keyword_report:f0 163. model.pinterest.pinterest_ads__ad_group_report 163. model.pinterest.pinterest_ads__ad_group_report ad_group_id 169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0->163. model.pinterest.pinterest_ads__ad_group_report:f0
169. model.pinterest_source.stg_pinterest_ads__ad_group_history
  • Input Column: 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp[id]
    • Direct The column is directly copied without transformation
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • ad_group_id: Directly mapped
163. model.pinterest.pinterest_ads__ad_group_report
  • Input Column: 169. model.pinterest_source.stg_pinterest_ads__ad_group_history[ad_group_id]
    • Integration used as a key to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_id: directly copied
166. model.pinterest.pinterest_ads__keyword_report
  • Input Column: 169. model.pinterest_source.stg_pinterest_ads__ad_group_history[ad_group_id]
    • Integration used as the key to join with the keywords table
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_id: directly copied
167. model.pinterest.pinterest_ads__pin_promotion_report
  • Input Column: 169. model.pinterest_source.stg_pinterest_ads__ad_group_history[ad_group_id]
    • Integration used as the key to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_id: directly copied
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 169. model.pinterest_source.stg_pinterest_ads__ad_group_history[ad_group_id]
    • Integration used as the key to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_id: directly copied
Column Lineage
%3 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp campaign_id 169. model.pinterest_source.stg_pinterest_ads__ad_group_history 169. model.pinterest_source.stg_pinterest_ads__ad_group_history campaign_id 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp:f0->169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0
169. model.pinterest_source.stg_pinterest_ads__ad_group_history
  • Input Column: 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp[campaign_id]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • campaign_id: Directly mapped
Column Lineage
%3 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp created_time 169. model.pinterest_source.stg_pinterest_ads__ad_group_history 169. model.pinterest_source.stg_pinterest_ads__ad_group_history created_at 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp:f0->169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0 163. model.pinterest.pinterest_ads__ad_group_report 163. model.pinterest.pinterest_ads__ad_group_report created_at 169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0->163. model.pinterest.pinterest_ads__ad_group_report:f0
169. model.pinterest_source.stg_pinterest_ads__ad_group_history
  • Input Column: 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp[created_time]
    • Direct The column is directly copied without transformation
    • Cleaning Cast to TIMESTAMP type
    • Output Columns:
      • created_at: Directly mapped after casting
163. model.pinterest.pinterest_ads__ad_group_report
  • Input Column: 169. model.pinterest_source.stg_pinterest_ads__ad_group_history[created_at]
    • Direct directly copied to the output
    • Output Columns:
      • created_at: directly copied
Column Lineage
%3 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp name 169. model.pinterest_source.stg_pinterest_ads__ad_group_history 169. model.pinterest_source.stg_pinterest_ads__ad_group_history ad_group_name 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp:f0->169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0 167. model.pinterest.pinterest_ads__pin_promotion_report 167. model.pinterest.pinterest_ads__pin_promotion_report ad_group_name 169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0->167. model.pinterest.pinterest_ads__pin_promotion_report:f0 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report ad_group_name 169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0->168. model.pinterest.pinterest_ads__url_report:f0 166. model.pinterest.pinterest_ads__keyword_report 166. model.pinterest.pinterest_ads__keyword_report ad_group_name 169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0->166. model.pinterest.pinterest_ads__keyword_report:f0 163. model.pinterest.pinterest_ads__ad_group_report 163. model.pinterest.pinterest_ads__ad_group_report ad_group_name 169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0->163. model.pinterest.pinterest_ads__ad_group_report:f0
169. model.pinterest_source.stg_pinterest_ads__ad_group_history
  • Input Column: 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • ad_group_name: Directly mapped
163. model.pinterest.pinterest_ads__ad_group_report
  • Input Column: 169. model.pinterest_source.stg_pinterest_ads__ad_group_history[ad_group_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_name: directly copied
166. model.pinterest.pinterest_ads__keyword_report
  • Input Column: 169. model.pinterest_source.stg_pinterest_ads__ad_group_history[ad_group_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_name: directly copied
167. model.pinterest.pinterest_ads__pin_promotion_report
  • Input Column: 169. model.pinterest_source.stg_pinterest_ads__ad_group_history[ad_group_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_name: directly copied
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 169. model.pinterest_source.stg_pinterest_ads__ad_group_history[ad_group_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_name: directly copied
Column Lineage
%3 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp status 169. model.pinterest_source.stg_pinterest_ads__ad_group_history 169. model.pinterest_source.stg_pinterest_ads__ad_group_history ad_group_status 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp:f0->169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0 167. model.pinterest.pinterest_ads__pin_promotion_report 167. model.pinterest.pinterest_ads__pin_promotion_report ad_group_status 169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0->167. model.pinterest.pinterest_ads__pin_promotion_report:f0 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report ad_group_status 169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0->168. model.pinterest.pinterest_ads__url_report:f0 163. model.pinterest.pinterest_ads__ad_group_report 163. model.pinterest.pinterest_ads__ad_group_report ad_group_status 169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0->163. model.pinterest.pinterest_ads__ad_group_report:f0
169. model.pinterest_source.stg_pinterest_ads__ad_group_history
  • Input Column: 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp[status]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • ad_group_status: Directly mapped
163. model.pinterest.pinterest_ads__ad_group_report
  • Input Column: 169. model.pinterest_source.stg_pinterest_ads__ad_group_history[ad_group_status]
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_status: directly copied
167. model.pinterest.pinterest_ads__pin_promotion_report
  • Input Column: 169. model.pinterest_source.stg_pinterest_ads__ad_group_history[ad_group_status]
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_status: directly copied
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 169. model.pinterest_source.stg_pinterest_ads__ad_group_history[ad_group_status]
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_status: directly copied
Column Lineage
%3 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp start_time 169. model.pinterest_source.stg_pinterest_ads__ad_group_history 169. model.pinterest_source.stg_pinterest_ads__ad_group_history start_time 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp:f0->169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0 163. model.pinterest.pinterest_ads__ad_group_report 163. model.pinterest.pinterest_ads__ad_group_report start_time 169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0->163. model.pinterest.pinterest_ads__ad_group_report:f0
169. model.pinterest_source.stg_pinterest_ads__ad_group_history
  • Input Column: 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp[start_time]
    • Direct The column is directly copied without transformation
    • Cleaning Cast to TIMESTAMP type
    • Output Columns:
      • start_time: Directly mapped after casting
163. model.pinterest.pinterest_ads__ad_group_report
  • Input Column: 169. model.pinterest_source.stg_pinterest_ads__ad_group_history[start_time]
    • Direct directly copied to the output
    • Output Columns:
      • start_time: directly copied
Column Lineage
%3 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp end_time 169. model.pinterest_source.stg_pinterest_ads__ad_group_history 169. model.pinterest_source.stg_pinterest_ads__ad_group_history end_time 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp:f0->169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0 163. model.pinterest.pinterest_ads__ad_group_report 163. model.pinterest.pinterest_ads__ad_group_report end_time 169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0->163. model.pinterest.pinterest_ads__ad_group_report:f0
169. model.pinterest_source.stg_pinterest_ads__ad_group_history
  • Input Column: 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp[end_time]
    • Direct The column is directly copied without transformation
    • Cleaning Cast to TIMESTAMP type
    • Output Columns:
      • end_time: Directly mapped after casting
163. model.pinterest.pinterest_ads__ad_group_report
  • Input Column: 169. model.pinterest_source.stg_pinterest_ads__ad_group_history[end_time]
    • Direct directly copied to the output
    • Output Columns:
      • end_time: directly copied
Column Lineage
%3 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp _fivetran_synced 169. model.pinterest_source.stg_pinterest_ads__ad_group_history 169. model.pinterest_source.stg_pinterest_ads__ad_group_history _fivetran_synced 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp:f0->169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0
169. model.pinterest_source.stg_pinterest_ads__ad_group_history
  • Input Column: 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp[_fivetran_synced]
    • Direct The column is directly copied without transformation
    • Cleaning Cast to TIMESTAMP type
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • _fivetran_synced: Directly mapped after casting
Column Lineage
%3 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp pacing_delivery_type 169. model.pinterest_source.stg_pinterest_ads__ad_group_history 169. model.pinterest_source.stg_pinterest_ads__ad_group_history pacing_delivery_type 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp:f0->169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0
169. model.pinterest_source.stg_pinterest_ads__ad_group_history
  • Input Column: 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp[pacing_delivery_type]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • pacing_delivery_type: Directly mapped
Column Lineage
%3 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp placement_group 169. model.pinterest_source.stg_pinterest_ads__ad_group_history 169. model.pinterest_source.stg_pinterest_ads__ad_group_history placement_group 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp:f0->169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0
169. model.pinterest_source.stg_pinterest_ads__ad_group_history
  • Input Column: 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp[placement_group]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • placement_group: Directly mapped
Column Lineage
%3 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp summary_status 169. model.pinterest_source.stg_pinterest_ads__ad_group_history 169. model.pinterest_source.stg_pinterest_ads__ad_group_history summary_status 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp:f0->169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0
169. model.pinterest_source.stg_pinterest_ads__ad_group_history
  • Input Column: 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp[summary_status]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the 'fields' CTE
    • Output Columns:
      • summary_status: Directly mapped to the output column of the same name
Column Lineage
%3 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp ad_account_id 169. model.pinterest_source.stg_pinterest_ads__ad_group_history 169. model.pinterest_source.stg_pinterest_ads__ad_group_history advertiser_id 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp:f0->169. model.pinterest_source.stg_pinterest_ads__ad_group_history:f0
169. model.pinterest_source.stg_pinterest_ads__ad_group_history
  • Input Column: 170. model.pinterest_source.stg_pinterest_ads__ad_group_history_tmp[ad_account_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the 'fields' CTE
    • Output Columns:
      • advertiser_id: Renamed from 'ad_account_id' to 'advertiser_id' in the final SELECT statement
171. model.pinterest_source.stg_pinterest_ads__ad_group_report

This SQL query transforms and cleans data from a Pinterest ads ad group report. It casts various fields to specific data types, combines impression and clickthrough data, calculates spend in dollars from micro-dollars, and truncates the date to day-level granularity. The query also adds a source_relation field and renames some columns for clarity.

CleaningFeaturization
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_pinterest_source.stg_pinterest_ads__ad_group_report_tmp
), fields AS (
  SELECT
    CAST(NULL AS TIMESTAMP) AS _fivetran_synced,
    CAST(NULL AS TEXT) AS ad_group_id,
    CAST(NULL AS TEXT) AS ad_group_name,
    CAST(NULL AS TEXT) AS ad_group_status,
    CAST(NULL AS TEXT) AS advertiser_id,
    CAST(NULL AS INT) AS campaign_id,
    CAST(NULL AS INT) AS clickthrough_1,
    CAST(NULL AS INT) AS clickthrough_2,
    CAST(NULL AS TIMESTAMP) AS date,
    CAST(NULL AS INT) AS impression_1,
    CAST(NULL AS INT) AS impression_2,
    CAST(NULL AS INT) AS spend_in_micro_dollar,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    DATE_TRUNC('DAY', date) AS date_day,
    ad_group_id,
    ad_group_name,
    ad_group_status,
    campaign_id,
    advertiser_id,
    COALESCE(impression_1, 0) + COALESCE(impression_2, 0) AS impressions,
    COALESCE(clickthrough_1, 0) + COALESCE(clickthrough_2, 0) AS clicks,
    spend_in_micro_dollar / 1000000.0 AS spend
  FROM fields
)
SELECT
  *
FROM final
%3 171. model.pinterest_source.stg_pinterest_ads__ad_group_report 171. model.pinterest_source.stg_pinterest_ads__ad_group_report source_relation date_day ad_group_id ad_group_name ad_group_status campaign_id advertiser_id impressions clicks spend 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp ad_group_id advertiser_id date ad_group_name ad_group_status campaign_id clickthrough_1 impression_1 spend_in_micro_dollar 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp:f0->171. model.pinterest_source.stg_pinterest_ads__ad_group_report:f2 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp:f1->171. model.pinterest_source.stg_pinterest_ads__ad_group_report:f6 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp:f2->171. model.pinterest_source.stg_pinterest_ads__ad_group_report:f1 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp:f3->171. model.pinterest_source.stg_pinterest_ads__ad_group_report:f3 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp:f4->171. model.pinterest_source.stg_pinterest_ads__ad_group_report:f4 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp:f5->171. model.pinterest_source.stg_pinterest_ads__ad_group_report:f5 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp:f6->171. model.pinterest_source.stg_pinterest_ads__ad_group_report:f8 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp:f7->171. model.pinterest_source.stg_pinterest_ads__ad_group_report:f7 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp:f8->171. model.pinterest_source.stg_pinterest_ads__ad_group_report:f9
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
date_day timestamp without time zone The date of the report.
ad_group_id bigint The ID representing the ad group, if present in the source data.
ad_group_name text Name of the ad group.
ad_group_status text Status of the ad group.
campaign_id bigint The ID representing the campaign, if present in the source data.
advertiser_id bigint The ID of the related Advertiser.
impressions integer The count of impressions.
clicks integer The count of clicks.
spend numeric The cost of the ads.
Column Lineage
%3 171. model.pinterest_source.stg_pinterest_ads__ad_group_report 171. model.pinterest_source.stg_pinterest_ads__ad_group_report source_relation 163. model.pinterest.pinterest_ads__ad_group_report 163. model.pinterest.pinterest_ads__ad_group_report source_relation 171. model.pinterest_source.stg_pinterest_ads__ad_group_report:f0->163. model.pinterest.pinterest_ads__ad_group_report:f0
163. model.pinterest.pinterest_ads__ad_group_report
  • Input Column: 171. model.pinterest_source.stg_pinterest_ads__ad_group_report[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with other tables
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
Column Lineage
%3 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp date 171. model.pinterest_source.stg_pinterest_ads__ad_group_report 171. model.pinterest_source.stg_pinterest_ads__ad_group_report date_day 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp:f0->171. model.pinterest_source.stg_pinterest_ads__ad_group_report:f0 163. model.pinterest.pinterest_ads__ad_group_report 163. model.pinterest.pinterest_ads__ad_group_report date_day 171. model.pinterest_source.stg_pinterest_ads__ad_group_report:f0->163. model.pinterest.pinterest_ads__ad_group_report:f0
171. model.pinterest_source.stg_pinterest_ads__ad_group_report
  • Input Column: 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp[date]
    • Cleaning The column is cast as TIMESTAMP in the fields CTE
    • Featurization The date is truncated to day-level granularity
    • Output Columns:
      • date_day: Transformed to day-level granularity using DATE_TRUNC
163. model.pinterest.pinterest_ads__ad_group_report
  • Input Column: 171. model.pinterest_source.stg_pinterest_ads__ad_group_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp ad_group_id 171. model.pinterest_source.stg_pinterest_ads__ad_group_report 171. model.pinterest_source.stg_pinterest_ads__ad_group_report ad_group_id 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp:f0->171. model.pinterest_source.stg_pinterest_ads__ad_group_report:f0 163. model.pinterest.pinterest_ads__ad_group_report 163. model.pinterest.pinterest_ads__ad_group_report ad_group_id 171. model.pinterest_source.stg_pinterest_ads__ad_group_report:f0->163. model.pinterest.pinterest_ads__ad_group_report:f0
171. model.pinterest_source.stg_pinterest_ads__ad_group_report
  • Input Column: 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp[ad_group_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • ad_group_id: Directly copied to the output
163. model.pinterest.pinterest_ads__ad_group_report
  • Input Column: 171. model.pinterest_source.stg_pinterest_ads__ad_group_report[ad_group_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as the key to join with the ad_groups table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • ad_group_id: Directly copied to the output
Column Lineage
%3 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp ad_group_name 171. model.pinterest_source.stg_pinterest_ads__ad_group_report 171. model.pinterest_source.stg_pinterest_ads__ad_group_report ad_group_name 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp:f0->171. model.pinterest_source.stg_pinterest_ads__ad_group_report:f0
171. model.pinterest_source.stg_pinterest_ads__ad_group_report
  • Input Column: 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp[ad_group_name]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • ad_group_name: Directly copied to the output
Column Lineage
%3 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp ad_group_status 171. model.pinterest_source.stg_pinterest_ads__ad_group_report 171. model.pinterest_source.stg_pinterest_ads__ad_group_report ad_group_status 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp:f0->171. model.pinterest_source.stg_pinterest_ads__ad_group_report:f0
171. model.pinterest_source.stg_pinterest_ads__ad_group_report
  • Input Column: 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp[ad_group_status]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • ad_group_status: Directly copied to the output
Column Lineage
%3 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp campaign_id 171. model.pinterest_source.stg_pinterest_ads__ad_group_report 171. model.pinterest_source.stg_pinterest_ads__ad_group_report campaign_id 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp:f0->171. model.pinterest_source.stg_pinterest_ads__ad_group_report:f0
171. model.pinterest_source.stg_pinterest_ads__ad_group_report
  • Input Column: 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp[campaign_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT in the fields CTE
    • Output Columns:
      • campaign_id: Directly copied to the output
Column Lineage
%3 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp advertiser_id 171. model.pinterest_source.stg_pinterest_ads__ad_group_report 171. model.pinterest_source.stg_pinterest_ads__ad_group_report advertiser_id 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp:f0->171. model.pinterest_source.stg_pinterest_ads__ad_group_report:f0
171. model.pinterest_source.stg_pinterest_ads__ad_group_report
  • Input Column: 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp[advertiser_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • advertiser_id: Directly copied to the output
Column Lineage
%3 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp impression_1 171. model.pinterest_source.stg_pinterest_ads__ad_group_report 171. model.pinterest_source.stg_pinterest_ads__ad_group_report impressions 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp:f0->171. model.pinterest_source.stg_pinterest_ads__ad_group_report:f0 163. model.pinterest.pinterest_ads__ad_group_report 163. model.pinterest.pinterest_ads__ad_group_report impressions 171. model.pinterest_source.stg_pinterest_ads__ad_group_report:f0->163. model.pinterest.pinterest_ads__ad_group_report:f0
171. model.pinterest_source.stg_pinterest_ads__ad_group_report
  • Input Column: 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp[impression_1]
    • Aggregation Combined with impression_2 to calculate total impressions
    • Cleaning Cast to INT and COALESCE used to handle NULL values
    • Output Columns:
      • impressions: Summed with impression_2 to create total impressions
163. model.pinterest.pinterest_ads__ad_group_report
  • Input Column: 171. model.pinterest_source.stg_pinterest_ads__ad_group_report[impressions]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • impressions: Aggregated sum in the output
Column Lineage
%3 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp clickthrough_1 171. model.pinterest_source.stg_pinterest_ads__ad_group_report 171. model.pinterest_source.stg_pinterest_ads__ad_group_report clicks 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp:f0->171. model.pinterest_source.stg_pinterest_ads__ad_group_report:f0 163. model.pinterest.pinterest_ads__ad_group_report 163. model.pinterest.pinterest_ads__ad_group_report clicks 171. model.pinterest_source.stg_pinterest_ads__ad_group_report:f0->163. model.pinterest.pinterest_ads__ad_group_report:f0
171. model.pinterest_source.stg_pinterest_ads__ad_group_report
  • Input Column: 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp[clickthrough_1]
    • Aggregation This column is summed with clickthrough_2 to calculate total clicks
    • Output Columns:
      • clicks: Summed with clickthrough_2 and coalesced with 0
163. model.pinterest.pinterest_ads__ad_group_report
  • Input Column: 171. model.pinterest_source.stg_pinterest_ads__ad_group_report[clicks]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • clicks: Aggregated sum in the output
Column Lineage
%3 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp spend_in_micro_dollar 171. model.pinterest_source.stg_pinterest_ads__ad_group_report 171. model.pinterest_source.stg_pinterest_ads__ad_group_report spend 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp:f0->171. model.pinterest_source.stg_pinterest_ads__ad_group_report:f0 163. model.pinterest.pinterest_ads__ad_group_report 163. model.pinterest.pinterest_ads__ad_group_report spend 171. model.pinterest_source.stg_pinterest_ads__ad_group_report:f0->163. model.pinterest.pinterest_ads__ad_group_report:f0
171. model.pinterest_source.stg_pinterest_ads__ad_group_report
  • Input Column: 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp[spend_in_micro_dollar]
    • Cleaning Cast to INT and divided by 1,000,000 to convert to dollars
    • Output Columns:
      • spend: Transformed from micro-dollars to dollars
163. model.pinterest.pinterest_ads__ad_group_report
  • Input Column: 171. model.pinterest_source.stg_pinterest_ads__ad_group_report[spend]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • spend: Aggregated sum in the output
172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of TEXT data type, which is set to NULL. The query is limited to 0 rows, effectively returning no data. This type of query is often used as a placeholder or template in data modeling tools like dbt (data build tool) to define the structure of a staging table without actually populating it with data.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp ad_group_id advertiser_id date _fivetran_synced ad_group_name ad_group_status campaign_daily_spend_cap campaign_id campaign_lifetime_spend_cap campaign_name campaign_status clickthrough_1 clickthrough_1_gross cpc_in_micro_dollar cpm_in_micro_dollar ctr ecpc_in_micro_dollar ecpm_in_micro_dollar ectr engagement_1 impression_1 impression_1_gross outbound_click_1 paid_impression spend_in_micro_dollar total_engagement total_impression_frequency total_impression_user 334. source.pinterest_source.pinterest_ads.ad_group_report 334. source.pinterest_source.pinterest_ads.ad_group_report
Name Type Comment
ad_group_id bigint None
advertiser_id bigint None
date timestamp without time zone None
_fivetran_synced timestamp without time zone None
ad_group_name text None
ad_group_status text None
campaign_daily_spend_cap integer None
campaign_id bigint None
campaign_lifetime_spend_cap integer None
campaign_name text None
campaign_status text None
clickthrough_1 integer None
clickthrough_1_gross integer None
cpc_in_micro_dollar double precision None
cpm_in_micro_dollar double precision None
ctr double precision None
ecpc_in_micro_dollar double precision None
ecpm_in_micro_dollar double precision None
ectr double precision None
engagement_1 integer None
impression_1 integer None
impression_1_gross integer None
outbound_click_1 integer None
paid_impression integer None
spend_in_micro_dollar integer None
total_engagement integer None
total_impression_frequency double precision None
total_impression_user integer None
Column Lineage
%3 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp ad_group_id 171. model.pinterest_source.stg_pinterest_ads__ad_group_report 171. model.pinterest_source.stg_pinterest_ads__ad_group_report ad_group_id 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp:f0->171. model.pinterest_source.stg_pinterest_ads__ad_group_report:f0 163. model.pinterest.pinterest_ads__ad_group_report 163. model.pinterest.pinterest_ads__ad_group_report ad_group_id 171. model.pinterest_source.stg_pinterest_ads__ad_group_report:f0->163. model.pinterest.pinterest_ads__ad_group_report:f0
171. model.pinterest_source.stg_pinterest_ads__ad_group_report
  • Input Column: 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp[ad_group_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • ad_group_id: Directly copied to the output
163. model.pinterest.pinterest_ads__ad_group_report
  • Input Column: 171. model.pinterest_source.stg_pinterest_ads__ad_group_report[ad_group_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as the key to join with the ad_groups table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • ad_group_id: Directly copied to the output
Column Lineage
%3 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp advertiser_id 171. model.pinterest_source.stg_pinterest_ads__ad_group_report 171. model.pinterest_source.stg_pinterest_ads__ad_group_report advertiser_id 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp:f0->171. model.pinterest_source.stg_pinterest_ads__ad_group_report:f0
171. model.pinterest_source.stg_pinterest_ads__ad_group_report
  • Input Column: 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp[advertiser_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • advertiser_id: Directly copied to the output
Column Lineage
%3 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp date 171. model.pinterest_source.stg_pinterest_ads__ad_group_report 171. model.pinterest_source.stg_pinterest_ads__ad_group_report date_day 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp:f0->171. model.pinterest_source.stg_pinterest_ads__ad_group_report:f0 163. model.pinterest.pinterest_ads__ad_group_report 163. model.pinterest.pinterest_ads__ad_group_report date_day 171. model.pinterest_source.stg_pinterest_ads__ad_group_report:f0->163. model.pinterest.pinterest_ads__ad_group_report:f0
171. model.pinterest_source.stg_pinterest_ads__ad_group_report
  • Input Column: 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp[date]
    • Cleaning The column is cast as TIMESTAMP in the fields CTE
    • Featurization The date is truncated to day-level granularity
    • Output Columns:
      • date_day: Transformed to day-level granularity using DATE_TRUNC
163. model.pinterest.pinterest_ads__ad_group_report
  • Input Column: 171. model.pinterest_source.stg_pinterest_ads__ad_group_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp ad_group_name 171. model.pinterest_source.stg_pinterest_ads__ad_group_report 171. model.pinterest_source.stg_pinterest_ads__ad_group_report ad_group_name 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp:f0->171. model.pinterest_source.stg_pinterest_ads__ad_group_report:f0
171. model.pinterest_source.stg_pinterest_ads__ad_group_report
  • Input Column: 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp[ad_group_name]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • ad_group_name: Directly copied to the output
Column Lineage
%3 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp ad_group_status 171. model.pinterest_source.stg_pinterest_ads__ad_group_report 171. model.pinterest_source.stg_pinterest_ads__ad_group_report ad_group_status 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp:f0->171. model.pinterest_source.stg_pinterest_ads__ad_group_report:f0
171. model.pinterest_source.stg_pinterest_ads__ad_group_report
  • Input Column: 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp[ad_group_status]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • ad_group_status: Directly copied to the output
Column Lineage
%3 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp campaign_id 171. model.pinterest_source.stg_pinterest_ads__ad_group_report 171. model.pinterest_source.stg_pinterest_ads__ad_group_report campaign_id 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp:f0->171. model.pinterest_source.stg_pinterest_ads__ad_group_report:f0
171. model.pinterest_source.stg_pinterest_ads__ad_group_report
  • Input Column: 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp[campaign_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT in the fields CTE
    • Output Columns:
      • campaign_id: Directly copied to the output
Column Lineage
%3 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp clickthrough_1 171. model.pinterest_source.stg_pinterest_ads__ad_group_report 171. model.pinterest_source.stg_pinterest_ads__ad_group_report clicks 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp:f0->171. model.pinterest_source.stg_pinterest_ads__ad_group_report:f0 163. model.pinterest.pinterest_ads__ad_group_report 163. model.pinterest.pinterest_ads__ad_group_report clicks 171. model.pinterest_source.stg_pinterest_ads__ad_group_report:f0->163. model.pinterest.pinterest_ads__ad_group_report:f0
171. model.pinterest_source.stg_pinterest_ads__ad_group_report
  • Input Column: 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp[clickthrough_1]
    • Aggregation This column is summed with clickthrough_2 to calculate total clicks
    • Output Columns:
      • clicks: Summed with clickthrough_2 and coalesced with 0
163. model.pinterest.pinterest_ads__ad_group_report
  • Input Column: 171. model.pinterest_source.stg_pinterest_ads__ad_group_report[clicks]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • clicks: Aggregated sum in the output
Column Lineage
%3 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp impression_1 171. model.pinterest_source.stg_pinterest_ads__ad_group_report 171. model.pinterest_source.stg_pinterest_ads__ad_group_report impressions 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp:f0->171. model.pinterest_source.stg_pinterest_ads__ad_group_report:f0 163. model.pinterest.pinterest_ads__ad_group_report 163. model.pinterest.pinterest_ads__ad_group_report impressions 171. model.pinterest_source.stg_pinterest_ads__ad_group_report:f0->163. model.pinterest.pinterest_ads__ad_group_report:f0
171. model.pinterest_source.stg_pinterest_ads__ad_group_report
  • Input Column: 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp[impression_1]
    • Aggregation Combined with impression_2 to calculate total impressions
    • Cleaning Cast to INT and COALESCE used to handle NULL values
    • Output Columns:
      • impressions: Summed with impression_2 to create total impressions
163. model.pinterest.pinterest_ads__ad_group_report
  • Input Column: 171. model.pinterest_source.stg_pinterest_ads__ad_group_report[impressions]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • impressions: Aggregated sum in the output
Column Lineage
%3 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp spend_in_micro_dollar 171. model.pinterest_source.stg_pinterest_ads__ad_group_report 171. model.pinterest_source.stg_pinterest_ads__ad_group_report spend 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp:f0->171. model.pinterest_source.stg_pinterest_ads__ad_group_report:f0 163. model.pinterest.pinterest_ads__ad_group_report 163. model.pinterest.pinterest_ads__ad_group_report spend 171. model.pinterest_source.stg_pinterest_ads__ad_group_report:f0->163. model.pinterest.pinterest_ads__ad_group_report:f0
171. model.pinterest_source.stg_pinterest_ads__ad_group_report
  • Input Column: 172. model.pinterest_source.stg_pinterest_ads__ad_group_report_tmp[spend_in_micro_dollar]
    • Cleaning Cast to INT and divided by 1,000,000 to convert to dollars
    • Output Columns:
      • spend: Transformed from micro-dollars to dollars
163. model.pinterest.pinterest_ads__ad_group_report
  • Input Column: 171. model.pinterest_source.stg_pinterest_ads__ad_group_report[spend]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • spend: Aggregated sum in the output
173. model.pinterest_source.stg_pinterest_ads__advertiser_history

This SQL query stages data from a Pinterest ads advertiser history table. It casts columns to specific data types, renames some columns, and adds a flag to identify the most recent record for each advertiser. The query also adds a source_relation column and selects specific fields from the base table.

CleaningDeduplicationOther
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_pinterest_source.stg_pinterest_ads__advertiser_history_tmp
), fields AS (
  SELECT
    CAST(NULL AS TIMESTAMP) AS _fivetran_synced,
    CAST(NULL AS TEXT) AS country,
    CAST(NULL AS TIMESTAMP) AS created_time,
    CAST(NULL AS TEXT) AS currency,
    CAST(NULL AS TEXT) AS id,
    CAST(NULL AS TEXT) AS owner_user_id,
    CAST(NULL AS TEXT) AS owner_username,
    CAST(NULL AS TEXT) AS name,
    CAST(NULL AS TEXT) AS advertiser_permissions,
    CAST(NULL AS TIMESTAMP) AS updated_time,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    id AS advertiser_id,
    name AS advertiser_name,
    country,
    created_time AS created_at,
    currency AS currency_code,
    owner_user_id,
    owner_username,
    advertiser_permissions, /* permissions was renamed in macro */
    updated_time AS updated_at,
    ROW_NUMBER() OVER (PARTITION BY source_relation, id ORDER BY updated_time DESC) = 1 AS is_most_recent_record
  FROM fields
)
SELECT
  *
FROM final
%3 173. model.pinterest_source.stg_pinterest_ads__advertiser_history 173. model.pinterest_source.stg_pinterest_ads__advertiser_history source_relation advertiser_id advertiser_name country created_at currency_code updated_at owner_username owner_user_id advertiser_permissions is_most_recent_record 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp id updated_time country created_time currency name owner_user_id owner_username permissions 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp:f0->173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f1 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp:f1->173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f6 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp:f2->173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f3 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp:f3->173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f4 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp:f4->173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f5 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp:f5->173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f2 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp:f6->173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f8 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp:f7->173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f7 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp:f8->173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f9
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
advertiser_id bigint The ID of the related Advertiser.
advertiser_name text Name of the advertiser.
country text The country code where the advertiser is located.
created_at timestamp without time zone Timestamp of when a record was created.
currency_code text The currency code which the advertiser is set up using.
updated_at timestamp without time zone Timestamp of when a record was last updated.
owner_username text Advertiser's username.
owner_user_id integer Unique identifier of the owner user.
advertiser_permissions text The permissions associated with this account.
is_most_recent_record boolean Boolean representing whether the record is the most recent version of the object.
Column Lineage
%3 173. model.pinterest_source.stg_pinterest_ads__advertiser_history 173. model.pinterest_source.stg_pinterest_ads__advertiser_history source_relation 167. model.pinterest.pinterest_ads__pin_promotion_report 167. model.pinterest.pinterest_ads__pin_promotion_report source_relation 173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0->167. model.pinterest.pinterest_ads__pin_promotion_report:f0 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report source_relation 173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0->168. model.pinterest.pinterest_ads__url_report:f0 166. model.pinterest.pinterest_ads__keyword_report 166. model.pinterest.pinterest_ads__keyword_report source_relation 173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0->166. model.pinterest.pinterest_ads__keyword_report:f0 163. model.pinterest.pinterest_ads__ad_group_report 163. model.pinterest.pinterest_ads__ad_group_report source_relation 173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0->163. model.pinterest.pinterest_ads__ad_group_report:f0 165. model.pinterest.pinterest_ads__campaign_report 165. model.pinterest.pinterest_ads__campaign_report source_relation 173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0->165. model.pinterest.pinterest_ads__campaign_report:f0 164. model.pinterest.pinterest_ads__advertiser_report 164. model.pinterest.pinterest_ads__advertiser_report source_relation 173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0->164. model.pinterest.pinterest_ads__advertiser_report:f0
163. model.pinterest.pinterest_ads__ad_group_report
  • Input Column: 173. model.pinterest_source.stg_pinterest_ads__advertiser_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
164. model.pinterest.pinterest_ads__advertiser_report
  • Input Column: 173. model.pinterest_source.stg_pinterest_ads__advertiser_history[source_relation]
    • Direct The column is directly copied without transformation
    • Integration Used as part of the join condition with the report table
    • Aggregation Part of the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
165. model.pinterest.pinterest_ads__campaign_report
  • Input Column: 173. model.pinterest_source.stg_pinterest_ads__advertiser_history[source_relation]
    • Direct The column is directly copied without transformation
    • Integration Used as part of the join condition with other tables
    • Output Columns:
      • source_relation: Directly copied to the output
166. model.pinterest.pinterest_ads__keyword_report
  • Input Column: 173. model.pinterest_source.stg_pinterest_ads__advertiser_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
167. model.pinterest.pinterest_ads__pin_promotion_report
  • Input Column: 173. model.pinterest_source.stg_pinterest_ads__advertiser_history[source_relation]
    • Integration Used as part of the join condition with other tables
    • Direct Directly copied to the output
    • Output Columns:
      • source_relation: Directly copied
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 173. model.pinterest_source.stg_pinterest_ads__advertiser_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
Column Lineage
%3 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp id 173. model.pinterest_source.stg_pinterest_ads__advertiser_history 173. model.pinterest_source.stg_pinterest_ads__advertiser_history advertiser_id 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp:f0->173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0 167. model.pinterest.pinterest_ads__pin_promotion_report 167. model.pinterest.pinterest_ads__pin_promotion_report advertiser_id 173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0->167. model.pinterest.pinterest_ads__pin_promotion_report:f0 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report advertiser_id 173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0->168. model.pinterest.pinterest_ads__url_report:f0 166. model.pinterest.pinterest_ads__keyword_report 166. model.pinterest.pinterest_ads__keyword_report advertiser_id 173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0->166. model.pinterest.pinterest_ads__keyword_report:f0 163. model.pinterest.pinterest_ads__ad_group_report 163. model.pinterest.pinterest_ads__ad_group_report advertiser_id 173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0->163. model.pinterest.pinterest_ads__ad_group_report:f0 165. model.pinterest.pinterest_ads__campaign_report 165. model.pinterest.pinterest_ads__campaign_report advertiser_id 173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0->165. model.pinterest.pinterest_ads__campaign_report:f0 164. model.pinterest.pinterest_ads__advertiser_report 164. model.pinterest.pinterest_ads__advertiser_report advertiser_id 173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0->164. model.pinterest.pinterest_ads__advertiser_report:f0
173. model.pinterest_source.stg_pinterest_ads__advertiser_history
  • Input Column: 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp[id]
    • Direct The column is directly copied without transformation
    • Deduplication Used in the PARTITION BY clause of ROW_NUMBER() function for deduplication
    • Output Columns:
      • advertiser_id: Directly mapped to this output column
163. model.pinterest.pinterest_ads__ad_group_report
  • Input Column: 173. model.pinterest_source.stg_pinterest_ads__advertiser_history[advertiser_id]
    • Integration used as the key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • advertiser_id: directly copied
164. model.pinterest.pinterest_ads__advertiser_report
  • Input Column: 173. model.pinterest_source.stg_pinterest_ads__advertiser_history[advertiser_id]
    • Direct The column is directly copied without transformation
    • Integration Used as the key to join with the report table
    • Aggregation Part of the GROUP BY clause
    • Output Columns:
      • advertiser_id: Directly copied to the output
165. model.pinterest.pinterest_ads__campaign_report
  • Input Column: 173. model.pinterest_source.stg_pinterest_ads__advertiser_history[advertiser_id]
    • Direct The column is directly copied without transformation
    • Integration Used as part of the join condition with the campaigns table
    • Output Columns:
      • advertiser_id: Directly copied to the output
166. model.pinterest.pinterest_ads__keyword_report
  • Input Column: 173. model.pinterest_source.stg_pinterest_ads__advertiser_history[advertiser_id]
    • Integration used as the key to join with the campaigns table
    • Direct directly copied to the output
    • Output Columns:
      • advertiser_id: directly copied
167. model.pinterest.pinterest_ads__pin_promotion_report
  • Input Column: 173. model.pinterest_source.stg_pinterest_ads__advertiser_history[advertiser_id]
    • Integration Used as the key to join with the campaigns table
    • Direct Directly copied to the output
    • Output Columns:
      • advertiser_id: Directly copied
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 173. model.pinterest_source.stg_pinterest_ads__advertiser_history[advertiser_id]
    • Integration used as the key to join with the campaigns table
    • Direct directly copied to the output
    • Output Columns:
      • advertiser_id: directly copied
Column Lineage
%3 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp name 173. model.pinterest_source.stg_pinterest_ads__advertiser_history 173. model.pinterest_source.stg_pinterest_ads__advertiser_history advertiser_name 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp:f0->173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0 167. model.pinterest.pinterest_ads__pin_promotion_report 167. model.pinterest.pinterest_ads__pin_promotion_report advertiser_name 173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0->167. model.pinterest.pinterest_ads__pin_promotion_report:f0 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report advertiser_name 173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0->168. model.pinterest.pinterest_ads__url_report:f0 166. model.pinterest.pinterest_ads__keyword_report 166. model.pinterest.pinterest_ads__keyword_report advertiser_name 173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0->166. model.pinterest.pinterest_ads__keyword_report:f0 163. model.pinterest.pinterest_ads__ad_group_report 163. model.pinterest.pinterest_ads__ad_group_report advertiser_name 173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0->163. model.pinterest.pinterest_ads__ad_group_report:f0 165. model.pinterest.pinterest_ads__campaign_report 165. model.pinterest.pinterest_ads__campaign_report advertiser_name 173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0->165. model.pinterest.pinterest_ads__campaign_report:f0 164. model.pinterest.pinterest_ads__advertiser_report 164. model.pinterest.pinterest_ads__advertiser_report advertiser_name 173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0->164. model.pinterest.pinterest_ads__advertiser_report:f0
173. model.pinterest_source.stg_pinterest_ads__advertiser_history
  • Input Column: 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • advertiser_name: Directly mapped to this output column
163. model.pinterest.pinterest_ads__ad_group_report
  • Input Column: 173. model.pinterest_source.stg_pinterest_ads__advertiser_history[advertiser_name]
    • Direct directly copied to the output
    • Output Columns:
      • advertiser_name: directly copied
164. model.pinterest.pinterest_ads__advertiser_report
  • Input Column: 173. model.pinterest_source.stg_pinterest_ads__advertiser_history[advertiser_name]
    • Direct The column is directly copied without transformation
    • Aggregation Part of the GROUP BY clause
    • Output Columns:
      • advertiser_name: Directly copied to the output
165. model.pinterest.pinterest_ads__campaign_report
  • Input Column: 173. model.pinterest_source.stg_pinterest_ads__advertiser_history[advertiser_name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • advertiser_name: Directly copied to the output
166. model.pinterest.pinterest_ads__keyword_report
  • Input Column: 173. model.pinterest_source.stg_pinterest_ads__advertiser_history[advertiser_name]
    • Direct directly copied to the output
    • Output Columns:
      • advertiser_name: directly copied
167. model.pinterest.pinterest_ads__pin_promotion_report
  • Input Column: 173. model.pinterest_source.stg_pinterest_ads__advertiser_history[advertiser_name]
    • Direct Directly copied to the output
    • Output Columns:
      • advertiser_name: Directly copied
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 173. model.pinterest_source.stg_pinterest_ads__advertiser_history[advertiser_name]
    • Direct directly copied to the output
    • Output Columns:
      • advertiser_name: directly copied
Column Lineage
%3 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp country 173. model.pinterest_source.stg_pinterest_ads__advertiser_history 173. model.pinterest_source.stg_pinterest_ads__advertiser_history country 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp:f0->173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0 164. model.pinterest.pinterest_ads__advertiser_report 164. model.pinterest.pinterest_ads__advertiser_report country 173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0->164. model.pinterest.pinterest_ads__advertiser_report:f0
173. model.pinterest_source.stg_pinterest_ads__advertiser_history
  • Input Column: 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp[country]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • country: Directly mapped to this output column
164. model.pinterest.pinterest_ads__advertiser_report
  • Input Column: 173. model.pinterest_source.stg_pinterest_ads__advertiser_history[country]
    • Direct The column is directly copied without transformation
    • Aggregation Part of the GROUP BY clause
    • Output Columns:
      • country: Directly copied to the output
Column Lineage
%3 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp created_time 173. model.pinterest_source.stg_pinterest_ads__advertiser_history 173. model.pinterest_source.stg_pinterest_ads__advertiser_history created_at 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp:f0->173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0
173. model.pinterest_source.stg_pinterest_ads__advertiser_history
  • Input Column: 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp[created_time]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • created_at: Directly mapped to this output column
Column Lineage
%3 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp currency 173. model.pinterest_source.stg_pinterest_ads__advertiser_history 173. model.pinterest_source.stg_pinterest_ads__advertiser_history currency_code 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp:f0->173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0 164. model.pinterest.pinterest_ads__advertiser_report 164. model.pinterest.pinterest_ads__advertiser_report currency_code 173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0->164. model.pinterest.pinterest_ads__advertiser_report:f0
173. model.pinterest_source.stg_pinterest_ads__advertiser_history
  • Input Column: 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp[currency]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • currency_code: Directly mapped to this output column
164. model.pinterest.pinterest_ads__advertiser_report
  • Input Column: 173. model.pinterest_source.stg_pinterest_ads__advertiser_history[currency_code]
    • Direct The column is directly copied without transformation
    • Aggregation Part of the GROUP BY clause
    • Output Columns:
      • currency_code: Directly copied to the output
Column Lineage
%3 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp updated_time 173. model.pinterest_source.stg_pinterest_ads__advertiser_history 173. model.pinterest_source.stg_pinterest_ads__advertiser_history updated_at 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp:f0->173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0
173. model.pinterest_source.stg_pinterest_ads__advertiser_history
  • Input Column: 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp[updated_time]
    • Direct The column is directly copied without transformation
    • Deduplication Used in the ORDER BY clause of ROW_NUMBER() function for deduplication
    • Output Columns:
      • updated_at: Directly mapped to this output column
Column Lineage
%3 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp owner_username 173. model.pinterest_source.stg_pinterest_ads__advertiser_history 173. model.pinterest_source.stg_pinterest_ads__advertiser_history owner_username 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp:f0->173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0
173. model.pinterest_source.stg_pinterest_ads__advertiser_history
  • Input Column: 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp[owner_username]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • owner_username: Directly mapped to the output column
Column Lineage
%3 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp owner_user_id 173. model.pinterest_source.stg_pinterest_ads__advertiser_history 173. model.pinterest_source.stg_pinterest_ads__advertiser_history owner_user_id 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp:f0->173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0
173. model.pinterest_source.stg_pinterest_ads__advertiser_history
  • Input Column: 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp[owner_user_id]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • owner_user_id: Directly mapped to the output column
Column Lineage
%3 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp permissions 173. model.pinterest_source.stg_pinterest_ads__advertiser_history 173. model.pinterest_source.stg_pinterest_ads__advertiser_history advertiser_permissions 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp:f0->173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0
173. model.pinterest_source.stg_pinterest_ads__advertiser_history
  • Input Column: 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp[permissions]
    • Cleaning The column is renamed to 'advertiser_permissions' in the output
    • Output Columns:
      • advertiser_permissions: Mapped to this output column after renaming
174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of type TEXT. It's likely used as a placeholder or template query, possibly for testing or initializing a structure without actual data.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp id updated_time _fivetran_synced billing_profile_status billing_type country created_time currency merchant_id name owner_user_id status owner_username permissions 335. source.pinterest_source.pinterest_ads.advertiser_history 335. source.pinterest_source.pinterest_ads.advertiser_history
Name Type Comment
id bigint None
updated_time timestamp without time zone None
_fivetran_synced timestamp without time zone None
billing_profile_status text None
billing_type text None
country text None
created_time timestamp without time zone None
currency text None
merchant_id integer None
name text None
owner_user_id integer None
status text None
owner_username text None
permissions text None
Column Lineage
%3 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp id 173. model.pinterest_source.stg_pinterest_ads__advertiser_history 173. model.pinterest_source.stg_pinterest_ads__advertiser_history advertiser_id 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp:f0->173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0 167. model.pinterest.pinterest_ads__pin_promotion_report 167. model.pinterest.pinterest_ads__pin_promotion_report advertiser_id 173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0->167. model.pinterest.pinterest_ads__pin_promotion_report:f0 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report advertiser_id 173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0->168. model.pinterest.pinterest_ads__url_report:f0 166. model.pinterest.pinterest_ads__keyword_report 166. model.pinterest.pinterest_ads__keyword_report advertiser_id 173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0->166. model.pinterest.pinterest_ads__keyword_report:f0 163. model.pinterest.pinterest_ads__ad_group_report 163. model.pinterest.pinterest_ads__ad_group_report advertiser_id 173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0->163. model.pinterest.pinterest_ads__ad_group_report:f0 165. model.pinterest.pinterest_ads__campaign_report 165. model.pinterest.pinterest_ads__campaign_report advertiser_id 173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0->165. model.pinterest.pinterest_ads__campaign_report:f0 164. model.pinterest.pinterest_ads__advertiser_report 164. model.pinterest.pinterest_ads__advertiser_report advertiser_id 173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0->164. model.pinterest.pinterest_ads__advertiser_report:f0
173. model.pinterest_source.stg_pinterest_ads__advertiser_history
  • Input Column: 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp[id]
    • Direct The column is directly copied without transformation
    • Deduplication Used in the PARTITION BY clause of ROW_NUMBER() function for deduplication
    • Output Columns:
      • advertiser_id: Directly mapped to this output column
163. model.pinterest.pinterest_ads__ad_group_report
  • Input Column: 173. model.pinterest_source.stg_pinterest_ads__advertiser_history[advertiser_id]
    • Integration used as the key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • advertiser_id: directly copied
164. model.pinterest.pinterest_ads__advertiser_report
  • Input Column: 173. model.pinterest_source.stg_pinterest_ads__advertiser_history[advertiser_id]
    • Direct The column is directly copied without transformation
    • Integration Used as the key to join with the report table
    • Aggregation Part of the GROUP BY clause
    • Output Columns:
      • advertiser_id: Directly copied to the output
165. model.pinterest.pinterest_ads__campaign_report
  • Input Column: 173. model.pinterest_source.stg_pinterest_ads__advertiser_history[advertiser_id]
    • Direct The column is directly copied without transformation
    • Integration Used as part of the join condition with the campaigns table
    • Output Columns:
      • advertiser_id: Directly copied to the output
166. model.pinterest.pinterest_ads__keyword_report
  • Input Column: 173. model.pinterest_source.stg_pinterest_ads__advertiser_history[advertiser_id]
    • Integration used as the key to join with the campaigns table
    • Direct directly copied to the output
    • Output Columns:
      • advertiser_id: directly copied
167. model.pinterest.pinterest_ads__pin_promotion_report
  • Input Column: 173. model.pinterest_source.stg_pinterest_ads__advertiser_history[advertiser_id]
    • Integration Used as the key to join with the campaigns table
    • Direct Directly copied to the output
    • Output Columns:
      • advertiser_id: Directly copied
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 173. model.pinterest_source.stg_pinterest_ads__advertiser_history[advertiser_id]
    • Integration used as the key to join with the campaigns table
    • Direct directly copied to the output
    • Output Columns:
      • advertiser_id: directly copied
Column Lineage
%3 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp updated_time 173. model.pinterest_source.stg_pinterest_ads__advertiser_history 173. model.pinterest_source.stg_pinterest_ads__advertiser_history updated_at 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp:f0->173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0
173. model.pinterest_source.stg_pinterest_ads__advertiser_history
  • Input Column: 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp[updated_time]
    • Direct The column is directly copied without transformation
    • Deduplication Used in the ORDER BY clause of ROW_NUMBER() function for deduplication
    • Output Columns:
      • updated_at: Directly mapped to this output column
Column Lineage
%3 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp country 173. model.pinterest_source.stg_pinterest_ads__advertiser_history 173. model.pinterest_source.stg_pinterest_ads__advertiser_history country 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp:f0->173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0 164. model.pinterest.pinterest_ads__advertiser_report 164. model.pinterest.pinterest_ads__advertiser_report country 173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0->164. model.pinterest.pinterest_ads__advertiser_report:f0
173. model.pinterest_source.stg_pinterest_ads__advertiser_history
  • Input Column: 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp[country]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • country: Directly mapped to this output column
164. model.pinterest.pinterest_ads__advertiser_report
  • Input Column: 173. model.pinterest_source.stg_pinterest_ads__advertiser_history[country]
    • Direct The column is directly copied without transformation
    • Aggregation Part of the GROUP BY clause
    • Output Columns:
      • country: Directly copied to the output
Column Lineage
%3 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp created_time 173. model.pinterest_source.stg_pinterest_ads__advertiser_history 173. model.pinterest_source.stg_pinterest_ads__advertiser_history created_at 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp:f0->173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0
173. model.pinterest_source.stg_pinterest_ads__advertiser_history
  • Input Column: 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp[created_time]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • created_at: Directly mapped to this output column
Column Lineage
%3 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp currency 173. model.pinterest_source.stg_pinterest_ads__advertiser_history 173. model.pinterest_source.stg_pinterest_ads__advertiser_history currency_code 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp:f0->173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0 164. model.pinterest.pinterest_ads__advertiser_report 164. model.pinterest.pinterest_ads__advertiser_report currency_code 173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0->164. model.pinterest.pinterest_ads__advertiser_report:f0
173. model.pinterest_source.stg_pinterest_ads__advertiser_history
  • Input Column: 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp[currency]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • currency_code: Directly mapped to this output column
164. model.pinterest.pinterest_ads__advertiser_report
  • Input Column: 173. model.pinterest_source.stg_pinterest_ads__advertiser_history[currency_code]
    • Direct The column is directly copied without transformation
    • Aggregation Part of the GROUP BY clause
    • Output Columns:
      • currency_code: Directly copied to the output
Column Lineage
%3 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp name 173. model.pinterest_source.stg_pinterest_ads__advertiser_history 173. model.pinterest_source.stg_pinterest_ads__advertiser_history advertiser_name 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp:f0->173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0 167. model.pinterest.pinterest_ads__pin_promotion_report 167. model.pinterest.pinterest_ads__pin_promotion_report advertiser_name 173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0->167. model.pinterest.pinterest_ads__pin_promotion_report:f0 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report advertiser_name 173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0->168. model.pinterest.pinterest_ads__url_report:f0 166. model.pinterest.pinterest_ads__keyword_report 166. model.pinterest.pinterest_ads__keyword_report advertiser_name 173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0->166. model.pinterest.pinterest_ads__keyword_report:f0 163. model.pinterest.pinterest_ads__ad_group_report 163. model.pinterest.pinterest_ads__ad_group_report advertiser_name 173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0->163. model.pinterest.pinterest_ads__ad_group_report:f0 165. model.pinterest.pinterest_ads__campaign_report 165. model.pinterest.pinterest_ads__campaign_report advertiser_name 173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0->165. model.pinterest.pinterest_ads__campaign_report:f0 164. model.pinterest.pinterest_ads__advertiser_report 164. model.pinterest.pinterest_ads__advertiser_report advertiser_name 173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0->164. model.pinterest.pinterest_ads__advertiser_report:f0
173. model.pinterest_source.stg_pinterest_ads__advertiser_history
  • Input Column: 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • advertiser_name: Directly mapped to this output column
163. model.pinterest.pinterest_ads__ad_group_report
  • Input Column: 173. model.pinterest_source.stg_pinterest_ads__advertiser_history[advertiser_name]
    • Direct directly copied to the output
    • Output Columns:
      • advertiser_name: directly copied
164. model.pinterest.pinterest_ads__advertiser_report
  • Input Column: 173. model.pinterest_source.stg_pinterest_ads__advertiser_history[advertiser_name]
    • Direct The column is directly copied without transformation
    • Aggregation Part of the GROUP BY clause
    • Output Columns:
      • advertiser_name: Directly copied to the output
165. model.pinterest.pinterest_ads__campaign_report
  • Input Column: 173. model.pinterest_source.stg_pinterest_ads__advertiser_history[advertiser_name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • advertiser_name: Directly copied to the output
166. model.pinterest.pinterest_ads__keyword_report
  • Input Column: 173. model.pinterest_source.stg_pinterest_ads__advertiser_history[advertiser_name]
    • Direct directly copied to the output
    • Output Columns:
      • advertiser_name: directly copied
167. model.pinterest.pinterest_ads__pin_promotion_report
  • Input Column: 173. model.pinterest_source.stg_pinterest_ads__advertiser_history[advertiser_name]
    • Direct Directly copied to the output
    • Output Columns:
      • advertiser_name: Directly copied
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 173. model.pinterest_source.stg_pinterest_ads__advertiser_history[advertiser_name]
    • Direct directly copied to the output
    • Output Columns:
      • advertiser_name: directly copied
Column Lineage
%3 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp owner_user_id 173. model.pinterest_source.stg_pinterest_ads__advertiser_history 173. model.pinterest_source.stg_pinterest_ads__advertiser_history owner_user_id 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp:f0->173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0
173. model.pinterest_source.stg_pinterest_ads__advertiser_history
  • Input Column: 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp[owner_user_id]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • owner_user_id: Directly mapped to the output column
Column Lineage
%3 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp owner_username 173. model.pinterest_source.stg_pinterest_ads__advertiser_history 173. model.pinterest_source.stg_pinterest_ads__advertiser_history owner_username 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp:f0->173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0
173. model.pinterest_source.stg_pinterest_ads__advertiser_history
  • Input Column: 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp[owner_username]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • owner_username: Directly mapped to the output column
Column Lineage
%3 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp permissions 173. model.pinterest_source.stg_pinterest_ads__advertiser_history 173. model.pinterest_source.stg_pinterest_ads__advertiser_history advertiser_permissions 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp:f0->173. model.pinterest_source.stg_pinterest_ads__advertiser_history:f0
173. model.pinterest_source.stg_pinterest_ads__advertiser_history
  • Input Column: 174. model.pinterest_source.stg_pinterest_ads__advertiser_history_tmp[permissions]
    • Cleaning The column is renamed to 'advertiser_permissions' in the output
    • Output Columns:
      • advertiser_permissions: Mapped to this output column after renaming
175. model.pinterest_source.stg_pinterest_ads__advertiser_report

This SQL query performs several transformations on data from a Pinterest ads advertiser report. It starts by casting columns to specific data types, then combines impression and clickthrough data, converts spend from micro-dollars to dollars, and truncates the date to day level. The query also adds a source_relation column and renames some fields for clarity.

CleaningFeaturizationOther
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_pinterest_source.stg_pinterest_ads__advertiser_report_tmp
), fields AS (
  SELECT
    CAST(NULL AS TIMESTAMP) AS _fivetran_synced,
    CAST(NULL AS TEXT) AS advertiser_id,
    CAST(NULL AS INT) AS clickthrough_1,
    CAST(NULL AS INT) AS clickthrough_2,
    CAST(NULL AS TIMESTAMP) AS date,
    CAST(NULL AS INT) AS impression_1,
    CAST(NULL AS INT) AS impression_2,
    CAST(NULL AS INT) AS spend_in_micro_dollar,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    DATE_TRUNC('DAY', date) AS date_day,
    advertiser_id,
    COALESCE(impression_1, 0) + COALESCE(impression_2, 0) AS impressions,
    COALESCE(clickthrough_1, 0) + COALESCE(clickthrough_2, 0) AS clicks,
    spend_in_micro_dollar / 1000000.0 AS spend
  FROM fields
)
SELECT
  *
FROM final
%3 175. model.pinterest_source.stg_pinterest_ads__advertiser_report 175. model.pinterest_source.stg_pinterest_ads__advertiser_report source_relation date_day advertiser_id impressions clicks spend 176. model.pinterest_source.stg_pinterest_ads__advertiser_report_tmp 176. model.pinterest_source.stg_pinterest_ads__advertiser_report_tmp advertiser_id date clickthrough_1 impression_1 spend_in_micro_dollar 176. model.pinterest_source.stg_pinterest_ads__advertiser_report_tmp:f0->175. model.pinterest_source.stg_pinterest_ads__advertiser_report:f2 176. model.pinterest_source.stg_pinterest_ads__advertiser_report_tmp:f1->175. model.pinterest_source.stg_pinterest_ads__advertiser_report:f1 176. model.pinterest_source.stg_pinterest_ads__advertiser_report_tmp:f2->175. model.pinterest_source.stg_pinterest_ads__advertiser_report:f4 176. model.pinterest_source.stg_pinterest_ads__advertiser_report_tmp:f3->175. model.pinterest_source.stg_pinterest_ads__advertiser_report:f3 176. model.pinterest_source.stg_pinterest_ads__advertiser_report_tmp:f4->175. model.pinterest_source.stg_pinterest_ads__advertiser_report:f5
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
date_day timestamp without time zone The date of the report.
advertiser_id bigint The ID of the related Advertiser.
impressions integer The count of impressions.
clicks integer The count of clicks.
spend numeric The cost of the ads.
Column Lineage
%3 175. model.pinterest_source.stg_pinterest_ads__advertiser_report 175. model.pinterest_source.stg_pinterest_ads__advertiser_report source_relation 164. model.pinterest.pinterest_ads__advertiser_report 164. model.pinterest.pinterest_ads__advertiser_report source_relation 175. model.pinterest_source.stg_pinterest_ads__advertiser_report:f0->164. model.pinterest.pinterest_ads__advertiser_report:f0
164. model.pinterest.pinterest_ads__advertiser_report
  • Input Column: 175. model.pinterest_source.stg_pinterest_ads__advertiser_report[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the key to join with the advertisers table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly mapped to the output column
Column Lineage
%3 176. model.pinterest_source.stg_pinterest_ads__advertiser_report_tmp 176. model.pinterest_source.stg_pinterest_ads__advertiser_report_tmp date 175. model.pinterest_source.stg_pinterest_ads__advertiser_report 175. model.pinterest_source.stg_pinterest_ads__advertiser_report date_day 176. model.pinterest_source.stg_pinterest_ads__advertiser_report_tmp:f0->175. model.pinterest_source.stg_pinterest_ads__advertiser_report:f0 164. model.pinterest.pinterest_ads__advertiser_report 164. model.pinterest.pinterest_ads__advertiser_report date_day 175. model.pinterest_source.stg_pinterest_ads__advertiser_report:f0->164. model.pinterest.pinterest_ads__advertiser_report:f0
175. model.pinterest_source.stg_pinterest_ads__advertiser_report
  • Input Column: 176. model.pinterest_source.stg_pinterest_ads__advertiser_report_tmp[date]
    • Cleaning The column is cast as TIMESTAMP in the fields CTE
    • Featurization The date is truncated to day level using DATE_TRUNC function
    • Output Columns:
      • date_day: Transformed to day level and mapped to this output column
164. model.pinterest.pinterest_ads__advertiser_report
  • Input Column: 175. model.pinterest_source.stg_pinterest_ads__advertiser_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly mapped to the output column
Column Lineage
%3 176. model.pinterest_source.stg_pinterest_ads__advertiser_report_tmp 176. model.pinterest_source.stg_pinterest_ads__advertiser_report_tmp advertiser_id 175. model.pinterest_source.stg_pinterest_ads__advertiser_report 175. model.pinterest_source.stg_pinterest_ads__advertiser_report advertiser_id 176. model.pinterest_source.stg_pinterest_ads__advertiser_report_tmp:f0->175. model.pinterest_source.stg_pinterest_ads__advertiser_report:f0 164. model.pinterest.pinterest_ads__advertiser_report 164. model.pinterest.pinterest_ads__advertiser_report advertiser_id 175. model.pinterest_source.stg_pinterest_ads__advertiser_report:f0->164. model.pinterest.pinterest_ads__advertiser_report:f0
175. model.pinterest_source.stg_pinterest_ads__advertiser_report
  • Input Column: 176. model.pinterest_source.stg_pinterest_ads__advertiser_report_tmp[advertiser_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • advertiser_id: Directly copied to the output
164. model.pinterest.pinterest_ads__advertiser_report
  • Input Column: 175. model.pinterest_source.stg_pinterest_ads__advertiser_report[advertiser_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as the key to join with the advertisers table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • advertiser_id: Directly mapped to the output column
Column Lineage
%3 176. model.pinterest_source.stg_pinterest_ads__advertiser_report_tmp 176. model.pinterest_source.stg_pinterest_ads__advertiser_report_tmp impression_1 175. model.pinterest_source.stg_pinterest_ads__advertiser_report 175. model.pinterest_source.stg_pinterest_ads__advertiser_report impressions 176. model.pinterest_source.stg_pinterest_ads__advertiser_report_tmp:f0->175. model.pinterest_source.stg_pinterest_ads__advertiser_report:f0 164. model.pinterest.pinterest_ads__advertiser_report 164. model.pinterest.pinterest_ads__advertiser_report impressions 175. model.pinterest_source.stg_pinterest_ads__advertiser_report:f0->164. model.pinterest.pinterest_ads__advertiser_report:f0
175. model.pinterest_source.stg_pinterest_ads__advertiser_report
  • Input Column: 176. model.pinterest_source.stg_pinterest_ads__advertiser_report_tmp[impression_1]
    • Aggregation This column is summed with impression_2 to calculate total impressions
    • Output Columns:
      • impressions: Aggregated with impression_2
164. model.pinterest.pinterest_ads__advertiser_report
  • Input Column: 175. model.pinterest_source.stg_pinterest_ads__advertiser_report[impressions]
    • Aggregation The column is summed up in the SELECT clause
    • Output Columns:
      • impressions: Aggregated sum is mapped to the output column
Column Lineage
%3 176. model.pinterest_source.stg_pinterest_ads__advertiser_report_tmp 176. model.pinterest_source.stg_pinterest_ads__advertiser_report_tmp clickthrough_1 175. model.pinterest_source.stg_pinterest_ads__advertiser_report 175. model.pinterest_source.stg_pinterest_ads__advertiser_report clicks 176. model.pinterest_source.stg_pinterest_ads__advertiser_report_tmp:f0->175. model.pinterest_source.stg_pinterest_ads__advertiser_report:f0 164. model.pinterest.pinterest_ads__advertiser_report 164. model.pinterest.pinterest_ads__advertiser_report clicks 175. model.pinterest_source.stg_pinterest_ads__advertiser_report:f0->164. model.pinterest.pinterest_ads__advertiser_report:f0
175. model.pinterest_source.stg_pinterest_ads__advertiser_report
  • Input Column: 176. model.pinterest_source.stg_pinterest_ads__advertiser_report_tmp[clickthrough_1]
    • Cleaning The column is cast as INT in the fields CTE
    • Aggregation It's combined with clickthrough_2 using COALESCE and addition
    • Output Columns:
      • clicks: Part of the calculation for the clicks output
164. model.pinterest.pinterest_ads__advertiser_report
  • Input Column: 175. model.pinterest_source.stg_pinterest_ads__advertiser_report[clicks]
    • Aggregation The column is summed up in the SELECT clause
    • Output Columns:
      • clicks: Aggregated sum is mapped to the output column
Column Lineage
%3 176. model.pinterest_source.stg_pinterest_ads__advertiser_report_tmp 176. model.pinterest_source.stg_pinterest_ads__advertiser_report_tmp spend_in_micro_dollar 175. model.pinterest_source.stg_pinterest_ads__advertiser_report 175. model.pinterest_source.stg_pinterest_ads__advertiser_report spend 176. model.pinterest_source.stg_pinterest_ads__advertiser_report_tmp:f0->175. model.pinterest_source.stg_pinterest_ads__advertiser_report:f0 164. model.pinterest.pinterest_ads__advertiser_report 164. model.pinterest.pinterest_ads__advertiser_report spend 175. model.pinterest_source.stg_pinterest_ads__advertiser_report:f0->164. model.pinterest.pinterest_ads__advertiser_report:f0
175. model.pinterest_source.stg_pinterest_ads__advertiser_report
  • Input Column: 176. model.pinterest_source.stg_pinterest_ads__advertiser_report_tmp[spend_in_micro_dollar]
    • Cleaning The value is divided by 1,000,000 to convert from micro-dollars to dollars
    • Output Columns:
      • spend: Transformed from micro-dollars to dollars
164. model.pinterest.pinterest_ads__advertiser_report
  • Input Column: 175. model.pinterest_source.stg_pinterest_ads__advertiser_report[spend]
    • Aggregation The column is summed up in the SELECT clause
    • Output Columns:
      • spend: Aggregated sum is mapped to the output column
176. model.pinterest_source.stg_pinterest_ads__advertiser_report_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of type TEXT, which is set to NULL. The LIMIT 0 ensures no rows are returned. This appears to be a template or placeholder query, possibly used for schema definition or testing purposes in a dbt (data build tool) project.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 176. model.pinterest_source.stg_pinterest_ads__advertiser_report_tmp 176. model.pinterest_source.stg_pinterest_ads__advertiser_report_tmp advertiser_id date _fivetran_synced clickthrough_1 clickthrough_1_gross cpc_in_micro_dollar cpm_in_micro_dollar ctr ecpc_in_micro_dollar ecpm_in_micro_dollar ectr engagement_1 impression_1 impression_1_gross outbound_click_1 paid_impression spend_in_micro_dollar total_engagement total_impression_frequency total_impression_user 336. source.pinterest_source.pinterest_ads.advertiser_report 336. source.pinterest_source.pinterest_ads.advertiser_report
Name Type Comment
advertiser_id bigint None
date timestamp without time zone None
_fivetran_synced timestamp without time zone None
clickthrough_1 integer None
clickthrough_1_gross integer None
cpc_in_micro_dollar double precision None
cpm_in_micro_dollar double precision None
ctr double precision None
ecpc_in_micro_dollar double precision None
ecpm_in_micro_dollar double precision None
ectr double precision None
engagement_1 integer None
impression_1 integer None
impression_1_gross integer None
outbound_click_1 integer None
paid_impression integer None
spend_in_micro_dollar integer None
total_engagement integer None
total_impression_frequency double precision None
total_impression_user integer None
Column Lineage
%3 176. model.pinterest_source.stg_pinterest_ads__advertiser_report_tmp 176. model.pinterest_source.stg_pinterest_ads__advertiser_report_tmp advertiser_id 175. model.pinterest_source.stg_pinterest_ads__advertiser_report 175. model.pinterest_source.stg_pinterest_ads__advertiser_report advertiser_id 176. model.pinterest_source.stg_pinterest_ads__advertiser_report_tmp:f0->175. model.pinterest_source.stg_pinterest_ads__advertiser_report:f0 164. model.pinterest.pinterest_ads__advertiser_report 164. model.pinterest.pinterest_ads__advertiser_report advertiser_id 175. model.pinterest_source.stg_pinterest_ads__advertiser_report:f0->164. model.pinterest.pinterest_ads__advertiser_report:f0
175. model.pinterest_source.stg_pinterest_ads__advertiser_report
  • Input Column: 176. model.pinterest_source.stg_pinterest_ads__advertiser_report_tmp[advertiser_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • advertiser_id: Directly copied to the output
164. model.pinterest.pinterest_ads__advertiser_report
  • Input Column: 175. model.pinterest_source.stg_pinterest_ads__advertiser_report[advertiser_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as the key to join with the advertisers table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • advertiser_id: Directly mapped to the output column
Column Lineage
%3 176. model.pinterest_source.stg_pinterest_ads__advertiser_report_tmp 176. model.pinterest_source.stg_pinterest_ads__advertiser_report_tmp date 175. model.pinterest_source.stg_pinterest_ads__advertiser_report 175. model.pinterest_source.stg_pinterest_ads__advertiser_report date_day 176. model.pinterest_source.stg_pinterest_ads__advertiser_report_tmp:f0->175. model.pinterest_source.stg_pinterest_ads__advertiser_report:f0 164. model.pinterest.pinterest_ads__advertiser_report 164. model.pinterest.pinterest_ads__advertiser_report date_day 175. model.pinterest_source.stg_pinterest_ads__advertiser_report:f0->164. model.pinterest.pinterest_ads__advertiser_report:f0
175. model.pinterest_source.stg_pinterest_ads__advertiser_report
  • Input Column: 176. model.pinterest_source.stg_pinterest_ads__advertiser_report_tmp[date]
    • Cleaning The column is cast as TIMESTAMP in the fields CTE
    • Featurization The date is truncated to day level using DATE_TRUNC function
    • Output Columns:
      • date_day: Transformed to day level and mapped to this output column
164. model.pinterest.pinterest_ads__advertiser_report
  • Input Column: 175. model.pinterest_source.stg_pinterest_ads__advertiser_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly mapped to the output column
Column Lineage
%3 176. model.pinterest_source.stg_pinterest_ads__advertiser_report_tmp 176. model.pinterest_source.stg_pinterest_ads__advertiser_report_tmp clickthrough_1 175. model.pinterest_source.stg_pinterest_ads__advertiser_report 175. model.pinterest_source.stg_pinterest_ads__advertiser_report clicks 176. model.pinterest_source.stg_pinterest_ads__advertiser_report_tmp:f0->175. model.pinterest_source.stg_pinterest_ads__advertiser_report:f0 164. model.pinterest.pinterest_ads__advertiser_report 164. model.pinterest.pinterest_ads__advertiser_report clicks 175. model.pinterest_source.stg_pinterest_ads__advertiser_report:f0->164. model.pinterest.pinterest_ads__advertiser_report:f0
175. model.pinterest_source.stg_pinterest_ads__advertiser_report
  • Input Column: 176. model.pinterest_source.stg_pinterest_ads__advertiser_report_tmp[clickthrough_1]
    • Cleaning The column is cast as INT in the fields CTE
    • Aggregation It's combined with clickthrough_2 using COALESCE and addition
    • Output Columns:
      • clicks: Part of the calculation for the clicks output
164. model.pinterest.pinterest_ads__advertiser_report
  • Input Column: 175. model.pinterest_source.stg_pinterest_ads__advertiser_report[clicks]
    • Aggregation The column is summed up in the SELECT clause
    • Output Columns:
      • clicks: Aggregated sum is mapped to the output column
Column Lineage
%3 176. model.pinterest_source.stg_pinterest_ads__advertiser_report_tmp 176. model.pinterest_source.stg_pinterest_ads__advertiser_report_tmp impression_1 175. model.pinterest_source.stg_pinterest_ads__advertiser_report 175. model.pinterest_source.stg_pinterest_ads__advertiser_report impressions 176. model.pinterest_source.stg_pinterest_ads__advertiser_report_tmp:f0->175. model.pinterest_source.stg_pinterest_ads__advertiser_report:f0 164. model.pinterest.pinterest_ads__advertiser_report 164. model.pinterest.pinterest_ads__advertiser_report impressions 175. model.pinterest_source.stg_pinterest_ads__advertiser_report:f0->164. model.pinterest.pinterest_ads__advertiser_report:f0
175. model.pinterest_source.stg_pinterest_ads__advertiser_report
  • Input Column: 176. model.pinterest_source.stg_pinterest_ads__advertiser_report_tmp[impression_1]
    • Aggregation This column is summed with impression_2 to calculate total impressions
    • Output Columns:
      • impressions: Aggregated with impression_2
164. model.pinterest.pinterest_ads__advertiser_report
  • Input Column: 175. model.pinterest_source.stg_pinterest_ads__advertiser_report[impressions]
    • Aggregation The column is summed up in the SELECT clause
    • Output Columns:
      • impressions: Aggregated sum is mapped to the output column
Column Lineage
%3 176. model.pinterest_source.stg_pinterest_ads__advertiser_report_tmp 176. model.pinterest_source.stg_pinterest_ads__advertiser_report_tmp spend_in_micro_dollar 175. model.pinterest_source.stg_pinterest_ads__advertiser_report 175. model.pinterest_source.stg_pinterest_ads__advertiser_report spend 176. model.pinterest_source.stg_pinterest_ads__advertiser_report_tmp:f0->175. model.pinterest_source.stg_pinterest_ads__advertiser_report:f0 164. model.pinterest.pinterest_ads__advertiser_report 164. model.pinterest.pinterest_ads__advertiser_report spend 175. model.pinterest_source.stg_pinterest_ads__advertiser_report:f0->164. model.pinterest.pinterest_ads__advertiser_report:f0
175. model.pinterest_source.stg_pinterest_ads__advertiser_report
  • Input Column: 176. model.pinterest_source.stg_pinterest_ads__advertiser_report_tmp[spend_in_micro_dollar]
    • Cleaning The value is divided by 1,000,000 to convert from micro-dollars to dollars
    • Output Columns:
      • spend: Transformed from micro-dollars to dollars
164. model.pinterest.pinterest_ads__advertiser_report
  • Input Column: 175. model.pinterest_source.stg_pinterest_ads__advertiser_report[spend]
    • Aggregation The column is summed up in the SELECT clause
    • Output Columns:
      • spend: Aggregated sum is mapped to the output column
177. model.pinterest_source.stg_pinterest_ads__campaign_history

This SQL query stages data from a temporary Pinterest ads campaign history table. It casts columns to specific data types, renames some columns, and adds a flag to identify the most recent record for each campaign. The query prepares the data for further processing or analysis by structuring it in a consistent format.

CleaningDeduplication
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_pinterest_source.stg_pinterest_ads__campaign_history_tmp
), fields AS (
  SELECT
    CAST(NULL AS TIMESTAMP) AS _fivetran_synced,
    CAST(NULL AS TIMESTAMP) AS created_time,
    CAST(NULL AS INT) AS default_ad_group_budget_in_micro_currency,
    CAST(NULL AS BOOLEAN) AS is_automated_campaign,
    CAST(NULL AS BOOLEAN) AS is_campaign_budget_optimization,
    CAST(NULL AS BOOLEAN) AS is_flexible_daily_budgets,
    CAST(NULL AS TEXT) AS id,
    CAST(NULL AS TEXT) AS advertiser_id,
    CAST(NULL AS TEXT) AS name,
    CAST(NULL AS TEXT) AS status,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    id AS campaign_id,
    name AS campaign_name,
    advertiser_id,
    default_ad_group_budget_in_micro_currency,
    is_automated_campaign,
    is_campaign_budget_optimization,
    is_flexible_daily_budgets,
    status AS campaign_status,
    _fivetran_synced,
    created_time AS created_at,
    ROW_NUMBER() OVER (PARTITION BY source_relation, id ORDER BY _fivetran_synced DESC) = 1 AS is_most_recent_record
  FROM fields
)
SELECT
  *
FROM final
%3 177. model.pinterest_source.stg_pinterest_ads__campaign_history 177. model.pinterest_source.stg_pinterest_ads__campaign_history source_relation campaign_id created_at advertiser_id campaign_name campaign_status default_ad_group_budget_in_micro_currency is_automated_campaign is_campaign_budget_optimization is_flexible_daily_budgets _fivetran_synced is_most_recent_record 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp id created_time name status _fivetran_synced advertiser_id default_ad_group_budget_in_micro_currency is_automated_campaign is_campaign_budget_optimization is_flexible_daily_budgets 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp:f0->177. model.pinterest_source.stg_pinterest_ads__campaign_history:f1 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp:f1->177. model.pinterest_source.stg_pinterest_ads__campaign_history:f2 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp:f2->177. model.pinterest_source.stg_pinterest_ads__campaign_history:f4 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp:f3->177. model.pinterest_source.stg_pinterest_ads__campaign_history:f5 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp:f4->177. model.pinterest_source.stg_pinterest_ads__campaign_history:f10 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp:f5->177. model.pinterest_source.stg_pinterest_ads__campaign_history:f3 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp:f6->177. model.pinterest_source.stg_pinterest_ads__campaign_history:f6 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp:f7->177. model.pinterest_source.stg_pinterest_ads__campaign_history:f7 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp:f8->177. model.pinterest_source.stg_pinterest_ads__campaign_history:f8 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp:f9->177. model.pinterest_source.stg_pinterest_ads__campaign_history:f9
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
campaign_id bigint The ID representing the campaign, if present in the source data.
created_at text Campaign creation time.
advertiser_id bigint The ID of the related Advertiser.
campaign_name text Campaign name.
campaign_status text The status of the Campaign. One of "ACTIVE", "ARCHIVED", "PAUSED"
default_ad_group_budget_in_micro_currency integer When transitioning from campaign budget optimization to non-campaign budget optimization, the default_ad_group_budget_in_micro_currency will propagate to each child ad groups daily budget. Unit is micro currency of the associated advertiser account.
is_automated_campaign boolean Specifies whether the campaign was created in the automated campaign flow
is_campaign_budget_optimization boolean Determines if a campaign automatically generate ad-group level budgets given a campaign budget to maximize campaign outcome. When transitioning from non-cbo to cbo, all previous child ad group budget will be cleared.
is_flexible_daily_budgets boolean Determine if a campaign has flexible daily budgets setup.
_fivetran_synced text Timestamp of when a record was last synced.
is_most_recent_record boolean Boolean representing whether the record is the most recent version of the object.
Column Lineage
%3 177. model.pinterest_source.stg_pinterest_ads__campaign_history 177. model.pinterest_source.stg_pinterest_ads__campaign_history source_relation 167. model.pinterest.pinterest_ads__pin_promotion_report 167. model.pinterest.pinterest_ads__pin_promotion_report source_relation 177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0->167. model.pinterest.pinterest_ads__pin_promotion_report:f0 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report source_relation 177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0->168. model.pinterest.pinterest_ads__url_report:f0 166. model.pinterest.pinterest_ads__keyword_report 166. model.pinterest.pinterest_ads__keyword_report source_relation 177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0->166. model.pinterest.pinterest_ads__keyword_report:f0 163. model.pinterest.pinterest_ads__ad_group_report 163. model.pinterest.pinterest_ads__ad_group_report source_relation 177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0->163. model.pinterest.pinterest_ads__ad_group_report:f0 165. model.pinterest.pinterest_ads__campaign_report 165. model.pinterest.pinterest_ads__campaign_report source_relation 177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0->165. model.pinterest.pinterest_ads__campaign_report:f0
163. model.pinterest.pinterest_ads__ad_group_report
  • Input Column: 177. model.pinterest_source.stg_pinterest_ads__campaign_history[source_relation]
    • Integration used to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
165. model.pinterest.pinterest_ads__campaign_report
  • Input Column: 177. model.pinterest_source.stg_pinterest_ads__campaign_history[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as a key to join with other tables
    • Output Columns:
      • source_relation: Directly copied to the output
166. model.pinterest.pinterest_ads__keyword_report
  • Input Column: 177. model.pinterest_source.stg_pinterest_ads__campaign_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
167. model.pinterest.pinterest_ads__pin_promotion_report
  • Input Column: 177. model.pinterest_source.stg_pinterest_ads__campaign_history[source_relation]
    • Direct The column is directly copied without transformation
    • Integration Used as part of the join condition with other tables
    • Output Columns:
      • source_relation: Directly copied to the output
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 177. model.pinterest_source.stg_pinterest_ads__campaign_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
Column Lineage
%3 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp id 177. model.pinterest_source.stg_pinterest_ads__campaign_history 177. model.pinterest_source.stg_pinterest_ads__campaign_history campaign_id 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp:f0->177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0 167. model.pinterest.pinterest_ads__pin_promotion_report 167. model.pinterest.pinterest_ads__pin_promotion_report campaign_id 177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0->167. model.pinterest.pinterest_ads__pin_promotion_report:f0 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report campaign_id 177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0->168. model.pinterest.pinterest_ads__url_report:f0 166. model.pinterest.pinterest_ads__keyword_report 166. model.pinterest.pinterest_ads__keyword_report campaign_id 177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0->166. model.pinterest.pinterest_ads__keyword_report:f0 163. model.pinterest.pinterest_ads__ad_group_report 163. model.pinterest.pinterest_ads__ad_group_report campaign_id 177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0->163. model.pinterest.pinterest_ads__ad_group_report:f0 165. model.pinterest.pinterest_ads__campaign_report 165. model.pinterest.pinterest_ads__campaign_report campaign_id 177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0->165. model.pinterest.pinterest_ads__campaign_report:f0
177. model.pinterest_source.stg_pinterest_ads__campaign_history
  • Input Column: 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp[id]
    • Direct The column is directly copied without transformation
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • campaign_id: Directly mapped to this output column
163. model.pinterest.pinterest_ads__ad_group_report
  • Input Column: 177. model.pinterest_source.stg_pinterest_ads__campaign_history[campaign_id]
    • Integration used to join with ad_groups table
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
165. model.pinterest.pinterest_ads__campaign_report
  • Input Column: 177. model.pinterest_source.stg_pinterest_ads__campaign_history[campaign_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with the report table
    • Output Columns:
      • campaign_id: Directly copied to the output
166. model.pinterest.pinterest_ads__keyword_report
  • Input Column: 177. model.pinterest_source.stg_pinterest_ads__campaign_history[campaign_id]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
167. model.pinterest.pinterest_ads__pin_promotion_report
  • Input Column: 177. model.pinterest_source.stg_pinterest_ads__campaign_history[campaign_id]
    • Direct The column is directly copied without transformation
    • Integration Used as the key to join with the report table
    • Output Columns:
      • campaign_id: Directly copied to the output
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 177. model.pinterest_source.stg_pinterest_ads__campaign_history[campaign_id]
    • Integration used as the key to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
Column Lineage
%3 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp created_time 177. model.pinterest_source.stg_pinterest_ads__campaign_history 177. model.pinterest_source.stg_pinterest_ads__campaign_history created_at 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp:f0->177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0
177. model.pinterest_source.stg_pinterest_ads__campaign_history
  • Input Column: 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp[created_time]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • created_at: Directly mapped to this output column
Column Lineage
%3 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp advertiser_id 177. model.pinterest_source.stg_pinterest_ads__campaign_history 177. model.pinterest_source.stg_pinterest_ads__campaign_history advertiser_id 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp:f0->177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0 167. model.pinterest.pinterest_ads__pin_promotion_report 167. model.pinterest.pinterest_ads__pin_promotion_report advertiser_id 177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0->167. model.pinterest.pinterest_ads__pin_promotion_report:f0 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report advertiser_id 177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0->168. model.pinterest.pinterest_ads__url_report:f0
177. model.pinterest_source.stg_pinterest_ads__campaign_history
  • Input Column: 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp[advertiser_id]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • advertiser_id: Directly mapped to this output column
167. model.pinterest.pinterest_ads__pin_promotion_report
  • Input Column: 177. model.pinterest_source.stg_pinterest_ads__campaign_history[advertiser_id]
    • Direct The column is directly copied without transformation
    • Integration Used to join with the advertisers table
    • Output Columns:
      • advertiser_id: Directly copied to the output
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 177. model.pinterest_source.stg_pinterest_ads__campaign_history[advertiser_id]
    • Integration used to join with the advertisers table
    • Direct directly copied to the output
    • Output Columns:
      • advertiser_id: directly copied
Column Lineage
%3 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp name 177. model.pinterest_source.stg_pinterest_ads__campaign_history 177. model.pinterest_source.stg_pinterest_ads__campaign_history campaign_name 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp:f0->177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0 167. model.pinterest.pinterest_ads__pin_promotion_report 167. model.pinterest.pinterest_ads__pin_promotion_report campaign_name 177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0->167. model.pinterest.pinterest_ads__pin_promotion_report:f0 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report campaign_name 177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0->168. model.pinterest.pinterest_ads__url_report:f0 166. model.pinterest.pinterest_ads__keyword_report 166. model.pinterest.pinterest_ads__keyword_report campaign_name 177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0->166. model.pinterest.pinterest_ads__keyword_report:f0 163. model.pinterest.pinterest_ads__ad_group_report 163. model.pinterest.pinterest_ads__ad_group_report campaign_name 177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0->163. model.pinterest.pinterest_ads__ad_group_report:f0 165. model.pinterest.pinterest_ads__campaign_report 165. model.pinterest.pinterest_ads__campaign_report campaign_name 177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0->165. model.pinterest.pinterest_ads__campaign_report:f0
177. model.pinterest_source.stg_pinterest_ads__campaign_history
  • Input Column: 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • campaign_name: Directly mapped to this output column
163. model.pinterest.pinterest_ads__ad_group_report
  • Input Column: 177. model.pinterest_source.stg_pinterest_ads__campaign_history[campaign_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_name: directly copied
165. model.pinterest.pinterest_ads__campaign_report
  • Input Column: 177. model.pinterest_source.stg_pinterest_ads__campaign_history[campaign_name]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • campaign_name: Directly copied to the output
166. model.pinterest.pinterest_ads__keyword_report
  • Input Column: 177. model.pinterest_source.stg_pinterest_ads__campaign_history[campaign_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_name: directly copied
167. model.pinterest.pinterest_ads__pin_promotion_report
  • Input Column: 177. model.pinterest_source.stg_pinterest_ads__campaign_history[campaign_name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • campaign_name: Directly copied to the output
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 177. model.pinterest_source.stg_pinterest_ads__campaign_history[campaign_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_name: directly copied
Column Lineage
%3 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp status 177. model.pinterest_source.stg_pinterest_ads__campaign_history 177. model.pinterest_source.stg_pinterest_ads__campaign_history campaign_status 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp:f0->177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0 167. model.pinterest.pinterest_ads__pin_promotion_report 167. model.pinterest.pinterest_ads__pin_promotion_report campaign_status 177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0->167. model.pinterest.pinterest_ads__pin_promotion_report:f0 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report campaign_status 177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0->168. model.pinterest.pinterest_ads__url_report:f0 163. model.pinterest.pinterest_ads__ad_group_report 163. model.pinterest.pinterest_ads__ad_group_report campaign_status 177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0->163. model.pinterest.pinterest_ads__ad_group_report:f0 165. model.pinterest.pinterest_ads__campaign_report 165. model.pinterest.pinterest_ads__campaign_report campaign_status 177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0->165. model.pinterest.pinterest_ads__campaign_report:f0
177. model.pinterest_source.stg_pinterest_ads__campaign_history
  • Input Column: 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp[status]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • campaign_status: Directly mapped to this output column
163. model.pinterest.pinterest_ads__ad_group_report
  • Input Column: 177. model.pinterest_source.stg_pinterest_ads__campaign_history[campaign_status]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_status: directly copied
165. model.pinterest.pinterest_ads__campaign_report
  • Input Column: 177. model.pinterest_source.stg_pinterest_ads__campaign_history[campaign_status]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • campaign_status: Directly copied to the output
167. model.pinterest.pinterest_ads__pin_promotion_report
  • Input Column: 177. model.pinterest_source.stg_pinterest_ads__campaign_history[campaign_status]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • campaign_status: Directly copied to the output
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 177. model.pinterest_source.stg_pinterest_ads__campaign_history[campaign_status]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_status: directly copied
Column Lineage
%3 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp default_ad_group_budget_in_micro_currency 177. model.pinterest_source.stg_pinterest_ads__campaign_history 177. model.pinterest_source.stg_pinterest_ads__campaign_history default_ad_group_budget_in_micro_currency 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp:f0->177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0
177. model.pinterest_source.stg_pinterest_ads__campaign_history
  • Input Column: 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp[default_ad_group_budget_in_micro_currency]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • default_ad_group_budget_in_micro_currency: Directly mapped to this output column
Column Lineage
%3 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp is_automated_campaign 177. model.pinterest_source.stg_pinterest_ads__campaign_history 177. model.pinterest_source.stg_pinterest_ads__campaign_history is_automated_campaign 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp:f0->177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0
177. model.pinterest_source.stg_pinterest_ads__campaign_history
  • Input Column: 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp[is_automated_campaign]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • is_automated_campaign: Directly mapped to this output column
Column Lineage
%3 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp is_campaign_budget_optimization 177. model.pinterest_source.stg_pinterest_ads__campaign_history 177. model.pinterest_source.stg_pinterest_ads__campaign_history is_campaign_budget_optimization 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp:f0->177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0
177. model.pinterest_source.stg_pinterest_ads__campaign_history
  • Input Column: 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp[is_campaign_budget_optimization]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • is_campaign_budget_optimization: Directly mapped to this output column
Column Lineage
%3 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp is_flexible_daily_budgets 177. model.pinterest_source.stg_pinterest_ads__campaign_history 177. model.pinterest_source.stg_pinterest_ads__campaign_history is_flexible_daily_budgets 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp:f0->177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0
177. model.pinterest_source.stg_pinterest_ads__campaign_history
  • Input Column: 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp[is_flexible_daily_budgets]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • is_flexible_daily_budgets: Directly mapped to this output column
Column Lineage
%3 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp _fivetran_synced 177. model.pinterest_source.stg_pinterest_ads__campaign_history 177. model.pinterest_source.stg_pinterest_ads__campaign_history _fivetran_synced 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp:f0->177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0
177. model.pinterest_source.stg_pinterest_ads__campaign_history
  • Input Column: 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp[_fivetran_synced]
    • Direct The column is directly copied without transformation
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • _fivetran_synced: Directly mapped to this output column
178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of TEXT data type. The query doesn't select any actual data and limits the output to 0 rows, effectively creating a template or placeholder for the table structure.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp id created_time name status _fivetran_synced advertiser_id default_ad_group_budget_in_micro_currency is_automated_campaign is_campaign_budget_optimization is_flexible_daily_budgets 337. source.pinterest_source.pinterest_ads.campaign_history 337. source.pinterest_source.pinterest_ads.campaign_history
Name Type Comment
id bigint None
created_time text None
name text None
status text None
_fivetran_synced text None
advertiser_id bigint None
default_ad_group_budget_in_micro_currency integer None
is_automated_campaign boolean None
is_campaign_budget_optimization boolean None
is_flexible_daily_budgets boolean None
Column Lineage
%3 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp id 177. model.pinterest_source.stg_pinterest_ads__campaign_history 177. model.pinterest_source.stg_pinterest_ads__campaign_history campaign_id 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp:f0->177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0 167. model.pinterest.pinterest_ads__pin_promotion_report 167. model.pinterest.pinterest_ads__pin_promotion_report campaign_id 177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0->167. model.pinterest.pinterest_ads__pin_promotion_report:f0 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report campaign_id 177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0->168. model.pinterest.pinterest_ads__url_report:f0 166. model.pinterest.pinterest_ads__keyword_report 166. model.pinterest.pinterest_ads__keyword_report campaign_id 177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0->166. model.pinterest.pinterest_ads__keyword_report:f0 163. model.pinterest.pinterest_ads__ad_group_report 163. model.pinterest.pinterest_ads__ad_group_report campaign_id 177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0->163. model.pinterest.pinterest_ads__ad_group_report:f0 165. model.pinterest.pinterest_ads__campaign_report 165. model.pinterest.pinterest_ads__campaign_report campaign_id 177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0->165. model.pinterest.pinterest_ads__campaign_report:f0
177. model.pinterest_source.stg_pinterest_ads__campaign_history
  • Input Column: 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp[id]
    • Direct The column is directly copied without transformation
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • campaign_id: Directly mapped to this output column
163. model.pinterest.pinterest_ads__ad_group_report
  • Input Column: 177. model.pinterest_source.stg_pinterest_ads__campaign_history[campaign_id]
    • Integration used to join with ad_groups table
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
165. model.pinterest.pinterest_ads__campaign_report
  • Input Column: 177. model.pinterest_source.stg_pinterest_ads__campaign_history[campaign_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with the report table
    • Output Columns:
      • campaign_id: Directly copied to the output
166. model.pinterest.pinterest_ads__keyword_report
  • Input Column: 177. model.pinterest_source.stg_pinterest_ads__campaign_history[campaign_id]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
167. model.pinterest.pinterest_ads__pin_promotion_report
  • Input Column: 177. model.pinterest_source.stg_pinterest_ads__campaign_history[campaign_id]
    • Direct The column is directly copied without transformation
    • Integration Used as the key to join with the report table
    • Output Columns:
      • campaign_id: Directly copied to the output
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 177. model.pinterest_source.stg_pinterest_ads__campaign_history[campaign_id]
    • Integration used as the key to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
Column Lineage
%3 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp created_time 177. model.pinterest_source.stg_pinterest_ads__campaign_history 177. model.pinterest_source.stg_pinterest_ads__campaign_history created_at 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp:f0->177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0
177. model.pinterest_source.stg_pinterest_ads__campaign_history
  • Input Column: 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp[created_time]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • created_at: Directly mapped to this output column
Column Lineage
%3 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp name 177. model.pinterest_source.stg_pinterest_ads__campaign_history 177. model.pinterest_source.stg_pinterest_ads__campaign_history campaign_name 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp:f0->177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0 167. model.pinterest.pinterest_ads__pin_promotion_report 167. model.pinterest.pinterest_ads__pin_promotion_report campaign_name 177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0->167. model.pinterest.pinterest_ads__pin_promotion_report:f0 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report campaign_name 177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0->168. model.pinterest.pinterest_ads__url_report:f0 166. model.pinterest.pinterest_ads__keyword_report 166. model.pinterest.pinterest_ads__keyword_report campaign_name 177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0->166. model.pinterest.pinterest_ads__keyword_report:f0 163. model.pinterest.pinterest_ads__ad_group_report 163. model.pinterest.pinterest_ads__ad_group_report campaign_name 177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0->163. model.pinterest.pinterest_ads__ad_group_report:f0 165. model.pinterest.pinterest_ads__campaign_report 165. model.pinterest.pinterest_ads__campaign_report campaign_name 177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0->165. model.pinterest.pinterest_ads__campaign_report:f0
177. model.pinterest_source.stg_pinterest_ads__campaign_history
  • Input Column: 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • campaign_name: Directly mapped to this output column
163. model.pinterest.pinterest_ads__ad_group_report
  • Input Column: 177. model.pinterest_source.stg_pinterest_ads__campaign_history[campaign_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_name: directly copied
165. model.pinterest.pinterest_ads__campaign_report
  • Input Column: 177. model.pinterest_source.stg_pinterest_ads__campaign_history[campaign_name]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • campaign_name: Directly copied to the output
166. model.pinterest.pinterest_ads__keyword_report
  • Input Column: 177. model.pinterest_source.stg_pinterest_ads__campaign_history[campaign_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_name: directly copied
167. model.pinterest.pinterest_ads__pin_promotion_report
  • Input Column: 177. model.pinterest_source.stg_pinterest_ads__campaign_history[campaign_name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • campaign_name: Directly copied to the output
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 177. model.pinterest_source.stg_pinterest_ads__campaign_history[campaign_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_name: directly copied
Column Lineage
%3 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp status 177. model.pinterest_source.stg_pinterest_ads__campaign_history 177. model.pinterest_source.stg_pinterest_ads__campaign_history campaign_status 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp:f0->177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0 167. model.pinterest.pinterest_ads__pin_promotion_report 167. model.pinterest.pinterest_ads__pin_promotion_report campaign_status 177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0->167. model.pinterest.pinterest_ads__pin_promotion_report:f0 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report campaign_status 177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0->168. model.pinterest.pinterest_ads__url_report:f0 163. model.pinterest.pinterest_ads__ad_group_report 163. model.pinterest.pinterest_ads__ad_group_report campaign_status 177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0->163. model.pinterest.pinterest_ads__ad_group_report:f0 165. model.pinterest.pinterest_ads__campaign_report 165. model.pinterest.pinterest_ads__campaign_report campaign_status 177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0->165. model.pinterest.pinterest_ads__campaign_report:f0
177. model.pinterest_source.stg_pinterest_ads__campaign_history
  • Input Column: 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp[status]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • campaign_status: Directly mapped to this output column
163. model.pinterest.pinterest_ads__ad_group_report
  • Input Column: 177. model.pinterest_source.stg_pinterest_ads__campaign_history[campaign_status]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_status: directly copied
165. model.pinterest.pinterest_ads__campaign_report
  • Input Column: 177. model.pinterest_source.stg_pinterest_ads__campaign_history[campaign_status]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • campaign_status: Directly copied to the output
167. model.pinterest.pinterest_ads__pin_promotion_report
  • Input Column: 177. model.pinterest_source.stg_pinterest_ads__campaign_history[campaign_status]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • campaign_status: Directly copied to the output
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 177. model.pinterest_source.stg_pinterest_ads__campaign_history[campaign_status]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_status: directly copied
Column Lineage
%3 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp _fivetran_synced 177. model.pinterest_source.stg_pinterest_ads__campaign_history 177. model.pinterest_source.stg_pinterest_ads__campaign_history _fivetran_synced 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp:f0->177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0
177. model.pinterest_source.stg_pinterest_ads__campaign_history
  • Input Column: 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp[_fivetran_synced]
    • Direct The column is directly copied without transformation
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • _fivetran_synced: Directly mapped to this output column
Column Lineage
%3 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp advertiser_id 177. model.pinterest_source.stg_pinterest_ads__campaign_history 177. model.pinterest_source.stg_pinterest_ads__campaign_history advertiser_id 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp:f0->177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0 167. model.pinterest.pinterest_ads__pin_promotion_report 167. model.pinterest.pinterest_ads__pin_promotion_report advertiser_id 177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0->167. model.pinterest.pinterest_ads__pin_promotion_report:f0 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report advertiser_id 177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0->168. model.pinterest.pinterest_ads__url_report:f0
177. model.pinterest_source.stg_pinterest_ads__campaign_history
  • Input Column: 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp[advertiser_id]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • advertiser_id: Directly mapped to this output column
167. model.pinterest.pinterest_ads__pin_promotion_report
  • Input Column: 177. model.pinterest_source.stg_pinterest_ads__campaign_history[advertiser_id]
    • Direct The column is directly copied without transformation
    • Integration Used to join with the advertisers table
    • Output Columns:
      • advertiser_id: Directly copied to the output
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 177. model.pinterest_source.stg_pinterest_ads__campaign_history[advertiser_id]
    • Integration used to join with the advertisers table
    • Direct directly copied to the output
    • Output Columns:
      • advertiser_id: directly copied
Column Lineage
%3 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp default_ad_group_budget_in_micro_currency 177. model.pinterest_source.stg_pinterest_ads__campaign_history 177. model.pinterest_source.stg_pinterest_ads__campaign_history default_ad_group_budget_in_micro_currency 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp:f0->177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0
177. model.pinterest_source.stg_pinterest_ads__campaign_history
  • Input Column: 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp[default_ad_group_budget_in_micro_currency]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • default_ad_group_budget_in_micro_currency: Directly mapped to this output column
Column Lineage
%3 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp is_automated_campaign 177. model.pinterest_source.stg_pinterest_ads__campaign_history 177. model.pinterest_source.stg_pinterest_ads__campaign_history is_automated_campaign 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp:f0->177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0
177. model.pinterest_source.stg_pinterest_ads__campaign_history
  • Input Column: 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp[is_automated_campaign]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • is_automated_campaign: Directly mapped to this output column
Column Lineage
%3 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp is_campaign_budget_optimization 177. model.pinterest_source.stg_pinterest_ads__campaign_history 177. model.pinterest_source.stg_pinterest_ads__campaign_history is_campaign_budget_optimization 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp:f0->177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0
177. model.pinterest_source.stg_pinterest_ads__campaign_history
  • Input Column: 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp[is_campaign_budget_optimization]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • is_campaign_budget_optimization: Directly mapped to this output column
Column Lineage
%3 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp is_flexible_daily_budgets 177. model.pinterest_source.stg_pinterest_ads__campaign_history 177. model.pinterest_source.stg_pinterest_ads__campaign_history is_flexible_daily_budgets 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp:f0->177. model.pinterest_source.stg_pinterest_ads__campaign_history:f0
177. model.pinterest_source.stg_pinterest_ads__campaign_history
  • Input Column: 178. model.pinterest_source.stg_pinterest_ads__campaign_history_tmp[is_flexible_daily_budgets]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • is_flexible_daily_budgets: Directly mapped to this output column
179. model.pinterest_source.stg_pinterest_ads__campaign_report

This SQL query performs several operations on the Pinterest ads campaign report data. It starts by casting fields to specific data types, then combines impression and clickthrough data, calculates spend in dollars from micro-dollars, and truncates the date to day level. The query also renames some columns and selects specific fields for the final output.

CleaningFeaturizationOther
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_pinterest_source.stg_pinterest_ads__campaign_report_tmp
), fields AS (
  SELECT
    CAST(NULL AS TIMESTAMP) AS _fivetran_synced,
    CAST(NULL AS TEXT) AS advertiser_id,
    CAST(NULL AS TEXT) AS campaign_id,
    CAST(NULL AS TEXT) AS campaign_name,
    CAST(NULL AS TEXT) AS campaign_status,
    CAST(NULL AS INT) AS clickthrough_1,
    CAST(NULL AS INT) AS clickthrough_2,
    CAST(NULL AS TIMESTAMP) AS date,
    CAST(NULL AS INT) AS impression_1,
    CAST(NULL AS INT) AS impression_2,
    CAST(NULL AS INT) AS spend_in_micro_dollar,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    DATE_TRUNC('DAY', date) AS date_day,
    campaign_id,
    campaign_name,
    campaign_status,
    advertiser_id,
    COALESCE(impression_1, 0) + COALESCE(impression_2, 0) AS impressions,
    COALESCE(clickthrough_1, 0) + COALESCE(clickthrough_2, 0) AS clicks,
    spend_in_micro_dollar / 1000000.0 AS spend
  FROM fields
)
SELECT
  *
FROM final
%3 179. model.pinterest_source.stg_pinterest_ads__campaign_report 179. model.pinterest_source.stg_pinterest_ads__campaign_report source_relation date_day campaign_id campaign_name campaign_status advertiser_id impressions clicks spend 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp advertiser_id campaign_id date campaign_name campaign_status clickthrough_1 impression_1 spend_in_micro_dollar 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp:f0->179. model.pinterest_source.stg_pinterest_ads__campaign_report:f5 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp:f1->179. model.pinterest_source.stg_pinterest_ads__campaign_report:f2 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp:f2->179. model.pinterest_source.stg_pinterest_ads__campaign_report:f1 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp:f3->179. model.pinterest_source.stg_pinterest_ads__campaign_report:f3 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp:f4->179. model.pinterest_source.stg_pinterest_ads__campaign_report:f4 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp:f5->179. model.pinterest_source.stg_pinterest_ads__campaign_report:f7 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp:f6->179. model.pinterest_source.stg_pinterest_ads__campaign_report:f6 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp:f7->179. model.pinterest_source.stg_pinterest_ads__campaign_report:f8
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
date_day timestamp without time zone The date of the report.
campaign_id bigint The ID representing the campaign, if present in the source data.
campaign_name text Name of the campaign.
campaign_status text Status of the campaign.
advertiser_id bigint The ID of the related Advertiser.
impressions integer The count of impressions.
clicks integer The count of clicks.
spend numeric The cost of the ads.
Column Lineage
%3 179. model.pinterest_source.stg_pinterest_ads__campaign_report 179. model.pinterest_source.stg_pinterest_ads__campaign_report source_relation 165. model.pinterest.pinterest_ads__campaign_report 165. model.pinterest.pinterest_ads__campaign_report source_relation 179. model.pinterest_source.stg_pinterest_ads__campaign_report:f0->165. model.pinterest.pinterest_ads__campaign_report:f0
165. model.pinterest.pinterest_ads__campaign_report
  • Input Column: 179. model.pinterest_source.stg_pinterest_ads__campaign_report[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with other tables
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
Column Lineage
%3 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp date 179. model.pinterest_source.stg_pinterest_ads__campaign_report 179. model.pinterest_source.stg_pinterest_ads__campaign_report date_day 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp:f0->179. model.pinterest_source.stg_pinterest_ads__campaign_report:f0 165. model.pinterest.pinterest_ads__campaign_report 165. model.pinterest.pinterest_ads__campaign_report date_day 179. model.pinterest_source.stg_pinterest_ads__campaign_report:f0->165. model.pinterest.pinterest_ads__campaign_report:f0
179. model.pinterest_source.stg_pinterest_ads__campaign_report
  • Input Column: 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp[date]
    • Cleaning The column is cast as TIMESTAMP and then truncated to day level
    • Featurization The date is transformed to represent the day level
    • Output Columns:
      • date_day: It is mapped to this output column after transformation
165. model.pinterest.pinterest_ads__campaign_report
  • Input Column: 179. model.pinterest_source.stg_pinterest_ads__campaign_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp campaign_id 179. model.pinterest_source.stg_pinterest_ads__campaign_report 179. model.pinterest_source.stg_pinterest_ads__campaign_report campaign_id 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp:f0->179. model.pinterest_source.stg_pinterest_ads__campaign_report:f0 165. model.pinterest.pinterest_ads__campaign_report 165. model.pinterest.pinterest_ads__campaign_report campaign_id 179. model.pinterest_source.stg_pinterest_ads__campaign_report:f0->165. model.pinterest.pinterest_ads__campaign_report:f0
179. model.pinterest_source.stg_pinterest_ads__campaign_report
  • Input Column: 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp[campaign_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • campaign_id: It is directly mapped to this output column
165. model.pinterest.pinterest_ads__campaign_report
  • Input Column: 179. model.pinterest_source.stg_pinterest_ads__campaign_report[campaign_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as the key to join with the campaigns table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • campaign_id: Directly copied to the output
Column Lineage
%3 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp campaign_name 179. model.pinterest_source.stg_pinterest_ads__campaign_report 179. model.pinterest_source.stg_pinterest_ads__campaign_report campaign_name 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp:f0->179. model.pinterest_source.stg_pinterest_ads__campaign_report:f0
179. model.pinterest_source.stg_pinterest_ads__campaign_report
  • Input Column: 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp[campaign_name]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • campaign_name: It is directly mapped to this output column
Column Lineage
%3 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp campaign_status 179. model.pinterest_source.stg_pinterest_ads__campaign_report 179. model.pinterest_source.stg_pinterest_ads__campaign_report campaign_status 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp:f0->179. model.pinterest_source.stg_pinterest_ads__campaign_report:f0
179. model.pinterest_source.stg_pinterest_ads__campaign_report
  • Input Column: 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp[campaign_status]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • campaign_status: It is directly mapped to this output column
Column Lineage
%3 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp advertiser_id 179. model.pinterest_source.stg_pinterest_ads__campaign_report 179. model.pinterest_source.stg_pinterest_ads__campaign_report advertiser_id 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp:f0->179. model.pinterest_source.stg_pinterest_ads__campaign_report:f0
179. model.pinterest_source.stg_pinterest_ads__campaign_report
  • Input Column: 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp[advertiser_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • advertiser_id: It is directly mapped to this output column
Column Lineage
%3 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp impression_1 179. model.pinterest_source.stg_pinterest_ads__campaign_report 179. model.pinterest_source.stg_pinterest_ads__campaign_report impressions 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp:f0->179. model.pinterest_source.stg_pinterest_ads__campaign_report:f0 165. model.pinterest.pinterest_ads__campaign_report 165. model.pinterest.pinterest_ads__campaign_report impressions 179. model.pinterest_source.stg_pinterest_ads__campaign_report:f0->165. model.pinterest.pinterest_ads__campaign_report:f0
179. model.pinterest_source.stg_pinterest_ads__campaign_report
  • Input Column: 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp[impression_1]
    • Aggregation This column is used in a COALESCE function to calculate the total impressions
    • Output Columns:
      • impressions: It's part of the calculation for the impressions output column
165. model.pinterest.pinterest_ads__campaign_report
  • Input Column: 179. model.pinterest_source.stg_pinterest_ads__campaign_report[impressions]
    • Aggregation The column is summed up in the SELECT statement
    • Output Columns:
      • impressions: Aggregated sum of impressions
Column Lineage
%3 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp clickthrough_1 179. model.pinterest_source.stg_pinterest_ads__campaign_report 179. model.pinterest_source.stg_pinterest_ads__campaign_report clicks 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp:f0->179. model.pinterest_source.stg_pinterest_ads__campaign_report:f0 165. model.pinterest.pinterest_ads__campaign_report 165. model.pinterest.pinterest_ads__campaign_report clicks 179. model.pinterest_source.stg_pinterest_ads__campaign_report:f0->165. model.pinterest.pinterest_ads__campaign_report:f0
179. model.pinterest_source.stg_pinterest_ads__campaign_report
  • Input Column: 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp[clickthrough_1]
    • Cleaning The column is cast as INT
    • Aggregation It is combined with clickthrough_2 to calculate total clicks
    • Output Columns:
      • clicks: It contributes to this output column after aggregation
165. model.pinterest.pinterest_ads__campaign_report
  • Input Column: 179. model.pinterest_source.stg_pinterest_ads__campaign_report[clicks]
    • Aggregation The column is summed up in the SELECT statement
    • Output Columns:
      • clicks: Aggregated sum of clicks
Column Lineage
%3 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp spend_in_micro_dollar 179. model.pinterest_source.stg_pinterest_ads__campaign_report 179. model.pinterest_source.stg_pinterest_ads__campaign_report spend 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp:f0->179. model.pinterest_source.stg_pinterest_ads__campaign_report:f0 165. model.pinterest.pinterest_ads__campaign_report 165. model.pinterest.pinterest_ads__campaign_report spend 179. model.pinterest_source.stg_pinterest_ads__campaign_report:f0->165. model.pinterest.pinterest_ads__campaign_report:f0
179. model.pinterest_source.stg_pinterest_ads__campaign_report
  • Input Column: 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp[spend_in_micro_dollar]
    • Cleaning The column is cast to INT type in the 'fields' CTE.
    • Featurization The value is divided by 1,000,000 to convert micro-dollars to dollars.
    • Output Columns:
      • spend: The spend_in_micro_dollar is divided by 1,000,000 to calculate the spend in dollars.
165. model.pinterest.pinterest_ads__campaign_report
  • Input Column: 179. model.pinterest_source.stg_pinterest_ads__campaign_report[spend]
    • Aggregation The column is summed up in the SELECT statement
    • Output Columns:
      • spend: Aggregated sum of spend
180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of type TEXT, which is set to NULL. The LIMIT 0 clause ensures no rows are returned. This is likely used as a template or placeholder for a staging table in a dbt (data build tool) project.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp advertiser_id campaign_id date _fivetran_synced campaign_daily_spend_cap campaign_lifetime_spend_cap campaign_name campaign_status clickthrough_1 clickthrough_1_gross cpc_in_micro_dollar cpm_in_micro_dollar ctr ecpc_in_micro_dollar ecpm_in_micro_dollar ectr engagement_1 impression_1 impression_1_gross outbound_click_1 paid_impression spend_in_micro_dollar total_engagement total_impression_frequency total_impression_user 338. source.pinterest_source.pinterest_ads.campaign_report 338. source.pinterest_source.pinterest_ads.campaign_report
Name Type Comment
advertiser_id bigint None
campaign_id bigint None
date timestamp without time zone None
_fivetran_synced timestamp without time zone None
campaign_daily_spend_cap integer None
campaign_lifetime_spend_cap integer None
campaign_name text None
campaign_status text None
clickthrough_1 integer None
clickthrough_1_gross integer None
cpc_in_micro_dollar double precision None
cpm_in_micro_dollar double precision None
ctr double precision None
ecpc_in_micro_dollar double precision None
ecpm_in_micro_dollar double precision None
ectr double precision None
engagement_1 integer None
impression_1 integer None
impression_1_gross integer None
outbound_click_1 integer None
paid_impression integer None
spend_in_micro_dollar integer None
total_engagement integer None
total_impression_frequency double precision None
total_impression_user integer None
Column Lineage
%3 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp advertiser_id 179. model.pinterest_source.stg_pinterest_ads__campaign_report 179. model.pinterest_source.stg_pinterest_ads__campaign_report advertiser_id 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp:f0->179. model.pinterest_source.stg_pinterest_ads__campaign_report:f0
179. model.pinterest_source.stg_pinterest_ads__campaign_report
  • Input Column: 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp[advertiser_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • advertiser_id: It is directly mapped to this output column
Column Lineage
%3 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp campaign_id 179. model.pinterest_source.stg_pinterest_ads__campaign_report 179. model.pinterest_source.stg_pinterest_ads__campaign_report campaign_id 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp:f0->179. model.pinterest_source.stg_pinterest_ads__campaign_report:f0 165. model.pinterest.pinterest_ads__campaign_report 165. model.pinterest.pinterest_ads__campaign_report campaign_id 179. model.pinterest_source.stg_pinterest_ads__campaign_report:f0->165. model.pinterest.pinterest_ads__campaign_report:f0
179. model.pinterest_source.stg_pinterest_ads__campaign_report
  • Input Column: 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp[campaign_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • campaign_id: It is directly mapped to this output column
165. model.pinterest.pinterest_ads__campaign_report
  • Input Column: 179. model.pinterest_source.stg_pinterest_ads__campaign_report[campaign_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as the key to join with the campaigns table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • campaign_id: Directly copied to the output
Column Lineage
%3 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp date 179. model.pinterest_source.stg_pinterest_ads__campaign_report 179. model.pinterest_source.stg_pinterest_ads__campaign_report date_day 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp:f0->179. model.pinterest_source.stg_pinterest_ads__campaign_report:f0 165. model.pinterest.pinterest_ads__campaign_report 165. model.pinterest.pinterest_ads__campaign_report date_day 179. model.pinterest_source.stg_pinterest_ads__campaign_report:f0->165. model.pinterest.pinterest_ads__campaign_report:f0
179. model.pinterest_source.stg_pinterest_ads__campaign_report
  • Input Column: 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp[date]
    • Cleaning The column is cast as TIMESTAMP and then truncated to day level
    • Featurization The date is transformed to represent the day level
    • Output Columns:
      • date_day: It is mapped to this output column after transformation
165. model.pinterest.pinterest_ads__campaign_report
  • Input Column: 179. model.pinterest_source.stg_pinterest_ads__campaign_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp campaign_name 179. model.pinterest_source.stg_pinterest_ads__campaign_report 179. model.pinterest_source.stg_pinterest_ads__campaign_report campaign_name 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp:f0->179. model.pinterest_source.stg_pinterest_ads__campaign_report:f0
179. model.pinterest_source.stg_pinterest_ads__campaign_report
  • Input Column: 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp[campaign_name]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • campaign_name: It is directly mapped to this output column
Column Lineage
%3 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp campaign_status 179. model.pinterest_source.stg_pinterest_ads__campaign_report 179. model.pinterest_source.stg_pinterest_ads__campaign_report campaign_status 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp:f0->179. model.pinterest_source.stg_pinterest_ads__campaign_report:f0
179. model.pinterest_source.stg_pinterest_ads__campaign_report
  • Input Column: 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp[campaign_status]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • campaign_status: It is directly mapped to this output column
Column Lineage
%3 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp clickthrough_1 179. model.pinterest_source.stg_pinterest_ads__campaign_report 179. model.pinterest_source.stg_pinterest_ads__campaign_report clicks 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp:f0->179. model.pinterest_source.stg_pinterest_ads__campaign_report:f0 165. model.pinterest.pinterest_ads__campaign_report 165. model.pinterest.pinterest_ads__campaign_report clicks 179. model.pinterest_source.stg_pinterest_ads__campaign_report:f0->165. model.pinterest.pinterest_ads__campaign_report:f0
179. model.pinterest_source.stg_pinterest_ads__campaign_report
  • Input Column: 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp[clickthrough_1]
    • Cleaning The column is cast as INT
    • Aggregation It is combined with clickthrough_2 to calculate total clicks
    • Output Columns:
      • clicks: It contributes to this output column after aggregation
165. model.pinterest.pinterest_ads__campaign_report
  • Input Column: 179. model.pinterest_source.stg_pinterest_ads__campaign_report[clicks]
    • Aggregation The column is summed up in the SELECT statement
    • Output Columns:
      • clicks: Aggregated sum of clicks
Column Lineage
%3 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp impression_1 179. model.pinterest_source.stg_pinterest_ads__campaign_report 179. model.pinterest_source.stg_pinterest_ads__campaign_report impressions 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp:f0->179. model.pinterest_source.stg_pinterest_ads__campaign_report:f0 165. model.pinterest.pinterest_ads__campaign_report 165. model.pinterest.pinterest_ads__campaign_report impressions 179. model.pinterest_source.stg_pinterest_ads__campaign_report:f0->165. model.pinterest.pinterest_ads__campaign_report:f0
179. model.pinterest_source.stg_pinterest_ads__campaign_report
  • Input Column: 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp[impression_1]
    • Aggregation This column is used in a COALESCE function to calculate the total impressions
    • Output Columns:
      • impressions: It's part of the calculation for the impressions output column
165. model.pinterest.pinterest_ads__campaign_report
  • Input Column: 179. model.pinterest_source.stg_pinterest_ads__campaign_report[impressions]
    • Aggregation The column is summed up in the SELECT statement
    • Output Columns:
      • impressions: Aggregated sum of impressions
Column Lineage
%3 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp spend_in_micro_dollar 179. model.pinterest_source.stg_pinterest_ads__campaign_report 179. model.pinterest_source.stg_pinterest_ads__campaign_report spend 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp:f0->179. model.pinterest_source.stg_pinterest_ads__campaign_report:f0 165. model.pinterest.pinterest_ads__campaign_report 165. model.pinterest.pinterest_ads__campaign_report spend 179. model.pinterest_source.stg_pinterest_ads__campaign_report:f0->165. model.pinterest.pinterest_ads__campaign_report:f0
179. model.pinterest_source.stg_pinterest_ads__campaign_report
  • Input Column: 180. model.pinterest_source.stg_pinterest_ads__campaign_report_tmp[spend_in_micro_dollar]
    • Cleaning The column is cast to INT type in the 'fields' CTE.
    • Featurization The value is divided by 1,000,000 to convert micro-dollars to dollars.
    • Output Columns:
      • spend: The spend_in_micro_dollar is divided by 1,000,000 to calculate the spend in dollars.
165. model.pinterest.pinterest_ads__campaign_report
  • Input Column: 179. model.pinterest_source.stg_pinterest_ads__campaign_report[spend]
    • Aggregation The column is summed up in the SELECT statement
    • Output Columns:
      • spend: Aggregated sum of spend
181. model.pinterest_source.stg_pinterest_ads__keyword_history

This SQL query performs a series of transformations on data from a Pinterest ads keyword history table. It starts by casting all fields to specific data types, then renames and reorganizes some columns. Finally, it adds a flag to identify the most recent record for each keyword using a window function.

CleaningDeduplicationOther
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_pinterest_source.stg_pinterest_ads__keyword_history_tmp
), fields AS (
  SELECT
    CAST(NULL AS TEXT) AS _fivetran_id,
    CAST(NULL AS TIMESTAMP) AS _fivetran_synced,
    CAST(NULL AS TEXT) AS ad_group_id,
    CAST(NULL AS TEXT) AS advertiser_id,
    CAST(NULL AS BOOLEAN) AS archived,
    CAST(NULL AS INT) AS bid,
    CAST(NULL AS TEXT) AS campaign_id,
    CAST(NULL AS TEXT) AS id,
    CAST(NULL AS TEXT) AS match_type,
    CAST(NULL AS TEXT) AS parent_type,
    CAST(NULL AS TEXT) AS value,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    id AS keyword_id,
    value AS keyword_value,
    _fivetran_id,
    _fivetran_synced,
    ad_group_id,
    advertiser_id,
    archived,
    bid,
    campaign_id,
    match_type,
    parent_type,
    ROW_NUMBER() OVER (PARTITION BY source_relation, id ORDER BY _fivetran_synced DESC) = 1 AS is_most_recent_record
  FROM fields
)
SELECT
  *
FROM final
%3 181. model.pinterest_source.stg_pinterest_ads__keyword_history 181. model.pinterest_source.stg_pinterest_ads__keyword_history source_relation keyword_id keyword_value _fivetran_id _fivetran_synced ad_group_id advertiser_id archived bid campaign_id match_type parent_type is_most_recent_record 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp _fivetran_id _fivetran_synced ad_group_id advertiser_id archived bid campaign_id id match_type parent_type value 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp:f0->181. model.pinterest_source.stg_pinterest_ads__keyword_history:f3 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp:f1->181. model.pinterest_source.stg_pinterest_ads__keyword_history:f4 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp:f1->181. model.pinterest_source.stg_pinterest_ads__keyword_history:f12 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp:f2->181. model.pinterest_source.stg_pinterest_ads__keyword_history:f5 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp:f3->181. model.pinterest_source.stg_pinterest_ads__keyword_history:f6 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp:f4->181. model.pinterest_source.stg_pinterest_ads__keyword_history:f7 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp:f5->181. model.pinterest_source.stg_pinterest_ads__keyword_history:f8 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp:f6->181. model.pinterest_source.stg_pinterest_ads__keyword_history:f9 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp:f7->181. model.pinterest_source.stg_pinterest_ads__keyword_history:f1 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp:f8->181. model.pinterest_source.stg_pinterest_ads__keyword_history:f10 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp:f9->181. model.pinterest_source.stg_pinterest_ads__keyword_history:f11 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp:f10->181. model.pinterest_source.stg_pinterest_ads__keyword_history:f2
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
keyword_id bigint Unique identifier of the keyword.
keyword_value text The text value that makes upd the keyword.
_fivetran_id text The unique identifier of the record within the Fivetran synced table.
_fivetran_synced timestamp without time zone Timestamp of when a record was last synced.
ad_group_id bigint The ID representing the ad group, if present in the source data.
advertiser_id bigint The ID of the related Advertiser.
archived boolean Boolean indicating if the keyword is archived.
bid integer Bid amount set for the keyword.
campaign_id bigint The ID representing the campaign, if present in the source data.
match_type text Type of match the keyword is tied to. Either Exact or Broad.
parent_type text Identifier of what grain the parent type is. Ad group or campaign.
is_most_recent_record boolean Boolean representing whether the record is the most recent version of the object.
Column Lineage
%3 181. model.pinterest_source.stg_pinterest_ads__keyword_history 181. model.pinterest_source.stg_pinterest_ads__keyword_history source_relation 166. model.pinterest.pinterest_ads__keyword_report 166. model.pinterest.pinterest_ads__keyword_report source_relation 181. model.pinterest_source.stg_pinterest_ads__keyword_history:f0->166. model.pinterest.pinterest_ads__keyword_report:f0
166. model.pinterest.pinterest_ads__keyword_report
  • Input Column: 181. model.pinterest_source.stg_pinterest_ads__keyword_history[source_relation]
    • Direct The column is directly copied without transformation
    • Integration Used as part of the join conditions with other tables
    • Output Columns:
      • source_relation: Directly copied to the output
Column Lineage
%3 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp id 181. model.pinterest_source.stg_pinterest_ads__keyword_history 181. model.pinterest_source.stg_pinterest_ads__keyword_history keyword_id 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp:f0->181. model.pinterest_source.stg_pinterest_ads__keyword_history:f0 166. model.pinterest.pinterest_ads__keyword_report 166. model.pinterest.pinterest_ads__keyword_report keyword_id 181. model.pinterest_source.stg_pinterest_ads__keyword_history:f0->166. model.pinterest.pinterest_ads__keyword_report:f0
181. model.pinterest_source.stg_pinterest_ads__keyword_history
  • Input Column: 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp[id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Deduplication Used in the PARTITION BY clause of the window function
    • Output Columns:
      • keyword_id: Renamed and directly copied after casting
166. model.pinterest.pinterest_ads__keyword_report
  • Input Column: 181. model.pinterest_source.stg_pinterest_ads__keyword_history[keyword_id]
    • Direct The column is directly copied without transformation
    • Integration Used as a key to join with the report table
    • Output Columns:
      • keyword_id: Directly copied to the output
Column Lineage
%3 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp value 181. model.pinterest_source.stg_pinterest_ads__keyword_history 181. model.pinterest_source.stg_pinterest_ads__keyword_history keyword_value 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp:f0->181. model.pinterest_source.stg_pinterest_ads__keyword_history:f0 166. model.pinterest.pinterest_ads__keyword_report 166. model.pinterest.pinterest_ads__keyword_report keyword_value 181. model.pinterest_source.stg_pinterest_ads__keyword_history:f0->166. model.pinterest.pinterest_ads__keyword_report:f0
181. model.pinterest_source.stg_pinterest_ads__keyword_history
  • Input Column: 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp[value]
    • Direct The 'value' column is directly copied to the 'keyword_value' column in the output without any transformation.
    • Cleaning The column is cast as TEXT in the 'fields' CTE.
    • Output Columns:
      • keyword_value: The 'value' column is directly mapped to 'keyword_value' in the final output.
166. model.pinterest.pinterest_ads__keyword_report
  • Input Column: 181. model.pinterest_source.stg_pinterest_ads__keyword_history[keyword_value]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • keyword_value: Directly copied to the output
Column Lineage
%3 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp _fivetran_id 181. model.pinterest_source.stg_pinterest_ads__keyword_history 181. model.pinterest_source.stg_pinterest_ads__keyword_history _fivetran_id 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp:f0->181. model.pinterest_source.stg_pinterest_ads__keyword_history:f0
181. model.pinterest_source.stg_pinterest_ads__keyword_history
  • Input Column: 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp[_fivetran_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • _fivetran_id: Directly copied after casting
Column Lineage
%3 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp _fivetran_synced 181. model.pinterest_source.stg_pinterest_ads__keyword_history 181. model.pinterest_source.stg_pinterest_ads__keyword_history _fivetran_synced is_most_recent_record 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp:f0->181. model.pinterest_source.stg_pinterest_ads__keyword_history:f0 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp:f0->181. model.pinterest_source.stg_pinterest_ads__keyword_history:f1
181. model.pinterest_source.stg_pinterest_ads__keyword_history
  • Input Column: 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp[_fivetran_synced]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TIMESTAMP
    • Deduplication Used in the window function to determine the most recent record
    • Output Columns:
      • _fivetran_synced: Directly copied after casting
      • is_most_recent_record: Used to determine this flag
Column Lineage
%3 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp ad_group_id 181. model.pinterest_source.stg_pinterest_ads__keyword_history 181. model.pinterest_source.stg_pinterest_ads__keyword_history ad_group_id 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp:f0->181. model.pinterest_source.stg_pinterest_ads__keyword_history:f0
181. model.pinterest_source.stg_pinterest_ads__keyword_history
  • Input Column: 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp[ad_group_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • ad_group_id: Directly copied after casting
Column Lineage
%3 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp advertiser_id 181. model.pinterest_source.stg_pinterest_ads__keyword_history 181. model.pinterest_source.stg_pinterest_ads__keyword_history advertiser_id 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp:f0->181. model.pinterest_source.stg_pinterest_ads__keyword_history:f0
181. model.pinterest_source.stg_pinterest_ads__keyword_history
  • Input Column: 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp[advertiser_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • advertiser_id: Directly copied after casting
Column Lineage
%3 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp archived 181. model.pinterest_source.stg_pinterest_ads__keyword_history 181. model.pinterest_source.stg_pinterest_ads__keyword_history archived 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp:f0->181. model.pinterest_source.stg_pinterest_ads__keyword_history:f0
181. model.pinterest_source.stg_pinterest_ads__keyword_history
  • Input Column: 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp[archived]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as BOOLEAN
    • Output Columns:
      • archived: Directly copied after casting
Column Lineage
%3 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp bid 181. model.pinterest_source.stg_pinterest_ads__keyword_history 181. model.pinterest_source.stg_pinterest_ads__keyword_history bid 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp:f0->181. model.pinterest_source.stg_pinterest_ads__keyword_history:f0
181. model.pinterest_source.stg_pinterest_ads__keyword_history
  • Input Column: 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp[bid]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT
    • Output Columns:
      • bid: Directly copied after casting
Column Lineage
%3 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp campaign_id 181. model.pinterest_source.stg_pinterest_ads__keyword_history 181. model.pinterest_source.stg_pinterest_ads__keyword_history campaign_id 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp:f0->181. model.pinterest_source.stg_pinterest_ads__keyword_history:f0
181. model.pinterest_source.stg_pinterest_ads__keyword_history
  • Input Column: 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp[campaign_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • campaign_id: Directly copied after casting
Column Lineage
%3 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp match_type 181. model.pinterest_source.stg_pinterest_ads__keyword_history 181. model.pinterest_source.stg_pinterest_ads__keyword_history match_type 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp:f0->181. model.pinterest_source.stg_pinterest_ads__keyword_history:f0 166. model.pinterest.pinterest_ads__keyword_report 166. model.pinterest.pinterest_ads__keyword_report match_type 181. model.pinterest_source.stg_pinterest_ads__keyword_history:f0->166. model.pinterest.pinterest_ads__keyword_report:f0
181. model.pinterest_source.stg_pinterest_ads__keyword_history
  • Input Column: 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp[match_type]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • match_type: Directly copied after casting
166. model.pinterest.pinterest_ads__keyword_report
  • Input Column: 181. model.pinterest_source.stg_pinterest_ads__keyword_history[match_type]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the report table
    • Output Columns:
      • match_type: It is directly copied to the output column 'match_type'
Column Lineage
%3 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp parent_type 181. model.pinterest_source.stg_pinterest_ads__keyword_history 181. model.pinterest_source.stg_pinterest_ads__keyword_history parent_type 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp:f0->181. model.pinterest_source.stg_pinterest_ads__keyword_history:f0 166. model.pinterest.pinterest_ads__keyword_report 166. model.pinterest.pinterest_ads__keyword_report parent_type 181. model.pinterest_source.stg_pinterest_ads__keyword_history:f0->166. model.pinterest.pinterest_ads__keyword_report:f0
181. model.pinterest_source.stg_pinterest_ads__keyword_history
  • Input Column: 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp[parent_type]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • parent_type: Directly copied after casting
166. model.pinterest.pinterest_ads__keyword_report
  • Input Column: 181. model.pinterest_source.stg_pinterest_ads__keyword_history[parent_type]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the report table
    • Output Columns:
      • parent_type: It is directly copied to the output column 'parent_type'
Column Lineage
%3 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp _fivetran_synced 181. model.pinterest_source.stg_pinterest_ads__keyword_history 181. model.pinterest_source.stg_pinterest_ads__keyword_history _fivetran_synced is_most_recent_record 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp:f0->181. model.pinterest_source.stg_pinterest_ads__keyword_history:f0 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp:f0->181. model.pinterest_source.stg_pinterest_ads__keyword_history:f1
181. model.pinterest_source.stg_pinterest_ads__keyword_history
  • Input Column: 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp[_fivetran_synced]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TIMESTAMP
    • Deduplication Used in the window function to determine the most recent record
    • Output Columns:
      • _fivetran_synced: Directly copied after casting
      • is_most_recent_record: Used to determine this flag
182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of type TEXT, initialized to NULL. The query is limited to 0 rows, effectively creating a schema-only representation of the table without any data.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp _fivetran_id _fivetran_synced ad_group_id advertiser_id archived bid campaign_id id match_type parent_type value 339. source.pinterest_source.pinterest_ads.keyword_history 339. source.pinterest_source.pinterest_ads.keyword_history
Name Type Comment
_fivetran_id text None
_fivetran_synced timestamp without time zone None
ad_group_id bigint None
advertiser_id bigint None
archived boolean None
bid integer None
campaign_id bigint None
id bigint None
match_type text None
parent_type text None
value text None
Column Lineage
%3 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp _fivetran_id 181. model.pinterest_source.stg_pinterest_ads__keyword_history 181. model.pinterest_source.stg_pinterest_ads__keyword_history _fivetran_id 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp:f0->181. model.pinterest_source.stg_pinterest_ads__keyword_history:f0
181. model.pinterest_source.stg_pinterest_ads__keyword_history
  • Input Column: 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp[_fivetran_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • _fivetran_id: Directly copied after casting
Column Lineage
%3 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp _fivetran_synced 181. model.pinterest_source.stg_pinterest_ads__keyword_history 181. model.pinterest_source.stg_pinterest_ads__keyword_history _fivetran_synced is_most_recent_record 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp:f0->181. model.pinterest_source.stg_pinterest_ads__keyword_history:f0 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp:f0->181. model.pinterest_source.stg_pinterest_ads__keyword_history:f1
181. model.pinterest_source.stg_pinterest_ads__keyword_history
  • Input Column: 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp[_fivetran_synced]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TIMESTAMP
    • Deduplication Used in the window function to determine the most recent record
    • Output Columns:
      • _fivetran_synced: Directly copied after casting
      • is_most_recent_record: Used to determine this flag
Column Lineage
%3 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp ad_group_id 181. model.pinterest_source.stg_pinterest_ads__keyword_history 181. model.pinterest_source.stg_pinterest_ads__keyword_history ad_group_id 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp:f0->181. model.pinterest_source.stg_pinterest_ads__keyword_history:f0
181. model.pinterest_source.stg_pinterest_ads__keyword_history
  • Input Column: 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp[ad_group_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • ad_group_id: Directly copied after casting
Column Lineage
%3 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp advertiser_id 181. model.pinterest_source.stg_pinterest_ads__keyword_history 181. model.pinterest_source.stg_pinterest_ads__keyword_history advertiser_id 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp:f0->181. model.pinterest_source.stg_pinterest_ads__keyword_history:f0
181. model.pinterest_source.stg_pinterest_ads__keyword_history
  • Input Column: 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp[advertiser_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • advertiser_id: Directly copied after casting
Column Lineage
%3 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp archived 181. model.pinterest_source.stg_pinterest_ads__keyword_history 181. model.pinterest_source.stg_pinterest_ads__keyword_history archived 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp:f0->181. model.pinterest_source.stg_pinterest_ads__keyword_history:f0
181. model.pinterest_source.stg_pinterest_ads__keyword_history
  • Input Column: 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp[archived]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as BOOLEAN
    • Output Columns:
      • archived: Directly copied after casting
Column Lineage
%3 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp bid 181. model.pinterest_source.stg_pinterest_ads__keyword_history 181. model.pinterest_source.stg_pinterest_ads__keyword_history bid 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp:f0->181. model.pinterest_source.stg_pinterest_ads__keyword_history:f0
181. model.pinterest_source.stg_pinterest_ads__keyword_history
  • Input Column: 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp[bid]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT
    • Output Columns:
      • bid: Directly copied after casting
Column Lineage
%3 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp campaign_id 181. model.pinterest_source.stg_pinterest_ads__keyword_history 181. model.pinterest_source.stg_pinterest_ads__keyword_history campaign_id 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp:f0->181. model.pinterest_source.stg_pinterest_ads__keyword_history:f0
181. model.pinterest_source.stg_pinterest_ads__keyword_history
  • Input Column: 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp[campaign_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • campaign_id: Directly copied after casting
Column Lineage
%3 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp id 181. model.pinterest_source.stg_pinterest_ads__keyword_history 181. model.pinterest_source.stg_pinterest_ads__keyword_history keyword_id 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp:f0->181. model.pinterest_source.stg_pinterest_ads__keyword_history:f0 166. model.pinterest.pinterest_ads__keyword_report 166. model.pinterest.pinterest_ads__keyword_report keyword_id 181. model.pinterest_source.stg_pinterest_ads__keyword_history:f0->166. model.pinterest.pinterest_ads__keyword_report:f0
181. model.pinterest_source.stg_pinterest_ads__keyword_history
  • Input Column: 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp[id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Deduplication Used in the PARTITION BY clause of the window function
    • Output Columns:
      • keyword_id: Renamed and directly copied after casting
166. model.pinterest.pinterest_ads__keyword_report
  • Input Column: 181. model.pinterest_source.stg_pinterest_ads__keyword_history[keyword_id]
    • Direct The column is directly copied without transformation
    • Integration Used as a key to join with the report table
    • Output Columns:
      • keyword_id: Directly copied to the output
Column Lineage
%3 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp match_type 181. model.pinterest_source.stg_pinterest_ads__keyword_history 181. model.pinterest_source.stg_pinterest_ads__keyword_history match_type 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp:f0->181. model.pinterest_source.stg_pinterest_ads__keyword_history:f0 166. model.pinterest.pinterest_ads__keyword_report 166. model.pinterest.pinterest_ads__keyword_report match_type 181. model.pinterest_source.stg_pinterest_ads__keyword_history:f0->166. model.pinterest.pinterest_ads__keyword_report:f0
181. model.pinterest_source.stg_pinterest_ads__keyword_history
  • Input Column: 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp[match_type]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • match_type: Directly copied after casting
166. model.pinterest.pinterest_ads__keyword_report
  • Input Column: 181. model.pinterest_source.stg_pinterest_ads__keyword_history[match_type]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the report table
    • Output Columns:
      • match_type: It is directly copied to the output column 'match_type'
Column Lineage
%3 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp parent_type 181. model.pinterest_source.stg_pinterest_ads__keyword_history 181. model.pinterest_source.stg_pinterest_ads__keyword_history parent_type 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp:f0->181. model.pinterest_source.stg_pinterest_ads__keyword_history:f0 166. model.pinterest.pinterest_ads__keyword_report 166. model.pinterest.pinterest_ads__keyword_report parent_type 181. model.pinterest_source.stg_pinterest_ads__keyword_history:f0->166. model.pinterest.pinterest_ads__keyword_report:f0
181. model.pinterest_source.stg_pinterest_ads__keyword_history
  • Input Column: 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp[parent_type]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • parent_type: Directly copied after casting
166. model.pinterest.pinterest_ads__keyword_report
  • Input Column: 181. model.pinterest_source.stg_pinterest_ads__keyword_history[parent_type]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the report table
    • Output Columns:
      • parent_type: It is directly copied to the output column 'parent_type'
Column Lineage
%3 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp value 181. model.pinterest_source.stg_pinterest_ads__keyword_history 181. model.pinterest_source.stg_pinterest_ads__keyword_history keyword_value 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp:f0->181. model.pinterest_source.stg_pinterest_ads__keyword_history:f0 166. model.pinterest.pinterest_ads__keyword_report 166. model.pinterest.pinterest_ads__keyword_report keyword_value 181. model.pinterest_source.stg_pinterest_ads__keyword_history:f0->166. model.pinterest.pinterest_ads__keyword_report:f0
181. model.pinterest_source.stg_pinterest_ads__keyword_history
  • Input Column: 182. model.pinterest_source.stg_pinterest_ads__keyword_history_tmp[value]
    • Direct The 'value' column is directly copied to the 'keyword_value' column in the output without any transformation.
    • Cleaning The column is cast as TEXT in the 'fields' CTE.
    • Output Columns:
      • keyword_value: The 'value' column is directly mapped to 'keyword_value' in the final output.
166. model.pinterest.pinterest_ads__keyword_report
  • Input Column: 181. model.pinterest_source.stg_pinterest_ads__keyword_history[keyword_value]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • keyword_value: Directly copied to the output
183. model.pinterest_source.stg_pinterest_ads__keyword_report

This SQL query stages data from a Pinterest ads keyword report. It performs type casting on various fields, combines impression and clickthrough data, calculates spend in dollars from micro-dollars, and truncates the date to day level. The query also adds a source_relation field and renames some columns for clarity.

CleaningFeaturization
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_pinterest_source.stg_pinterest_ads__keyword_report_tmp
), fields AS (
  SELECT
    CAST(NULL AS TIMESTAMP) AS _fivetran_synced,
    CAST(NULL AS TEXT) AS ad_group_id,
    CAST(NULL AS TEXT) AS ad_group_name,
    CAST(NULL AS TEXT) AS ad_group_status,
    CAST(NULL AS TEXT) AS advertiser_id,
    CAST(NULL AS TEXT) AS campaign_id,
    CAST(NULL AS INT) AS clickthrough_1,
    CAST(NULL AS INT) AS clickthrough_2,
    CAST(NULL AS TIMESTAMP) AS date,
    CAST(NULL AS INT) AS impression_1,
    CAST(NULL AS INT) AS impression_2,
    CAST(NULL AS TEXT) AS keyword_id,
    CAST(NULL AS TEXT) AS pin_promotion_id,
    CAST(NULL AS INT) AS spend_in_micro_dollar,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    DATE_TRUNC('DAY', date) AS date_day,
    keyword_id,
    pin_promotion_id,
    ad_group_id,
    ad_group_name,
    ad_group_status,
    campaign_id,
    advertiser_id,
    COALESCE(impression_1, 0) + COALESCE(impression_2, 0) AS impressions,
    COALESCE(clickthrough_1, 0) + COALESCE(clickthrough_2, 0) AS clicks,
    spend_in_micro_dollar / 1000000.0 AS spend
  FROM fields
)
SELECT
  *
FROM final
%3 183. model.pinterest_source.stg_pinterest_ads__keyword_report 183. model.pinterest_source.stg_pinterest_ads__keyword_report source_relation date_day keyword_id pin_promotion_id ad_group_id ad_group_name ad_group_status campaign_id advertiser_id impressions clicks spend 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp ad_group_id advertiser_id campaign_id date keyword_id pin_promotion_id ad_group_name ad_group_status clickthrough_1 impression_1 spend_in_micro_dollar 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp:f0->183. model.pinterest_source.stg_pinterest_ads__keyword_report:f4 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp:f1->183. model.pinterest_source.stg_pinterest_ads__keyword_report:f8 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp:f2->183. model.pinterest_source.stg_pinterest_ads__keyword_report:f7 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp:f3->183. model.pinterest_source.stg_pinterest_ads__keyword_report:f1 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp:f4->183. model.pinterest_source.stg_pinterest_ads__keyword_report:f2 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp:f5->183. model.pinterest_source.stg_pinterest_ads__keyword_report:f3 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp:f6->183. model.pinterest_source.stg_pinterest_ads__keyword_report:f5 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp:f7->183. model.pinterest_source.stg_pinterest_ads__keyword_report:f6 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp:f8->183. model.pinterest_source.stg_pinterest_ads__keyword_report:f10 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp:f9->183. model.pinterest_source.stg_pinterest_ads__keyword_report:f9 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp:f10->183. model.pinterest_source.stg_pinterest_ads__keyword_report:f11
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
date_day timestamp without time zone The date of the report.
keyword_id bigint Unique identifier of the keyword.
pin_promotion_id bigint The ID of the related Pin promotion.
ad_group_id bigint The ID representing the ad group, if present in the source data.
ad_group_name text Name of the ad group.
ad_group_status text Status of the ad group.
campaign_id bigint The ID representing the campaign, if present in the source data.
advertiser_id bigint The ID of the related Advertiser.
impressions integer The count of impressions.
clicks integer The count of clicks.
spend numeric The cost of the ads.
Column Lineage
%3 183. model.pinterest_source.stg_pinterest_ads__keyword_report 183. model.pinterest_source.stg_pinterest_ads__keyword_report source_relation 166. model.pinterest.pinterest_ads__keyword_report 166. model.pinterest.pinterest_ads__keyword_report source_relation 183. model.pinterest_source.stg_pinterest_ads__keyword_report:f0->166. model.pinterest.pinterest_ads__keyword_report:f0
166. model.pinterest.pinterest_ads__keyword_report
  • Input Column: 183. model.pinterest_source.stg_pinterest_ads__keyword_report[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with other tables
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
Column Lineage
%3 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp date 183. model.pinterest_source.stg_pinterest_ads__keyword_report 183. model.pinterest_source.stg_pinterest_ads__keyword_report date_day 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp:f0->183. model.pinterest_source.stg_pinterest_ads__keyword_report:f0 166. model.pinterest.pinterest_ads__keyword_report 166. model.pinterest.pinterest_ads__keyword_report date_day 183. model.pinterest_source.stg_pinterest_ads__keyword_report:f0->166. model.pinterest.pinterest_ads__keyword_report:f0
183. model.pinterest_source.stg_pinterest_ads__keyword_report
  • Input Column: 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp[date]
    • Cleaning The column is cast as TIMESTAMP and truncated to day level
    • Featurization The date is transformed to represent the day level
    • Output Columns:
      • date_day: Mapped after casting and truncating to day level
166. model.pinterest.pinterest_ads__keyword_report
  • Input Column: 183. model.pinterest_source.stg_pinterest_ads__keyword_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp keyword_id 183. model.pinterest_source.stg_pinterest_ads__keyword_report 183. model.pinterest_source.stg_pinterest_ads__keyword_report keyword_id 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp:f0->183. model.pinterest_source.stg_pinterest_ads__keyword_report:f0 166. model.pinterest.pinterest_ads__keyword_report 166. model.pinterest.pinterest_ads__keyword_report keyword_id 183. model.pinterest_source.stg_pinterest_ads__keyword_report:f0->166. model.pinterest.pinterest_ads__keyword_report:f0
183. model.pinterest_source.stg_pinterest_ads__keyword_report
  • Input Column: 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp[keyword_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • keyword_id: Directly mapped after casting
166. model.pinterest.pinterest_ads__keyword_report
  • Input Column: 183. model.pinterest_source.stg_pinterest_ads__keyword_report[keyword_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as the key to join with the keywords table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • keyword_id: Directly copied to the output
Column Lineage
%3 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp pin_promotion_id 183. model.pinterest_source.stg_pinterest_ads__keyword_report 183. model.pinterest_source.stg_pinterest_ads__keyword_report pin_promotion_id 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp:f0->183. model.pinterest_source.stg_pinterest_ads__keyword_report:f0
183. model.pinterest_source.stg_pinterest_ads__keyword_report
  • Input Column: 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp[pin_promotion_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • pin_promotion_id: Directly mapped after casting
Column Lineage
%3 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp ad_group_id 183. model.pinterest_source.stg_pinterest_ads__keyword_report 183. model.pinterest_source.stg_pinterest_ads__keyword_report ad_group_id 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp:f0->183. model.pinterest_source.stg_pinterest_ads__keyword_report:f0
183. model.pinterest_source.stg_pinterest_ads__keyword_report
  • Input Column: 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp[ad_group_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • ad_group_id: Directly mapped after casting
Column Lineage
%3 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp ad_group_name 183. model.pinterest_source.stg_pinterest_ads__keyword_report 183. model.pinterest_source.stg_pinterest_ads__keyword_report ad_group_name 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp:f0->183. model.pinterest_source.stg_pinterest_ads__keyword_report:f0
183. model.pinterest_source.stg_pinterest_ads__keyword_report
  • Input Column: 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp[ad_group_name]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • ad_group_name: Directly mapped after casting
Column Lineage
%3 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp ad_group_status 183. model.pinterest_source.stg_pinterest_ads__keyword_report 183. model.pinterest_source.stg_pinterest_ads__keyword_report ad_group_status 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp:f0->183. model.pinterest_source.stg_pinterest_ads__keyword_report:f0
183. model.pinterest_source.stg_pinterest_ads__keyword_report
  • Input Column: 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp[ad_group_status]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • ad_group_status: Directly mapped after casting
Column Lineage
%3 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp campaign_id 183. model.pinterest_source.stg_pinterest_ads__keyword_report 183. model.pinterest_source.stg_pinterest_ads__keyword_report campaign_id 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp:f0->183. model.pinterest_source.stg_pinterest_ads__keyword_report:f0
183. model.pinterest_source.stg_pinterest_ads__keyword_report
  • Input Column: 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp[campaign_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • campaign_id: Directly mapped after casting
Column Lineage
%3 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp advertiser_id 183. model.pinterest_source.stg_pinterest_ads__keyword_report 183. model.pinterest_source.stg_pinterest_ads__keyword_report advertiser_id 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp:f0->183. model.pinterest_source.stg_pinterest_ads__keyword_report:f0
183. model.pinterest_source.stg_pinterest_ads__keyword_report
  • Input Column: 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp[advertiser_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • advertiser_id: Directly mapped after casting
Column Lineage
%3 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp impression_1 183. model.pinterest_source.stg_pinterest_ads__keyword_report 183. model.pinterest_source.stg_pinterest_ads__keyword_report impressions 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp:f0->183. model.pinterest_source.stg_pinterest_ads__keyword_report:f0 166. model.pinterest.pinterest_ads__keyword_report 166. model.pinterest.pinterest_ads__keyword_report impressions 183. model.pinterest_source.stg_pinterest_ads__keyword_report:f0->166. model.pinterest.pinterest_ads__keyword_report:f0
183. model.pinterest_source.stg_pinterest_ads__keyword_report
  • Input Column: 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp[impression_1]
    • Aggregation This column is combined with impression_2 to calculate total impressions
    • Output Columns:
      • impressions: Combined with impression_2 using COALESCE and addition
166. model.pinterest.pinterest_ads__keyword_report
  • Input Column: 183. model.pinterest_source.stg_pinterest_ads__keyword_report[impressions]
    • Aggregation The column is summed up in the SELECT clause
    • Output Columns:
      • impressions: Aggregated sum of impressions
Column Lineage
%3 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp clickthrough_1 183. model.pinterest_source.stg_pinterest_ads__keyword_report 183. model.pinterest_source.stg_pinterest_ads__keyword_report clicks 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp:f0->183. model.pinterest_source.stg_pinterest_ads__keyword_report:f0 166. model.pinterest.pinterest_ads__keyword_report 166. model.pinterest.pinterest_ads__keyword_report clicks 183. model.pinterest_source.stg_pinterest_ads__keyword_report:f0->166. model.pinterest.pinterest_ads__keyword_report:f0
183. model.pinterest_source.stg_pinterest_ads__keyword_report
  • Input Column: 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp[clickthrough_1]
    • Aggregation This column is used in a COALESCE function and summed with clickthrough_2
    • Output Columns:
      • clicks: Summed with clickthrough_2 to calculate total clicks
166. model.pinterest.pinterest_ads__keyword_report
  • Input Column: 183. model.pinterest_source.stg_pinterest_ads__keyword_report[clicks]
    • Aggregation The clicks are summed up in the GROUP BY clause
    • Output Columns:
      • clicks: The sum of clicks is mapped to the output 'clicks' column
Column Lineage
%3 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp spend_in_micro_dollar 183. model.pinterest_source.stg_pinterest_ads__keyword_report 183. model.pinterest_source.stg_pinterest_ads__keyword_report spend 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp:f0->183. model.pinterest_source.stg_pinterest_ads__keyword_report:f0 166. model.pinterest.pinterest_ads__keyword_report 166. model.pinterest.pinterest_ads__keyword_report spend 183. model.pinterest_source.stg_pinterest_ads__keyword_report:f0->166. model.pinterest.pinterest_ads__keyword_report:f0
183. model.pinterest_source.stg_pinterest_ads__keyword_report
  • Input Column: 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp[spend_in_micro_dollar]
    • Cleaning The column is transformed from micro-dollars to dollars
    • Output Columns:
      • spend: Divided by 1,000,000 to convert from micro-dollars to dollars
166. model.pinterest.pinterest_ads__keyword_report
  • Input Column: 183. model.pinterest_source.stg_pinterest_ads__keyword_report[spend]
    • Aggregation The spend is summed up in the GROUP BY clause
    • Output Columns:
      • spend: The sum of spend is mapped to the output 'spend' column
184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of TEXT data type. It's likely used as a placeholder or template for a staging table in a dbt (data build tool) project, specifically for Pinterest ads keyword report data.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp ad_group_id advertiser_id campaign_id date keyword_id pin_id pin_promotion_id _fivetran_synced ad_group_name ad_group_status campaign_daily_spend_cap campaign_lifetime_spend_cap campaign_name campaign_status clickthrough_1 clickthrough_1_gross cpc_in_micro_dollar cpm_in_micro_dollar ctr ecpc_in_micro_dollar ecpm_in_micro_dollar ectr engagement_1 impression_1 impression_1_gross outbound_click_1 paid_impression pin_promotion_name pin_promotion_status spend_in_micro_dollar targeting_type targeting_value total_engagement 340. source.pinterest_source.pinterest_ads.keyword_report 340. source.pinterest_source.pinterest_ads.keyword_report
Name Type Comment
ad_group_id bigint None
advertiser_id bigint None
campaign_id bigint None
date timestamp without time zone None
keyword_id bigint None
pin_id bigint None
pin_promotion_id bigint None
_fivetran_synced timestamp without time zone None
ad_group_name text None
ad_group_status text None
campaign_daily_spend_cap integer None
campaign_lifetime_spend_cap integer None
campaign_name text None
campaign_status text None
clickthrough_1 integer None
clickthrough_1_gross integer None
cpc_in_micro_dollar integer None
cpm_in_micro_dollar double precision None
ctr integer None
ecpc_in_micro_dollar integer None
ecpm_in_micro_dollar double precision None
ectr integer None
engagement_1 integer None
impression_1 integer None
impression_1_gross integer None
outbound_click_1 integer None
paid_impression integer None
pin_promotion_name text None
pin_promotion_status text None
spend_in_micro_dollar integer None
targeting_type text None
targeting_value text None
total_engagement integer None
Column Lineage
%3 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp ad_group_id 183. model.pinterest_source.stg_pinterest_ads__keyword_report 183. model.pinterest_source.stg_pinterest_ads__keyword_report ad_group_id 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp:f0->183. model.pinterest_source.stg_pinterest_ads__keyword_report:f0
183. model.pinterest_source.stg_pinterest_ads__keyword_report
  • Input Column: 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp[ad_group_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • ad_group_id: Directly mapped after casting
Column Lineage
%3 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp advertiser_id 183. model.pinterest_source.stg_pinterest_ads__keyword_report 183. model.pinterest_source.stg_pinterest_ads__keyword_report advertiser_id 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp:f0->183. model.pinterest_source.stg_pinterest_ads__keyword_report:f0
183. model.pinterest_source.stg_pinterest_ads__keyword_report
  • Input Column: 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp[advertiser_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • advertiser_id: Directly mapped after casting
Column Lineage
%3 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp campaign_id 183. model.pinterest_source.stg_pinterest_ads__keyword_report 183. model.pinterest_source.stg_pinterest_ads__keyword_report campaign_id 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp:f0->183. model.pinterest_source.stg_pinterest_ads__keyword_report:f0
183. model.pinterest_source.stg_pinterest_ads__keyword_report
  • Input Column: 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp[campaign_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • campaign_id: Directly mapped after casting
Column Lineage
%3 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp date 183. model.pinterest_source.stg_pinterest_ads__keyword_report 183. model.pinterest_source.stg_pinterest_ads__keyword_report date_day 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp:f0->183. model.pinterest_source.stg_pinterest_ads__keyword_report:f0 166. model.pinterest.pinterest_ads__keyword_report 166. model.pinterest.pinterest_ads__keyword_report date_day 183. model.pinterest_source.stg_pinterest_ads__keyword_report:f0->166. model.pinterest.pinterest_ads__keyword_report:f0
183. model.pinterest_source.stg_pinterest_ads__keyword_report
  • Input Column: 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp[date]
    • Cleaning The column is cast as TIMESTAMP and truncated to day level
    • Featurization The date is transformed to represent the day level
    • Output Columns:
      • date_day: Mapped after casting and truncating to day level
166. model.pinterest.pinterest_ads__keyword_report
  • Input Column: 183. model.pinterest_source.stg_pinterest_ads__keyword_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp keyword_id 183. model.pinterest_source.stg_pinterest_ads__keyword_report 183. model.pinterest_source.stg_pinterest_ads__keyword_report keyword_id 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp:f0->183. model.pinterest_source.stg_pinterest_ads__keyword_report:f0 166. model.pinterest.pinterest_ads__keyword_report 166. model.pinterest.pinterest_ads__keyword_report keyword_id 183. model.pinterest_source.stg_pinterest_ads__keyword_report:f0->166. model.pinterest.pinterest_ads__keyword_report:f0
183. model.pinterest_source.stg_pinterest_ads__keyword_report
  • Input Column: 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp[keyword_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • keyword_id: Directly mapped after casting
166. model.pinterest.pinterest_ads__keyword_report
  • Input Column: 183. model.pinterest_source.stg_pinterest_ads__keyword_report[keyword_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as the key to join with the keywords table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • keyword_id: Directly copied to the output
Column Lineage
%3 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp pin_promotion_id 183. model.pinterest_source.stg_pinterest_ads__keyword_report 183. model.pinterest_source.stg_pinterest_ads__keyword_report pin_promotion_id 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp:f0->183. model.pinterest_source.stg_pinterest_ads__keyword_report:f0
183. model.pinterest_source.stg_pinterest_ads__keyword_report
  • Input Column: 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp[pin_promotion_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • pin_promotion_id: Directly mapped after casting
Column Lineage
%3 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp ad_group_name 183. model.pinterest_source.stg_pinterest_ads__keyword_report 183. model.pinterest_source.stg_pinterest_ads__keyword_report ad_group_name 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp:f0->183. model.pinterest_source.stg_pinterest_ads__keyword_report:f0
183. model.pinterest_source.stg_pinterest_ads__keyword_report
  • Input Column: 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp[ad_group_name]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • ad_group_name: Directly mapped after casting
Column Lineage
%3 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp ad_group_status 183. model.pinterest_source.stg_pinterest_ads__keyword_report 183. model.pinterest_source.stg_pinterest_ads__keyword_report ad_group_status 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp:f0->183. model.pinterest_source.stg_pinterest_ads__keyword_report:f0
183. model.pinterest_source.stg_pinterest_ads__keyword_report
  • Input Column: 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp[ad_group_status]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • ad_group_status: Directly mapped after casting
Column Lineage
%3 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp clickthrough_1 183. model.pinterest_source.stg_pinterest_ads__keyword_report 183. model.pinterest_source.stg_pinterest_ads__keyword_report clicks 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp:f0->183. model.pinterest_source.stg_pinterest_ads__keyword_report:f0 166. model.pinterest.pinterest_ads__keyword_report 166. model.pinterest.pinterest_ads__keyword_report clicks 183. model.pinterest_source.stg_pinterest_ads__keyword_report:f0->166. model.pinterest.pinterest_ads__keyword_report:f0
183. model.pinterest_source.stg_pinterest_ads__keyword_report
  • Input Column: 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp[clickthrough_1]
    • Aggregation This column is used in a COALESCE function and summed with clickthrough_2
    • Output Columns:
      • clicks: Summed with clickthrough_2 to calculate total clicks
166. model.pinterest.pinterest_ads__keyword_report
  • Input Column: 183. model.pinterest_source.stg_pinterest_ads__keyword_report[clicks]
    • Aggregation The clicks are summed up in the GROUP BY clause
    • Output Columns:
      • clicks: The sum of clicks is mapped to the output 'clicks' column
Column Lineage
%3 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp impression_1 183. model.pinterest_source.stg_pinterest_ads__keyword_report 183. model.pinterest_source.stg_pinterest_ads__keyword_report impressions 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp:f0->183. model.pinterest_source.stg_pinterest_ads__keyword_report:f0 166. model.pinterest.pinterest_ads__keyword_report 166. model.pinterest.pinterest_ads__keyword_report impressions 183. model.pinterest_source.stg_pinterest_ads__keyword_report:f0->166. model.pinterest.pinterest_ads__keyword_report:f0
183. model.pinterest_source.stg_pinterest_ads__keyword_report
  • Input Column: 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp[impression_1]
    • Aggregation This column is combined with impression_2 to calculate total impressions
    • Output Columns:
      • impressions: Combined with impression_2 using COALESCE and addition
166. model.pinterest.pinterest_ads__keyword_report
  • Input Column: 183. model.pinterest_source.stg_pinterest_ads__keyword_report[impressions]
    • Aggregation The column is summed up in the SELECT clause
    • Output Columns:
      • impressions: Aggregated sum of impressions
Column Lineage
%3 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp spend_in_micro_dollar 183. model.pinterest_source.stg_pinterest_ads__keyword_report 183. model.pinterest_source.stg_pinterest_ads__keyword_report spend 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp:f0->183. model.pinterest_source.stg_pinterest_ads__keyword_report:f0 166. model.pinterest.pinterest_ads__keyword_report 166. model.pinterest.pinterest_ads__keyword_report spend 183. model.pinterest_source.stg_pinterest_ads__keyword_report:f0->166. model.pinterest.pinterest_ads__keyword_report:f0
183. model.pinterest_source.stg_pinterest_ads__keyword_report
  • Input Column: 184. model.pinterest_source.stg_pinterest_ads__keyword_report_tmp[spend_in_micro_dollar]
    • Cleaning The column is transformed from micro-dollars to dollars
    • Output Columns:
      • spend: Divided by 1,000,000 to convert from micro-dollars to dollars
166. model.pinterest.pinterest_ads__keyword_report
  • Input Column: 183. model.pinterest_source.stg_pinterest_ads__keyword_report[spend]
    • Aggregation The spend is summed up in the GROUP BY clause
    • Output Columns:
      • spend: The sum of spend is mapped to the output 'spend' column
185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history

This SQL query processes data from a Pinterest ads pin promotion history table. It performs several transformations on the data, including casting data types, extracting URL components, parsing UTM parameters, and creating a flag for the most recent record. The query also renames some columns and creates new features from existing data.

CleaningFeaturizationDeduplication
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp
), fields AS (
  SELECT
    CAST(NULL AS TIMESTAMP) AS _fivetran_synced,
    CAST(NULL AS TEXT) AS ad_group_id,
    CAST(NULL AS TEXT) AS ad_account_id,
    CAST(NULL AS TEXT) AS android_deep_link,
    CAST(NULL AS TEXT) AS click_tracking_url,
    CAST(NULL AS TIMESTAMP) AS created_time,
    CAST(NULL AS TEXT) AS creative_type,
    CAST(NULL AS TEXT) AS destination_url,
    CAST(NULL AS TEXT) AS id,
    CAST(NULL AS TEXT) AS ios_deep_link,
    CAST(NULL AS BOOLEAN) AS is_pin_deleted,
    CAST(NULL AS BOOLEAN) AS is_removable,
    CAST(NULL AS TEXT) AS name,
    CAST(NULL AS TEXT) AS pin_id,
    CAST(NULL AS TEXT) AS review_status,
    CAST(NULL AS TEXT) AS status,
    CAST(NULL AS TIMESTAMP) AS updated_time,
    CAST(NULL AS TEXT) AS view_tracking_url,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    id AS pin_promotion_id,
    ad_account_id AS advertiser_id,
    ad_group_id,
    created_time AS created_at,
    destination_url,
    SPLIT_PART(destination_url, '?', 1) AS base_url,
    TRY_CAST(SPLIT_PART(
      SPLIT_PART(
        REPLACE(
          REPLACE(REPLACE(destination_url, 'android-app://', ''), 'http://', ''),
          'https://',
          ''
        ),
        '/',
        1
      ),
      '?',
      1
    ) AS TEXT) AS url_host,
    '/' || TRY_CAST(SPLIT_PART(
      CASE
        WHEN LENGTH(REPLACE(REPLACE(destination_url, 'http://', ''), 'https://', '')) - COALESCE(
          NULLIF(
            STR_POSITION(REPLACE(REPLACE(destination_url, 'http://', ''), 'https://', ''), '/'),
            0
          ),
          STR_POSITION(REPLACE(REPLACE(destination_url, 'http://', ''), 'https://', ''), '?') - 1
        ) = 0
        THEN ''
        ELSE RIGHT(
          REPLACE(REPLACE(destination_url, 'http://', ''), 'https://', ''),
          LENGTH(REPLACE(REPLACE(destination_url, 'http://', ''), 'https://', '')) - COALESCE(
            NULLIF(
              STR_POSITION(REPLACE(REPLACE(destination_url, 'http://', ''), 'https://', ''), '/'),
              0
            ),
            STR_POSITION(REPLACE(REPLACE(destination_url, 'http://', ''), 'https://', ''), '?') - 1
          )
        )
      END,
      '?',
      1
    ) AS TEXT) AS url_path,
    NULLIF(SPLIT_PART(SPLIT_PART(destination_url, 'utm_source=', 2), '&', 1), '') AS utm_source,
    NULLIF(SPLIT_PART(SPLIT_PART(destination_url, 'utm_medium=', 2), '&', 1), '') AS utm_medium,
    NULLIF(SPLIT_PART(SPLIT_PART(destination_url, 'utm_campaign=', 2), '&', 1), '') AS utm_campaign,
    NULLIF(SPLIT_PART(SPLIT_PART(destination_url, 'utm_content=', 2), '&', 1), '') AS utm_content,
    NULLIF(SPLIT_PART(SPLIT_PART(destination_url, 'utm_term=', 2), '&', 1), '') AS utm_term,
    name AS pin_name,
    pin_id,
    status AS pin_status,
    creative_type,
    _fivetran_synced,
    ROW_NUMBER() OVER (PARTITION BY source_relation, id ORDER BY _fivetran_synced DESC) = 1 AS is_most_recent_record
  FROM fields
)
SELECT
  *
FROM final
%3 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history source_relation pin_promotion_id advertiser_id ad_group_id created_at destination_url pin_name pin_id pin_status creative_type _fivetran_synced is_most_recent_record base_url url_host url_path utm_source utm_medium utm_campaign utm_content utm_term 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp id ad_group_id created_time destination_url name pin_id status creative_type _fivetran_synced ad_account_id 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f1->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f3 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f2->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f4 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f3->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f5 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f3->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f12 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f3->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f13 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f3->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f14 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f3->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f15 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f3->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f16 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f3->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f17 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f3->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f18 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f3->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f19 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f4->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f6 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f5->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f7 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f6->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f8 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f7->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f9 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f8->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f10 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f9->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f2
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
pin_promotion_id bigint Pin promotion ID.
advertiser_id bigint The ID of the related Advertiser.
ad_group_id bigint Pin promotion ad group ID.
created_at text Pin creation time.
destination_url text Pin destination URL.
pin_name text Pin promotion name.
pin_id bigint Original pin ID.
pin_status text The status of the Pin promotion. One of "ACTIVE", "ARCHIVED", "PAUSED"
creative_type text The creative type. One of "APP", "APP_VIDEO", "BOARD", "CAROUSEL", "CINEMATIC", "COMMERCE", "MAX_VIDEO", "NATIVE_VIDEO", "REGULAR", "SEARCH_PROMINENCE", "SEARCH_PROMINENCE_CAROUSEL", "SHOPPING", "SHOP_THE_PIN", "THIRD_PARTY", or "VIDEO".
_fivetran_synced text Timestamp of when a record was last synced.
is_most_recent_record boolean Boolean representing whether the record is the most recent version of the object.
base_url text The base URL of the ad, extracted from the `destination_url`.
url_host text The URL host of the ad, extracted from the `destination_url`.
url_path text The URL path of the ad, extracted from the `destination_url`.
utm_source text The utm_source parameter of the ad, extracted from the `destination_url`.
utm_medium text The utm_medium parameter of the ad, extracted from the `destination_url`.
utm_campaign text The utm_campaign parameter of the ad, extracted from the `destination_url`.
utm_content text The utm_content parameter of the ad, extracted from the `destination_url`.
utm_term text The utm_term parameter of the ad, extracted from the `destination_url`.
Column Lineage
%3 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history source_relation 167. model.pinterest.pinterest_ads__pin_promotion_report 167. model.pinterest.pinterest_ads__pin_promotion_report source_relation 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0->167. model.pinterest.pinterest_ads__pin_promotion_report:f0 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report source_relation 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0->168. model.pinterest.pinterest_ads__url_report:f0
167. model.pinterest.pinterest_ads__pin_promotion_report
  • Input Column: 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history[source_relation]
    • Integration used as a key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history[source_relation]
    • Direct The column is directly copied without transformation
    • Integration Used as part of the join condition with other tables
    • Output Columns:
      • source_relation: Directly copied to the output
Column Lineage
%3 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp id 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history pin_promotion_id 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0 167. model.pinterest.pinterest_ads__pin_promotion_report 167. model.pinterest.pinterest_ads__pin_promotion_report pin_promotion_id 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0->167. model.pinterest.pinterest_ads__pin_promotion_report:f0 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report pin_promotion_id 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0->168. model.pinterest.pinterest_ads__url_report:f0
185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history
  • Input Column: 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp[id]
    • Direct The column is directly copied to the output
    • Deduplication Used in ROW_NUMBER() function for identifying the most recent record
    • Output Columns:
      • pin_promotion_id: Directly copied
167. model.pinterest.pinterest_ads__pin_promotion_report
  • Input Column: 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history[pin_promotion_id]
    • Integration used as a key to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • pin_promotion_id: directly copied
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history[pin_promotion_id]
    • Integration Used as the key to join with the report table
    • Direct Directly copied to the output
    • Output Columns:
      • pin_promotion_id: Directly copied to the output
Column Lineage
%3 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp ad_account_id 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history advertiser_id 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0
185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history
  • Input Column: 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp[ad_account_id]
    • Direct The column is directly copied to the output
    • Output Columns:
      • advertiser_id: Directly copied
Column Lineage
%3 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp ad_group_id 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history ad_group_id 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0
185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history
  • Input Column: 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp[ad_group_id]
    • Direct The column is directly copied to the output
    • Output Columns:
      • ad_group_id: Directly copied
Column Lineage
%3 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp created_time 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history created_at 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0
185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history
  • Input Column: 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp[created_time]
    • Cleaning Cast to TIMESTAMP type
    • Output Columns:
      • created_at: Directly copied after casting
Column Lineage
%3 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp destination_url 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history base_url destination_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f2 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f3 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f7 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f6 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f4 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f5 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f8 167. model.pinterest.pinterest_ads__pin_promotion_report 167. model.pinterest.pinterest_ads__pin_promotion_report destination_url 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->167. model.pinterest.pinterest_ads__pin_promotion_report:f0 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report base_url destination_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f1 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f0 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f2 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f3 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f7 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f6 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f4 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f5 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f8
185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history
  • Input Column: 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp[destination_url]
    • Direct The column is directly copied to the output
    • Featurization Used to extract various URL components and UTM parameters
    • Output Columns:
      • destination_url: Directly copied
      • base_url: Extracted from destination_url
      • url_host: Extracted from destination_url
      • url_path: Extracted from destination_url
      • utm_source: Extracted from destination_url
      • utm_medium: Extracted from destination_url
      • utm_campaign: Extracted from destination_url
      • utm_content: Extracted from destination_url
      • utm_term: Extracted from destination_url
167. model.pinterest.pinterest_ads__pin_promotion_report
  • Input Column: 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history[destination_url]
    • Direct directly copied to the output
    • Output Columns:
      • destination_url: directly copied
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history[destination_url]
    • Direct Directly copied to the output
    • Filtering Used in the WHERE clause to filter out null values
    • Featurization Base for extracting URL components and UTM parameters
    • Output Columns:
      • destination_url: Directly copied to the output
      • base_url: Extracted from this column
      • url_host: Extracted from this column
      • url_path: Extracted from this column
      • utm_source: Extracted from this column
      • utm_medium: Extracted from this column
      • utm_campaign: Extracted from this column
      • utm_content: Extracted from this column
      • utm_term: Extracted from this column
Column Lineage
%3 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp name 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history pin_name 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0 167. model.pinterest.pinterest_ads__pin_promotion_report 167. model.pinterest.pinterest_ads__pin_promotion_report pin_name 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0->167. model.pinterest.pinterest_ads__pin_promotion_report:f0 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report pin_name 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0->168. model.pinterest.pinterest_ads__url_report:f0
185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history
  • Input Column: 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp[name]
    • Direct The column is directly copied to the output
    • Output Columns:
      • pin_name: Directly copied
167. model.pinterest.pinterest_ads__pin_promotion_report
  • Input Column: 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history[pin_name]
    • Direct directly copied to the output
    • Output Columns:
      • pin_name: directly copied
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history[pin_name]
    • Direct Directly copied to the output
    • Output Columns:
      • pin_name: Directly copied to the output
Column Lineage
%3 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp pin_id 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history pin_id 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0
185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history
  • Input Column: 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp[pin_id]
    • Direct The column is directly copied to the output
    • Output Columns:
      • pin_id: Directly copied
Column Lineage
%3 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp status 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history pin_status 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0 167. model.pinterest.pinterest_ads__pin_promotion_report 167. model.pinterest.pinterest_ads__pin_promotion_report pin_status 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0->167. model.pinterest.pinterest_ads__pin_promotion_report:f0 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report pin_status 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0->168. model.pinterest.pinterest_ads__url_report:f0
185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history
  • Input Column: 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp[status]
    • Direct The column is directly copied to the output
    • Output Columns:
      • pin_status: Directly copied
167. model.pinterest.pinterest_ads__pin_promotion_report
  • Input Column: 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history[pin_status]
    • Direct directly copied to the output
    • Output Columns:
      • pin_status: directly copied
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history[pin_status]
    • Direct Directly copied to the output
    • Output Columns:
      • pin_status: Directly copied to the output
Column Lineage
%3 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp creative_type 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history creative_type 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0 167. model.pinterest.pinterest_ads__pin_promotion_report 167. model.pinterest.pinterest_ads__pin_promotion_report creative_type 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0->167. model.pinterest.pinterest_ads__pin_promotion_report:f0 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report creative_type 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0->168. model.pinterest.pinterest_ads__url_report:f0
185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history
  • Input Column: 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp[creative_type]
    • Direct The column is directly copied to the output
    • Output Columns:
      • creative_type: Directly copied
167. model.pinterest.pinterest_ads__pin_promotion_report
  • Input Column: 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history[creative_type]
    • Direct directly copied to the output
    • Output Columns:
      • creative_type: directly copied
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history[creative_type]
    • Direct Directly copied to the output
    • Output Columns:
      • creative_type: Directly copied to the output
Column Lineage
%3 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp _fivetran_synced 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history _fivetran_synced 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0
185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history
  • Input Column: 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp[_fivetran_synced]
    • Direct The column is directly copied to the output
    • Deduplication Used in ROW_NUMBER() function for identifying the most recent record
    • Output Columns:
      • _fivetran_synced: Directly copied
Column Lineage
%3 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp destination_url 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history base_url destination_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f2 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f3 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f7 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f6 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f4 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f5 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f8 167. model.pinterest.pinterest_ads__pin_promotion_report 167. model.pinterest.pinterest_ads__pin_promotion_report base_url 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0->167. model.pinterest.pinterest_ads__pin_promotion_report:f0 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report base_url 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0->168. model.pinterest.pinterest_ads__url_report:f0
185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history
  • Input Column: 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp[destination_url]
    • Direct The column is directly copied to the output
    • Featurization Used to extract various URL components and UTM parameters
    • Output Columns:
      • destination_url: Directly copied
      • base_url: Extracted from destination_url
      • url_host: Extracted from destination_url
      • url_path: Extracted from destination_url
      • utm_source: Extracted from destination_url
      • utm_medium: Extracted from destination_url
      • utm_campaign: Extracted from destination_url
      • utm_content: Extracted from destination_url
      • utm_term: Extracted from destination_url
167. model.pinterest.pinterest_ads__pin_promotion_report
  • Input Column: 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history[base_url]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • base_url: Directly mapped to the output column
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history[base_url]
    • Direct This column is directly copied to the output without transformation.
    • Output Columns:
      • base_url: Directly copied
Column Lineage
%3 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp destination_url 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history base_url destination_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f2 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f3 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f7 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f6 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f4 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f5 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f8 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report url_host 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f2->168. model.pinterest.pinterest_ads__url_report:f0
185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history
  • Input Column: 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp[destination_url]
    • Direct The column is directly copied to the output
    • Featurization Used to extract various URL components and UTM parameters
    • Output Columns:
      • destination_url: Directly copied
      • base_url: Extracted from destination_url
      • url_host: Extracted from destination_url
      • url_path: Extracted from destination_url
      • utm_source: Extracted from destination_url
      • utm_medium: Extracted from destination_url
      • utm_campaign: Extracted from destination_url
      • utm_content: Extracted from destination_url
      • utm_term: Extracted from destination_url
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history[url_host]
    • Direct This column is directly copied to the output without transformation.
    • Output Columns:
      • url_host: Directly copied
Column Lineage
%3 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp destination_url 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history base_url destination_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f2 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f3 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f7 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f6 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f4 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f5 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f8 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report url_path 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f3->168. model.pinterest.pinterest_ads__url_report:f0
185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history
  • Input Column: 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp[destination_url]
    • Direct The column is directly copied to the output
    • Featurization Used to extract various URL components and UTM parameters
    • Output Columns:
      • destination_url: Directly copied
      • base_url: Extracted from destination_url
      • url_host: Extracted from destination_url
      • url_path: Extracted from destination_url
      • utm_source: Extracted from destination_url
      • utm_medium: Extracted from destination_url
      • utm_campaign: Extracted from destination_url
      • utm_content: Extracted from destination_url
      • utm_term: Extracted from destination_url
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history[url_path]
    • Direct This column is directly copied to the output without transformation.
    • Output Columns:
      • url_path: Directly copied
Column Lineage
%3 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp destination_url 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history base_url destination_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f2 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f3 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f7 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f6 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f4 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f5 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f8 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report utm_source 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f7->168. model.pinterest.pinterest_ads__url_report:f0
185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history
  • Input Column: 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp[destination_url]
    • Direct The column is directly copied to the output
    • Featurization Used to extract various URL components and UTM parameters
    • Output Columns:
      • destination_url: Directly copied
      • base_url: Extracted from destination_url
      • url_host: Extracted from destination_url
      • url_path: Extracted from destination_url
      • utm_source: Extracted from destination_url
      • utm_medium: Extracted from destination_url
      • utm_campaign: Extracted from destination_url
      • utm_content: Extracted from destination_url
      • utm_term: Extracted from destination_url
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history[utm_source]
    • Direct This column is directly copied to the output without transformation.
    • Output Columns:
      • utm_source: Directly copied
Column Lineage
%3 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp destination_url 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history base_url destination_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f2 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f3 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f7 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f6 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f4 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f5 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f8 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report utm_medium 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f6->168. model.pinterest.pinterest_ads__url_report:f0
185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history
  • Input Column: 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp[destination_url]
    • Direct The column is directly copied to the output
    • Featurization Used to extract various URL components and UTM parameters
    • Output Columns:
      • destination_url: Directly copied
      • base_url: Extracted from destination_url
      • url_host: Extracted from destination_url
      • url_path: Extracted from destination_url
      • utm_source: Extracted from destination_url
      • utm_medium: Extracted from destination_url
      • utm_campaign: Extracted from destination_url
      • utm_content: Extracted from destination_url
      • utm_term: Extracted from destination_url
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history[utm_medium]
    • Direct This column is directly copied to the output without transformation.
    • Output Columns:
      • utm_medium: Directly copied
Column Lineage
%3 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp destination_url 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history base_url destination_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f2 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f3 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f7 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f6 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f4 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f5 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f8 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report utm_campaign 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f4->168. model.pinterest.pinterest_ads__url_report:f0
185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history
  • Input Column: 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp[destination_url]
    • Direct The column is directly copied to the output
    • Featurization Used to extract various URL components and UTM parameters
    • Output Columns:
      • destination_url: Directly copied
      • base_url: Extracted from destination_url
      • url_host: Extracted from destination_url
      • url_path: Extracted from destination_url
      • utm_source: Extracted from destination_url
      • utm_medium: Extracted from destination_url
      • utm_campaign: Extracted from destination_url
      • utm_content: Extracted from destination_url
      • utm_term: Extracted from destination_url
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history[utm_campaign]
    • Direct This column is directly copied to the output without transformation.
    • Output Columns:
      • utm_campaign: Directly copied
Column Lineage
%3 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp destination_url 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history base_url destination_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f2 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f3 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f7 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f6 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f4 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f5 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f8 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report utm_content 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f5->168. model.pinterest.pinterest_ads__url_report:f0
185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history
  • Input Column: 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp[destination_url]
    • Direct The column is directly copied to the output
    • Featurization Used to extract various URL components and UTM parameters
    • Output Columns:
      • destination_url: Directly copied
      • base_url: Extracted from destination_url
      • url_host: Extracted from destination_url
      • url_path: Extracted from destination_url
      • utm_source: Extracted from destination_url
      • utm_medium: Extracted from destination_url
      • utm_campaign: Extracted from destination_url
      • utm_content: Extracted from destination_url
      • utm_term: Extracted from destination_url
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history[utm_content]
    • Direct This column is directly copied to the output without transformation.
    • Output Columns:
      • utm_content: Directly copied
Column Lineage
%3 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp destination_url 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history base_url destination_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f2 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f3 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f7 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f6 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f4 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f5 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f8 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report utm_term 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f8->168. model.pinterest.pinterest_ads__url_report:f0
185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history
  • Input Column: 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp[destination_url]
    • Direct The column is directly copied to the output
    • Featurization Used to extract various URL components and UTM parameters
    • Output Columns:
      • destination_url: Directly copied
      • base_url: Extracted from destination_url
      • url_host: Extracted from destination_url
      • url_path: Extracted from destination_url
      • utm_source: Extracted from destination_url
      • utm_medium: Extracted from destination_url
      • utm_campaign: Extracted from destination_url
      • utm_content: Extracted from destination_url
      • utm_term: Extracted from destination_url
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history[utm_term]
    • Direct This column is directly copied to the output without transformation.
    • Output Columns:
      • utm_term: Directly copied
186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of TEXT data type. The query doesn't fetch any actual data; it's likely used as a placeholder or template for further development or testing purposes.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp id ad_group_id created_time destination_url name pin_id status creative_type _fivetran_synced ad_account_id 341. source.pinterest_source.pinterest_ads.pin_promotion_history 341. source.pinterest_source.pinterest_ads.pin_promotion_history
Name Type Comment
id bigint None
ad_group_id bigint None
created_time text None
destination_url text None
name text None
pin_id bigint None
status text None
creative_type text None
_fivetran_synced text None
ad_account_id bigint None
Column Lineage
%3 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp id 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history pin_promotion_id 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0 167. model.pinterest.pinterest_ads__pin_promotion_report 167. model.pinterest.pinterest_ads__pin_promotion_report pin_promotion_id 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0->167. model.pinterest.pinterest_ads__pin_promotion_report:f0 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report pin_promotion_id 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0->168. model.pinterest.pinterest_ads__url_report:f0
185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history
  • Input Column: 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp[id]
    • Direct The column is directly copied to the output
    • Deduplication Used in ROW_NUMBER() function for identifying the most recent record
    • Output Columns:
      • pin_promotion_id: Directly copied
167. model.pinterest.pinterest_ads__pin_promotion_report
  • Input Column: 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history[pin_promotion_id]
    • Integration used as a key to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • pin_promotion_id: directly copied
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history[pin_promotion_id]
    • Integration Used as the key to join with the report table
    • Direct Directly copied to the output
    • Output Columns:
      • pin_promotion_id: Directly copied to the output
Column Lineage
%3 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp ad_group_id 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history ad_group_id 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0
185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history
  • Input Column: 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp[ad_group_id]
    • Direct The column is directly copied to the output
    • Output Columns:
      • ad_group_id: Directly copied
Column Lineage
%3 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp created_time 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history created_at 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0
185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history
  • Input Column: 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp[created_time]
    • Cleaning Cast to TIMESTAMP type
    • Output Columns:
      • created_at: Directly copied after casting
Column Lineage
%3 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp destination_url 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history base_url destination_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f2 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f3 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f7 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f6 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f4 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f5 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f8 167. model.pinterest.pinterest_ads__pin_promotion_report 167. model.pinterest.pinterest_ads__pin_promotion_report base_url destination_url 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->167. model.pinterest.pinterest_ads__pin_promotion_report:f1 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0->167. model.pinterest.pinterest_ads__pin_promotion_report:f0 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report base_url destination_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f1 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f0 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f2 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f3 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f7 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f6 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f4 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f5 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f1->168. model.pinterest.pinterest_ads__url_report:f8 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0->168. model.pinterest.pinterest_ads__url_report:f0 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f2->168. model.pinterest.pinterest_ads__url_report:f2 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f3->168. model.pinterest.pinterest_ads__url_report:f3 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f7->168. model.pinterest.pinterest_ads__url_report:f7 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f6->168. model.pinterest.pinterest_ads__url_report:f6 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f4->168. model.pinterest.pinterest_ads__url_report:f4 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f5->168. model.pinterest.pinterest_ads__url_report:f5 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f8->168. model.pinterest.pinterest_ads__url_report:f8
185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history
  • Input Column: 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp[destination_url]
    • Direct The column is directly copied to the output
    • Featurization Used to extract various URL components and UTM parameters
    • Output Columns:
      • destination_url: Directly copied
      • base_url: Extracted from destination_url
      • url_host: Extracted from destination_url
      • url_path: Extracted from destination_url
      • utm_source: Extracted from destination_url
      • utm_medium: Extracted from destination_url
      • utm_campaign: Extracted from destination_url
      • utm_content: Extracted from destination_url
      • utm_term: Extracted from destination_url
167. model.pinterest.pinterest_ads__pin_promotion_report
  • Input Column: 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history[destination_url]
    • Direct directly copied to the output
    • Output Columns:
      • destination_url: directly copied
  • Input Column: 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history[base_url]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • base_url: Directly mapped to the output column
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history[destination_url]
    • Direct Directly copied to the output
    • Filtering Used in the WHERE clause to filter out null values
    • Featurization Base for extracting URL components and UTM parameters
    • Output Columns:
      • destination_url: Directly copied to the output
      • base_url: Extracted from this column
      • url_host: Extracted from this column
      • url_path: Extracted from this column
      • utm_source: Extracted from this column
      • utm_medium: Extracted from this column
      • utm_campaign: Extracted from this column
      • utm_content: Extracted from this column
      • utm_term: Extracted from this column
  • Input Column: 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history[base_url]
    • Direct This column is directly copied to the output without transformation.
    • Output Columns:
      • base_url: Directly copied
  • Input Column: 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history[url_host]
    • Direct This column is directly copied to the output without transformation.
    • Output Columns:
      • url_host: Directly copied
  • Input Column: 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history[url_path]
    • Direct This column is directly copied to the output without transformation.
    • Output Columns:
      • url_path: Directly copied
  • Input Column: 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history[utm_source]
    • Direct This column is directly copied to the output without transformation.
    • Output Columns:
      • utm_source: Directly copied
  • Input Column: 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history[utm_medium]
    • Direct This column is directly copied to the output without transformation.
    • Output Columns:
      • utm_medium: Directly copied
  • Input Column: 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history[utm_campaign]
    • Direct This column is directly copied to the output without transformation.
    • Output Columns:
      • utm_campaign: Directly copied
  • Input Column: 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history[utm_content]
    • Direct This column is directly copied to the output without transformation.
    • Output Columns:
      • utm_content: Directly copied
  • Input Column: 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history[utm_term]
    • Direct This column is directly copied to the output without transformation.
    • Output Columns:
      • utm_term: Directly copied
Column Lineage
%3 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp name 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history pin_name 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0 167. model.pinterest.pinterest_ads__pin_promotion_report 167. model.pinterest.pinterest_ads__pin_promotion_report pin_name 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0->167. model.pinterest.pinterest_ads__pin_promotion_report:f0 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report pin_name 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0->168. model.pinterest.pinterest_ads__url_report:f0
185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history
  • Input Column: 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp[name]
    • Direct The column is directly copied to the output
    • Output Columns:
      • pin_name: Directly copied
167. model.pinterest.pinterest_ads__pin_promotion_report
  • Input Column: 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history[pin_name]
    • Direct directly copied to the output
    • Output Columns:
      • pin_name: directly copied
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history[pin_name]
    • Direct Directly copied to the output
    • Output Columns:
      • pin_name: Directly copied to the output
Column Lineage
%3 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp pin_id 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history pin_id 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0
185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history
  • Input Column: 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp[pin_id]
    • Direct The column is directly copied to the output
    • Output Columns:
      • pin_id: Directly copied
Column Lineage
%3 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp status 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history pin_status 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0 167. model.pinterest.pinterest_ads__pin_promotion_report 167. model.pinterest.pinterest_ads__pin_promotion_report pin_status 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0->167. model.pinterest.pinterest_ads__pin_promotion_report:f0 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report pin_status 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0->168. model.pinterest.pinterest_ads__url_report:f0
185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history
  • Input Column: 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp[status]
    • Direct The column is directly copied to the output
    • Output Columns:
      • pin_status: Directly copied
167. model.pinterest.pinterest_ads__pin_promotion_report
  • Input Column: 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history[pin_status]
    • Direct directly copied to the output
    • Output Columns:
      • pin_status: directly copied
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history[pin_status]
    • Direct Directly copied to the output
    • Output Columns:
      • pin_status: Directly copied to the output
Column Lineage
%3 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp creative_type 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history creative_type 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0 167. model.pinterest.pinterest_ads__pin_promotion_report 167. model.pinterest.pinterest_ads__pin_promotion_report creative_type 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0->167. model.pinterest.pinterest_ads__pin_promotion_report:f0 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report creative_type 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0->168. model.pinterest.pinterest_ads__url_report:f0
185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history
  • Input Column: 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp[creative_type]
    • Direct The column is directly copied to the output
    • Output Columns:
      • creative_type: Directly copied
167. model.pinterest.pinterest_ads__pin_promotion_report
  • Input Column: 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history[creative_type]
    • Direct directly copied to the output
    • Output Columns:
      • creative_type: directly copied
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history[creative_type]
    • Direct Directly copied to the output
    • Output Columns:
      • creative_type: Directly copied to the output
Column Lineage
%3 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp _fivetran_synced 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history _fivetran_synced 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0
185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history
  • Input Column: 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp[_fivetran_synced]
    • Direct The column is directly copied to the output
    • Deduplication Used in ROW_NUMBER() function for identifying the most recent record
    • Output Columns:
      • _fivetran_synced: Directly copied
Column Lineage
%3 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp ad_account_id 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history 185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history advertiser_id 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp:f0->185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history:f0
185. model.pinterest_source.stg_pinterest_ads__pin_promotion_history
  • Input Column: 186. model.pinterest_source.stg_pinterest_ads__pin_promotion_history_tmp[ad_account_id]
    • Direct The column is directly copied to the output
    • Output Columns:
      • advertiser_id: Directly copied
187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report

This SQL query performs data transformation on a Pinterest ads pin promotion report. It starts by casting columns to specific data types, then calculates total impressions and clicks by combining two separate impression and clickthrough fields. It also converts the spend from micro-dollars to dollars. The query truncates the date to day level and selects specific fields for the final output.

CleaningFeaturization
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp
), fields AS (
  SELECT
    CAST(NULL AS TIMESTAMP) AS _fivetran_synced,
    CAST(NULL AS TEXT) AS ad_group_id,
    CAST(NULL AS TEXT) AS advertiser_id,
    CAST(NULL AS TEXT) AS campaign_id,
    CAST(NULL AS DECIMAL(28, 6)) AS clickthrough_1,
    CAST(NULL AS DECIMAL(28, 6)) AS clickthrough_2,
    CAST(NULL AS TIMESTAMP) AS date,
    CAST(NULL AS DECIMAL(28, 6)) AS impression_1,
    CAST(NULL AS DECIMAL(28, 6)) AS impression_2,
    CAST(NULL AS TEXT) AS pin_promotion_id,
    CAST(NULL AS DECIMAL(28, 6)) AS spend_in_micro_dollar,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    DATE_TRUNC('DAY', date) AS date_day,
    pin_promotion_id,
    ad_group_id,
    campaign_id,
    advertiser_id,
    COALESCE(impression_1, 0) + COALESCE(impression_2, 0) AS impressions,
    COALESCE(clickthrough_1, 0) + COALESCE(clickthrough_2, 0) AS clicks,
    spend_in_micro_dollar / 1000000.0 AS spend
  FROM fields
)
SELECT
  *
FROM final
%3 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report source_relation date_day pin_promotion_id ad_group_id campaign_id advertiser_id impressions clicks spend 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp date pin_promotion_id ad_group_id campaign_id advertiser_id impression_1 impression_2 clickthrough_1 clickthrough_2 spend_in_micro_dollar 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp:f0->187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f1 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp:f1->187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f2 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp:f2->187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f3 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp:f3->187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f4 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp:f4->187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f5 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp:f5->187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f6 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp:f6->187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f6 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp:f7->187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f7 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp:f8->187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f7 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp:f9->187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f8
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
date_day timestamp without time zone The date of the report.
pin_promotion_id bigint The ID of the related Pin promotion.
ad_group_id bigint The ID representing the ad group, if present in the source data.
campaign_id bigint The ID representing the campaign, if present in the source data.
advertiser_id bigint The ID of the related Advertiser.
impressions integer The count of impressions.
clicks integer The count of clicks.
spend numeric The cost of the ads.
Column Lineage
%3 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report source_relation 167. model.pinterest.pinterest_ads__pin_promotion_report 167. model.pinterest.pinterest_ads__pin_promotion_report source_relation 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0->167. model.pinterest.pinterest_ads__pin_promotion_report:f0 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report source_relation 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0->168. model.pinterest.pinterest_ads__url_report:f0
167. model.pinterest.pinterest_ads__pin_promotion_report
  • Input Column: 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report[source_relation]
    • Direct The column is directly copied without transformation
    • Integration Used as part of the join condition with other tables
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with other tables
    • Output Columns:
      • source_relation: Directly copied to the output
Column Lineage
%3 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp date 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report date_day 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp:f0->187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0 167. model.pinterest.pinterest_ads__pin_promotion_report 167. model.pinterest.pinterest_ads__pin_promotion_report date_day 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0->167. model.pinterest.pinterest_ads__pin_promotion_report:f0 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report date_day 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0->168. model.pinterest.pinterest_ads__url_report:f0
187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report
  • Input Column: 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp[date]
    • Cleaning The date is truncated to the day level using DATE_TRUNC('DAY', date)
    • Output Columns:
      • date_day: Truncated to day level
167. model.pinterest.pinterest_ads__pin_promotion_report
  • Input Column: 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report[date_day]
    • Direct The column is directly copied without transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp pin_promotion_id 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report pin_promotion_id 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp:f0->187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0 167. model.pinterest.pinterest_ads__pin_promotion_report 167. model.pinterest.pinterest_ads__pin_promotion_report pin_promotion_id 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0->167. model.pinterest.pinterest_ads__pin_promotion_report:f0 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report pin_promotion_id 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0->168. model.pinterest.pinterest_ads__url_report:f0
187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report
  • Input Column: 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp[pin_promotion_id]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • pin_promotion_id: Directly copied
167. model.pinterest.pinterest_ads__pin_promotion_report
  • Input Column: 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report[pin_promotion_id]
    • Integration Used as a key to join with the pins table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • pin_promotion_id: Directly copied to the output
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report[pin_promotion_id]
    • Integration Used as the key to join with the pins table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • pin_promotion_id: Directly copied to the output
Column Lineage
%3 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp ad_group_id 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report ad_group_id 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp:f0->187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0 167. model.pinterest.pinterest_ads__pin_promotion_report 167. model.pinterest.pinterest_ads__pin_promotion_report ad_group_id 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0->167. model.pinterest.pinterest_ads__pin_promotion_report:f0 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report ad_group_id 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0->168. model.pinterest.pinterest_ads__url_report:f0
187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report
  • Input Column: 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp[ad_group_id]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • ad_group_id: Directly copied
167. model.pinterest.pinterest_ads__pin_promotion_report
  • Input Column: 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report[ad_group_id]
    • Integration Used as a key to join with the ad_groups table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • ad_group_id: Directly copied to the output
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report[ad_group_id]
    • Integration Used as the key to join with the ad_groups table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • ad_group_id: Directly copied to the output
Column Lineage
%3 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp campaign_id 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report campaign_id 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp:f0->187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0 167. model.pinterest.pinterest_ads__pin_promotion_report 167. model.pinterest.pinterest_ads__pin_promotion_report campaign_id 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0->167. model.pinterest.pinterest_ads__pin_promotion_report:f0 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report campaign_id 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0->168. model.pinterest.pinterest_ads__url_report:f0
187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report
  • Input Column: 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp[campaign_id]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • campaign_id: Directly copied
167. model.pinterest.pinterest_ads__pin_promotion_report
  • Input Column: 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report[campaign_id]
    • Integration Used as a key to join with the campaigns table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • campaign_id: Directly copied to the output
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report[campaign_id]
    • Integration Used as the key to join with the campaigns table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • campaign_id: Directly copied to the output
Column Lineage
%3 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp advertiser_id 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report advertiser_id 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp:f0->187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0
187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report
  • Input Column: 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp[advertiser_id]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • advertiser_id: Directly copied
Column Lineage
%3 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp impression_1 impression_2 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report impressions 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp:f0->187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp:f1->187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0 167. model.pinterest.pinterest_ads__pin_promotion_report 167. model.pinterest.pinterest_ads__pin_promotion_report impressions 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0->167. model.pinterest.pinterest_ads__pin_promotion_report:f0 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report impressions 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0->168. model.pinterest.pinterest_ads__url_report:f0
187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report
  • Input Column: 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp[impression_1]
    • Aggregation Combined with impression_2 using COALESCE and addition
    • Output Columns:
      • impressions: Combined with impression_2
  • Input Column: 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp[impression_2]
    • Aggregation Combined with impression_1 using COALESCE and addition
    • Output Columns:
      • impressions: Combined with impression_1
167. model.pinterest.pinterest_ads__pin_promotion_report
  • Input Column: 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report[impressions]
    • Aggregation Summed up in the SELECT statement
    • Output Columns:
      • impressions: Aggregated sum of impressions
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report[impressions]
    • Aggregation Summed up in the SELECT clause
    • Output Columns:
      • impressions: Aggregated sum in the output
Column Lineage
%3 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp clickthrough_1 clickthrough_2 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report clicks 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp:f0->187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp:f1->187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0 167. model.pinterest.pinterest_ads__pin_promotion_report 167. model.pinterest.pinterest_ads__pin_promotion_report clicks 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0->167. model.pinterest.pinterest_ads__pin_promotion_report:f0 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report clicks 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0->168. model.pinterest.pinterest_ads__url_report:f0
187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report
  • Input Column: 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp[clickthrough_1]
    • Aggregation Combined with clickthrough_2 using COALESCE and addition
    • Output Columns:
      • clicks: Combined with clickthrough_2
  • Input Column: 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp[clickthrough_2]
    • Aggregation Combined with clickthrough_1 using COALESCE and addition
    • Output Columns:
      • clicks: Combined with clickthrough_1
167. model.pinterest.pinterest_ads__pin_promotion_report
  • Input Column: 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report[clicks]
    • Aggregation Summed up in the SELECT statement
    • Output Columns:
      • clicks: Aggregated sum of clicks
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report[clicks]
    • Aggregation Summed up in the SELECT clause
    • Output Columns:
      • clicks: Aggregated sum in the output
Column Lineage
%3 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp spend_in_micro_dollar 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report spend 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp:f0->187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0 167. model.pinterest.pinterest_ads__pin_promotion_report 167. model.pinterest.pinterest_ads__pin_promotion_report spend 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0->167. model.pinterest.pinterest_ads__pin_promotion_report:f0 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report spend 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0->168. model.pinterest.pinterest_ads__url_report:f0
187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report
  • Input Column: 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp[spend_in_micro_dollar]
    • Cleaning The column is cleaned by casting it to DECIMAL(28, 6) and then divided by 1,000,000 to convert micro-dollars to dollars.
    • Output Columns:
      • spend: The column is transformed by dividing it by 1,000,000 to convert micro-dollars to dollars, and the result is mapped to the 'spend' output column.
167. model.pinterest.pinterest_ads__pin_promotion_report
  • Input Column: 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report[spend]
    • Aggregation Summed up in the SELECT statement
    • Output Columns:
      • spend: Aggregated sum of spend
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report[spend]
    • Aggregation Summed up in the SELECT clause
    • Output Columns:
      • spend: Aggregated sum in the output
188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of TEXT data type, initialized as NULL. It's likely used as a placeholder or template for a staging table in a dbt (data build tool) project, specifically for Pinterest ads data related to pin promotion reports.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp date pin_promotion_id ad_group_id campaign_id advertiser_id _fivetran_synced impression_1 impression_2 clickthrough_1 clickthrough_2 spend_in_micro_dollar 342. source.pinterest_source.pinterest_ads.pin_promotion_report 342. source.pinterest_source.pinterest_ads.pin_promotion_report
Name Type Comment
date timestamp without time zone None
pin_promotion_id bigint None
ad_group_id bigint None
campaign_id bigint None
advertiser_id bigint None
_fivetran_synced text None
impression_1 integer None
impression_2 integer None
clickthrough_1 integer None
clickthrough_2 integer None
spend_in_micro_dollar integer None
Column Lineage
%3 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp date 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report date_day 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp:f0->187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0 167. model.pinterest.pinterest_ads__pin_promotion_report 167. model.pinterest.pinterest_ads__pin_promotion_report date_day 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0->167. model.pinterest.pinterest_ads__pin_promotion_report:f0 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report date_day 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0->168. model.pinterest.pinterest_ads__url_report:f0
187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report
  • Input Column: 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp[date]
    • Cleaning The date is truncated to the day level using DATE_TRUNC('DAY', date)
    • Output Columns:
      • date_day: Truncated to day level
167. model.pinterest.pinterest_ads__pin_promotion_report
  • Input Column: 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report[date_day]
    • Direct The column is directly copied without transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp pin_promotion_id 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report pin_promotion_id 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp:f0->187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0 167. model.pinterest.pinterest_ads__pin_promotion_report 167. model.pinterest.pinterest_ads__pin_promotion_report pin_promotion_id 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0->167. model.pinterest.pinterest_ads__pin_promotion_report:f0 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report pin_promotion_id 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0->168. model.pinterest.pinterest_ads__url_report:f0
187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report
  • Input Column: 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp[pin_promotion_id]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • pin_promotion_id: Directly copied
167. model.pinterest.pinterest_ads__pin_promotion_report
  • Input Column: 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report[pin_promotion_id]
    • Integration Used as a key to join with the pins table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • pin_promotion_id: Directly copied to the output
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report[pin_promotion_id]
    • Integration Used as the key to join with the pins table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • pin_promotion_id: Directly copied to the output
Column Lineage
%3 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp ad_group_id 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report ad_group_id 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp:f0->187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0 167. model.pinterest.pinterest_ads__pin_promotion_report 167. model.pinterest.pinterest_ads__pin_promotion_report ad_group_id 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0->167. model.pinterest.pinterest_ads__pin_promotion_report:f0 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report ad_group_id 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0->168. model.pinterest.pinterest_ads__url_report:f0
187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report
  • Input Column: 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp[ad_group_id]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • ad_group_id: Directly copied
167. model.pinterest.pinterest_ads__pin_promotion_report
  • Input Column: 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report[ad_group_id]
    • Integration Used as a key to join with the ad_groups table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • ad_group_id: Directly copied to the output
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report[ad_group_id]
    • Integration Used as the key to join with the ad_groups table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • ad_group_id: Directly copied to the output
Column Lineage
%3 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp campaign_id 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report campaign_id 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp:f0->187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0 167. model.pinterest.pinterest_ads__pin_promotion_report 167. model.pinterest.pinterest_ads__pin_promotion_report campaign_id 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0->167. model.pinterest.pinterest_ads__pin_promotion_report:f0 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report campaign_id 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0->168. model.pinterest.pinterest_ads__url_report:f0
187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report
  • Input Column: 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp[campaign_id]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • campaign_id: Directly copied
167. model.pinterest.pinterest_ads__pin_promotion_report
  • Input Column: 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report[campaign_id]
    • Integration Used as a key to join with the campaigns table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • campaign_id: Directly copied to the output
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report[campaign_id]
    • Integration Used as the key to join with the campaigns table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • campaign_id: Directly copied to the output
Column Lineage
%3 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp advertiser_id 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report advertiser_id 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp:f0->187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0
187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report
  • Input Column: 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp[advertiser_id]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • advertiser_id: Directly copied
Column Lineage
%3 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp impression_1 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report impressions 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp:f0->187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0 167. model.pinterest.pinterest_ads__pin_promotion_report 167. model.pinterest.pinterest_ads__pin_promotion_report impressions 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0->167. model.pinterest.pinterest_ads__pin_promotion_report:f0 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report impressions 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0->168. model.pinterest.pinterest_ads__url_report:f0
187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report
  • Input Column: 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp[impression_1]
    • Aggregation Combined with impression_2 using COALESCE and addition
    • Output Columns:
      • impressions: Combined with impression_2
167. model.pinterest.pinterest_ads__pin_promotion_report
  • Input Column: 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report[impressions]
    • Aggregation Summed up in the SELECT statement
    • Output Columns:
      • impressions: Aggregated sum of impressions
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report[impressions]
    • Aggregation Summed up in the SELECT clause
    • Output Columns:
      • impressions: Aggregated sum in the output
Column Lineage
%3 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp impression_2 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report impressions 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp:f0->187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0 167. model.pinterest.pinterest_ads__pin_promotion_report 167. model.pinterest.pinterest_ads__pin_promotion_report impressions 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0->167. model.pinterest.pinterest_ads__pin_promotion_report:f0 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report impressions 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0->168. model.pinterest.pinterest_ads__url_report:f0
187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report
  • Input Column: 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp[impression_2]
    • Aggregation Combined with impression_1 using COALESCE and addition
    • Output Columns:
      • impressions: Combined with impression_1
167. model.pinterest.pinterest_ads__pin_promotion_report
  • Input Column: 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report[impressions]
    • Aggregation Summed up in the SELECT statement
    • Output Columns:
      • impressions: Aggregated sum of impressions
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report[impressions]
    • Aggregation Summed up in the SELECT clause
    • Output Columns:
      • impressions: Aggregated sum in the output
Column Lineage
%3 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp clickthrough_1 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report clicks 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp:f0->187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0 167. model.pinterest.pinterest_ads__pin_promotion_report 167. model.pinterest.pinterest_ads__pin_promotion_report clicks 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0->167. model.pinterest.pinterest_ads__pin_promotion_report:f0 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report clicks 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0->168. model.pinterest.pinterest_ads__url_report:f0
187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report
  • Input Column: 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp[clickthrough_1]
    • Aggregation Combined with clickthrough_2 using COALESCE and addition
    • Output Columns:
      • clicks: Combined with clickthrough_2
167. model.pinterest.pinterest_ads__pin_promotion_report
  • Input Column: 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report[clicks]
    • Aggregation Summed up in the SELECT statement
    • Output Columns:
      • clicks: Aggregated sum of clicks
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report[clicks]
    • Aggregation Summed up in the SELECT clause
    • Output Columns:
      • clicks: Aggregated sum in the output
Column Lineage
%3 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp clickthrough_2 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report clicks 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp:f0->187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0 167. model.pinterest.pinterest_ads__pin_promotion_report 167. model.pinterest.pinterest_ads__pin_promotion_report clicks 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0->167. model.pinterest.pinterest_ads__pin_promotion_report:f0 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report clicks 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0->168. model.pinterest.pinterest_ads__url_report:f0
187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report
  • Input Column: 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp[clickthrough_2]
    • Aggregation Combined with clickthrough_1 using COALESCE and addition
    • Output Columns:
      • clicks: Combined with clickthrough_1
167. model.pinterest.pinterest_ads__pin_promotion_report
  • Input Column: 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report[clicks]
    • Aggregation Summed up in the SELECT statement
    • Output Columns:
      • clicks: Aggregated sum of clicks
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report[clicks]
    • Aggregation Summed up in the SELECT clause
    • Output Columns:
      • clicks: Aggregated sum in the output
Column Lineage
%3 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp spend_in_micro_dollar 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report spend 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp:f0->187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0 167. model.pinterest.pinterest_ads__pin_promotion_report 167. model.pinterest.pinterest_ads__pin_promotion_report spend 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0->167. model.pinterest.pinterest_ads__pin_promotion_report:f0 168. model.pinterest.pinterest_ads__url_report 168. model.pinterest.pinterest_ads__url_report spend 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report:f0->168. model.pinterest.pinterest_ads__url_report:f0
187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report
  • Input Column: 188. model.pinterest_source.stg_pinterest_ads__pin_promotion_report_tmp[spend_in_micro_dollar]
    • Cleaning The column is cleaned by casting it to DECIMAL(28, 6) and then divided by 1,000,000 to convert micro-dollars to dollars.
    • Output Columns:
      • spend: The column is transformed by dividing it by 1,000,000 to convert micro-dollars to dollars, and the result is mapped to the 'spend' output column.
167. model.pinterest.pinterest_ads__pin_promotion_report
  • Input Column: 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report[spend]
    • Aggregation Summed up in the SELECT statement
    • Output Columns:
      • spend: Aggregated sum of spend
168. model.pinterest.pinterest_ads__url_report
  • Input Column: 187. model.pinterest_source.stg_pinterest_ads__pin_promotion_report[spend]
    • Aggregation Summed up in the SELECT clause
    • Output Columns:
      • spend: Aggregated sum in the output
189. model.reddit_ads.reddit_ads__account_report

This SQL query combines data from two staging tables: account reports and accounts. It joins these tables on account_id and source_relation, then aggregates the data by summing clicks, impressions, and spend. The result includes various account details and daily aggregated metrics.

IntegrationAggregation
SQL Query
WITH report AS (
  SELECT
    *
  FROM TEST.PUBLIC_reddit_ads_source.stg_reddit_ads__account_report
), accounts AS (
  SELECT
    *
  FROM TEST.PUBLIC_reddit_ads_source.stg_reddit_ads__account
), joined AS (
  SELECT
    report.source_relation,
    report.date_day,
    report.account_id,
    accounts.currency,
    accounts.attribution_type,
    accounts.status,
    accounts.time_zone_id,
    SUM(report.clicks) AS clicks,
    SUM(report.impressions) AS impressions,
    SUM(report.spend) AS spend
  FROM report
  LEFT JOIN accounts
    ON report.account_id = accounts.account_id
    AND report.source_relation = accounts.source_relation
  GROUP BY
    1,
    2,
    3,
    4,
    5,
    6,
    7
)
SELECT
  *
FROM joined
%3 189. model.reddit_ads.reddit_ads__account_report 189. model.reddit_ads.reddit_ads__account_report source_relation date_day account_id currency attribution_type status time_zone_id clicks impressions spend 194. model.reddit_ads_source.stg_reddit_ads__account 194. model.reddit_ads_source.stg_reddit_ads__account source_relation account_id attribution_type currency status time_zone_id 194. model.reddit_ads_source.stg_reddit_ads__account:f0->189. model.reddit_ads.reddit_ads__account_report:f0 194. model.reddit_ads_source.stg_reddit_ads__account:f1->189. model.reddit_ads.reddit_ads__account_report:f2 194. model.reddit_ads_source.stg_reddit_ads__account:f2->189. model.reddit_ads.reddit_ads__account_report:f4 194. model.reddit_ads_source.stg_reddit_ads__account:f3->189. model.reddit_ads.reddit_ads__account_report:f3 194. model.reddit_ads_source.stg_reddit_ads__account:f4->189. model.reddit_ads.reddit_ads__account_report:f5 194. model.reddit_ads_source.stg_reddit_ads__account:f5->189. model.reddit_ads.reddit_ads__account_report:f6 195. model.reddit_ads_source.stg_reddit_ads__account_report 195. model.reddit_ads_source.stg_reddit_ads__account_report source_relation account_id clicks date_day impressions spend 195. model.reddit_ads_source.stg_reddit_ads__account_report:f0->189. model.reddit_ads.reddit_ads__account_report:f0 195. model.reddit_ads_source.stg_reddit_ads__account_report:f1->189. model.reddit_ads.reddit_ads__account_report:f2 195. model.reddit_ads_source.stg_reddit_ads__account_report:f2->189. model.reddit_ads.reddit_ads__account_report:f7 195. model.reddit_ads_source.stg_reddit_ads__account_report:f3->189. model.reddit_ads.reddit_ads__account_report:f1 195. model.reddit_ads_source.stg_reddit_ads__account_report:f4->189. model.reddit_ads.reddit_ads__account_report:f8 195. model.reddit_ads_source.stg_reddit_ads__account_report:f5->189. model.reddit_ads.reddit_ads__account_report:f9
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
date_day date The date of the report.
account_id bigint The ID representing the account.
currency text The currency this account uses (ISO-4217)
attribution_type text Attribution type: "CLICK_THROUGH_CONVERSION", "VIEW_THROUGH_CONVERSION", or "ALL_CONVERSION". CLICK_THROUGH_CONVERSION: A user clicked on your ad and then completed the conversion action on your site. VIEW_THROUGH_CONVERSION: A user saw your ad and did not click it, but did complete the conversion action on your site. ALL_CONVERSION: Combination of both.
status integer The current state of the advertiser. "PENDING_BILLING", "VALID", "TRUSTED", "ADMIN", "FAILED_BILLING", "SUSPICIOUS", "SUSPENDED", or "BANNED"
time_zone_id text The time zone id preference for this account
clicks bigint The count of clicks.
impressions bigint The count of impressions.
spend bigint Spend converted out of microcurrency (so Spend/1,000,000)
Column Lineage
%3 194. model.reddit_ads_source.stg_reddit_ads__account 194. model.reddit_ads_source.stg_reddit_ads__account source_relation 189. model.reddit_ads.reddit_ads__account_report 189. model.reddit_ads.reddit_ads__account_report source_relation 194. model.reddit_ads_source.stg_reddit_ads__account:f0->189. model.reddit_ads.reddit_ads__account_report:f0 195. model.reddit_ads_source.stg_reddit_ads__account_report 195. model.reddit_ads_source.stg_reddit_ads__account_report source_relation 195. model.reddit_ads_source.stg_reddit_ads__account_report:f0->189. model.reddit_ads.reddit_ads__account_report:f0
189. model.reddit_ads.reddit_ads__account_report
  • Input Column: 194. model.reddit_ads_source.stg_reddit_ads__account[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as a key to join with the report table
    • Output Columns:
      • source_relation: Directly copied to the output
  • Input Column: 195. model.reddit_ads_source.stg_reddit_ads__account_report[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with the accounts table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
Column Lineage
%3 195. model.reddit_ads_source.stg_reddit_ads__account_report 195. model.reddit_ads_source.stg_reddit_ads__account_report date_day 189. model.reddit_ads.reddit_ads__account_report 189. model.reddit_ads.reddit_ads__account_report date_day 195. model.reddit_ads_source.stg_reddit_ads__account_report:f0->189. model.reddit_ads.reddit_ads__account_report:f0 196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp 196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp date 196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp:f0->195. model.reddit_ads_source.stg_reddit_ads__account_report:f0
195. model.reddit_ads_source.stg_reddit_ads__account_report
  • Input Column: 196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp[date]
    • Cleaning The column is cleaned by casting to DATE type
    • Output Columns:
      • date_day: Mapped to 'date_day' in the output after casting
189. model.reddit_ads.reddit_ads__account_report
  • Input Column: 195. model.reddit_ads_source.stg_reddit_ads__account_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 194. model.reddit_ads_source.stg_reddit_ads__account 194. model.reddit_ads_source.stg_reddit_ads__account account_id 189. model.reddit_ads.reddit_ads__account_report 189. model.reddit_ads.reddit_ads__account_report account_id 194. model.reddit_ads_source.stg_reddit_ads__account:f0->189. model.reddit_ads.reddit_ads__account_report:f0 195. model.reddit_ads_source.stg_reddit_ads__account_report 195. model.reddit_ads_source.stg_reddit_ads__account_report account_id 195. model.reddit_ads_source.stg_reddit_ads__account_report:f0->189. model.reddit_ads.reddit_ads__account_report:f0 197. model.reddit_ads_source.stg_reddit_ads__account_tmp 197. model.reddit_ads_source.stg_reddit_ads__account_tmp id 197. model.reddit_ads_source.stg_reddit_ads__account_tmp:f0->194. model.reddit_ads_source.stg_reddit_ads__account:f0 196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp 196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp account_id 196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp:f0->195. model.reddit_ads_source.stg_reddit_ads__account_report:f0
194. model.reddit_ads_source.stg_reddit_ads__account
  • Input Column: 197. model.reddit_ads_source.stg_reddit_ads__account_tmp[id]
    • Cleaning The column is cast to TEXT and renamed to 'account_id'
    • Output Columns:
      • account_id: Directly copied after casting and renaming
195. model.reddit_ads_source.stg_reddit_ads__account_report
  • Input Column: 196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp[account_id]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • account_id: Directly copied to the output 'account_id' column
189. model.reddit_ads.reddit_ads__account_report
  • Input Column: 194. model.reddit_ads_source.stg_reddit_ads__account[account_id]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as a key to join with the report table
    • Output Columns:
      • account_id: Directly copied to the output
  • Input Column: 195. model.reddit_ads_source.stg_reddit_ads__account_report[account_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as the key to join with the accounts table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • account_id: Directly copied to the output
Column Lineage
%3 194. model.reddit_ads_source.stg_reddit_ads__account 194. model.reddit_ads_source.stg_reddit_ads__account currency 189. model.reddit_ads.reddit_ads__account_report 189. model.reddit_ads.reddit_ads__account_report currency 194. model.reddit_ads_source.stg_reddit_ads__account:f0->189. model.reddit_ads.reddit_ads__account_report:f0 197. model.reddit_ads_source.stg_reddit_ads__account_tmp 197. model.reddit_ads_source.stg_reddit_ads__account_tmp currency 197. model.reddit_ads_source.stg_reddit_ads__account_tmp:f0->194. model.reddit_ads_source.stg_reddit_ads__account:f0
194. model.reddit_ads_source.stg_reddit_ads__account
  • Input Column: 197. model.reddit_ads_source.stg_reddit_ads__account_tmp[currency]
    • Cleaning The column is cast to TEXT
    • Output Columns:
      • currency: Directly copied after casting
189. model.reddit_ads.reddit_ads__account_report
  • Input Column: 194. model.reddit_ads_source.stg_reddit_ads__account[currency]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • currency: Directly copied to the output
Column Lineage
%3 194. model.reddit_ads_source.stg_reddit_ads__account 194. model.reddit_ads_source.stg_reddit_ads__account attribution_type 189. model.reddit_ads.reddit_ads__account_report 189. model.reddit_ads.reddit_ads__account_report attribution_type 194. model.reddit_ads_source.stg_reddit_ads__account:f0->189. model.reddit_ads.reddit_ads__account_report:f0 197. model.reddit_ads_source.stg_reddit_ads__account_tmp 197. model.reddit_ads_source.stg_reddit_ads__account_tmp attribution_type 197. model.reddit_ads_source.stg_reddit_ads__account_tmp:f0->194. model.reddit_ads_source.stg_reddit_ads__account:f0
194. model.reddit_ads_source.stg_reddit_ads__account
  • Input Column: 197. model.reddit_ads_source.stg_reddit_ads__account_tmp[attribution_type]
    • Cleaning The column is cast to TEXT
    • Output Columns:
      • attribution_type: Directly copied after casting
189. model.reddit_ads.reddit_ads__account_report
  • Input Column: 194. model.reddit_ads_source.stg_reddit_ads__account[attribution_type]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • attribution_type: Directly copied to the output
Column Lineage
%3 194. model.reddit_ads_source.stg_reddit_ads__account 194. model.reddit_ads_source.stg_reddit_ads__account status 189. model.reddit_ads.reddit_ads__account_report 189. model.reddit_ads.reddit_ads__account_report status 194. model.reddit_ads_source.stg_reddit_ads__account:f0->189. model.reddit_ads.reddit_ads__account_report:f0 197. model.reddit_ads_source.stg_reddit_ads__account_tmp 197. model.reddit_ads_source.stg_reddit_ads__account_tmp status 197. model.reddit_ads_source.stg_reddit_ads__account_tmp:f0->194. model.reddit_ads_source.stg_reddit_ads__account:f0
194. model.reddit_ads_source.stg_reddit_ads__account
  • Input Column: 197. model.reddit_ads_source.stg_reddit_ads__account_tmp[status]
    • Cleaning The column is cast to TEXT
    • Output Columns:
      • status: Directly copied after casting
189. model.reddit_ads.reddit_ads__account_report
  • Input Column: 194. model.reddit_ads_source.stg_reddit_ads__account[status]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • status: Directly copied to the output
Column Lineage
%3 194. model.reddit_ads_source.stg_reddit_ads__account 194. model.reddit_ads_source.stg_reddit_ads__account time_zone_id 189. model.reddit_ads.reddit_ads__account_report 189. model.reddit_ads.reddit_ads__account_report time_zone_id 194. model.reddit_ads_source.stg_reddit_ads__account:f0->189. model.reddit_ads.reddit_ads__account_report:f0 197. model.reddit_ads_source.stg_reddit_ads__account_tmp 197. model.reddit_ads_source.stg_reddit_ads__account_tmp time_zone_id 197. model.reddit_ads_source.stg_reddit_ads__account_tmp:f0->194. model.reddit_ads_source.stg_reddit_ads__account:f0
194. model.reddit_ads_source.stg_reddit_ads__account
  • Input Column: 197. model.reddit_ads_source.stg_reddit_ads__account_tmp[time_zone_id]
    • Cleaning The column is cast to TEXT
    • Output Columns:
      • time_zone_id: Directly copied after casting
189. model.reddit_ads.reddit_ads__account_report
  • Input Column: 194. model.reddit_ads_source.stg_reddit_ads__account[time_zone_id]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • time_zone_id: Directly copied to the output
Column Lineage
%3 195. model.reddit_ads_source.stg_reddit_ads__account_report 195. model.reddit_ads_source.stg_reddit_ads__account_report clicks 189. model.reddit_ads.reddit_ads__account_report 189. model.reddit_ads.reddit_ads__account_report clicks 195. model.reddit_ads_source.stg_reddit_ads__account_report:f0->189. model.reddit_ads.reddit_ads__account_report:f0 196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp 196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp clicks 196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp:f0->195. model.reddit_ads_source.stg_reddit_ads__account_report:f0
195. model.reddit_ads_source.stg_reddit_ads__account_report
  • Input Column: 196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp[clicks]
    • Cleaning The column is cast to INT type in the 'fields' CTE
    • Output Columns:
      • clicks: Directly mapped after casting
189. model.reddit_ads.reddit_ads__account_report
  • Input Column: 195. model.reddit_ads_source.stg_reddit_ads__account_report[clicks]
    • Aggregation The column is summed up in the GROUP BY
    • Output Columns:
      • clicks: Aggregated sum in the output
Column Lineage
%3 195. model.reddit_ads_source.stg_reddit_ads__account_report 195. model.reddit_ads_source.stg_reddit_ads__account_report impressions 189. model.reddit_ads.reddit_ads__account_report 189. model.reddit_ads.reddit_ads__account_report impressions 195. model.reddit_ads_source.stg_reddit_ads__account_report:f0->189. model.reddit_ads.reddit_ads__account_report:f0 196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp 196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp impressions 196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp:f0->195. model.reddit_ads_source.stg_reddit_ads__account_report:f0
195. model.reddit_ads_source.stg_reddit_ads__account_report
  • Input Column: 196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp[impressions]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • impressions: Directly mapped to the output 'impressions' column
189. model.reddit_ads.reddit_ads__account_report
  • Input Column: 195. model.reddit_ads_source.stg_reddit_ads__account_report[impressions]
    • Aggregation The column is summed up in the GROUP BY
    • Output Columns:
      • impressions: Aggregated sum in the output
Column Lineage
%3 195. model.reddit_ads_source.stg_reddit_ads__account_report 195. model.reddit_ads_source.stg_reddit_ads__account_report spend 189. model.reddit_ads.reddit_ads__account_report 189. model.reddit_ads.reddit_ads__account_report spend 195. model.reddit_ads_source.stg_reddit_ads__account_report:f0->189. model.reddit_ads.reddit_ads__account_report:f0 196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp 196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp spend 196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp:f0->195. model.reddit_ads_source.stg_reddit_ads__account_report:f0
195. model.reddit_ads_source.stg_reddit_ads__account_report
  • Input Column: 196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp[spend]
    • Cleaning The column is cleaned by dividing its value by 1,000,000 to convert from microcurrency
    • Output Columns:
      • spend: Transformed and mapped to the output 'spend' column
189. model.reddit_ads.reddit_ads__account_report
  • Input Column: 195. model.reddit_ads_source.stg_reddit_ads__account_report[spend]
    • Aggregation The column is summed up in the GROUP BY
    • Output Columns:
      • spend: Aggregated sum in the output
190. model.reddit_ads.reddit_ads__ad_group_report

This SQL query integrates data from multiple Reddit Ads tables (ad group report, ad groups, campaigns, and accounts) to create a comprehensive ad performance report. It joins these tables based on common identifiers and source relations, then aggregates the data to calculate total clicks, impressions, and spend for each unique combination of date, account, ad group, and campaign. The result provides a detailed view of ad performance across different levels of the advertising hierarchy.

IntegrationAggregation
SQL Query
WITH report AS (
  SELECT
    *
  FROM TEST.PUBLIC_reddit_ads_source.stg_reddit_ads__ad_group_report
), ad_groups AS (
  SELECT
    *
  FROM TEST.PUBLIC_reddit_ads_source.stg_reddit_ads__ad_group
), campaigns AS (
  SELECT
    *
  FROM TEST.PUBLIC_reddit_ads_source.stg_reddit_ads__campaign
), accounts AS (
  SELECT
    *
  FROM TEST.PUBLIC_reddit_ads_source.stg_reddit_ads__account
), joined AS (
  SELECT
    report.source_relation,
    report.date_day,
    report.account_id,
    ad_groups.ad_group_name,
    report.ad_group_id,
    campaigns.campaign_name,
    ad_groups.campaign_id,
    accounts.currency,
    SUM(report.clicks) AS clicks,
    SUM(report.impressions) AS impressions,
    SUM(report.spend) AS spend
  FROM report
  LEFT JOIN ad_groups
    ON report.ad_group_id = ad_groups.ad_group_id
    AND report.source_relation = ad_groups.source_relation
  LEFT JOIN accounts
    ON report.account_id = accounts.account_id
    AND report.source_relation = accounts.source_relation
  LEFT JOIN campaigns
    ON ad_groups.campaign_id = campaigns.campaign_id
    AND ad_groups.source_relation = campaigns.source_relation
  GROUP BY
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8
)
SELECT
  *
FROM joined
%3 190. model.reddit_ads.reddit_ads__ad_group_report 190. model.reddit_ads.reddit_ads__ad_group_report source_relation date_day account_id ad_group_name ad_group_id campaign_name campaign_id currency clicks impressions spend 194. model.reddit_ads_source.stg_reddit_ads__account 194. model.reddit_ads_source.stg_reddit_ads__account source_relation account_id currency 194. model.reddit_ads_source.stg_reddit_ads__account:f0->190. model.reddit_ads.reddit_ads__ad_group_report:f0 194. model.reddit_ads_source.stg_reddit_ads__account:f1->190. model.reddit_ads.reddit_ads__ad_group_report:f2 194. model.reddit_ads_source.stg_reddit_ads__account:f2->190. model.reddit_ads.reddit_ads__ad_group_report:f7 199. model.reddit_ads_source.stg_reddit_ads__ad_group 199. model.reddit_ads_source.stg_reddit_ads__ad_group source_relation ad_group_id campaign_id ad_group_name 199. model.reddit_ads_source.stg_reddit_ads__ad_group:f0->190. model.reddit_ads.reddit_ads__ad_group_report:f0 199. model.reddit_ads_source.stg_reddit_ads__ad_group:f1->190. model.reddit_ads.reddit_ads__ad_group_report:f4 199. model.reddit_ads_source.stg_reddit_ads__ad_group:f2->190. model.reddit_ads.reddit_ads__ad_group_report:f6 199. model.reddit_ads_source.stg_reddit_ads__ad_group:f3->190. model.reddit_ads.reddit_ads__ad_group_report:f3 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report source_relation account_id ad_group_id clicks date_day impressions spend 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report:f0->190. model.reddit_ads.reddit_ads__ad_group_report:f0 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report:f1->190. model.reddit_ads.reddit_ads__ad_group_report:f2 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report:f2->190. model.reddit_ads.reddit_ads__ad_group_report:f4 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report:f3->190. model.reddit_ads.reddit_ads__ad_group_report:f8 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report:f4->190. model.reddit_ads.reddit_ads__ad_group_report:f1 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report:f5->190. model.reddit_ads.reddit_ads__ad_group_report:f9 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report:f6->190. model.reddit_ads.reddit_ads__ad_group_report:f10 206. model.reddit_ads_source.stg_reddit_ads__campaign 206. model.reddit_ads_source.stg_reddit_ads__campaign source_relation campaign_id campaign_name 206. model.reddit_ads_source.stg_reddit_ads__campaign:f0->190. model.reddit_ads.reddit_ads__ad_group_report:f0 206. model.reddit_ads_source.stg_reddit_ads__campaign:f1->190. model.reddit_ads.reddit_ads__ad_group_report:f6 206. model.reddit_ads_source.stg_reddit_ads__campaign:f2->190. model.reddit_ads.reddit_ads__ad_group_report:f5
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
date_day date The date of the report.
account_id bigint The ID representing the account.
ad_group_name text The name of the ad group, if present in the source data.
ad_group_id bigint The ID representing the ad group, if present in the source data.
campaign_name text The name of the campaign, if present in the source data.
campaign_id bigint The ID representing the campaign, if present in the source data.
currency text The currency this account uses (ISO-4217)
clicks bigint The count of clicks.
impressions bigint The count of impressions.
spend bigint Spend converted out of microcurrency (so Spend/1,000,000)
Column Lineage
%3 194. model.reddit_ads_source.stg_reddit_ads__account 194. model.reddit_ads_source.stg_reddit_ads__account source_relation 190. model.reddit_ads.reddit_ads__ad_group_report 190. model.reddit_ads.reddit_ads__ad_group_report source_relation 194. model.reddit_ads_source.stg_reddit_ads__account:f0->190. model.reddit_ads.reddit_ads__ad_group_report:f0 199. model.reddit_ads_source.stg_reddit_ads__ad_group 199. model.reddit_ads_source.stg_reddit_ads__ad_group source_relation 199. model.reddit_ads_source.stg_reddit_ads__ad_group:f0->190. model.reddit_ads.reddit_ads__ad_group_report:f0 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report source_relation 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report:f0->190. model.reddit_ads.reddit_ads__ad_group_report:f0 206. model.reddit_ads_source.stg_reddit_ads__campaign 206. model.reddit_ads_source.stg_reddit_ads__campaign source_relation 206. model.reddit_ads_source.stg_reddit_ads__campaign:f0->190. model.reddit_ads.reddit_ads__ad_group_report:f0
190. model.reddit_ads.reddit_ads__ad_group_report
  • Input Column: 194. model.reddit_ads_source.stg_reddit_ads__account[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 199. model.reddit_ads_source.stg_reddit_ads__ad_group[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with other tables
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
  • Input Column: 206. model.reddit_ads_source.stg_reddit_ads__campaign[source_relation]
    • Integration used as part of the JOIN condition to ensure data from the same source is combined
    • Direct directly selected in the final output
    • Output Columns:
      • source_relation: directly copied to the output
Column Lineage
%3 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report date_day 190. model.reddit_ads.reddit_ads__ad_group_report 190. model.reddit_ads.reddit_ads__ad_group_report date_day 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report:f0->190. model.reddit_ads.reddit_ads__ad_group_report:f0 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp date 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp:f0->200. model.reddit_ads_source.stg_reddit_ads__ad_group_report:f0
200. model.reddit_ads_source.stg_reddit_ads__ad_group_report
  • Input Column: 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp[date]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as DATE type
    • Output Columns:
      • date_day: Directly copied to the output column 'date_day' after casting
190. model.reddit_ads.reddit_ads__ad_group_report
  • Input Column: 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 194. model.reddit_ads_source.stg_reddit_ads__account 194. model.reddit_ads_source.stg_reddit_ads__account account_id 190. model.reddit_ads.reddit_ads__ad_group_report 190. model.reddit_ads.reddit_ads__ad_group_report account_id 194. model.reddit_ads_source.stg_reddit_ads__account:f0->190. model.reddit_ads.reddit_ads__ad_group_report:f0 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report account_id 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report:f0->190. model.reddit_ads.reddit_ads__ad_group_report:f0 197. model.reddit_ads_source.stg_reddit_ads__account_tmp 197. model.reddit_ads_source.stg_reddit_ads__account_tmp id 197. model.reddit_ads_source.stg_reddit_ads__account_tmp:f0->194. model.reddit_ads_source.stg_reddit_ads__account:f0 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp account_id 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp:f0->200. model.reddit_ads_source.stg_reddit_ads__ad_group_report:f0
194. model.reddit_ads_source.stg_reddit_ads__account
  • Input Column: 197. model.reddit_ads_source.stg_reddit_ads__account_tmp[id]
    • Cleaning The column is cast to TEXT and renamed to 'account_id'
    • Output Columns:
      • account_id: Directly copied after casting and renaming
200. model.reddit_ads_source.stg_reddit_ads__ad_group_report
  • Input Column: 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp[account_id]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • account_id: Directly copied to the output column 'account_id'
190. model.reddit_ads.reddit_ads__ad_group_report
  • Input Column: 194. model.reddit_ads_source.stg_reddit_ads__account[account_id]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • account_id: directly copied
  • Input Column: 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report[account_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with the accounts table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • account_id: Directly copied to the output
Column Lineage
%3 199. model.reddit_ads_source.stg_reddit_ads__ad_group 199. model.reddit_ads_source.stg_reddit_ads__ad_group ad_group_name 190. model.reddit_ads.reddit_ads__ad_group_report 190. model.reddit_ads.reddit_ads__ad_group_report ad_group_name 199. model.reddit_ads_source.stg_reddit_ads__ad_group:f0->190. model.reddit_ads.reddit_ads__ad_group_report:f0 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp name 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp:f0->199. model.reddit_ads_source.stg_reddit_ads__ad_group:f0
199. model.reddit_ads_source.stg_reddit_ads__ad_group
  • Input Column: 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp[name]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to TEXT data type
    • Output Columns:
      • ad_group_name: Directly copied after casting to TEXT and renamed
190. model.reddit_ads.reddit_ads__ad_group_report
  • Input Column: 199. model.reddit_ads_source.stg_reddit_ads__ad_group[ad_group_name]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the report table
    • Output Columns:
      • ad_group_name: Directly mapped to the output column
Column Lineage
%3 199. model.reddit_ads_source.stg_reddit_ads__ad_group 199. model.reddit_ads_source.stg_reddit_ads__ad_group ad_group_id 190. model.reddit_ads.reddit_ads__ad_group_report 190. model.reddit_ads.reddit_ads__ad_group_report ad_group_id 199. model.reddit_ads_source.stg_reddit_ads__ad_group:f0->190. model.reddit_ads.reddit_ads__ad_group_report:f0 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report ad_group_id 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report:f0->190. model.reddit_ads.reddit_ads__ad_group_report:f0 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp id 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp:f0->199. model.reddit_ads_source.stg_reddit_ads__ad_group:f0 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp ad_group_id 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp:f0->200. model.reddit_ads_source.stg_reddit_ads__ad_group_report:f0
199. model.reddit_ads_source.stg_reddit_ads__ad_group
  • Input Column: 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp[id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • ad_group_id: Renamed from 'id' to 'ad_group_id'
200. model.reddit_ads_source.stg_reddit_ads__ad_group_report
  • Input Column: 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp[ad_group_id]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • ad_group_id: Directly copied to the output column 'ad_group_id'
190. model.reddit_ads.reddit_ads__ad_group_report
  • Input Column: 199. model.reddit_ads_source.stg_reddit_ads__ad_group[ad_group_id]
    • Integration used as the key to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_id: directly copied
  • Input Column: 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report[ad_group_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with the ad_groups table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • ad_group_id: Directly copied to the output
Column Lineage
%3 206. model.reddit_ads_source.stg_reddit_ads__campaign 206. model.reddit_ads_source.stg_reddit_ads__campaign campaign_name 190. model.reddit_ads.reddit_ads__ad_group_report 190. model.reddit_ads.reddit_ads__ad_group_report campaign_name 206. model.reddit_ads_source.stg_reddit_ads__campaign:f0->190. model.reddit_ads.reddit_ads__ad_group_report:f0 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp name 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp:f0->206. model.reddit_ads_source.stg_reddit_ads__campaign:f0
206. model.reddit_ads_source.stg_reddit_ads__campaign
  • Input Column: 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp[name]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • campaign_name: Directly mapped and renamed
190. model.reddit_ads.reddit_ads__ad_group_report
  • Input Column: 206. model.reddit_ads_source.stg_reddit_ads__campaign[campaign_name]
    • Direct directly selected in the final output
    • Output Columns:
      • campaign_name: directly copied to the output
Column Lineage
%3 199. model.reddit_ads_source.stg_reddit_ads__ad_group 199. model.reddit_ads_source.stg_reddit_ads__ad_group campaign_id 190. model.reddit_ads.reddit_ads__ad_group_report 190. model.reddit_ads.reddit_ads__ad_group_report campaign_id 199. model.reddit_ads_source.stg_reddit_ads__ad_group:f0->190. model.reddit_ads.reddit_ads__ad_group_report:f0 206. model.reddit_ads_source.stg_reddit_ads__campaign 206. model.reddit_ads_source.stg_reddit_ads__campaign campaign_id 206. model.reddit_ads_source.stg_reddit_ads__campaign:f0->190. model.reddit_ads.reddit_ads__ad_group_report:f0 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp campaign_id 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp:f0->199. model.reddit_ads_source.stg_reddit_ads__ad_group:f0 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp id 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp:f0->206. model.reddit_ads_source.stg_reddit_ads__campaign:f0
199. model.reddit_ads_source.stg_reddit_ads__ad_group
  • Input Column: 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp[campaign_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • campaign_id: Directly mapped
206. model.reddit_ads_source.stg_reddit_ads__campaign
  • Input Column: 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp[id]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • campaign_id: Directly mapped and renamed
190. model.reddit_ads.reddit_ads__ad_group_report
  • Input Column: 199. model.reddit_ads_source.stg_reddit_ads__ad_group[campaign_id]
    • Integration used as the key to join with the campaigns table
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
  • Input Column: 206. model.reddit_ads_source.stg_reddit_ads__campaign[campaign_id]
    • Integration used as the key to join the campaigns table with the ad_groups table
    • Direct directly selected in the final output
    • Output Columns:
      • campaign_id: directly copied to the output
Column Lineage
%3 194. model.reddit_ads_source.stg_reddit_ads__account 194. model.reddit_ads_source.stg_reddit_ads__account currency 190. model.reddit_ads.reddit_ads__ad_group_report 190. model.reddit_ads.reddit_ads__ad_group_report currency 194. model.reddit_ads_source.stg_reddit_ads__account:f0->190. model.reddit_ads.reddit_ads__ad_group_report:f0 197. model.reddit_ads_source.stg_reddit_ads__account_tmp 197. model.reddit_ads_source.stg_reddit_ads__account_tmp currency 197. model.reddit_ads_source.stg_reddit_ads__account_tmp:f0->194. model.reddit_ads_source.stg_reddit_ads__account:f0
194. model.reddit_ads_source.stg_reddit_ads__account
  • Input Column: 197. model.reddit_ads_source.stg_reddit_ads__account_tmp[currency]
    • Cleaning The column is cast to TEXT
    • Output Columns:
      • currency: Directly copied after casting
190. model.reddit_ads.reddit_ads__ad_group_report
  • Input Column: 194. model.reddit_ads_source.stg_reddit_ads__account[currency]
    • Direct directly copied to the output
    • Output Columns:
      • currency: directly copied
Column Lineage
%3 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report clicks 190. model.reddit_ads.reddit_ads__ad_group_report 190. model.reddit_ads.reddit_ads__ad_group_report clicks 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report:f0->190. model.reddit_ads.reddit_ads__ad_group_report:f0 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp clicks 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp:f0->200. model.reddit_ads_source.stg_reddit_ads__ad_group_report:f0
200. model.reddit_ads_source.stg_reddit_ads__ad_group_report
  • Input Column: 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp[clicks]
    • Cleaning The column is cast to INT type in the fields CTE
    • Output Columns:
      • clicks: Directly mapped after casting
190. model.reddit_ads.reddit_ads__ad_group_report
  • Input Column: 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report[clicks]
    • Aggregation The column is summed up in the SELECT clause
    • Output Columns:
      • clicks: Aggregated sum in the output
Column Lineage
%3 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report impressions 190. model.reddit_ads.reddit_ads__ad_group_report 190. model.reddit_ads.reddit_ads__ad_group_report impressions 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report:f0->190. model.reddit_ads.reddit_ads__ad_group_report:f0 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp impressions 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp:f0->200. model.reddit_ads_source.stg_reddit_ads__ad_group_report:f0
200. model.reddit_ads_source.stg_reddit_ads__ad_group_report
  • Input Column: 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp[impressions]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • impressions: Directly mapped to the output column 'impressions'
190. model.reddit_ads.reddit_ads__ad_group_report
  • Input Column: 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report[impressions]
    • Aggregation The column is summed up in the SELECT clause
    • Output Columns:
      • impressions: Aggregated sum in the output
Column Lineage
%3 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report spend 190. model.reddit_ads.reddit_ads__ad_group_report 190. model.reddit_ads.reddit_ads__ad_group_report spend 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report:f0->190. model.reddit_ads.reddit_ads__ad_group_report:f0 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp spend 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp:f0->200. model.reddit_ads_source.stg_reddit_ads__ad_group_report:f0
200. model.reddit_ads_source.stg_reddit_ads__ad_group_report
  • Input Column: 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp[spend]
    • Cleaning The column is cleaned by dividing it by 1,000,000 to convert from microcurrency
    • Output Columns:
      • spend: Transformed and mapped to the output 'spend' column
190. model.reddit_ads.reddit_ads__ad_group_report
  • Input Column: 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report[spend]
    • Aggregation The column is summed up in the SELECT clause
    • Output Columns:
      • spend: Aggregated sum in the output
191. model.reddit_ads.reddit_ads__ad_report

This SQL query integrates data from multiple Reddit ad-related tables (ad reports, ads, ad groups, campaigns, and accounts) to create a comprehensive view of ad performance. It joins these tables based on common identifiers and source relations, then aggregates the data to calculate total clicks, impressions, and spend for each unique combination of ad, campaign, ad group, and account details.

IntegrationAggregation
SQL Query
WITH report AS (
  SELECT
    *
  FROM TEST.PUBLIC_reddit_ads_source.stg_reddit_ads__ad_report
), ads AS (
  SELECT
    *
  FROM TEST.PUBLIC_reddit_ads_source.stg_reddit_ads__ad
), ad_groups AS (
  SELECT
    *
  FROM TEST.PUBLIC_reddit_ads_source.stg_reddit_ads__ad_group
), campaigns AS (
  SELECT
    *
  FROM TEST.PUBLIC_reddit_ads_source.stg_reddit_ads__campaign
), accounts AS (
  SELECT
    *
  FROM TEST.PUBLIC_reddit_ads_source.stg_reddit_ads__account
), joined AS (
  SELECT
    report.source_relation,
    report.date_day,
    report.ad_id,
    ads.ad_name,
    report.account_id,
    campaigns.campaign_name,
    ads.campaign_id,
    ad_groups.ad_group_name,
    ads.ad_group_id,
    accounts.currency,
    ads.post_id,
    SUM(report.clicks) AS clicks,
    SUM(report.impressions) AS impressions,
    SUM(report.spend) AS spend
  FROM report
  LEFT JOIN ads
    ON report.ad_id = ads.ad_id AND report.source_relation = ads.source_relation
  LEFT JOIN accounts
    ON report.account_id = accounts.account_id
    AND report.source_relation = accounts.source_relation
  LEFT JOIN ad_groups
    ON ads.ad_group_id = ad_groups.ad_group_id
    AND ads.source_relation = ad_groups.source_relation
  LEFT JOIN campaigns
    ON ads.campaign_id = campaigns.campaign_id
    AND ads.source_relation = campaigns.source_relation
  GROUP BY
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10,
    11
)
SELECT
  *
FROM joined
%3 191. model.reddit_ads.reddit_ads__ad_report 191. model.reddit_ads.reddit_ads__ad_report source_relation date_day ad_id ad_name account_id campaign_name campaign_id ad_group_name ad_group_id currency post_id clicks impressions spend 194. model.reddit_ads_source.stg_reddit_ads__account 194. model.reddit_ads_source.stg_reddit_ads__account source_relation account_id currency 194. model.reddit_ads_source.stg_reddit_ads__account:f0->191. model.reddit_ads.reddit_ads__ad_report:f0 194. model.reddit_ads_source.stg_reddit_ads__account:f1->191. model.reddit_ads.reddit_ads__ad_report:f4 194. model.reddit_ads_source.stg_reddit_ads__account:f2->191. model.reddit_ads.reddit_ads__ad_report:f9 198. model.reddit_ads_source.stg_reddit_ads__ad 198. model.reddit_ads_source.stg_reddit_ads__ad source_relation ad_id ad_group_id campaign_id ad_name post_id 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->191. model.reddit_ads.reddit_ads__ad_report:f0 198. model.reddit_ads_source.stg_reddit_ads__ad:f1->191. model.reddit_ads.reddit_ads__ad_report:f2 198. model.reddit_ads_source.stg_reddit_ads__ad:f2->191. model.reddit_ads.reddit_ads__ad_report:f8 198. model.reddit_ads_source.stg_reddit_ads__ad:f3->191. model.reddit_ads.reddit_ads__ad_report:f6 198. model.reddit_ads_source.stg_reddit_ads__ad:f4->191. model.reddit_ads.reddit_ads__ad_report:f3 198. model.reddit_ads_source.stg_reddit_ads__ad:f5->191. model.reddit_ads.reddit_ads__ad_report:f10 199. model.reddit_ads_source.stg_reddit_ads__ad_group 199. model.reddit_ads_source.stg_reddit_ads__ad_group source_relation ad_group_id ad_group_name 199. model.reddit_ads_source.stg_reddit_ads__ad_group:f0->191. model.reddit_ads.reddit_ads__ad_report:f0 199. model.reddit_ads_source.stg_reddit_ads__ad_group:f1->191. model.reddit_ads.reddit_ads__ad_report:f8 199. model.reddit_ads_source.stg_reddit_ads__ad_group:f2->191. model.reddit_ads.reddit_ads__ad_report:f7 203. model.reddit_ads_source.stg_reddit_ads__ad_report 203. model.reddit_ads_source.stg_reddit_ads__ad_report source_relation account_id ad_id clicks date_day impressions spend 203. model.reddit_ads_source.stg_reddit_ads__ad_report:f0->191. model.reddit_ads.reddit_ads__ad_report:f0 203. model.reddit_ads_source.stg_reddit_ads__ad_report:f1->191. model.reddit_ads.reddit_ads__ad_report:f4 203. model.reddit_ads_source.stg_reddit_ads__ad_report:f2->191. model.reddit_ads.reddit_ads__ad_report:f2 203. model.reddit_ads_source.stg_reddit_ads__ad_report:f3->191. model.reddit_ads.reddit_ads__ad_report:f11 203. model.reddit_ads_source.stg_reddit_ads__ad_report:f4->191. model.reddit_ads.reddit_ads__ad_report:f1 203. model.reddit_ads_source.stg_reddit_ads__ad_report:f5->191. model.reddit_ads.reddit_ads__ad_report:f12 203. model.reddit_ads_source.stg_reddit_ads__ad_report:f6->191. model.reddit_ads.reddit_ads__ad_report:f13 206. model.reddit_ads_source.stg_reddit_ads__campaign 206. model.reddit_ads_source.stg_reddit_ads__campaign source_relation campaign_id campaign_name 206. model.reddit_ads_source.stg_reddit_ads__campaign:f0->191. model.reddit_ads.reddit_ads__ad_report:f0 206. model.reddit_ads_source.stg_reddit_ads__campaign:f1->191. model.reddit_ads.reddit_ads__ad_report:f6 206. model.reddit_ads_source.stg_reddit_ads__campaign:f2->191. model.reddit_ads.reddit_ads__ad_report:f5
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
date_day date The date of the report.
ad_id bigint The ID representing the ad, if present in the source data.
ad_name text The name of the ad, if present in the source data.
account_id bigint The ID representing the account.
campaign_name text The name of the campaign, if present in the source data.
campaign_id bigint The ID representing the campaign, if present in the source data.
ad_group_name text The name of the ad group, if present in the source data.
ad_group_id bigint The ID representing the ad group, if present in the source data.
currency text The currency this account uses (ISO-4217)
post_id text The ID of the post.
clicks bigint The count of clicks.
impressions bigint The count of impressions.
spend bigint Spend converted out of microcurrency (so Spend/1,000,000)
Column Lineage
%3 194. model.reddit_ads_source.stg_reddit_ads__account 194. model.reddit_ads_source.stg_reddit_ads__account source_relation 191. model.reddit_ads.reddit_ads__ad_report 191. model.reddit_ads.reddit_ads__ad_report source_relation 194. model.reddit_ads_source.stg_reddit_ads__account:f0->191. model.reddit_ads.reddit_ads__ad_report:f0 198. model.reddit_ads_source.stg_reddit_ads__ad 198. model.reddit_ads_source.stg_reddit_ads__ad source_relation 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->191. model.reddit_ads.reddit_ads__ad_report:f0 199. model.reddit_ads_source.stg_reddit_ads__ad_group 199. model.reddit_ads_source.stg_reddit_ads__ad_group source_relation 199. model.reddit_ads_source.stg_reddit_ads__ad_group:f0->191. model.reddit_ads.reddit_ads__ad_report:f0 203. model.reddit_ads_source.stg_reddit_ads__ad_report 203. model.reddit_ads_source.stg_reddit_ads__ad_report source_relation 203. model.reddit_ads_source.stg_reddit_ads__ad_report:f0->191. model.reddit_ads.reddit_ads__ad_report:f0 206. model.reddit_ads_source.stg_reddit_ads__campaign 206. model.reddit_ads_source.stg_reddit_ads__campaign source_relation 206. model.reddit_ads_source.stg_reddit_ads__campaign:f0->191. model.reddit_ads.reddit_ads__ad_report:f0
191. model.reddit_ads.reddit_ads__ad_report
  • Input Column: 194. model.reddit_ads_source.stg_reddit_ads__account[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 198. model.reddit_ads_source.stg_reddit_ads__ad[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as a key to join with other tables
    • Output Columns:
      • source_relation: Directly copied to the output
  • Input Column: 199. model.reddit_ads_source.stg_reddit_ads__ad_group[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 203. model.reddit_ads_source.stg_reddit_ads__ad_report[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with other tables
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
  • Input Column: 206. model.reddit_ads_source.stg_reddit_ads__campaign[source_relation]
    • Integration Used as part of the join condition with other tables
    • Direct Directly included in the output
    • Output Columns:
      • source_relation: Directly copied to the output
Column Lineage
%3 203. model.reddit_ads_source.stg_reddit_ads__ad_report 203. model.reddit_ads_source.stg_reddit_ads__ad_report date_day 191. model.reddit_ads.reddit_ads__ad_report 191. model.reddit_ads.reddit_ads__ad_report date_day 203. model.reddit_ads_source.stg_reddit_ads__ad_report:f0->191. model.reddit_ads.reddit_ads__ad_report:f0 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp date 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp:f0->203. model.reddit_ads_source.stg_reddit_ads__ad_report:f0
203. model.reddit_ads_source.stg_reddit_ads__ad_report
  • Input Column: 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp[date]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to DATE data type and renamed
    • Output Columns:
      • date_day: Directly mapped after casting and renaming
191. model.reddit_ads.reddit_ads__ad_report
  • Input Column: 203. model.reddit_ads_source.stg_reddit_ads__ad_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 198. model.reddit_ads_source.stg_reddit_ads__ad 198. model.reddit_ads_source.stg_reddit_ads__ad ad_id 191. model.reddit_ads.reddit_ads__ad_report 191. model.reddit_ads.reddit_ads__ad_report ad_id 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->191. model.reddit_ads.reddit_ads__ad_report:f0 203. model.reddit_ads_source.stg_reddit_ads__ad_report 203. model.reddit_ads_source.stg_reddit_ads__ad_report ad_id 203. model.reddit_ads_source.stg_reddit_ads__ad_report:f0->191. model.reddit_ads.reddit_ads__ad_report:f0 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp id 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp:f0->198. model.reddit_ads_source.stg_reddit_ads__ad:f0 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp ad_id 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp:f0->203. model.reddit_ads_source.stg_reddit_ads__ad_report:f0
198. model.reddit_ads_source.stg_reddit_ads__ad
  • Input Column: 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp[id]
    • Cleaning The column is cast as TEXT and renamed to 'ad_id'
    • Output Columns:
      • ad_id: Directly mapped after casting
203. model.reddit_ads_source.stg_reddit_ads__ad_report
  • Input Column: 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp[ad_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to TEXT data type
    • Output Columns:
      • ad_id: Directly mapped after casting
191. model.reddit_ads.reddit_ads__ad_report
  • Input Column: 198. model.reddit_ads_source.stg_reddit_ads__ad[ad_id]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as a key to join with the report table
    • Output Columns:
      • ad_id: Directly copied to the output
  • Input Column: 203. model.reddit_ads_source.stg_reddit_ads__ad_report[ad_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with the ads table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • ad_id: Directly copied to the output
Column Lineage
%3 198. model.reddit_ads_source.stg_reddit_ads__ad 198. model.reddit_ads_source.stg_reddit_ads__ad ad_name 191. model.reddit_ads.reddit_ads__ad_report 191. model.reddit_ads.reddit_ads__ad_report ad_name 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->191. model.reddit_ads.reddit_ads__ad_report:f0 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp name 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp:f0->198. model.reddit_ads_source.stg_reddit_ads__ad:f0
198. model.reddit_ads_source.stg_reddit_ads__ad
  • Input Column: 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp[name]
    • Cleaning The column is cast as TEXT and renamed to 'ad_name'
    • Output Columns:
      • ad_name: Directly mapped after casting and renaming
191. model.reddit_ads.reddit_ads__ad_report
  • Input Column: 198. model.reddit_ads_source.stg_reddit_ads__ad[ad_name]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • ad_name: Directly copied to the output
Column Lineage
%3 194. model.reddit_ads_source.stg_reddit_ads__account 194. model.reddit_ads_source.stg_reddit_ads__account account_id 191. model.reddit_ads.reddit_ads__ad_report 191. model.reddit_ads.reddit_ads__ad_report account_id 194. model.reddit_ads_source.stg_reddit_ads__account:f0->191. model.reddit_ads.reddit_ads__ad_report:f0 203. model.reddit_ads_source.stg_reddit_ads__ad_report 203. model.reddit_ads_source.stg_reddit_ads__ad_report account_id 203. model.reddit_ads_source.stg_reddit_ads__ad_report:f0->191. model.reddit_ads.reddit_ads__ad_report:f0 197. model.reddit_ads_source.stg_reddit_ads__account_tmp 197. model.reddit_ads_source.stg_reddit_ads__account_tmp id 197. model.reddit_ads_source.stg_reddit_ads__account_tmp:f0->194. model.reddit_ads_source.stg_reddit_ads__account:f0 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp account_id 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp:f0->203. model.reddit_ads_source.stg_reddit_ads__ad_report:f0
194. model.reddit_ads_source.stg_reddit_ads__account
  • Input Column: 197. model.reddit_ads_source.stg_reddit_ads__account_tmp[id]
    • Cleaning The column is cast to TEXT and renamed to 'account_id'
    • Output Columns:
      • account_id: Directly copied after casting and renaming
203. model.reddit_ads_source.stg_reddit_ads__ad_report
  • Input Column: 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp[account_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to TEXT data type
    • Output Columns:
      • account_id: Directly mapped after casting
191. model.reddit_ads.reddit_ads__ad_report
  • Input Column: 194. model.reddit_ads_source.stg_reddit_ads__account[account_id]
    • Integration used as the key to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • account_id: directly copied
  • Input Column: 203. model.reddit_ads_source.stg_reddit_ads__ad_report[account_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with the accounts table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • account_id: Directly copied to the output
Column Lineage
%3 206. model.reddit_ads_source.stg_reddit_ads__campaign 206. model.reddit_ads_source.stg_reddit_ads__campaign campaign_name 191. model.reddit_ads.reddit_ads__ad_report 191. model.reddit_ads.reddit_ads__ad_report campaign_name 206. model.reddit_ads_source.stg_reddit_ads__campaign:f0->191. model.reddit_ads.reddit_ads__ad_report:f0 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp name 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp:f0->206. model.reddit_ads_source.stg_reddit_ads__campaign:f0
206. model.reddit_ads_source.stg_reddit_ads__campaign
  • Input Column: 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp[name]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • campaign_name: Directly mapped and renamed
191. model.reddit_ads.reddit_ads__ad_report
  • Input Column: 206. model.reddit_ads_source.stg_reddit_ads__campaign[campaign_name]
    • Direct Directly included in the output
    • Output Columns:
      • campaign_name: Directly copied to the output
Column Lineage
%3 198. model.reddit_ads_source.stg_reddit_ads__ad 198. model.reddit_ads_source.stg_reddit_ads__ad campaign_id 191. model.reddit_ads.reddit_ads__ad_report 191. model.reddit_ads.reddit_ads__ad_report campaign_id 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->191. model.reddit_ads.reddit_ads__ad_report:f0 206. model.reddit_ads_source.stg_reddit_ads__campaign 206. model.reddit_ads_source.stg_reddit_ads__campaign campaign_id 206. model.reddit_ads_source.stg_reddit_ads__campaign:f0->191. model.reddit_ads.reddit_ads__ad_report:f0 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp campaign_id 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp:f0->198. model.reddit_ads_source.stg_reddit_ads__ad:f0 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp id 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp:f0->206. model.reddit_ads_source.stg_reddit_ads__campaign:f0
198. model.reddit_ads_source.stg_reddit_ads__ad
  • Input Column: 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp[campaign_id]
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • campaign_id: Directly mapped after casting
206. model.reddit_ads_source.stg_reddit_ads__campaign
  • Input Column: 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp[id]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • campaign_id: Directly mapped and renamed
191. model.reddit_ads.reddit_ads__ad_report
  • Input Column: 198. model.reddit_ads_source.stg_reddit_ads__ad[campaign_id]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as a key to join with the campaigns table
    • Output Columns:
      • campaign_id: Directly copied to the output
  • Input Column: 206. model.reddit_ads_source.stg_reddit_ads__campaign[campaign_id]
    • Integration Used as a key to join with the ads table
    • Direct Directly included in the output
    • Output Columns:
      • campaign_id: Directly copied to the output
Column Lineage
%3 199. model.reddit_ads_source.stg_reddit_ads__ad_group 199. model.reddit_ads_source.stg_reddit_ads__ad_group ad_group_name 191. model.reddit_ads.reddit_ads__ad_report 191. model.reddit_ads.reddit_ads__ad_report ad_group_name 199. model.reddit_ads_source.stg_reddit_ads__ad_group:f0->191. model.reddit_ads.reddit_ads__ad_report:f0 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp name 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp:f0->199. model.reddit_ads_source.stg_reddit_ads__ad_group:f0
199. model.reddit_ads_source.stg_reddit_ads__ad_group
  • Input Column: 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp[name]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to TEXT data type
    • Output Columns:
      • ad_group_name: Directly copied after casting to TEXT and renamed
191. model.reddit_ads.reddit_ads__ad_report
  • Input Column: 199. model.reddit_ads_source.stg_reddit_ads__ad_group[ad_group_name]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the ads table
    • Output Columns:
      • ad_group_name: Directly mapped to the output column
Column Lineage
%3 198. model.reddit_ads_source.stg_reddit_ads__ad 198. model.reddit_ads_source.stg_reddit_ads__ad ad_group_id 191. model.reddit_ads.reddit_ads__ad_report 191. model.reddit_ads.reddit_ads__ad_report ad_group_id 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->191. model.reddit_ads.reddit_ads__ad_report:f0 199. model.reddit_ads_source.stg_reddit_ads__ad_group 199. model.reddit_ads_source.stg_reddit_ads__ad_group ad_group_id 199. model.reddit_ads_source.stg_reddit_ads__ad_group:f0->191. model.reddit_ads.reddit_ads__ad_report:f0 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp ad_group_id 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp:f0->198. model.reddit_ads_source.stg_reddit_ads__ad:f0 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp id 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp:f0->199. model.reddit_ads_source.stg_reddit_ads__ad_group:f0
198. model.reddit_ads_source.stg_reddit_ads__ad
  • Input Column: 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp[ad_group_id]
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • ad_group_id: Directly mapped after casting
199. model.reddit_ads_source.stg_reddit_ads__ad_group
  • Input Column: 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp[id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • ad_group_id: Renamed from 'id' to 'ad_group_id'
191. model.reddit_ads.reddit_ads__ad_report
  • Input Column: 198. model.reddit_ads_source.stg_reddit_ads__ad[ad_group_id]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as a key to join with the ad_groups table
    • Output Columns:
      • ad_group_id: Directly copied to the output
  • Input Column: 199. model.reddit_ads_source.stg_reddit_ads__ad_group[ad_group_id]
    • Integration used as the key to join with the ads table
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_id: directly copied
Column Lineage
%3 194. model.reddit_ads_source.stg_reddit_ads__account 194. model.reddit_ads_source.stg_reddit_ads__account currency 191. model.reddit_ads.reddit_ads__ad_report 191. model.reddit_ads.reddit_ads__ad_report currency 194. model.reddit_ads_source.stg_reddit_ads__account:f0->191. model.reddit_ads.reddit_ads__ad_report:f0 197. model.reddit_ads_source.stg_reddit_ads__account_tmp 197. model.reddit_ads_source.stg_reddit_ads__account_tmp currency 197. model.reddit_ads_source.stg_reddit_ads__account_tmp:f0->194. model.reddit_ads_source.stg_reddit_ads__account:f0
194. model.reddit_ads_source.stg_reddit_ads__account
  • Input Column: 197. model.reddit_ads_source.stg_reddit_ads__account_tmp[currency]
    • Cleaning The column is cast to TEXT
    • Output Columns:
      • currency: Directly copied after casting
191. model.reddit_ads.reddit_ads__ad_report
  • Input Column: 194. model.reddit_ads_source.stg_reddit_ads__account[currency]
    • Direct directly copied to the output
    • Output Columns:
      • currency: directly copied
Column Lineage
%3 198. model.reddit_ads_source.stg_reddit_ads__ad 198. model.reddit_ads_source.stg_reddit_ads__ad post_id 191. model.reddit_ads.reddit_ads__ad_report 191. model.reddit_ads.reddit_ads__ad_report post_id 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->191. model.reddit_ads.reddit_ads__ad_report:f0 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp post_id 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp:f0->198. model.reddit_ads_source.stg_reddit_ads__ad:f0
198. model.reddit_ads_source.stg_reddit_ads__ad
  • Input Column: 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp[post_id]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • post_id: Directly mapped to the output column 'post_id'
191. model.reddit_ads.reddit_ads__ad_report
  • Input Column: 198. model.reddit_ads_source.stg_reddit_ads__ad[post_id]
    • Direct The post_id is directly copied to the output without transformation
    • Integration The post_id is used as part of the join condition with other tables
    • Output Columns:
      • post_id: Directly copied to the output column 'post_id'
Column Lineage
%3 203. model.reddit_ads_source.stg_reddit_ads__ad_report 203. model.reddit_ads_source.stg_reddit_ads__ad_report clicks 191. model.reddit_ads.reddit_ads__ad_report 191. model.reddit_ads.reddit_ads__ad_report clicks 203. model.reddit_ads_source.stg_reddit_ads__ad_report:f0->191. model.reddit_ads.reddit_ads__ad_report:f0 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp clicks 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp:f0->203. model.reddit_ads_source.stg_reddit_ads__ad_report:f0
203. model.reddit_ads_source.stg_reddit_ads__ad_report
  • Input Column: 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp[clicks]
    • Cleaning The column is cast to INT data type
    • Output Columns:
      • clicks: Directly mapped after casting
191. model.reddit_ads.reddit_ads__ad_report
  • Input Column: 203. model.reddit_ads_source.stg_reddit_ads__ad_report[clicks]
    • Aggregation The column is summed up in the SELECT statement
    • Output Columns:
      • clicks: Aggregated sum of clicks
Column Lineage
%3 203. model.reddit_ads_source.stg_reddit_ads__ad_report 203. model.reddit_ads_source.stg_reddit_ads__ad_report impressions 191. model.reddit_ads.reddit_ads__ad_report 191. model.reddit_ads.reddit_ads__ad_report impressions 203. model.reddit_ads_source.stg_reddit_ads__ad_report:f0->191. model.reddit_ads.reddit_ads__ad_report:f0 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp impressions 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp:f0->203. model.reddit_ads_source.stg_reddit_ads__ad_report:f0
203. model.reddit_ads_source.stg_reddit_ads__ad_report
  • Input Column: 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp[impressions]
    • Cleaning The column is cast to INT data type
    • Output Columns:
      • impressions: Directly mapped after casting
191. model.reddit_ads.reddit_ads__ad_report
  • Input Column: 203. model.reddit_ads_source.stg_reddit_ads__ad_report[impressions]
    • Aggregation The column is summed up in the SELECT statement
    • Output Columns:
      • impressions: Aggregated sum of impressions
Column Lineage
%3 203. model.reddit_ads_source.stg_reddit_ads__ad_report 203. model.reddit_ads_source.stg_reddit_ads__ad_report spend 191. model.reddit_ads.reddit_ads__ad_report 191. model.reddit_ads.reddit_ads__ad_report spend 203. model.reddit_ads_source.stg_reddit_ads__ad_report:f0->191. model.reddit_ads.reddit_ads__ad_report:f0 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp spend 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp:f0->203. model.reddit_ads_source.stg_reddit_ads__ad_report:f0
203. model.reddit_ads_source.stg_reddit_ads__ad_report
  • Input Column: 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp[spend]
    • Cleaning The column is cleaned by casting to INT and then divided by 1,000,000 to convert from microcurrency
    • Output Columns:
      • spend: Transformed and mapped to the output 'spend' column
191. model.reddit_ads.reddit_ads__ad_report
  • Input Column: 203. model.reddit_ads_source.stg_reddit_ads__ad_report[spend]
    • Aggregation The column is summed up in the SELECT statement
    • Output Columns:
      • spend: Aggregated sum of spend
192. model.reddit_ads.reddit_ads__campaign_report

This SQL query integrates data from three tables: campaign report, campaigns, and accounts. It joins these tables based on account_id, campaign_id, and source_relation. The query then aggregates the data, summing up clicks, impressions, and spend for each unique combination of source_relation, date_day, account_id, campaign_name, campaign_id, and currency. The result provides a comprehensive view of campaign performance metrics across different accounts and campaigns.

IntegrationAggregation
SQL Query
WITH report AS (
  SELECT
    *
  FROM TEST.PUBLIC_reddit_ads_source.stg_reddit_ads__campaign_report
), campaigns AS (
  SELECT
    *
  FROM TEST.PUBLIC_reddit_ads_source.stg_reddit_ads__campaign
), accounts AS (
  SELECT
    *
  FROM TEST.PUBLIC_reddit_ads_source.stg_reddit_ads__account
), joined AS (
  SELECT
    report.source_relation,
    report.date_day,
    report.account_id,
    campaigns.campaign_name,
    report.campaign_id,
    accounts.currency,
    SUM(report.clicks) AS clicks,
    SUM(report.impressions) AS impressions,
    SUM(report.spend) AS spend
  FROM report
  LEFT JOIN accounts
    ON report.account_id = accounts.account_id
    AND report.source_relation = accounts.source_relation
  LEFT JOIN campaigns
    ON report.campaign_id = campaigns.campaign_id
    AND report.source_relation = campaigns.source_relation
  GROUP BY
    1,
    2,
    3,
    4,
    5,
    6
)
SELECT
  *
FROM joined
%3 192. model.reddit_ads.reddit_ads__campaign_report 192. model.reddit_ads.reddit_ads__campaign_report source_relation date_day account_id campaign_name campaign_id currency clicks impressions spend 194. model.reddit_ads_source.stg_reddit_ads__account 194. model.reddit_ads_source.stg_reddit_ads__account source_relation account_id currency 194. model.reddit_ads_source.stg_reddit_ads__account:f0->192. model.reddit_ads.reddit_ads__campaign_report:f0 194. model.reddit_ads_source.stg_reddit_ads__account:f1->192. model.reddit_ads.reddit_ads__campaign_report:f2 194. model.reddit_ads_source.stg_reddit_ads__account:f2->192. model.reddit_ads.reddit_ads__campaign_report:f5 206. model.reddit_ads_source.stg_reddit_ads__campaign 206. model.reddit_ads_source.stg_reddit_ads__campaign source_relation campaign_id campaign_name 206. model.reddit_ads_source.stg_reddit_ads__campaign:f0->192. model.reddit_ads.reddit_ads__campaign_report:f0 206. model.reddit_ads_source.stg_reddit_ads__campaign:f1->192. model.reddit_ads.reddit_ads__campaign_report:f4 206. model.reddit_ads_source.stg_reddit_ads__campaign:f2->192. model.reddit_ads.reddit_ads__campaign_report:f3 207. model.reddit_ads_source.stg_reddit_ads__campaign_report 207. model.reddit_ads_source.stg_reddit_ads__campaign_report source_relation account_id campaign_id clicks date_day impressions spend 207. model.reddit_ads_source.stg_reddit_ads__campaign_report:f0->192. model.reddit_ads.reddit_ads__campaign_report:f0 207. model.reddit_ads_source.stg_reddit_ads__campaign_report:f1->192. model.reddit_ads.reddit_ads__campaign_report:f2 207. model.reddit_ads_source.stg_reddit_ads__campaign_report:f2->192. model.reddit_ads.reddit_ads__campaign_report:f4 207. model.reddit_ads_source.stg_reddit_ads__campaign_report:f3->192. model.reddit_ads.reddit_ads__campaign_report:f6 207. model.reddit_ads_source.stg_reddit_ads__campaign_report:f4->192. model.reddit_ads.reddit_ads__campaign_report:f1 207. model.reddit_ads_source.stg_reddit_ads__campaign_report:f5->192. model.reddit_ads.reddit_ads__campaign_report:f7 207. model.reddit_ads_source.stg_reddit_ads__campaign_report:f6->192. model.reddit_ads.reddit_ads__campaign_report:f8
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
date_day date The date of the report.
account_id bigint The ID representing the account.
campaign_name text The name of the campaign, if present in the source data.
campaign_id bigint The ID representing the campaign, if present in the source data.
currency text The currency this account uses (ISO-4217)
clicks bigint The count of clicks.
impressions bigint The count of impressions.
spend bigint Spend converted out of microcurrency (so Spend/1,000,000)
Column Lineage
%3 194. model.reddit_ads_source.stg_reddit_ads__account 194. model.reddit_ads_source.stg_reddit_ads__account source_relation 192. model.reddit_ads.reddit_ads__campaign_report 192. model.reddit_ads.reddit_ads__campaign_report source_relation 194. model.reddit_ads_source.stg_reddit_ads__account:f0->192. model.reddit_ads.reddit_ads__campaign_report:f0 206. model.reddit_ads_source.stg_reddit_ads__campaign 206. model.reddit_ads_source.stg_reddit_ads__campaign source_relation 206. model.reddit_ads_source.stg_reddit_ads__campaign:f0->192. model.reddit_ads.reddit_ads__campaign_report:f0 207. model.reddit_ads_source.stg_reddit_ads__campaign_report 207. model.reddit_ads_source.stg_reddit_ads__campaign_report source_relation 207. model.reddit_ads_source.stg_reddit_ads__campaign_report:f0->192. model.reddit_ads.reddit_ads__campaign_report:f0
192. model.reddit_ads.reddit_ads__campaign_report
  • Input Column: 194. model.reddit_ads_source.stg_reddit_ads__account[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as a key to join with other tables
    • Output Columns:
      • source_relation: Directly copied to the output
  • Input Column: 206. model.reddit_ads_source.stg_reddit_ads__campaign[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as a key to join with other tables
    • Output Columns:
      • source_relation: Directly copied to the output
  • Input Column: 207. model.reddit_ads_source.stg_reddit_ads__campaign_report[source_relation]
    • Direct The column is directly copied without transformation
    • Integration Used as part of the join condition with other tables
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
Column Lineage
%3 207. model.reddit_ads_source.stg_reddit_ads__campaign_report 207. model.reddit_ads_source.stg_reddit_ads__campaign_report date_day 192. model.reddit_ads.reddit_ads__campaign_report 192. model.reddit_ads.reddit_ads__campaign_report date_day 207. model.reddit_ads_source.stg_reddit_ads__campaign_report:f0->192. model.reddit_ads.reddit_ads__campaign_report:f0 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp date 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp:f0->207. model.reddit_ads_source.stg_reddit_ads__campaign_report:f0
207. model.reddit_ads_source.stg_reddit_ads__campaign_report
  • Input Column: 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp[date]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to DATE data type and renamed
    • Output Columns:
      • date_day: Directly mapped and renamed
192. model.reddit_ads.reddit_ads__campaign_report
  • Input Column: 207. model.reddit_ads_source.stg_reddit_ads__campaign_report[date_day]
    • Direct The column is directly copied without transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 194. model.reddit_ads_source.stg_reddit_ads__account 194. model.reddit_ads_source.stg_reddit_ads__account account_id 192. model.reddit_ads.reddit_ads__campaign_report 192. model.reddit_ads.reddit_ads__campaign_report account_id 194. model.reddit_ads_source.stg_reddit_ads__account:f0->192. model.reddit_ads.reddit_ads__campaign_report:f0 207. model.reddit_ads_source.stg_reddit_ads__campaign_report 207. model.reddit_ads_source.stg_reddit_ads__campaign_report account_id 207. model.reddit_ads_source.stg_reddit_ads__campaign_report:f0->192. model.reddit_ads.reddit_ads__campaign_report:f0 197. model.reddit_ads_source.stg_reddit_ads__account_tmp 197. model.reddit_ads_source.stg_reddit_ads__account_tmp id 197. model.reddit_ads_source.stg_reddit_ads__account_tmp:f0->194. model.reddit_ads_source.stg_reddit_ads__account:f0 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp account_id 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp:f0->207. model.reddit_ads_source.stg_reddit_ads__campaign_report:f0
194. model.reddit_ads_source.stg_reddit_ads__account
  • Input Column: 197. model.reddit_ads_source.stg_reddit_ads__account_tmp[id]
    • Cleaning The column is cast to TEXT and renamed to 'account_id'
    • Output Columns:
      • account_id: Directly copied after casting and renaming
207. model.reddit_ads_source.stg_reddit_ads__campaign_report
  • Input Column: 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp[account_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to TEXT data type
    • Output Columns:
      • account_id: Directly mapped
192. model.reddit_ads.reddit_ads__campaign_report
  • Input Column: 194. model.reddit_ads_source.stg_reddit_ads__account[account_id]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as a key to join with other tables
    • Output Columns:
      • account_id: Directly copied to the output
  • Input Column: 207. model.reddit_ads_source.stg_reddit_ads__campaign_report[account_id]
    • Direct The column is directly copied without transformation
    • Integration Used as a key to join with the accounts table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • account_id: Directly copied to the output
Column Lineage
%3 206. model.reddit_ads_source.stg_reddit_ads__campaign 206. model.reddit_ads_source.stg_reddit_ads__campaign campaign_name 192. model.reddit_ads.reddit_ads__campaign_report 192. model.reddit_ads.reddit_ads__campaign_report campaign_name 206. model.reddit_ads_source.stg_reddit_ads__campaign:f0->192. model.reddit_ads.reddit_ads__campaign_report:f0 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp name 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp:f0->206. model.reddit_ads_source.stg_reddit_ads__campaign:f0
206. model.reddit_ads_source.stg_reddit_ads__campaign
  • Input Column: 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp[name]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • campaign_name: Directly mapped and renamed
192. model.reddit_ads.reddit_ads__campaign_report
  • Input Column: 206. model.reddit_ads_source.stg_reddit_ads__campaign[campaign_name]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • campaign_name: Directly copied to the output
Column Lineage
%3 206. model.reddit_ads_source.stg_reddit_ads__campaign 206. model.reddit_ads_source.stg_reddit_ads__campaign campaign_id 192. model.reddit_ads.reddit_ads__campaign_report 192. model.reddit_ads.reddit_ads__campaign_report campaign_id 206. model.reddit_ads_source.stg_reddit_ads__campaign:f0->192. model.reddit_ads.reddit_ads__campaign_report:f0 207. model.reddit_ads_source.stg_reddit_ads__campaign_report 207. model.reddit_ads_source.stg_reddit_ads__campaign_report campaign_id 207. model.reddit_ads_source.stg_reddit_ads__campaign_report:f0->192. model.reddit_ads.reddit_ads__campaign_report:f0 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp id 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp:f0->206. model.reddit_ads_source.stg_reddit_ads__campaign:f0 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp campaign_id 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp:f0->207. model.reddit_ads_source.stg_reddit_ads__campaign_report:f0
206. model.reddit_ads_source.stg_reddit_ads__campaign
  • Input Column: 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp[id]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • campaign_id: Directly mapped and renamed
207. model.reddit_ads_source.stg_reddit_ads__campaign_report
  • Input Column: 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp[campaign_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to TEXT data type
    • Output Columns:
      • campaign_id: Directly mapped
192. model.reddit_ads.reddit_ads__campaign_report
  • Input Column: 206. model.reddit_ads_source.stg_reddit_ads__campaign[campaign_id]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as a key to join with the report table
    • Output Columns:
      • campaign_id: Directly copied to the output
  • Input Column: 207. model.reddit_ads_source.stg_reddit_ads__campaign_report[campaign_id]
    • Direct The column is directly copied without transformation
    • Integration Used as a key to join with the campaigns table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • campaign_id: Directly copied to the output
Column Lineage
%3 194. model.reddit_ads_source.stg_reddit_ads__account 194. model.reddit_ads_source.stg_reddit_ads__account currency 192. model.reddit_ads.reddit_ads__campaign_report 192. model.reddit_ads.reddit_ads__campaign_report currency 194. model.reddit_ads_source.stg_reddit_ads__account:f0->192. model.reddit_ads.reddit_ads__campaign_report:f0 197. model.reddit_ads_source.stg_reddit_ads__account_tmp 197. model.reddit_ads_source.stg_reddit_ads__account_tmp currency 197. model.reddit_ads_source.stg_reddit_ads__account_tmp:f0->194. model.reddit_ads_source.stg_reddit_ads__account:f0
194. model.reddit_ads_source.stg_reddit_ads__account
  • Input Column: 197. model.reddit_ads_source.stg_reddit_ads__account_tmp[currency]
    • Cleaning The column is cast to TEXT
    • Output Columns:
      • currency: Directly copied after casting
192. model.reddit_ads.reddit_ads__campaign_report
  • Input Column: 194. model.reddit_ads_source.stg_reddit_ads__account[currency]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • currency: Directly copied to the output
Column Lineage
%3 207. model.reddit_ads_source.stg_reddit_ads__campaign_report 207. model.reddit_ads_source.stg_reddit_ads__campaign_report clicks 192. model.reddit_ads.reddit_ads__campaign_report 192. model.reddit_ads.reddit_ads__campaign_report clicks 207. model.reddit_ads_source.stg_reddit_ads__campaign_report:f0->192. model.reddit_ads.reddit_ads__campaign_report:f0 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp clicks 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp:f0->207. model.reddit_ads_source.stg_reddit_ads__campaign_report:f0
207. model.reddit_ads_source.stg_reddit_ads__campaign_report
  • Input Column: 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp[clicks]
    • Cleaning The column is cast to INT data type.
    • Output Columns:
      • clicks: Directly mapped after casting.
192. model.reddit_ads.reddit_ads__campaign_report
  • Input Column: 207. model.reddit_ads_source.stg_reddit_ads__campaign_report[clicks]
    • Aggregation The column is summed up in the SELECT statement
    • Output Columns:
      • clicks: Aggregated sum in the output
Column Lineage
%3 207. model.reddit_ads_source.stg_reddit_ads__campaign_report 207. model.reddit_ads_source.stg_reddit_ads__campaign_report impressions 192. model.reddit_ads.reddit_ads__campaign_report 192. model.reddit_ads.reddit_ads__campaign_report impressions 207. model.reddit_ads_source.stg_reddit_ads__campaign_report:f0->192. model.reddit_ads.reddit_ads__campaign_report:f0 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp impressions 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp:f0->207. model.reddit_ads_source.stg_reddit_ads__campaign_report:f0
207. model.reddit_ads_source.stg_reddit_ads__campaign_report
  • Input Column: 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp[impressions]
    • Cleaning The column is cast to INT data type
    • Direct The column is directly copied after casting
    • Output Columns:
      • impressions: Directly mapped after casting to INT
192. model.reddit_ads.reddit_ads__campaign_report
  • Input Column: 207. model.reddit_ads_source.stg_reddit_ads__campaign_report[impressions]
    • Aggregation The column is summed up in the SELECT statement
    • Output Columns:
      • impressions: Aggregated sum in the output
Column Lineage
%3 207. model.reddit_ads_source.stg_reddit_ads__campaign_report 207. model.reddit_ads_source.stg_reddit_ads__campaign_report spend 192. model.reddit_ads.reddit_ads__campaign_report 192. model.reddit_ads.reddit_ads__campaign_report spend 207. model.reddit_ads_source.stg_reddit_ads__campaign_report:f0->192. model.reddit_ads.reddit_ads__campaign_report:f0 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp spend 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp:f0->207. model.reddit_ads_source.stg_reddit_ads__campaign_report:f0
207. model.reddit_ads_source.stg_reddit_ads__campaign_report
  • Input Column: 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp[spend]
    • Cleaning The spend column is cleaned by casting to INT and then divided by 1,000,000 to convert from microseconds to seconds
    • Output Columns:
      • spend: Transformed and mapped to the output 'spend' column
192. model.reddit_ads.reddit_ads__campaign_report
  • Input Column: 207. model.reddit_ads_source.stg_reddit_ads__campaign_report[spend]
    • Aggregation The column is summed up in the SELECT statement
    • Output Columns:
      • spend: Aggregated sum in the output
193. model.reddit_ads.reddit_ads__url_report

This SQL query integrates data from multiple Reddit ads-related tables (ad reports, ads, ad groups, campaigns, and accounts) to create a comprehensive URL report. It cleans and extracts various URL components and UTM parameters from the click_url field, aggregates metrics like clicks, impressions, and spend, and filters out ads without valid URLs. The query performs complex string manipulations to parse URL information and combines it with other ad-related data to provide a detailed view of ad performance by URL.

IntegrationCleaningFeaturizationAggregationFiltering
SQL Query
WITH report AS (
  SELECT
    *
  FROM TEST.PUBLIC_reddit_ads_source.stg_reddit_ads__ad_report
), ads AS (
  SELECT
    *
  FROM TEST.PUBLIC_reddit_ads_source.stg_reddit_ads__ad
), ad_groups AS (
  SELECT
    *
  FROM TEST.PUBLIC_reddit_ads_source.stg_reddit_ads__ad_group
), campaigns AS (
  SELECT
    *
  FROM TEST.PUBLIC_reddit_ads_source.stg_reddit_ads__campaign
), accounts AS (
  SELECT
    *
  FROM TEST.PUBLIC_reddit_ads_source.stg_reddit_ads__account
), joined AS (
  SELECT
    report.source_relation,
    report.date_day,
    ads.ad_name,
    report.ad_id,
    report.account_id,
    campaigns.campaign_name,
    ads.campaign_id,
    ad_groups.ad_group_name,
    ads.ad_group_id,
    accounts.currency,
    ads.post_id,
    ads.post_url,
    ads.click_url,
    SPLIT_PART(ads.click_url, '?', 1) AS base_url,
    TRY_CAST(SPLIT_PART(
      SPLIT_PART(
        REPLACE(REPLACE(REPLACE(ads.click_url, 'android-app://', ''), 'http://', ''), 'https://', ''),
        '/',
        1
      ),
      '?',
      1
    ) AS TEXT) AS url_host,
    '/' || TRY_CAST(SPLIT_PART(
      CASE
        WHEN LENGTH(REPLACE(REPLACE(ads.click_url, 'http://', ''), 'https://', '')) - COALESCE(
          NULLIF(
            STR_POSITION(REPLACE(REPLACE(ads.click_url, 'http://', ''), 'https://', ''), '/'),
            0
          ),
          STR_POSITION(REPLACE(REPLACE(ads.click_url, 'http://', ''), 'https://', ''), '?') - 1
        ) = 0
        THEN ''
        ELSE RIGHT(
          REPLACE(REPLACE(ads.click_url, 'http://', ''), 'https://', ''),
          LENGTH(REPLACE(REPLACE(ads.click_url, 'http://', ''), 'https://', '')) - COALESCE(
            NULLIF(
              STR_POSITION(REPLACE(REPLACE(ads.click_url, 'http://', ''), 'https://', ''), '/'),
              0
            ),
            STR_POSITION(REPLACE(REPLACE(ads.click_url, 'http://', ''), 'https://', ''), '?') - 1
          )
        )
      END,
      '?',
      1
    ) AS TEXT) AS url_path,
    NULLIF(SPLIT_PART(SPLIT_PART(ads.click_url, 'utm_source=', 2), '&', 1), '') AS utm_source,
    NULLIF(SPLIT_PART(SPLIT_PART(ads.click_url, 'utm_medium=', 2), '&', 1), '') AS utm_medium,
    NULLIF(SPLIT_PART(SPLIT_PART(ads.click_url, 'utm_term=', 2), '&', 1), '') AS utm_term,
    NULLIF(SPLIT_PART(SPLIT_PART(ads.click_url, 'utm_content=', 2), '&', 1), '') AS utm_content,
    COALESCE(
      NULLIF(SPLIT_PART(SPLIT_PART(ads.click_url, 'utm_campaign=', 2), '&', 1), ''),
      campaigns.campaign_name
    ) AS utm_campaign,
    SUM(report.clicks) AS clicks,
    SUM(report.impressions) AS impressions,
    SUM(report.spend) AS spend
  FROM report
  LEFT JOIN ads
    ON report.ad_id = ads.ad_id AND report.source_relation = ads.source_relation
  LEFT JOIN accounts
    ON report.account_id = accounts.account_id
    AND report.source_relation = accounts.source_relation
  LEFT JOIN ad_groups
    ON ads.ad_group_id = ad_groups.ad_group_id
    AND ads.source_relation = ad_groups.source_relation
  LEFT JOIN campaigns
    ON ads.campaign_id = campaigns.campaign_id
    AND ads.source_relation = campaigns.source_relation
  GROUP BY
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10,
    11,
    12,
    13,
    14,
    15,
    16,
    17,
    18,
    19,
    20
), filtered AS (
  SELECT
    *
  FROM joined
  WHERE
    NOT click_url IS NULL /* filter for only ads with valid URLs */
)
SELECT
  *
FROM filtered
%3 193. model.reddit_ads.reddit_ads__url_report 193. model.reddit_ads.reddit_ads__url_report source_relation date_day ad_name ad_id account_id campaign_name campaign_id ad_group_name ad_group_id currency post_id post_url click_url clicks impressions spend base_url url_host url_path utm_source utm_medium utm_campaign utm_content utm_term 194. model.reddit_ads_source.stg_reddit_ads__account 194. model.reddit_ads_source.stg_reddit_ads__account source_relation account_id currency 194. model.reddit_ads_source.stg_reddit_ads__account:f0->193. model.reddit_ads.reddit_ads__url_report:f0 194. model.reddit_ads_source.stg_reddit_ads__account:f1->193. model.reddit_ads.reddit_ads__url_report:f4 194. model.reddit_ads_source.stg_reddit_ads__account:f2->193. model.reddit_ads.reddit_ads__url_report:f9 198. model.reddit_ads_source.stg_reddit_ads__ad 198. model.reddit_ads_source.stg_reddit_ads__ad source_relation ad_id ad_group_id campaign_id click_url ad_name post_id post_url 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f0 198. model.reddit_ads_source.stg_reddit_ads__ad:f1->193. model.reddit_ads.reddit_ads__url_report:f3 198. model.reddit_ads_source.stg_reddit_ads__ad:f2->193. model.reddit_ads.reddit_ads__url_report:f8 198. model.reddit_ads_source.stg_reddit_ads__ad:f3->193. model.reddit_ads.reddit_ads__url_report:f6 198. model.reddit_ads_source.stg_reddit_ads__ad:f4->193. model.reddit_ads.reddit_ads__url_report:f12 198. model.reddit_ads_source.stg_reddit_ads__ad:f4->193. model.reddit_ads.reddit_ads__url_report:f16 198. model.reddit_ads_source.stg_reddit_ads__ad:f4->193. model.reddit_ads.reddit_ads__url_report:f17 198. model.reddit_ads_source.stg_reddit_ads__ad:f4->193. model.reddit_ads.reddit_ads__url_report:f18 198. model.reddit_ads_source.stg_reddit_ads__ad:f4->193. model.reddit_ads.reddit_ads__url_report:f19 198. model.reddit_ads_source.stg_reddit_ads__ad:f4->193. model.reddit_ads.reddit_ads__url_report:f20 198. model.reddit_ads_source.stg_reddit_ads__ad:f4->193. model.reddit_ads.reddit_ads__url_report:f23 198. model.reddit_ads_source.stg_reddit_ads__ad:f4->193. model.reddit_ads.reddit_ads__url_report:f22 198. model.reddit_ads_source.stg_reddit_ads__ad:f4->193. model.reddit_ads.reddit_ads__url_report:f21 198. model.reddit_ads_source.stg_reddit_ads__ad:f5->193. model.reddit_ads.reddit_ads__url_report:f2 198. model.reddit_ads_source.stg_reddit_ads__ad:f6->193. model.reddit_ads.reddit_ads__url_report:f10 198. model.reddit_ads_source.stg_reddit_ads__ad:f7->193. model.reddit_ads.reddit_ads__url_report:f11 199. model.reddit_ads_source.stg_reddit_ads__ad_group 199. model.reddit_ads_source.stg_reddit_ads__ad_group source_relation ad_group_id ad_group_name 199. model.reddit_ads_source.stg_reddit_ads__ad_group:f0->193. model.reddit_ads.reddit_ads__url_report:f0 199. model.reddit_ads_source.stg_reddit_ads__ad_group:f1->193. model.reddit_ads.reddit_ads__url_report:f8 199. model.reddit_ads_source.stg_reddit_ads__ad_group:f2->193. model.reddit_ads.reddit_ads__url_report:f7 203. model.reddit_ads_source.stg_reddit_ads__ad_report 203. model.reddit_ads_source.stg_reddit_ads__ad_report source_relation account_id ad_id clicks date_day impressions spend 203. model.reddit_ads_source.stg_reddit_ads__ad_report:f0->193. model.reddit_ads.reddit_ads__url_report:f0 203. model.reddit_ads_source.stg_reddit_ads__ad_report:f1->193. model.reddit_ads.reddit_ads__url_report:f4 203. model.reddit_ads_source.stg_reddit_ads__ad_report:f2->193. model.reddit_ads.reddit_ads__url_report:f3 203. model.reddit_ads_source.stg_reddit_ads__ad_report:f3->193. model.reddit_ads.reddit_ads__url_report:f13 203. model.reddit_ads_source.stg_reddit_ads__ad_report:f4->193. model.reddit_ads.reddit_ads__url_report:f1 203. model.reddit_ads_source.stg_reddit_ads__ad_report:f5->193. model.reddit_ads.reddit_ads__url_report:f14 203. model.reddit_ads_source.stg_reddit_ads__ad_report:f6->193. model.reddit_ads.reddit_ads__url_report:f15 206. model.reddit_ads_source.stg_reddit_ads__campaign 206. model.reddit_ads_source.stg_reddit_ads__campaign source_relation campaign_id campaign_name 206. model.reddit_ads_source.stg_reddit_ads__campaign:f0->193. model.reddit_ads.reddit_ads__url_report:f0 206. model.reddit_ads_source.stg_reddit_ads__campaign:f1->193. model.reddit_ads.reddit_ads__url_report:f6 206. model.reddit_ads_source.stg_reddit_ads__campaign:f2->193. model.reddit_ads.reddit_ads__url_report:f5 206. model.reddit_ads_source.stg_reddit_ads__campaign:f2->193. model.reddit_ads.reddit_ads__url_report:f21
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
date_day date The date of the report.
ad_name text The name of the ad, if present in the source data.
ad_id bigint The ID representing the ad, if present in the source data.
account_id bigint The ID representing the account.
campaign_name text The name of the campaign, if present in the source data.
campaign_id bigint The ID representing the campaign, if present in the source data.
ad_group_name text The name of the ad group, if present in the source data.
ad_group_id bigint The ID representing the ad group, if present in the source data.
currency text The currency this account uses (ISO-4217)
post_id text The ID of the post.
post_url integer The URL belonging to the post.
click_url text The destination url, or the website address, that a visitor goes to when they click on the ad
clicks bigint The count of clicks.
impressions bigint The count of impressions.
spend bigint Spend converted out of microcurrency (so Spend/1,000,000)
base_url text The base URL of the ad, extracted from the `click_url`.
url_host text The URL host of the ad, extracted from the `click_url`.
url_path text The URL path of the ad, extracted from the `click_url`.
utm_source text The site that sent traffic to your page. Microsoft Advertising sets this to Bing; extracted from the `click_url`.
utm_medium text Which channel was used. Microsoft Advertising sets this to cp; extracted from the `click_url`.
utm_campaign text Which campaign the keyword came from; extracted from the `click_url`.
utm_content text Which ad group the keyword came from; extracted from the `click_url`.
utm_term text Which keyword brought people to your website; extracted from the `click_url`.
Column Lineage
%3 194. model.reddit_ads_source.stg_reddit_ads__account 194. model.reddit_ads_source.stg_reddit_ads__account source_relation 193. model.reddit_ads.reddit_ads__url_report 193. model.reddit_ads.reddit_ads__url_report source_relation 194. model.reddit_ads_source.stg_reddit_ads__account:f0->193. model.reddit_ads.reddit_ads__url_report:f0 198. model.reddit_ads_source.stg_reddit_ads__ad 198. model.reddit_ads_source.stg_reddit_ads__ad source_relation 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f0 199. model.reddit_ads_source.stg_reddit_ads__ad_group 199. model.reddit_ads_source.stg_reddit_ads__ad_group source_relation 199. model.reddit_ads_source.stg_reddit_ads__ad_group:f0->193. model.reddit_ads.reddit_ads__url_report:f0 203. model.reddit_ads_source.stg_reddit_ads__ad_report 203. model.reddit_ads_source.stg_reddit_ads__ad_report source_relation 203. model.reddit_ads_source.stg_reddit_ads__ad_report:f0->193. model.reddit_ads.reddit_ads__url_report:f0 206. model.reddit_ads_source.stg_reddit_ads__campaign 206. model.reddit_ads_source.stg_reddit_ads__campaign source_relation 206. model.reddit_ads_source.stg_reddit_ads__campaign:f0->193. model.reddit_ads.reddit_ads__url_report:f0
193. model.reddit_ads.reddit_ads__url_report
  • Input Column: 194. model.reddit_ads_source.stg_reddit_ads__account[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 198. model.reddit_ads_source.stg_reddit_ads__ad[source_relation]
    • Integration used to join with other tables
    • Direct directly copied to output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 199. model.reddit_ads_source.stg_reddit_ads__ad_group[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 203. model.reddit_ads_source.stg_reddit_ads__ad_report[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with other tables
    • Output Columns:
      • source_relation: Directly copied to the output
  • Input Column: 206. model.reddit_ads_source.stg_reddit_ads__campaign[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
Column Lineage
%3 203. model.reddit_ads_source.stg_reddit_ads__ad_report 203. model.reddit_ads_source.stg_reddit_ads__ad_report date_day 193. model.reddit_ads.reddit_ads__url_report 193. model.reddit_ads.reddit_ads__url_report date_day 203. model.reddit_ads_source.stg_reddit_ads__ad_report:f0->193. model.reddit_ads.reddit_ads__url_report:f0 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp date 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp:f0->203. model.reddit_ads_source.stg_reddit_ads__ad_report:f0
203. model.reddit_ads_source.stg_reddit_ads__ad_report
  • Input Column: 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp[date]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to DATE data type and renamed
    • Output Columns:
      • date_day: Directly mapped after casting and renaming
193. model.reddit_ads.reddit_ads__url_report
  • Input Column: 203. model.reddit_ads_source.stg_reddit_ads__ad_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 198. model.reddit_ads_source.stg_reddit_ads__ad 198. model.reddit_ads_source.stg_reddit_ads__ad ad_name 193. model.reddit_ads.reddit_ads__url_report 193. model.reddit_ads.reddit_ads__url_report ad_name 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f0 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp name 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp:f0->198. model.reddit_ads_source.stg_reddit_ads__ad:f0
198. model.reddit_ads_source.stg_reddit_ads__ad
  • Input Column: 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp[name]
    • Cleaning The column is cast as TEXT and renamed to 'ad_name'
    • Output Columns:
      • ad_name: Directly mapped after casting and renaming
193. model.reddit_ads.reddit_ads__url_report
  • Input Column: 198. model.reddit_ads_source.stg_reddit_ads__ad[ad_name]
    • Direct directly copied to output
    • Output Columns:
      • ad_name: directly copied
Column Lineage
%3 198. model.reddit_ads_source.stg_reddit_ads__ad 198. model.reddit_ads_source.stg_reddit_ads__ad ad_id 193. model.reddit_ads.reddit_ads__url_report 193. model.reddit_ads.reddit_ads__url_report ad_id 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f0 203. model.reddit_ads_source.stg_reddit_ads__ad_report 203. model.reddit_ads_source.stg_reddit_ads__ad_report ad_id 203. model.reddit_ads_source.stg_reddit_ads__ad_report:f0->193. model.reddit_ads.reddit_ads__url_report:f0 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp id 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp:f0->198. model.reddit_ads_source.stg_reddit_ads__ad:f0 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp ad_id 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp:f0->203. model.reddit_ads_source.stg_reddit_ads__ad_report:f0
198. model.reddit_ads_source.stg_reddit_ads__ad
  • Input Column: 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp[id]
    • Cleaning The column is cast as TEXT and renamed to 'ad_id'
    • Output Columns:
      • ad_id: Directly mapped after casting
203. model.reddit_ads_source.stg_reddit_ads__ad_report
  • Input Column: 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp[ad_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to TEXT data type
    • Output Columns:
      • ad_id: Directly mapped after casting
193. model.reddit_ads.reddit_ads__url_report
  • Input Column: 198. model.reddit_ads_source.stg_reddit_ads__ad[ad_id]
    • Integration used to join with the report table
    • Direct directly copied to output
    • Output Columns:
      • ad_id: directly copied
  • Input Column: 203. model.reddit_ads_source.stg_reddit_ads__ad_report[ad_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with the ads table
    • Output Columns:
      • ad_id: Directly copied to the output
Column Lineage
%3 194. model.reddit_ads_source.stg_reddit_ads__account 194. model.reddit_ads_source.stg_reddit_ads__account account_id 193. model.reddit_ads.reddit_ads__url_report 193. model.reddit_ads.reddit_ads__url_report account_id 194. model.reddit_ads_source.stg_reddit_ads__account:f0->193. model.reddit_ads.reddit_ads__url_report:f0 203. model.reddit_ads_source.stg_reddit_ads__ad_report 203. model.reddit_ads_source.stg_reddit_ads__ad_report account_id 203. model.reddit_ads_source.stg_reddit_ads__ad_report:f0->193. model.reddit_ads.reddit_ads__url_report:f0 197. model.reddit_ads_source.stg_reddit_ads__account_tmp 197. model.reddit_ads_source.stg_reddit_ads__account_tmp id 197. model.reddit_ads_source.stg_reddit_ads__account_tmp:f0->194. model.reddit_ads_source.stg_reddit_ads__account:f0 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp account_id 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp:f0->203. model.reddit_ads_source.stg_reddit_ads__ad_report:f0
194. model.reddit_ads_source.stg_reddit_ads__account
  • Input Column: 197. model.reddit_ads_source.stg_reddit_ads__account_tmp[id]
    • Cleaning The column is cast to TEXT and renamed to 'account_id'
    • Output Columns:
      • account_id: Directly copied after casting and renaming
203. model.reddit_ads_source.stg_reddit_ads__ad_report
  • Input Column: 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp[account_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to TEXT data type
    • Output Columns:
      • account_id: Directly mapped after casting
193. model.reddit_ads.reddit_ads__url_report
  • Input Column: 194. model.reddit_ads_source.stg_reddit_ads__account[account_id]
    • Integration used as the key to join with the report table
    • Output Columns:
      • account_id: directly copied
  • Input Column: 203. model.reddit_ads_source.stg_reddit_ads__ad_report[account_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with the accounts table
    • Output Columns:
      • account_id: Directly copied to the output
Column Lineage
%3 206. model.reddit_ads_source.stg_reddit_ads__campaign 206. model.reddit_ads_source.stg_reddit_ads__campaign campaign_name 193. model.reddit_ads.reddit_ads__url_report 193. model.reddit_ads.reddit_ads__url_report campaign_name utm_campaign 206. model.reddit_ads_source.stg_reddit_ads__campaign:f0->193. model.reddit_ads.reddit_ads__url_report:f0 206. model.reddit_ads_source.stg_reddit_ads__campaign:f0->193. model.reddit_ads.reddit_ads__url_report:f1 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp name 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp:f0->206. model.reddit_ads_source.stg_reddit_ads__campaign:f0
206. model.reddit_ads_source.stg_reddit_ads__campaign
  • Input Column: 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp[name]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • campaign_name: Directly mapped and renamed
193. model.reddit_ads.reddit_ads__url_report
  • Input Column: 206. model.reddit_ads_source.stg_reddit_ads__campaign[campaign_name]
    • Direct directly copied to the output
    • Featurization used as a fallback value for utm_campaign
    • Output Columns:
      • campaign_name: directly copied
      • utm_campaign: used as fallback if not present in click_url
Column Lineage
%3 198. model.reddit_ads_source.stg_reddit_ads__ad 198. model.reddit_ads_source.stg_reddit_ads__ad campaign_id 193. model.reddit_ads.reddit_ads__url_report 193. model.reddit_ads.reddit_ads__url_report campaign_id 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f0 206. model.reddit_ads_source.stg_reddit_ads__campaign 206. model.reddit_ads_source.stg_reddit_ads__campaign campaign_id 206. model.reddit_ads_source.stg_reddit_ads__campaign:f0->193. model.reddit_ads.reddit_ads__url_report:f0 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp campaign_id 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp:f0->198. model.reddit_ads_source.stg_reddit_ads__ad:f0 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp id 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp:f0->206. model.reddit_ads_source.stg_reddit_ads__campaign:f0
198. model.reddit_ads_source.stg_reddit_ads__ad
  • Input Column: 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp[campaign_id]
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • campaign_id: Directly mapped after casting
206. model.reddit_ads_source.stg_reddit_ads__campaign
  • Input Column: 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp[id]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • campaign_id: Directly mapped and renamed
193. model.reddit_ads.reddit_ads__url_report
  • Input Column: 198. model.reddit_ads_source.stg_reddit_ads__ad[campaign_id]
    • Integration used to join with the campaigns table
    • Direct directly copied to output
    • Output Columns:
      • campaign_id: directly copied
  • Input Column: 206. model.reddit_ads_source.stg_reddit_ads__campaign[campaign_id]
    • Integration used as the key to join with the ads table
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
Column Lineage
%3 199. model.reddit_ads_source.stg_reddit_ads__ad_group 199. model.reddit_ads_source.stg_reddit_ads__ad_group ad_group_name 193. model.reddit_ads.reddit_ads__url_report 193. model.reddit_ads.reddit_ads__url_report ad_group_name 199. model.reddit_ads_source.stg_reddit_ads__ad_group:f0->193. model.reddit_ads.reddit_ads__url_report:f0 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp name 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp:f0->199. model.reddit_ads_source.stg_reddit_ads__ad_group:f0
199. model.reddit_ads_source.stg_reddit_ads__ad_group
  • Input Column: 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp[name]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to TEXT data type
    • Output Columns:
      • ad_group_name: Directly copied after casting to TEXT and renamed
193. model.reddit_ads.reddit_ads__url_report
  • Input Column: 199. model.reddit_ads_source.stg_reddit_ads__ad_group[ad_group_name]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the JOIN condition with the ads table
    • Output Columns:
      • ad_group_name: Directly mapped to the output column
Column Lineage
%3 198. model.reddit_ads_source.stg_reddit_ads__ad 198. model.reddit_ads_source.stg_reddit_ads__ad ad_group_id 193. model.reddit_ads.reddit_ads__url_report 193. model.reddit_ads.reddit_ads__url_report ad_group_id 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f0 199. model.reddit_ads_source.stg_reddit_ads__ad_group 199. model.reddit_ads_source.stg_reddit_ads__ad_group ad_group_id 199. model.reddit_ads_source.stg_reddit_ads__ad_group:f0->193. model.reddit_ads.reddit_ads__url_report:f0 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp ad_group_id 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp:f0->198. model.reddit_ads_source.stg_reddit_ads__ad:f0 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp id 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp:f0->199. model.reddit_ads_source.stg_reddit_ads__ad_group:f0
198. model.reddit_ads_source.stg_reddit_ads__ad
  • Input Column: 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp[ad_group_id]
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • ad_group_id: Directly mapped after casting
199. model.reddit_ads_source.stg_reddit_ads__ad_group
  • Input Column: 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp[id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • ad_group_id: Renamed from 'id' to 'ad_group_id'
193. model.reddit_ads.reddit_ads__url_report
  • Input Column: 198. model.reddit_ads_source.stg_reddit_ads__ad[ad_group_id]
    • Integration used to join with the ad_groups table
    • Direct directly copied to output
    • Output Columns:
      • ad_group_id: directly copied
  • Input Column: 199. model.reddit_ads_source.stg_reddit_ads__ad_group[ad_group_id]
    • Integration used as a join key with the ads table
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_id: directly copied
Column Lineage
%3 194. model.reddit_ads_source.stg_reddit_ads__account 194. model.reddit_ads_source.stg_reddit_ads__account currency 193. model.reddit_ads.reddit_ads__url_report 193. model.reddit_ads.reddit_ads__url_report currency 194. model.reddit_ads_source.stg_reddit_ads__account:f0->193. model.reddit_ads.reddit_ads__url_report:f0 197. model.reddit_ads_source.stg_reddit_ads__account_tmp 197. model.reddit_ads_source.stg_reddit_ads__account_tmp currency 197. model.reddit_ads_source.stg_reddit_ads__account_tmp:f0->194. model.reddit_ads_source.stg_reddit_ads__account:f0
194. model.reddit_ads_source.stg_reddit_ads__account
  • Input Column: 197. model.reddit_ads_source.stg_reddit_ads__account_tmp[currency]
    • Cleaning The column is cast to TEXT
    • Output Columns:
      • currency: Directly copied after casting
193. model.reddit_ads.reddit_ads__url_report
  • Input Column: 194. model.reddit_ads_source.stg_reddit_ads__account[currency]
    • Direct directly copied to the output
    • Output Columns:
      • currency: directly copied
Column Lineage
%3 198. model.reddit_ads_source.stg_reddit_ads__ad 198. model.reddit_ads_source.stg_reddit_ads__ad post_id 193. model.reddit_ads.reddit_ads__url_report 193. model.reddit_ads.reddit_ads__url_report post_id 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f0 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp post_id 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp:f0->198. model.reddit_ads_source.stg_reddit_ads__ad:f0
198. model.reddit_ads_source.stg_reddit_ads__ad
  • Input Column: 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp[post_id]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • post_id: Directly mapped to the output column 'post_id'
193. model.reddit_ads.reddit_ads__url_report
  • Input Column: 198. model.reddit_ads_source.stg_reddit_ads__ad[post_id]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • post_id: Directly copied to the output
Column Lineage
%3 198. model.reddit_ads_source.stg_reddit_ads__ad 198. model.reddit_ads_source.stg_reddit_ads__ad post_url 193. model.reddit_ads.reddit_ads__url_report 193. model.reddit_ads.reddit_ads__url_report post_url 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f0 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp post_url 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp:f0->198. model.reddit_ads_source.stg_reddit_ads__ad:f0
198. model.reddit_ads_source.stg_reddit_ads__ad
  • Input Column: 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp[post_url]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • post_url: Directly mapped to the output column 'post_url'
193. model.reddit_ads.reddit_ads__url_report
  • Input Column: 198. model.reddit_ads_source.stg_reddit_ads__ad[post_url]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • post_url: Directly copied to the output
Column Lineage
%3 198. model.reddit_ads_source.stg_reddit_ads__ad 198. model.reddit_ads_source.stg_reddit_ads__ad click_url 193. model.reddit_ads.reddit_ads__url_report 193. model.reddit_ads.reddit_ads__url_report base_url click_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f1 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f0 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f2 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f3 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f7 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f6 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f8 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f5 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f4 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp click_url 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp:f0->198. model.reddit_ads_source.stg_reddit_ads__ad:f0
198. model.reddit_ads_source.stg_reddit_ads__ad
  • Input Column: 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp[click_url]
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • click_url: Directly mapped after casting
193. model.reddit_ads.reddit_ads__url_report
  • Input Column: 198. model.reddit_ads_source.stg_reddit_ads__ad[click_url]
    • Direct directly copied to output
    • Cleaning used to extract various URL components
    • Featurization used to extract UTM parameters
    • Filtering used to filter out null values in the final output
    • Output Columns:
      • click_url: directly copied
      • base_url: extracted from click_url
      • url_host: extracted from click_url
      • url_path: extracted from click_url
      • utm_source: extracted from click_url
      • utm_medium: extracted from click_url
      • utm_term: extracted from click_url
      • utm_content: extracted from click_url
      • utm_campaign: extracted from click_url (if not null)
Column Lineage
%3 203. model.reddit_ads_source.stg_reddit_ads__ad_report 203. model.reddit_ads_source.stg_reddit_ads__ad_report clicks 193. model.reddit_ads.reddit_ads__url_report 193. model.reddit_ads.reddit_ads__url_report clicks 203. model.reddit_ads_source.stg_reddit_ads__ad_report:f0->193. model.reddit_ads.reddit_ads__url_report:f0 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp clicks 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp:f0->203. model.reddit_ads_source.stg_reddit_ads__ad_report:f0
203. model.reddit_ads_source.stg_reddit_ads__ad_report
  • Input Column: 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp[clicks]
    • Cleaning The column is cast to INT data type
    • Output Columns:
      • clicks: Directly mapped after casting
193. model.reddit_ads.reddit_ads__url_report
  • Input Column: 203. model.reddit_ads_source.stg_reddit_ads__ad_report[clicks]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • clicks: Aggregated sum of clicks
Column Lineage
%3 203. model.reddit_ads_source.stg_reddit_ads__ad_report 203. model.reddit_ads_source.stg_reddit_ads__ad_report impressions 193. model.reddit_ads.reddit_ads__url_report 193. model.reddit_ads.reddit_ads__url_report impressions 203. model.reddit_ads_source.stg_reddit_ads__ad_report:f0->193. model.reddit_ads.reddit_ads__url_report:f0 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp impressions 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp:f0->203. model.reddit_ads_source.stg_reddit_ads__ad_report:f0
203. model.reddit_ads_source.stg_reddit_ads__ad_report
  • Input Column: 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp[impressions]
    • Cleaning The column is cast to INT data type
    • Output Columns:
      • impressions: Directly mapped after casting
193. model.reddit_ads.reddit_ads__url_report
  • Input Column: 203. model.reddit_ads_source.stg_reddit_ads__ad_report[impressions]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • impressions: Aggregated sum of impressions
Column Lineage
%3 203. model.reddit_ads_source.stg_reddit_ads__ad_report 203. model.reddit_ads_source.stg_reddit_ads__ad_report spend 193. model.reddit_ads.reddit_ads__url_report 193. model.reddit_ads.reddit_ads__url_report spend 203. model.reddit_ads_source.stg_reddit_ads__ad_report:f0->193. model.reddit_ads.reddit_ads__url_report:f0 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp spend 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp:f0->203. model.reddit_ads_source.stg_reddit_ads__ad_report:f0
203. model.reddit_ads_source.stg_reddit_ads__ad_report
  • Input Column: 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp[spend]
    • Cleaning The column is cleaned by casting to INT and then divided by 1,000,000 to convert from microcurrency
    • Output Columns:
      • spend: Transformed and mapped to the output 'spend' column
193. model.reddit_ads.reddit_ads__url_report
  • Input Column: 203. model.reddit_ads_source.stg_reddit_ads__ad_report[spend]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • spend: Aggregated sum of spend
Column Lineage
%3 198. model.reddit_ads_source.stg_reddit_ads__ad 198. model.reddit_ads_source.stg_reddit_ads__ad click_url 193. model.reddit_ads.reddit_ads__url_report 193. model.reddit_ads.reddit_ads__url_report base_url click_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f1 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f0 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f2 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f3 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f7 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f6 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f8 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f5 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f4 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp click_url 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp:f0->198. model.reddit_ads_source.stg_reddit_ads__ad:f0
198. model.reddit_ads_source.stg_reddit_ads__ad
  • Input Column: 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp[click_url]
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • click_url: Directly mapped after casting
193. model.reddit_ads.reddit_ads__url_report
  • Input Column: 198. model.reddit_ads_source.stg_reddit_ads__ad[click_url]
    • Direct directly copied to output
    • Cleaning used to extract various URL components
    • Featurization used to extract UTM parameters
    • Filtering used to filter out null values in the final output
    • Output Columns:
      • click_url: directly copied
      • base_url: extracted from click_url
      • url_host: extracted from click_url
      • url_path: extracted from click_url
      • utm_source: extracted from click_url
      • utm_medium: extracted from click_url
      • utm_term: extracted from click_url
      • utm_content: extracted from click_url
      • utm_campaign: extracted from click_url (if not null)
Column Lineage
%3 198. model.reddit_ads_source.stg_reddit_ads__ad 198. model.reddit_ads_source.stg_reddit_ads__ad click_url 193. model.reddit_ads.reddit_ads__url_report 193. model.reddit_ads.reddit_ads__url_report base_url click_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f1 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f0 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f2 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f3 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f7 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f6 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f8 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f5 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f4 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp click_url 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp:f0->198. model.reddit_ads_source.stg_reddit_ads__ad:f0
198. model.reddit_ads_source.stg_reddit_ads__ad
  • Input Column: 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp[click_url]
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • click_url: Directly mapped after casting
193. model.reddit_ads.reddit_ads__url_report
  • Input Column: 198. model.reddit_ads_source.stg_reddit_ads__ad[click_url]
    • Direct directly copied to output
    • Cleaning used to extract various URL components
    • Featurization used to extract UTM parameters
    • Filtering used to filter out null values in the final output
    • Output Columns:
      • click_url: directly copied
      • base_url: extracted from click_url
      • url_host: extracted from click_url
      • url_path: extracted from click_url
      • utm_source: extracted from click_url
      • utm_medium: extracted from click_url
      • utm_term: extracted from click_url
      • utm_content: extracted from click_url
      • utm_campaign: extracted from click_url (if not null)
Column Lineage
%3 198. model.reddit_ads_source.stg_reddit_ads__ad 198. model.reddit_ads_source.stg_reddit_ads__ad click_url 193. model.reddit_ads.reddit_ads__url_report 193. model.reddit_ads.reddit_ads__url_report base_url click_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f1 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f0 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f2 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f3 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f7 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f6 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f8 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f5 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f4 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp click_url 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp:f0->198. model.reddit_ads_source.stg_reddit_ads__ad:f0
198. model.reddit_ads_source.stg_reddit_ads__ad
  • Input Column: 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp[click_url]
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • click_url: Directly mapped after casting
193. model.reddit_ads.reddit_ads__url_report
  • Input Column: 198. model.reddit_ads_source.stg_reddit_ads__ad[click_url]
    • Direct directly copied to output
    • Cleaning used to extract various URL components
    • Featurization used to extract UTM parameters
    • Filtering used to filter out null values in the final output
    • Output Columns:
      • click_url: directly copied
      • base_url: extracted from click_url
      • url_host: extracted from click_url
      • url_path: extracted from click_url
      • utm_source: extracted from click_url
      • utm_medium: extracted from click_url
      • utm_term: extracted from click_url
      • utm_content: extracted from click_url
      • utm_campaign: extracted from click_url (if not null)
Column Lineage
%3 198. model.reddit_ads_source.stg_reddit_ads__ad 198. model.reddit_ads_source.stg_reddit_ads__ad click_url 193. model.reddit_ads.reddit_ads__url_report 193. model.reddit_ads.reddit_ads__url_report base_url click_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f1 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f0 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f2 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f3 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f7 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f6 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f8 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f5 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f4 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp click_url 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp:f0->198. model.reddit_ads_source.stg_reddit_ads__ad:f0
198. model.reddit_ads_source.stg_reddit_ads__ad
  • Input Column: 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp[click_url]
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • click_url: Directly mapped after casting
193. model.reddit_ads.reddit_ads__url_report
  • Input Column: 198. model.reddit_ads_source.stg_reddit_ads__ad[click_url]
    • Direct directly copied to output
    • Cleaning used to extract various URL components
    • Featurization used to extract UTM parameters
    • Filtering used to filter out null values in the final output
    • Output Columns:
      • click_url: directly copied
      • base_url: extracted from click_url
      • url_host: extracted from click_url
      • url_path: extracted from click_url
      • utm_source: extracted from click_url
      • utm_medium: extracted from click_url
      • utm_term: extracted from click_url
      • utm_content: extracted from click_url
      • utm_campaign: extracted from click_url (if not null)
Column Lineage
%3 198. model.reddit_ads_source.stg_reddit_ads__ad 198. model.reddit_ads_source.stg_reddit_ads__ad click_url 193. model.reddit_ads.reddit_ads__url_report 193. model.reddit_ads.reddit_ads__url_report base_url click_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f1 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f0 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f2 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f3 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f7 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f6 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f8 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f5 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f4 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp click_url 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp:f0->198. model.reddit_ads_source.stg_reddit_ads__ad:f0
198. model.reddit_ads_source.stg_reddit_ads__ad
  • Input Column: 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp[click_url]
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • click_url: Directly mapped after casting
193. model.reddit_ads.reddit_ads__url_report
  • Input Column: 198. model.reddit_ads_source.stg_reddit_ads__ad[click_url]
    • Direct directly copied to output
    • Cleaning used to extract various URL components
    • Featurization used to extract UTM parameters
    • Filtering used to filter out null values in the final output
    • Output Columns:
      • click_url: directly copied
      • base_url: extracted from click_url
      • url_host: extracted from click_url
      • url_path: extracted from click_url
      • utm_source: extracted from click_url
      • utm_medium: extracted from click_url
      • utm_term: extracted from click_url
      • utm_content: extracted from click_url
      • utm_campaign: extracted from click_url (if not null)
Column Lineage
%3 198. model.reddit_ads_source.stg_reddit_ads__ad 198. model.reddit_ads_source.stg_reddit_ads__ad click_url 193. model.reddit_ads.reddit_ads__url_report 193. model.reddit_ads.reddit_ads__url_report base_url campaign_name click_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f2 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f0 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f3 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f4 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f8 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f7 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f9 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f6 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f5 206. model.reddit_ads_source.stg_reddit_ads__campaign 206. model.reddit_ads_source.stg_reddit_ads__campaign campaign_name 206. model.reddit_ads_source.stg_reddit_ads__campaign:f0->193. model.reddit_ads.reddit_ads__url_report:f1 206. model.reddit_ads_source.stg_reddit_ads__campaign:f0->193. model.reddit_ads.reddit_ads__url_report:f5 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp click_url 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp:f0->198. model.reddit_ads_source.stg_reddit_ads__ad:f0 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp name 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp:f0->206. model.reddit_ads_source.stg_reddit_ads__campaign:f0
198. model.reddit_ads_source.stg_reddit_ads__ad
  • Input Column: 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp[click_url]
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • click_url: Directly mapped after casting
206. model.reddit_ads_source.stg_reddit_ads__campaign
  • Input Column: 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp[name]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • campaign_name: Directly mapped and renamed
193. model.reddit_ads.reddit_ads__url_report
  • Input Column: 198. model.reddit_ads_source.stg_reddit_ads__ad[click_url]
    • Direct directly copied to output
    • Cleaning used to extract various URL components
    • Featurization used to extract UTM parameters
    • Filtering used to filter out null values in the final output
    • Output Columns:
      • click_url: directly copied
      • base_url: extracted from click_url
      • url_host: extracted from click_url
      • url_path: extracted from click_url
      • utm_source: extracted from click_url
      • utm_medium: extracted from click_url
      • utm_term: extracted from click_url
      • utm_content: extracted from click_url
      • utm_campaign: extracted from click_url (if not null)
  • Input Column: 206. model.reddit_ads_source.stg_reddit_ads__campaign[campaign_name]
    • Direct directly copied to the output
    • Featurization used as a fallback value for utm_campaign
    • Output Columns:
      • campaign_name: directly copied
      • utm_campaign: used as fallback if not present in click_url
Column Lineage
%3 198. model.reddit_ads_source.stg_reddit_ads__ad 198. model.reddit_ads_source.stg_reddit_ads__ad click_url 193. model.reddit_ads.reddit_ads__url_report 193. model.reddit_ads.reddit_ads__url_report base_url click_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f1 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f0 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f2 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f3 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f7 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f6 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f8 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f5 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f4 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp click_url 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp:f0->198. model.reddit_ads_source.stg_reddit_ads__ad:f0
198. model.reddit_ads_source.stg_reddit_ads__ad
  • Input Column: 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp[click_url]
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • click_url: Directly mapped after casting
193. model.reddit_ads.reddit_ads__url_report
  • Input Column: 198. model.reddit_ads_source.stg_reddit_ads__ad[click_url]
    • Direct directly copied to output
    • Cleaning used to extract various URL components
    • Featurization used to extract UTM parameters
    • Filtering used to filter out null values in the final output
    • Output Columns:
      • click_url: directly copied
      • base_url: extracted from click_url
      • url_host: extracted from click_url
      • url_path: extracted from click_url
      • utm_source: extracted from click_url
      • utm_medium: extracted from click_url
      • utm_term: extracted from click_url
      • utm_content: extracted from click_url
      • utm_campaign: extracted from click_url (if not null)
Column Lineage
%3 198. model.reddit_ads_source.stg_reddit_ads__ad 198. model.reddit_ads_source.stg_reddit_ads__ad click_url 193. model.reddit_ads.reddit_ads__url_report 193. model.reddit_ads.reddit_ads__url_report base_url click_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f1 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f0 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f2 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f3 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f7 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f6 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f8 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f5 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f4 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp click_url 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp:f0->198. model.reddit_ads_source.stg_reddit_ads__ad:f0
198. model.reddit_ads_source.stg_reddit_ads__ad
  • Input Column: 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp[click_url]
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • click_url: Directly mapped after casting
193. model.reddit_ads.reddit_ads__url_report
  • Input Column: 198. model.reddit_ads_source.stg_reddit_ads__ad[click_url]
    • Direct directly copied to output
    • Cleaning used to extract various URL components
    • Featurization used to extract UTM parameters
    • Filtering used to filter out null values in the final output
    • Output Columns:
      • click_url: directly copied
      • base_url: extracted from click_url
      • url_host: extracted from click_url
      • url_path: extracted from click_url
      • utm_source: extracted from click_url
      • utm_medium: extracted from click_url
      • utm_term: extracted from click_url
      • utm_content: extracted from click_url
      • utm_campaign: extracted from click_url (if not null)
194. model.reddit_ads_source.stg_reddit_ads__account

This SQL query performs a basic transformation on data from a staging table for Reddit ads accounts. It casts several columns to specific data types, renames the 'id' column to 'account_id', and adds a 'source_relation' column. The query doesn't filter, deduplicate, or aggregate data, but rather focuses on cleaning and standardizing the data structure.

Cleaning
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_reddit_ads_source.stg_reddit_ads__account_tmp
), fields AS (
  SELECT
    CAST(NULL AS TIMESTAMP) AS _fivetran_synced,
    CAST(NULL AS TEXT) AS attribution_type,
    CAST(NULL AS TEXT) AS click_attribution_window,
    CAST(NULL AS TIMESTAMP) AS created_at,
    CAST(NULL AS TEXT) AS currency,
    CAST(NULL AS TEXT) AS id,
    CAST(NULL AS TEXT) AS status,
    CAST(NULL AS TEXT) AS time_zone_id,
    CAST(NULL AS TEXT) AS view_attribution_window,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    attribution_type,
    click_attribution_window,
    CAST(created_at AS TIMESTAMP) AS created_at,
    currency,
    id AS account_id,
    status,
    time_zone_id,
    view_attribution_window
  FROM fields
)
SELECT
  *
FROM final
%3 194. model.reddit_ads_source.stg_reddit_ads__account 194. model.reddit_ads_source.stg_reddit_ads__account source_relation account_id attribution_type click_attribution_window created_at currency status time_zone_id view_attribution_window 197. model.reddit_ads_source.stg_reddit_ads__account_tmp 197. model.reddit_ads_source.stg_reddit_ads__account_tmp id attribution_type click_attribution_window created_at currency status time_zone_id view_attribution_window 197. model.reddit_ads_source.stg_reddit_ads__account_tmp:f0->194. model.reddit_ads_source.stg_reddit_ads__account:f1 197. model.reddit_ads_source.stg_reddit_ads__account_tmp:f1->194. model.reddit_ads_source.stg_reddit_ads__account:f2 197. model.reddit_ads_source.stg_reddit_ads__account_tmp:f2->194. model.reddit_ads_source.stg_reddit_ads__account:f3 197. model.reddit_ads_source.stg_reddit_ads__account_tmp:f3->194. model.reddit_ads_source.stg_reddit_ads__account:f4 197. model.reddit_ads_source.stg_reddit_ads__account_tmp:f4->194. model.reddit_ads_source.stg_reddit_ads__account:f5 197. model.reddit_ads_source.stg_reddit_ads__account_tmp:f5->194. model.reddit_ads_source.stg_reddit_ads__account:f6 197. model.reddit_ads_source.stg_reddit_ads__account_tmp:f6->194. model.reddit_ads_source.stg_reddit_ads__account:f7 197. model.reddit_ads_source.stg_reddit_ads__account_tmp:f7->194. model.reddit_ads_source.stg_reddit_ads__account:f8
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
account_id bigint The ID representing the account.
attribution_type text Attribution type: "CLICK_THROUGH_CONVERSION", "VIEW_THROUGH_CONVERSION", or "ALL_CONVERSION". CLICK_THROUGH_CONVERSION: A user clicked on your ad and then completed the conversion action on your site. VIEW_THROUGH_CONVERSION: A user saw your ad and did not click it, but did complete the conversion action on your site. ALL_CONVERSION: Combination of both.
click_attribution_window text Determines how long after clicking on your ad you count that user’s actions as a conversion. "DAY", "WEEK", or "MONTH"
created_at timestamp without time zone Time that the respective record (ad, ad group, campaign, post, etc) was created. ISO-8601 timestamp.
currency text The currency this account uses (ISO-4217)
status integer The current state of the advertiser. "PENDING_BILLING", "VALID", "TRUSTED", "ADMIN", "FAILED_BILLING", "SUSPICIOUS", "SUSPENDED", or "BANNED"
time_zone_id text The time zone id preference for this account
view_attribution_window text Determines how long after viewing on your ad you count that user’s actions as a conversion. "DAY", "WEEK", or "MONTH"
Column Lineage
%3 194. model.reddit_ads_source.stg_reddit_ads__account 194. model.reddit_ads_source.stg_reddit_ads__account source_relation 193. model.reddit_ads.reddit_ads__url_report 193. model.reddit_ads.reddit_ads__url_report source_relation 194. model.reddit_ads_source.stg_reddit_ads__account:f0->193. model.reddit_ads.reddit_ads__url_report:f0 189. model.reddit_ads.reddit_ads__account_report 189. model.reddit_ads.reddit_ads__account_report source_relation 194. model.reddit_ads_source.stg_reddit_ads__account:f0->189. model.reddit_ads.reddit_ads__account_report:f0 191. model.reddit_ads.reddit_ads__ad_report 191. model.reddit_ads.reddit_ads__ad_report source_relation 194. model.reddit_ads_source.stg_reddit_ads__account:f0->191. model.reddit_ads.reddit_ads__ad_report:f0 190. model.reddit_ads.reddit_ads__ad_group_report 190. model.reddit_ads.reddit_ads__ad_group_report source_relation 194. model.reddit_ads_source.stg_reddit_ads__account:f0->190. model.reddit_ads.reddit_ads__ad_group_report:f0 192. model.reddit_ads.reddit_ads__campaign_report 192. model.reddit_ads.reddit_ads__campaign_report source_relation 194. model.reddit_ads_source.stg_reddit_ads__account:f0->192. model.reddit_ads.reddit_ads__campaign_report:f0
189. model.reddit_ads.reddit_ads__account_report
  • Input Column: 194. model.reddit_ads_source.stg_reddit_ads__account[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as a key to join with the report table
    • Output Columns:
      • source_relation: Directly copied to the output
190. model.reddit_ads.reddit_ads__ad_group_report
  • Input Column: 194. model.reddit_ads_source.stg_reddit_ads__account[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
191. model.reddit_ads.reddit_ads__ad_report
  • Input Column: 194. model.reddit_ads_source.stg_reddit_ads__account[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
192. model.reddit_ads.reddit_ads__campaign_report
  • Input Column: 194. model.reddit_ads_source.stg_reddit_ads__account[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as a key to join with other tables
    • Output Columns:
      • source_relation: Directly copied to the output
193. model.reddit_ads.reddit_ads__url_report
  • Input Column: 194. model.reddit_ads_source.stg_reddit_ads__account[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
Column Lineage
%3 197. model.reddit_ads_source.stg_reddit_ads__account_tmp 197. model.reddit_ads_source.stg_reddit_ads__account_tmp id 194. model.reddit_ads_source.stg_reddit_ads__account 194. model.reddit_ads_source.stg_reddit_ads__account account_id 197. model.reddit_ads_source.stg_reddit_ads__account_tmp:f0->194. model.reddit_ads_source.stg_reddit_ads__account:f0 193. model.reddit_ads.reddit_ads__url_report 193. model.reddit_ads.reddit_ads__url_report account_id 194. model.reddit_ads_source.stg_reddit_ads__account:f0->193. model.reddit_ads.reddit_ads__url_report:f0 189. model.reddit_ads.reddit_ads__account_report 189. model.reddit_ads.reddit_ads__account_report account_id 194. model.reddit_ads_source.stg_reddit_ads__account:f0->189. model.reddit_ads.reddit_ads__account_report:f0 191. model.reddit_ads.reddit_ads__ad_report 191. model.reddit_ads.reddit_ads__ad_report account_id 194. model.reddit_ads_source.stg_reddit_ads__account:f0->191. model.reddit_ads.reddit_ads__ad_report:f0 190. model.reddit_ads.reddit_ads__ad_group_report 190. model.reddit_ads.reddit_ads__ad_group_report account_id 194. model.reddit_ads_source.stg_reddit_ads__account:f0->190. model.reddit_ads.reddit_ads__ad_group_report:f0 192. model.reddit_ads.reddit_ads__campaign_report 192. model.reddit_ads.reddit_ads__campaign_report account_id 194. model.reddit_ads_source.stg_reddit_ads__account:f0->192. model.reddit_ads.reddit_ads__campaign_report:f0
194. model.reddit_ads_source.stg_reddit_ads__account
  • Input Column: 197. model.reddit_ads_source.stg_reddit_ads__account_tmp[id]
    • Cleaning The column is cast to TEXT and renamed to 'account_id'
    • Output Columns:
      • account_id: Directly copied after casting and renaming
189. model.reddit_ads.reddit_ads__account_report
  • Input Column: 194. model.reddit_ads_source.stg_reddit_ads__account[account_id]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as a key to join with the report table
    • Output Columns:
      • account_id: Directly copied to the output
190. model.reddit_ads.reddit_ads__ad_group_report
  • Input Column: 194. model.reddit_ads_source.stg_reddit_ads__account[account_id]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • account_id: directly copied
191. model.reddit_ads.reddit_ads__ad_report
  • Input Column: 194. model.reddit_ads_source.stg_reddit_ads__account[account_id]
    • Integration used as the key to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • account_id: directly copied
192. model.reddit_ads.reddit_ads__campaign_report
  • Input Column: 194. model.reddit_ads_source.stg_reddit_ads__account[account_id]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as a key to join with other tables
    • Output Columns:
      • account_id: Directly copied to the output
193. model.reddit_ads.reddit_ads__url_report
  • Input Column: 194. model.reddit_ads_source.stg_reddit_ads__account[account_id]
    • Integration used as the key to join with the report table
    • Output Columns:
      • account_id: directly copied
Column Lineage
%3 197. model.reddit_ads_source.stg_reddit_ads__account_tmp 197. model.reddit_ads_source.stg_reddit_ads__account_tmp attribution_type 194. model.reddit_ads_source.stg_reddit_ads__account 194. model.reddit_ads_source.stg_reddit_ads__account attribution_type 197. model.reddit_ads_source.stg_reddit_ads__account_tmp:f0->194. model.reddit_ads_source.stg_reddit_ads__account:f0 189. model.reddit_ads.reddit_ads__account_report 189. model.reddit_ads.reddit_ads__account_report attribution_type 194. model.reddit_ads_source.stg_reddit_ads__account:f0->189. model.reddit_ads.reddit_ads__account_report:f0
194. model.reddit_ads_source.stg_reddit_ads__account
  • Input Column: 197. model.reddit_ads_source.stg_reddit_ads__account_tmp[attribution_type]
    • Cleaning The column is cast to TEXT
    • Output Columns:
      • attribution_type: Directly copied after casting
189. model.reddit_ads.reddit_ads__account_report
  • Input Column: 194. model.reddit_ads_source.stg_reddit_ads__account[attribution_type]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • attribution_type: Directly copied to the output
Column Lineage
%3 197. model.reddit_ads_source.stg_reddit_ads__account_tmp 197. model.reddit_ads_source.stg_reddit_ads__account_tmp click_attribution_window 194. model.reddit_ads_source.stg_reddit_ads__account 194. model.reddit_ads_source.stg_reddit_ads__account click_attribution_window 197. model.reddit_ads_source.stg_reddit_ads__account_tmp:f0->194. model.reddit_ads_source.stg_reddit_ads__account:f0
194. model.reddit_ads_source.stg_reddit_ads__account
  • Input Column: 197. model.reddit_ads_source.stg_reddit_ads__account_tmp[click_attribution_window]
    • Cleaning The column is cast to TEXT
    • Output Columns:
      • click_attribution_window: Directly copied after casting
Column Lineage
%3 197. model.reddit_ads_source.stg_reddit_ads__account_tmp 197. model.reddit_ads_source.stg_reddit_ads__account_tmp created_at 194. model.reddit_ads_source.stg_reddit_ads__account 194. model.reddit_ads_source.stg_reddit_ads__account created_at 197. model.reddit_ads_source.stg_reddit_ads__account_tmp:f0->194. model.reddit_ads_source.stg_reddit_ads__account:f0
194. model.reddit_ads_source.stg_reddit_ads__account
  • Input Column: 197. model.reddit_ads_source.stg_reddit_ads__account_tmp[created_at]
    • Cleaning The column is cast to TIMESTAMP
    • Output Columns:
      • created_at: Directly copied after casting
Column Lineage
%3 197. model.reddit_ads_source.stg_reddit_ads__account_tmp 197. model.reddit_ads_source.stg_reddit_ads__account_tmp currency 194. model.reddit_ads_source.stg_reddit_ads__account 194. model.reddit_ads_source.stg_reddit_ads__account currency 197. model.reddit_ads_source.stg_reddit_ads__account_tmp:f0->194. model.reddit_ads_source.stg_reddit_ads__account:f0 193. model.reddit_ads.reddit_ads__url_report 193. model.reddit_ads.reddit_ads__url_report currency 194. model.reddit_ads_source.stg_reddit_ads__account:f0->193. model.reddit_ads.reddit_ads__url_report:f0 189. model.reddit_ads.reddit_ads__account_report 189. model.reddit_ads.reddit_ads__account_report currency 194. model.reddit_ads_source.stg_reddit_ads__account:f0->189. model.reddit_ads.reddit_ads__account_report:f0 191. model.reddit_ads.reddit_ads__ad_report 191. model.reddit_ads.reddit_ads__ad_report currency 194. model.reddit_ads_source.stg_reddit_ads__account:f0->191. model.reddit_ads.reddit_ads__ad_report:f0 190. model.reddit_ads.reddit_ads__ad_group_report 190. model.reddit_ads.reddit_ads__ad_group_report currency 194. model.reddit_ads_source.stg_reddit_ads__account:f0->190. model.reddit_ads.reddit_ads__ad_group_report:f0 192. model.reddit_ads.reddit_ads__campaign_report 192. model.reddit_ads.reddit_ads__campaign_report currency 194. model.reddit_ads_source.stg_reddit_ads__account:f0->192. model.reddit_ads.reddit_ads__campaign_report:f0
194. model.reddit_ads_source.stg_reddit_ads__account
  • Input Column: 197. model.reddit_ads_source.stg_reddit_ads__account_tmp[currency]
    • Cleaning The column is cast to TEXT
    • Output Columns:
      • currency: Directly copied after casting
189. model.reddit_ads.reddit_ads__account_report
  • Input Column: 194. model.reddit_ads_source.stg_reddit_ads__account[currency]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • currency: Directly copied to the output
190. model.reddit_ads.reddit_ads__ad_group_report
  • Input Column: 194. model.reddit_ads_source.stg_reddit_ads__account[currency]
    • Direct directly copied to the output
    • Output Columns:
      • currency: directly copied
191. model.reddit_ads.reddit_ads__ad_report
  • Input Column: 194. model.reddit_ads_source.stg_reddit_ads__account[currency]
    • Direct directly copied to the output
    • Output Columns:
      • currency: directly copied
192. model.reddit_ads.reddit_ads__campaign_report
  • Input Column: 194. model.reddit_ads_source.stg_reddit_ads__account[currency]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • currency: Directly copied to the output
193. model.reddit_ads.reddit_ads__url_report
  • Input Column: 194. model.reddit_ads_source.stg_reddit_ads__account[currency]
    • Direct directly copied to the output
    • Output Columns:
      • currency: directly copied
Column Lineage
%3 197. model.reddit_ads_source.stg_reddit_ads__account_tmp 197. model.reddit_ads_source.stg_reddit_ads__account_tmp status 194. model.reddit_ads_source.stg_reddit_ads__account 194. model.reddit_ads_source.stg_reddit_ads__account status 197. model.reddit_ads_source.stg_reddit_ads__account_tmp:f0->194. model.reddit_ads_source.stg_reddit_ads__account:f0 189. model.reddit_ads.reddit_ads__account_report 189. model.reddit_ads.reddit_ads__account_report status 194. model.reddit_ads_source.stg_reddit_ads__account:f0->189. model.reddit_ads.reddit_ads__account_report:f0
194. model.reddit_ads_source.stg_reddit_ads__account
  • Input Column: 197. model.reddit_ads_source.stg_reddit_ads__account_tmp[status]
    • Cleaning The column is cast to TEXT
    • Output Columns:
      • status: Directly copied after casting
189. model.reddit_ads.reddit_ads__account_report
  • Input Column: 194. model.reddit_ads_source.stg_reddit_ads__account[status]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • status: Directly copied to the output
Column Lineage
%3 197. model.reddit_ads_source.stg_reddit_ads__account_tmp 197. model.reddit_ads_source.stg_reddit_ads__account_tmp time_zone_id 194. model.reddit_ads_source.stg_reddit_ads__account 194. model.reddit_ads_source.stg_reddit_ads__account time_zone_id 197. model.reddit_ads_source.stg_reddit_ads__account_tmp:f0->194. model.reddit_ads_source.stg_reddit_ads__account:f0 189. model.reddit_ads.reddit_ads__account_report 189. model.reddit_ads.reddit_ads__account_report time_zone_id 194. model.reddit_ads_source.stg_reddit_ads__account:f0->189. model.reddit_ads.reddit_ads__account_report:f0
194. model.reddit_ads_source.stg_reddit_ads__account
  • Input Column: 197. model.reddit_ads_source.stg_reddit_ads__account_tmp[time_zone_id]
    • Cleaning The column is cast to TEXT
    • Output Columns:
      • time_zone_id: Directly copied after casting
189. model.reddit_ads.reddit_ads__account_report
  • Input Column: 194. model.reddit_ads_source.stg_reddit_ads__account[time_zone_id]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • time_zone_id: Directly copied to the output
Column Lineage
%3 197. model.reddit_ads_source.stg_reddit_ads__account_tmp 197. model.reddit_ads_source.stg_reddit_ads__account_tmp view_attribution_window 194. model.reddit_ads_source.stg_reddit_ads__account 194. model.reddit_ads_source.stg_reddit_ads__account view_attribution_window 197. model.reddit_ads_source.stg_reddit_ads__account_tmp:f0->194. model.reddit_ads_source.stg_reddit_ads__account:f0
194. model.reddit_ads_source.stg_reddit_ads__account
  • Input Column: 197. model.reddit_ads_source.stg_reddit_ads__account_tmp[view_attribution_window]
    • Cleaning The column is cast to TEXT
    • Output Columns:
      • view_attribution_window: Directly copied after casting
195. model.reddit_ads_source.stg_reddit_ads__account_report

This SQL query performs data transformation on the 'stg_reddit_ads__account_report_tmp' table. It starts by casting NULL values to specific data types for various fields. Then, it selects and renames certain columns, and performs a simple calculation on the 'spend' column (dividing it by 1,000,000). The query also adds a 'source_relation' column with an empty string value.

CleaningFeaturization
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_reddit_ads_source.stg_reddit_ads__account_report_tmp
), fields AS (
  SELECT
    CAST(NULL AS TIMESTAMP) AS _fivetran_synced,
    CAST(NULL AS TEXT) AS account_id,
    CAST(NULL AS INT) AS clicks,
    CAST(NULL AS DATE) AS date,
    CAST(NULL AS INT) AS impressions,
    CAST(NULL AS TEXT) AS region,
    CAST(NULL AS INT) AS spend,
    CAST(NULL AS DATE) AS date_day,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    account_id,
    clicks,
    date AS date_day,
    impressions,
    region,
    (
      spend / 1000000
    ) AS spend
  FROM fields
)
SELECT
  *
FROM final
%3 195. model.reddit_ads_source.stg_reddit_ads__account_report 195. model.reddit_ads_source.stg_reddit_ads__account_report source_relation account_id clicks date_day impressions region spend 196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp 196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp account_id date clicks impressions region spend 196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp:f0->195. model.reddit_ads_source.stg_reddit_ads__account_report:f1 196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp:f1->195. model.reddit_ads_source.stg_reddit_ads__account_report:f3 196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp:f2->195. model.reddit_ads_source.stg_reddit_ads__account_report:f2 196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp:f3->195. model.reddit_ads_source.stg_reddit_ads__account_report:f4 196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp:f4->195. model.reddit_ads_source.stg_reddit_ads__account_report:f5 196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp:f5->195. model.reddit_ads_source.stg_reddit_ads__account_report:f6
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
account_id bigint The ID representing the account.
clicks integer The count of clicks.
date_day date YYYY-MM-DD formatted date
impressions integer The count of impressions.
region integer The region (US state or UK country) targeted for the reports
spend integer Spend converted out of microcurrency (so Spend/1,000,000)
Column Lineage
%3 195. model.reddit_ads_source.stg_reddit_ads__account_report 195. model.reddit_ads_source.stg_reddit_ads__account_report source_relation 189. model.reddit_ads.reddit_ads__account_report 189. model.reddit_ads.reddit_ads__account_report source_relation 195. model.reddit_ads_source.stg_reddit_ads__account_report:f0->189. model.reddit_ads.reddit_ads__account_report:f0
189. model.reddit_ads.reddit_ads__account_report
  • Input Column: 195. model.reddit_ads_source.stg_reddit_ads__account_report[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with the accounts table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
Column Lineage
%3 196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp 196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp account_id 195. model.reddit_ads_source.stg_reddit_ads__account_report 195. model.reddit_ads_source.stg_reddit_ads__account_report account_id 196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp:f0->195. model.reddit_ads_source.stg_reddit_ads__account_report:f0 189. model.reddit_ads.reddit_ads__account_report 189. model.reddit_ads.reddit_ads__account_report account_id 195. model.reddit_ads_source.stg_reddit_ads__account_report:f0->189. model.reddit_ads.reddit_ads__account_report:f0
195. model.reddit_ads_source.stg_reddit_ads__account_report
  • Input Column: 196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp[account_id]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • account_id: Directly copied to the output 'account_id' column
189. model.reddit_ads.reddit_ads__account_report
  • Input Column: 195. model.reddit_ads_source.stg_reddit_ads__account_report[account_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as the key to join with the accounts table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • account_id: Directly copied to the output
Column Lineage
%3 196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp 196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp clicks 195. model.reddit_ads_source.stg_reddit_ads__account_report 195. model.reddit_ads_source.stg_reddit_ads__account_report clicks 196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp:f0->195. model.reddit_ads_source.stg_reddit_ads__account_report:f0 189. model.reddit_ads.reddit_ads__account_report 189. model.reddit_ads.reddit_ads__account_report clicks 195. model.reddit_ads_source.stg_reddit_ads__account_report:f0->189. model.reddit_ads.reddit_ads__account_report:f0
195. model.reddit_ads_source.stg_reddit_ads__account_report
  • Input Column: 196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp[clicks]
    • Cleaning The column is cast to INT type in the 'fields' CTE
    • Output Columns:
      • clicks: Directly mapped after casting
189. model.reddit_ads.reddit_ads__account_report
  • Input Column: 195. model.reddit_ads_source.stg_reddit_ads__account_report[clicks]
    • Aggregation The column is summed up in the GROUP BY
    • Output Columns:
      • clicks: Aggregated sum in the output
Column Lineage
%3 196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp 196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp date 195. model.reddit_ads_source.stg_reddit_ads__account_report 195. model.reddit_ads_source.stg_reddit_ads__account_report date_day 196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp:f0->195. model.reddit_ads_source.stg_reddit_ads__account_report:f0 189. model.reddit_ads.reddit_ads__account_report 189. model.reddit_ads.reddit_ads__account_report date_day 195. model.reddit_ads_source.stg_reddit_ads__account_report:f0->189. model.reddit_ads.reddit_ads__account_report:f0
195. model.reddit_ads_source.stg_reddit_ads__account_report
  • Input Column: 196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp[date]
    • Cleaning The column is cleaned by casting to DATE type
    • Output Columns:
      • date_day: Mapped to 'date_day' in the output after casting
189. model.reddit_ads.reddit_ads__account_report
  • Input Column: 195. model.reddit_ads_source.stg_reddit_ads__account_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp 196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp impressions 195. model.reddit_ads_source.stg_reddit_ads__account_report 195. model.reddit_ads_source.stg_reddit_ads__account_report impressions 196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp:f0->195. model.reddit_ads_source.stg_reddit_ads__account_report:f0 189. model.reddit_ads.reddit_ads__account_report 189. model.reddit_ads.reddit_ads__account_report impressions 195. model.reddit_ads_source.stg_reddit_ads__account_report:f0->189. model.reddit_ads.reddit_ads__account_report:f0
195. model.reddit_ads_source.stg_reddit_ads__account_report
  • Input Column: 196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp[impressions]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • impressions: Directly mapped to the output 'impressions' column
189. model.reddit_ads.reddit_ads__account_report
  • Input Column: 195. model.reddit_ads_source.stg_reddit_ads__account_report[impressions]
    • Aggregation The column is summed up in the GROUP BY
    • Output Columns:
      • impressions: Aggregated sum in the output
Column Lineage
%3 196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp 196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp region 195. model.reddit_ads_source.stg_reddit_ads__account_report 195. model.reddit_ads_source.stg_reddit_ads__account_report region 196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp:f0->195. model.reddit_ads_source.stg_reddit_ads__account_report:f0
195. model.reddit_ads_source.stg_reddit_ads__account_report
  • Input Column: 196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp[region]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • region: Directly mapped to the output 'region' column
Column Lineage
%3 196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp 196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp spend 195. model.reddit_ads_source.stg_reddit_ads__account_report 195. model.reddit_ads_source.stg_reddit_ads__account_report spend 196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp:f0->195. model.reddit_ads_source.stg_reddit_ads__account_report:f0 189. model.reddit_ads.reddit_ads__account_report 189. model.reddit_ads.reddit_ads__account_report spend 195. model.reddit_ads_source.stg_reddit_ads__account_report:f0->189. model.reddit_ads.reddit_ads__account_report:f0
195. model.reddit_ads_source.stg_reddit_ads__account_report
  • Input Column: 196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp[spend]
    • Cleaning The column is cleaned by dividing its value by 1,000,000 to convert from microcurrency
    • Output Columns:
      • spend: Transformed and mapped to the output 'spend' column
189. model.reddit_ads.reddit_ads__account_report
  • Input Column: 195. model.reddit_ads_source.stg_reddit_ads__account_report[spend]
    • Aggregation The column is summed up in the GROUP BY
    • Output Columns:
      • spend: Aggregated sum in the output
196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of type TEXT. It's likely used as a placeholder or template for further operations in a dbt (data build tool) model.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp 196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp account_id date _fivetran_synced app_install_metrics_add_payment_info app_install_metrics_add_to_cart app_install_metrics_app_launch app_install_metrics_completed_tutorial app_install_metrics_install app_install_metrics_level_achieved app_install_metrics_purchase app_install_metrics_search app_install_metrics_sign_up app_install_metrics_spend app_install_metrics_spend_credits app_install_metrics_view_content clicks comment_downvotes comment_upvotes comments_page_views conversion_roas cpc ctr ecpm gallery_item_caption gallery_item_id impressions legacy_click_conversions_attribution_window_day legacy_click_conversions_attribution_window_month legacy_click_conversions_attribution_window_week legacy_view_conversions_attribution_window_day legacy_view_conversions_attribution_window_month legacy_view_conversions_attribution_window_week priority region spend video_fully_viewable_impressions video_plays_expanded video_plays_with_sound video_started video_viewable_impressions video_watched_100_percent video_watched_10_seconds video_watched_25_percent video_watched_3_seconds video_watched_50_percent video_watched_5_seconds video_watched_75_percent video_watched_95_percent viewable_impressions viewer_comments 344. source.reddit_ads_source.reddit_ads.account_report 344. source.reddit_ads_source.reddit_ads.account_report
Name Type Comment
account_id bigint None
date date None
_fivetran_synced timestamp without time zone None
app_install_metrics_add_payment_info integer None
app_install_metrics_add_to_cart integer None
app_install_metrics_app_launch integer None
app_install_metrics_completed_tutorial integer None
app_install_metrics_install integer None
app_install_metrics_level_achieved integer None
app_install_metrics_purchase integer None
app_install_metrics_search integer None
app_install_metrics_sign_up integer None
app_install_metrics_spend integer None
app_install_metrics_spend_credits integer None
app_install_metrics_view_content integer None
clicks integer None
comment_downvotes integer None
comment_upvotes integer None
comments_page_views integer None
conversion_roas integer None
cpc double precision None
ctr double precision None
ecpm double precision None
gallery_item_caption integer None
gallery_item_id integer None
impressions integer None
legacy_click_conversions_attribution_window_day integer None
legacy_click_conversions_attribution_window_month integer None
legacy_click_conversions_attribution_window_week integer None
legacy_view_conversions_attribution_window_day integer None
legacy_view_conversions_attribution_window_month integer None
legacy_view_conversions_attribution_window_week integer None
priority integer None
region integer None
spend integer None
video_fully_viewable_impressions integer None
video_plays_expanded integer None
video_plays_with_sound integer None
video_started integer None
video_viewable_impressions integer None
video_watched_100_percent integer None
video_watched_10_seconds integer None
video_watched_25_percent integer None
video_watched_3_seconds integer None
video_watched_50_percent integer None
video_watched_5_seconds integer None
video_watched_75_percent integer None
video_watched_95_percent integer None
viewable_impressions integer None
viewer_comments integer None
Column Lineage
%3 196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp 196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp account_id 195. model.reddit_ads_source.stg_reddit_ads__account_report 195. model.reddit_ads_source.stg_reddit_ads__account_report account_id 196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp:f0->195. model.reddit_ads_source.stg_reddit_ads__account_report:f0 189. model.reddit_ads.reddit_ads__account_report 189. model.reddit_ads.reddit_ads__account_report account_id 195. model.reddit_ads_source.stg_reddit_ads__account_report:f0->189. model.reddit_ads.reddit_ads__account_report:f0
195. model.reddit_ads_source.stg_reddit_ads__account_report
  • Input Column: 196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp[account_id]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • account_id: Directly copied to the output 'account_id' column
189. model.reddit_ads.reddit_ads__account_report
  • Input Column: 195. model.reddit_ads_source.stg_reddit_ads__account_report[account_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as the key to join with the accounts table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • account_id: Directly copied to the output
Column Lineage
%3 196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp 196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp date 195. model.reddit_ads_source.stg_reddit_ads__account_report 195. model.reddit_ads_source.stg_reddit_ads__account_report date_day 196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp:f0->195. model.reddit_ads_source.stg_reddit_ads__account_report:f0 189. model.reddit_ads.reddit_ads__account_report 189. model.reddit_ads.reddit_ads__account_report date_day 195. model.reddit_ads_source.stg_reddit_ads__account_report:f0->189. model.reddit_ads.reddit_ads__account_report:f0
195. model.reddit_ads_source.stg_reddit_ads__account_report
  • Input Column: 196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp[date]
    • Cleaning The column is cleaned by casting to DATE type
    • Output Columns:
      • date_day: Mapped to 'date_day' in the output after casting
189. model.reddit_ads.reddit_ads__account_report
  • Input Column: 195. model.reddit_ads_source.stg_reddit_ads__account_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp 196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp clicks 195. model.reddit_ads_source.stg_reddit_ads__account_report 195. model.reddit_ads_source.stg_reddit_ads__account_report clicks 196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp:f0->195. model.reddit_ads_source.stg_reddit_ads__account_report:f0 189. model.reddit_ads.reddit_ads__account_report 189. model.reddit_ads.reddit_ads__account_report clicks 195. model.reddit_ads_source.stg_reddit_ads__account_report:f0->189. model.reddit_ads.reddit_ads__account_report:f0
195. model.reddit_ads_source.stg_reddit_ads__account_report
  • Input Column: 196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp[clicks]
    • Cleaning The column is cast to INT type in the 'fields' CTE
    • Output Columns:
      • clicks: Directly mapped after casting
189. model.reddit_ads.reddit_ads__account_report
  • Input Column: 195. model.reddit_ads_source.stg_reddit_ads__account_report[clicks]
    • Aggregation The column is summed up in the GROUP BY
    • Output Columns:
      • clicks: Aggregated sum in the output
Column Lineage
%3 196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp 196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp impressions 195. model.reddit_ads_source.stg_reddit_ads__account_report 195. model.reddit_ads_source.stg_reddit_ads__account_report impressions 196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp:f0->195. model.reddit_ads_source.stg_reddit_ads__account_report:f0 189. model.reddit_ads.reddit_ads__account_report 189. model.reddit_ads.reddit_ads__account_report impressions 195. model.reddit_ads_source.stg_reddit_ads__account_report:f0->189. model.reddit_ads.reddit_ads__account_report:f0
195. model.reddit_ads_source.stg_reddit_ads__account_report
  • Input Column: 196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp[impressions]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • impressions: Directly mapped to the output 'impressions' column
189. model.reddit_ads.reddit_ads__account_report
  • Input Column: 195. model.reddit_ads_source.stg_reddit_ads__account_report[impressions]
    • Aggregation The column is summed up in the GROUP BY
    • Output Columns:
      • impressions: Aggregated sum in the output
Column Lineage
%3 196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp 196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp region 195. model.reddit_ads_source.stg_reddit_ads__account_report 195. model.reddit_ads_source.stg_reddit_ads__account_report region 196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp:f0->195. model.reddit_ads_source.stg_reddit_ads__account_report:f0
195. model.reddit_ads_source.stg_reddit_ads__account_report
  • Input Column: 196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp[region]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • region: Directly mapped to the output 'region' column
Column Lineage
%3 196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp 196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp spend 195. model.reddit_ads_source.stg_reddit_ads__account_report 195. model.reddit_ads_source.stg_reddit_ads__account_report spend 196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp:f0->195. model.reddit_ads_source.stg_reddit_ads__account_report:f0 189. model.reddit_ads.reddit_ads__account_report 189. model.reddit_ads.reddit_ads__account_report spend 195. model.reddit_ads_source.stg_reddit_ads__account_report:f0->189. model.reddit_ads.reddit_ads__account_report:f0
195. model.reddit_ads_source.stg_reddit_ads__account_report
  • Input Column: 196. model.reddit_ads_source.stg_reddit_ads__account_report_tmp[spend]
    • Cleaning The column is cleaned by dividing its value by 1,000,000 to convert from microcurrency
    • Output Columns:
      • spend: Transformed and mapped to the output 'spend' column
189. model.reddit_ads.reddit_ads__account_report
  • Input Column: 195. model.reddit_ads_source.stg_reddit_ads__account_report[spend]
    • Aggregation The column is summed up in the GROUP BY
    • Output Columns:
      • spend: Aggregated sum in the output
197. model.reddit_ads_source.stg_reddit_ads__account_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of type TEXT. It's likely used as a placeholder or template for a staging table in a dbt (data build tool) project, specifically for Reddit ads account data.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 197. model.reddit_ads_source.stg_reddit_ads__account_tmp 197. model.reddit_ads_source.stg_reddit_ads__account_tmp id _fivetran_synced attribution_type click_attribution_window created_at currency status time_zone_id view_attribution_window 343. source.reddit_ads_source.reddit_ads.account 343. source.reddit_ads_source.reddit_ads.account
Name Type Comment
id bigint None
_fivetran_synced timestamp without time zone None
attribution_type text None
click_attribution_window text None
created_at timestamp without time zone None
currency text None
status integer None
time_zone_id text None
view_attribution_window text None
Column Lineage
%3 197. model.reddit_ads_source.stg_reddit_ads__account_tmp 197. model.reddit_ads_source.stg_reddit_ads__account_tmp id 194. model.reddit_ads_source.stg_reddit_ads__account 194. model.reddit_ads_source.stg_reddit_ads__account account_id 197. model.reddit_ads_source.stg_reddit_ads__account_tmp:f0->194. model.reddit_ads_source.stg_reddit_ads__account:f0 193. model.reddit_ads.reddit_ads__url_report 193. model.reddit_ads.reddit_ads__url_report account_id 194. model.reddit_ads_source.stg_reddit_ads__account:f0->193. model.reddit_ads.reddit_ads__url_report:f0 189. model.reddit_ads.reddit_ads__account_report 189. model.reddit_ads.reddit_ads__account_report account_id 194. model.reddit_ads_source.stg_reddit_ads__account:f0->189. model.reddit_ads.reddit_ads__account_report:f0 191. model.reddit_ads.reddit_ads__ad_report 191. model.reddit_ads.reddit_ads__ad_report account_id 194. model.reddit_ads_source.stg_reddit_ads__account:f0->191. model.reddit_ads.reddit_ads__ad_report:f0 190. model.reddit_ads.reddit_ads__ad_group_report 190. model.reddit_ads.reddit_ads__ad_group_report account_id 194. model.reddit_ads_source.stg_reddit_ads__account:f0->190. model.reddit_ads.reddit_ads__ad_group_report:f0 192. model.reddit_ads.reddit_ads__campaign_report 192. model.reddit_ads.reddit_ads__campaign_report account_id 194. model.reddit_ads_source.stg_reddit_ads__account:f0->192. model.reddit_ads.reddit_ads__campaign_report:f0
194. model.reddit_ads_source.stg_reddit_ads__account
  • Input Column: 197. model.reddit_ads_source.stg_reddit_ads__account_tmp[id]
    • Cleaning The column is cast to TEXT and renamed to 'account_id'
    • Output Columns:
      • account_id: Directly copied after casting and renaming
189. model.reddit_ads.reddit_ads__account_report
  • Input Column: 194. model.reddit_ads_source.stg_reddit_ads__account[account_id]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as a key to join with the report table
    • Output Columns:
      • account_id: Directly copied to the output
190. model.reddit_ads.reddit_ads__ad_group_report
  • Input Column: 194. model.reddit_ads_source.stg_reddit_ads__account[account_id]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • account_id: directly copied
191. model.reddit_ads.reddit_ads__ad_report
  • Input Column: 194. model.reddit_ads_source.stg_reddit_ads__account[account_id]
    • Integration used as the key to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • account_id: directly copied
192. model.reddit_ads.reddit_ads__campaign_report
  • Input Column: 194. model.reddit_ads_source.stg_reddit_ads__account[account_id]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as a key to join with other tables
    • Output Columns:
      • account_id: Directly copied to the output
193. model.reddit_ads.reddit_ads__url_report
  • Input Column: 194. model.reddit_ads_source.stg_reddit_ads__account[account_id]
    • Integration used as the key to join with the report table
    • Output Columns:
      • account_id: directly copied
Column Lineage
%3 197. model.reddit_ads_source.stg_reddit_ads__account_tmp 197. model.reddit_ads_source.stg_reddit_ads__account_tmp attribution_type 194. model.reddit_ads_source.stg_reddit_ads__account 194. model.reddit_ads_source.stg_reddit_ads__account attribution_type 197. model.reddit_ads_source.stg_reddit_ads__account_tmp:f0->194. model.reddit_ads_source.stg_reddit_ads__account:f0 189. model.reddit_ads.reddit_ads__account_report 189. model.reddit_ads.reddit_ads__account_report attribution_type 194. model.reddit_ads_source.stg_reddit_ads__account:f0->189. model.reddit_ads.reddit_ads__account_report:f0
194. model.reddit_ads_source.stg_reddit_ads__account
  • Input Column: 197. model.reddit_ads_source.stg_reddit_ads__account_tmp[attribution_type]
    • Cleaning The column is cast to TEXT
    • Output Columns:
      • attribution_type: Directly copied after casting
189. model.reddit_ads.reddit_ads__account_report
  • Input Column: 194. model.reddit_ads_source.stg_reddit_ads__account[attribution_type]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • attribution_type: Directly copied to the output
Column Lineage
%3 197. model.reddit_ads_source.stg_reddit_ads__account_tmp 197. model.reddit_ads_source.stg_reddit_ads__account_tmp click_attribution_window 194. model.reddit_ads_source.stg_reddit_ads__account 194. model.reddit_ads_source.stg_reddit_ads__account click_attribution_window 197. model.reddit_ads_source.stg_reddit_ads__account_tmp:f0->194. model.reddit_ads_source.stg_reddit_ads__account:f0
194. model.reddit_ads_source.stg_reddit_ads__account
  • Input Column: 197. model.reddit_ads_source.stg_reddit_ads__account_tmp[click_attribution_window]
    • Cleaning The column is cast to TEXT
    • Output Columns:
      • click_attribution_window: Directly copied after casting
Column Lineage
%3 197. model.reddit_ads_source.stg_reddit_ads__account_tmp 197. model.reddit_ads_source.stg_reddit_ads__account_tmp created_at 194. model.reddit_ads_source.stg_reddit_ads__account 194. model.reddit_ads_source.stg_reddit_ads__account created_at 197. model.reddit_ads_source.stg_reddit_ads__account_tmp:f0->194. model.reddit_ads_source.stg_reddit_ads__account:f0
194. model.reddit_ads_source.stg_reddit_ads__account
  • Input Column: 197. model.reddit_ads_source.stg_reddit_ads__account_tmp[created_at]
    • Cleaning The column is cast to TIMESTAMP
    • Output Columns:
      • created_at: Directly copied after casting
Column Lineage
%3 197. model.reddit_ads_source.stg_reddit_ads__account_tmp 197. model.reddit_ads_source.stg_reddit_ads__account_tmp currency 194. model.reddit_ads_source.stg_reddit_ads__account 194. model.reddit_ads_source.stg_reddit_ads__account currency 197. model.reddit_ads_source.stg_reddit_ads__account_tmp:f0->194. model.reddit_ads_source.stg_reddit_ads__account:f0 193. model.reddit_ads.reddit_ads__url_report 193. model.reddit_ads.reddit_ads__url_report currency 194. model.reddit_ads_source.stg_reddit_ads__account:f0->193. model.reddit_ads.reddit_ads__url_report:f0 189. model.reddit_ads.reddit_ads__account_report 189. model.reddit_ads.reddit_ads__account_report currency 194. model.reddit_ads_source.stg_reddit_ads__account:f0->189. model.reddit_ads.reddit_ads__account_report:f0 191. model.reddit_ads.reddit_ads__ad_report 191. model.reddit_ads.reddit_ads__ad_report currency 194. model.reddit_ads_source.stg_reddit_ads__account:f0->191. model.reddit_ads.reddit_ads__ad_report:f0 190. model.reddit_ads.reddit_ads__ad_group_report 190. model.reddit_ads.reddit_ads__ad_group_report currency 194. model.reddit_ads_source.stg_reddit_ads__account:f0->190. model.reddit_ads.reddit_ads__ad_group_report:f0 192. model.reddit_ads.reddit_ads__campaign_report 192. model.reddit_ads.reddit_ads__campaign_report currency 194. model.reddit_ads_source.stg_reddit_ads__account:f0->192. model.reddit_ads.reddit_ads__campaign_report:f0
194. model.reddit_ads_source.stg_reddit_ads__account
  • Input Column: 197. model.reddit_ads_source.stg_reddit_ads__account_tmp[currency]
    • Cleaning The column is cast to TEXT
    • Output Columns:
      • currency: Directly copied after casting
189. model.reddit_ads.reddit_ads__account_report
  • Input Column: 194. model.reddit_ads_source.stg_reddit_ads__account[currency]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • currency: Directly copied to the output
190. model.reddit_ads.reddit_ads__ad_group_report
  • Input Column: 194. model.reddit_ads_source.stg_reddit_ads__account[currency]
    • Direct directly copied to the output
    • Output Columns:
      • currency: directly copied
191. model.reddit_ads.reddit_ads__ad_report
  • Input Column: 194. model.reddit_ads_source.stg_reddit_ads__account[currency]
    • Direct directly copied to the output
    • Output Columns:
      • currency: directly copied
192. model.reddit_ads.reddit_ads__campaign_report
  • Input Column: 194. model.reddit_ads_source.stg_reddit_ads__account[currency]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • currency: Directly copied to the output
193. model.reddit_ads.reddit_ads__url_report
  • Input Column: 194. model.reddit_ads_source.stg_reddit_ads__account[currency]
    • Direct directly copied to the output
    • Output Columns:
      • currency: directly copied
Column Lineage
%3 197. model.reddit_ads_source.stg_reddit_ads__account_tmp 197. model.reddit_ads_source.stg_reddit_ads__account_tmp status 194. model.reddit_ads_source.stg_reddit_ads__account 194. model.reddit_ads_source.stg_reddit_ads__account status 197. model.reddit_ads_source.stg_reddit_ads__account_tmp:f0->194. model.reddit_ads_source.stg_reddit_ads__account:f0 189. model.reddit_ads.reddit_ads__account_report 189. model.reddit_ads.reddit_ads__account_report status 194. model.reddit_ads_source.stg_reddit_ads__account:f0->189. model.reddit_ads.reddit_ads__account_report:f0
194. model.reddit_ads_source.stg_reddit_ads__account
  • Input Column: 197. model.reddit_ads_source.stg_reddit_ads__account_tmp[status]
    • Cleaning The column is cast to TEXT
    • Output Columns:
      • status: Directly copied after casting
189. model.reddit_ads.reddit_ads__account_report
  • Input Column: 194. model.reddit_ads_source.stg_reddit_ads__account[status]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • status: Directly copied to the output
Column Lineage
%3 197. model.reddit_ads_source.stg_reddit_ads__account_tmp 197. model.reddit_ads_source.stg_reddit_ads__account_tmp time_zone_id 194. model.reddit_ads_source.stg_reddit_ads__account 194. model.reddit_ads_source.stg_reddit_ads__account time_zone_id 197. model.reddit_ads_source.stg_reddit_ads__account_tmp:f0->194. model.reddit_ads_source.stg_reddit_ads__account:f0 189. model.reddit_ads.reddit_ads__account_report 189. model.reddit_ads.reddit_ads__account_report time_zone_id 194. model.reddit_ads_source.stg_reddit_ads__account:f0->189. model.reddit_ads.reddit_ads__account_report:f0
194. model.reddit_ads_source.stg_reddit_ads__account
  • Input Column: 197. model.reddit_ads_source.stg_reddit_ads__account_tmp[time_zone_id]
    • Cleaning The column is cast to TEXT
    • Output Columns:
      • time_zone_id: Directly copied after casting
189. model.reddit_ads.reddit_ads__account_report
  • Input Column: 194. model.reddit_ads_source.stg_reddit_ads__account[time_zone_id]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • time_zone_id: Directly copied to the output
Column Lineage
%3 197. model.reddit_ads_source.stg_reddit_ads__account_tmp 197. model.reddit_ads_source.stg_reddit_ads__account_tmp view_attribution_window 194. model.reddit_ads_source.stg_reddit_ads__account 194. model.reddit_ads_source.stg_reddit_ads__account view_attribution_window 197. model.reddit_ads_source.stg_reddit_ads__account_tmp:f0->194. model.reddit_ads_source.stg_reddit_ads__account:f0
194. model.reddit_ads_source.stg_reddit_ads__account
  • Input Column: 197. model.reddit_ads_source.stg_reddit_ads__account_tmp[view_attribution_window]
    • Cleaning The column is cast to TEXT
    • Output Columns:
      • view_attribution_window: Directly copied after casting
198. model.reddit_ads_source.stg_reddit_ads__ad

This SQL query stages data from a temporary table for Reddit ads. It performs type casting on various fields, renames some columns, and selects specific columns for the final output. The query doesn't filter, deduplicate, or aggregate data, but rather prepares it for further processing or analysis.

CleaningOther
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_reddit_ads_source.stg_reddit_ads__ad_tmp
), fields AS (
  SELECT
    CAST(NULL AS TIMESTAMP) AS _fivetran_synced,
    CAST(NULL AS TEXT) AS account_id,
    CAST(NULL AS TEXT) AS ad_group_id,
    CAST(NULL AS TEXT) AS campaign_id,
    CAST(NULL AS TEXT) AS click_url,
    CAST(NULL AS TEXT) AS configured_status,
    CAST(NULL AS TEXT) AS effective_status,
    CAST(NULL AS TEXT) AS id,
    CAST(NULL AS BOOLEAN) AS is_processing,
    CAST(NULL AS TEXT) AS name,
    CAST(NULL AS TEXT) AS post_id,
    CAST(NULL AS TEXT) AS post_url,
    CAST(NULL AS TEXT) AS rejection_reason,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    account_id,
    ad_group_id,
    campaign_id,
    click_url,
    configured_status,
    effective_status,
    id AS ad_id,
    is_processing,
    name AS ad_name,
    post_id,
    post_url,
    rejection_reason
  FROM fields
)
SELECT
  *
FROM final
%3 198. model.reddit_ads_source.stg_reddit_ads__ad 198. model.reddit_ads_source.stg_reddit_ads__ad source_relation ad_id account_id ad_group_id campaign_id click_url configured_status effective_status is_processing ad_name post_id post_url rejection_reason 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp id account_id ad_group_id campaign_id click_url configured_status effective_status is_processing name post_id post_url rejection_reason 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp:f0->198. model.reddit_ads_source.stg_reddit_ads__ad:f1 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp:f1->198. model.reddit_ads_source.stg_reddit_ads__ad:f2 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp:f2->198. model.reddit_ads_source.stg_reddit_ads__ad:f3 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp:f3->198. model.reddit_ads_source.stg_reddit_ads__ad:f4 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp:f4->198. model.reddit_ads_source.stg_reddit_ads__ad:f5 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp:f5->198. model.reddit_ads_source.stg_reddit_ads__ad:f6 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp:f6->198. model.reddit_ads_source.stg_reddit_ads__ad:f7 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp:f7->198. model.reddit_ads_source.stg_reddit_ads__ad:f8 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp:f8->198. model.reddit_ads_source.stg_reddit_ads__ad:f9 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp:f9->198. model.reddit_ads_source.stg_reddit_ads__ad:f10 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp:f10->198. model.reddit_ads_source.stg_reddit_ads__ad:f11 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp:f11->198. model.reddit_ads_source.stg_reddit_ads__ad:f12
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
ad_id bigint The ID representing the ad, if present in the source data.
account_id text The ID representing the account.
ad_group_id bigint The ID representing the ad group, if present in the source data.
campaign_id bigint The ID representing the campaign, if present in the source data.
click_url text The destination url, or the website address, that a visitor goes to when they click on the ad
configured_status text The status configured by the account owner. "ACTIVE", "PAUSED", "ARCHIVED", "DELETED"
effective_status text The calculated status determining the real status of this entity.
is_processing boolean Whether or not effective status is processing
ad_name text The name of the ad, if present in the source data.
post_id text The ID of the post.
post_url integer The URL belonging to the post.
rejection_reason integer Reason why entity was rejected.
Column Lineage
%3 198. model.reddit_ads_source.stg_reddit_ads__ad 198. model.reddit_ads_source.stg_reddit_ads__ad source_relation 193. model.reddit_ads.reddit_ads__url_report 193. model.reddit_ads.reddit_ads__url_report source_relation 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f0 191. model.reddit_ads.reddit_ads__ad_report 191. model.reddit_ads.reddit_ads__ad_report source_relation 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->191. model.reddit_ads.reddit_ads__ad_report:f0
191. model.reddit_ads.reddit_ads__ad_report
  • Input Column: 198. model.reddit_ads_source.stg_reddit_ads__ad[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as a key to join with other tables
    • Output Columns:
      • source_relation: Directly copied to the output
193. model.reddit_ads.reddit_ads__url_report
  • Input Column: 198. model.reddit_ads_source.stg_reddit_ads__ad[source_relation]
    • Integration used to join with other tables
    • Direct directly copied to output
    • Output Columns:
      • source_relation: directly copied
Column Lineage
%3 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp id 198. model.reddit_ads_source.stg_reddit_ads__ad 198. model.reddit_ads_source.stg_reddit_ads__ad ad_id 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp:f0->198. model.reddit_ads_source.stg_reddit_ads__ad:f0 193. model.reddit_ads.reddit_ads__url_report 193. model.reddit_ads.reddit_ads__url_report ad_id 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f0 191. model.reddit_ads.reddit_ads__ad_report 191. model.reddit_ads.reddit_ads__ad_report ad_id 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->191. model.reddit_ads.reddit_ads__ad_report:f0
198. model.reddit_ads_source.stg_reddit_ads__ad
  • Input Column: 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp[id]
    • Cleaning The column is cast as TEXT and renamed to 'ad_id'
    • Output Columns:
      • ad_id: Directly mapped after casting
191. model.reddit_ads.reddit_ads__ad_report
  • Input Column: 198. model.reddit_ads_source.stg_reddit_ads__ad[ad_id]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as a key to join with the report table
    • Output Columns:
      • ad_id: Directly copied to the output
193. model.reddit_ads.reddit_ads__url_report
  • Input Column: 198. model.reddit_ads_source.stg_reddit_ads__ad[ad_id]
    • Integration used to join with the report table
    • Direct directly copied to output
    • Output Columns:
      • ad_id: directly copied
Column Lineage
%3 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp account_id 198. model.reddit_ads_source.stg_reddit_ads__ad 198. model.reddit_ads_source.stg_reddit_ads__ad account_id 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp:f0->198. model.reddit_ads_source.stg_reddit_ads__ad:f0
198. model.reddit_ads_source.stg_reddit_ads__ad
  • Input Column: 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp[account_id]
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • account_id: Directly mapped after casting
Column Lineage
%3 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp ad_group_id 198. model.reddit_ads_source.stg_reddit_ads__ad 198. model.reddit_ads_source.stg_reddit_ads__ad ad_group_id 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp:f0->198. model.reddit_ads_source.stg_reddit_ads__ad:f0 193. model.reddit_ads.reddit_ads__url_report 193. model.reddit_ads.reddit_ads__url_report ad_group_id 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f0 191. model.reddit_ads.reddit_ads__ad_report 191. model.reddit_ads.reddit_ads__ad_report ad_group_id 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->191. model.reddit_ads.reddit_ads__ad_report:f0
198. model.reddit_ads_source.stg_reddit_ads__ad
  • Input Column: 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp[ad_group_id]
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • ad_group_id: Directly mapped after casting
191. model.reddit_ads.reddit_ads__ad_report
  • Input Column: 198. model.reddit_ads_source.stg_reddit_ads__ad[ad_group_id]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as a key to join with the ad_groups table
    • Output Columns:
      • ad_group_id: Directly copied to the output
193. model.reddit_ads.reddit_ads__url_report
  • Input Column: 198. model.reddit_ads_source.stg_reddit_ads__ad[ad_group_id]
    • Integration used to join with the ad_groups table
    • Direct directly copied to output
    • Output Columns:
      • ad_group_id: directly copied
Column Lineage
%3 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp campaign_id 198. model.reddit_ads_source.stg_reddit_ads__ad 198. model.reddit_ads_source.stg_reddit_ads__ad campaign_id 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp:f0->198. model.reddit_ads_source.stg_reddit_ads__ad:f0 193. model.reddit_ads.reddit_ads__url_report 193. model.reddit_ads.reddit_ads__url_report campaign_id 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f0 191. model.reddit_ads.reddit_ads__ad_report 191. model.reddit_ads.reddit_ads__ad_report campaign_id 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->191. model.reddit_ads.reddit_ads__ad_report:f0
198. model.reddit_ads_source.stg_reddit_ads__ad
  • Input Column: 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp[campaign_id]
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • campaign_id: Directly mapped after casting
191. model.reddit_ads.reddit_ads__ad_report
  • Input Column: 198. model.reddit_ads_source.stg_reddit_ads__ad[campaign_id]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as a key to join with the campaigns table
    • Output Columns:
      • campaign_id: Directly copied to the output
193. model.reddit_ads.reddit_ads__url_report
  • Input Column: 198. model.reddit_ads_source.stg_reddit_ads__ad[campaign_id]
    • Integration used to join with the campaigns table
    • Direct directly copied to output
    • Output Columns:
      • campaign_id: directly copied
Column Lineage
%3 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp click_url 198. model.reddit_ads_source.stg_reddit_ads__ad 198. model.reddit_ads_source.stg_reddit_ads__ad click_url 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp:f0->198. model.reddit_ads_source.stg_reddit_ads__ad:f0 193. model.reddit_ads.reddit_ads__url_report 193. model.reddit_ads.reddit_ads__url_report base_url click_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f1 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f0 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f2 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f3 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f7 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f6 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f8 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f5 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f4
198. model.reddit_ads_source.stg_reddit_ads__ad
  • Input Column: 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp[click_url]
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • click_url: Directly mapped after casting
193. model.reddit_ads.reddit_ads__url_report
  • Input Column: 198. model.reddit_ads_source.stg_reddit_ads__ad[click_url]
    • Direct directly copied to output
    • Cleaning used to extract various URL components
    • Featurization used to extract UTM parameters
    • Filtering used to filter out null values in the final output
    • Output Columns:
      • click_url: directly copied
      • base_url: extracted from click_url
      • url_host: extracted from click_url
      • url_path: extracted from click_url
      • utm_source: extracted from click_url
      • utm_medium: extracted from click_url
      • utm_term: extracted from click_url
      • utm_content: extracted from click_url
      • utm_campaign: extracted from click_url (if not null)
Column Lineage
%3 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp configured_status 198. model.reddit_ads_source.stg_reddit_ads__ad 198. model.reddit_ads_source.stg_reddit_ads__ad configured_status 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp:f0->198. model.reddit_ads_source.stg_reddit_ads__ad:f0
198. model.reddit_ads_source.stg_reddit_ads__ad
  • Input Column: 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp[configured_status]
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • configured_status: Directly mapped after casting
Column Lineage
%3 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp effective_status 198. model.reddit_ads_source.stg_reddit_ads__ad 198. model.reddit_ads_source.stg_reddit_ads__ad effective_status 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp:f0->198. model.reddit_ads_source.stg_reddit_ads__ad:f0
198. model.reddit_ads_source.stg_reddit_ads__ad
  • Input Column: 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp[effective_status]
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • effective_status: Directly mapped after casting
Column Lineage
%3 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp is_processing 198. model.reddit_ads_source.stg_reddit_ads__ad 198. model.reddit_ads_source.stg_reddit_ads__ad is_processing 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp:f0->198. model.reddit_ads_source.stg_reddit_ads__ad:f0
198. model.reddit_ads_source.stg_reddit_ads__ad
  • Input Column: 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp[is_processing]
    • Cleaning The column is cast as BOOLEAN
    • Output Columns:
      • is_processing: Directly mapped after casting
Column Lineage
%3 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp name 198. model.reddit_ads_source.stg_reddit_ads__ad 198. model.reddit_ads_source.stg_reddit_ads__ad ad_name 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp:f0->198. model.reddit_ads_source.stg_reddit_ads__ad:f0 193. model.reddit_ads.reddit_ads__url_report 193. model.reddit_ads.reddit_ads__url_report ad_name 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f0 191. model.reddit_ads.reddit_ads__ad_report 191. model.reddit_ads.reddit_ads__ad_report ad_name 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->191. model.reddit_ads.reddit_ads__ad_report:f0
198. model.reddit_ads_source.stg_reddit_ads__ad
  • Input Column: 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp[name]
    • Cleaning The column is cast as TEXT and renamed to 'ad_name'
    • Output Columns:
      • ad_name: Directly mapped after casting and renaming
191. model.reddit_ads.reddit_ads__ad_report
  • Input Column: 198. model.reddit_ads_source.stg_reddit_ads__ad[ad_name]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • ad_name: Directly copied to the output
193. model.reddit_ads.reddit_ads__url_report
  • Input Column: 198. model.reddit_ads_source.stg_reddit_ads__ad[ad_name]
    • Direct directly copied to output
    • Output Columns:
      • ad_name: directly copied
Column Lineage
%3 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp post_id 198. model.reddit_ads_source.stg_reddit_ads__ad 198. model.reddit_ads_source.stg_reddit_ads__ad post_id 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp:f0->198. model.reddit_ads_source.stg_reddit_ads__ad:f0 193. model.reddit_ads.reddit_ads__url_report 193. model.reddit_ads.reddit_ads__url_report post_id 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f0 191. model.reddit_ads.reddit_ads__ad_report 191. model.reddit_ads.reddit_ads__ad_report post_id 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->191. model.reddit_ads.reddit_ads__ad_report:f0
198. model.reddit_ads_source.stg_reddit_ads__ad
  • Input Column: 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp[post_id]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • post_id: Directly mapped to the output column 'post_id'
191. model.reddit_ads.reddit_ads__ad_report
  • Input Column: 198. model.reddit_ads_source.stg_reddit_ads__ad[post_id]
    • Direct The post_id is directly copied to the output without transformation
    • Integration The post_id is used as part of the join condition with other tables
    • Output Columns:
      • post_id: Directly copied to the output column 'post_id'
193. model.reddit_ads.reddit_ads__url_report
  • Input Column: 198. model.reddit_ads_source.stg_reddit_ads__ad[post_id]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • post_id: Directly copied to the output
Column Lineage
%3 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp post_url 198. model.reddit_ads_source.stg_reddit_ads__ad 198. model.reddit_ads_source.stg_reddit_ads__ad post_url 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp:f0->198. model.reddit_ads_source.stg_reddit_ads__ad:f0 193. model.reddit_ads.reddit_ads__url_report 193. model.reddit_ads.reddit_ads__url_report post_url 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f0
198. model.reddit_ads_source.stg_reddit_ads__ad
  • Input Column: 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp[post_url]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • post_url: Directly mapped to the output column 'post_url'
193. model.reddit_ads.reddit_ads__url_report
  • Input Column: 198. model.reddit_ads_source.stg_reddit_ads__ad[post_url]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • post_url: Directly copied to the output
Column Lineage
%3 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp rejection_reason 198. model.reddit_ads_source.stg_reddit_ads__ad 198. model.reddit_ads_source.stg_reddit_ads__ad rejection_reason 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp:f0->198. model.reddit_ads_source.stg_reddit_ads__ad:f0
198. model.reddit_ads_source.stg_reddit_ads__ad
  • Input Column: 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp[rejection_reason]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • rejection_reason: Directly mapped to the output column 'rejection_reason'
199. model.reddit_ads_source.stg_reddit_ads__ad_group

This SQL query performs data cleaning and transformation on the 'stg_reddit_ads__ad_group_tmp' table. It casts columns to specific data types, renames some columns, and restructures the data. The query doesn't filter or aggregate data, but focuses on standardizing the format and structure of the ad group information from Reddit Ads.

CleaningOther
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_reddit_ads_source.stg_reddit_ads__ad_group_tmp
), fields AS (
  SELECT
    CAST(NULL AS TIMESTAMP) AS _fivetran_synced,
    CAST(NULL AS TEXT) AS account_id,
    CAST(NULL AS TEXT) AS bid_strategy,
    CAST(NULL AS INT) AS bid_value,
    CAST(NULL AS TEXT) AS campaign_id,
    CAST(NULL AS TEXT) AS configured_status,
    CAST(NULL AS TEXT) AS effective_status,
    CAST(NULL AS TIMESTAMP) AS end_time,
    CAST(NULL AS BOOLEAN) AS expand_targeting,
    CAST(NULL AS TEXT) AS goal_type,
    CAST(NULL AS INT) AS goal_value,
    CAST(NULL AS TEXT) AS id,
    CAST(NULL AS BOOLEAN) AS is_processing,
    CAST(NULL AS TEXT) AS name,
    CAST(NULL AS TEXT) AS optimization_strategy_type,
    CAST(NULL AS TIMESTAMP) AS start_time,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    account_id,
    bid_strategy,
    bid_value,
    campaign_id,
    configured_status,
    effective_status,
    CAST(end_time AS TIMESTAMP) AS end_time_at,
    expand_targeting,
    goal_type,
    goal_value,
    id AS ad_group_id,
    is_processing,
    name AS ad_group_name,
    optimization_strategy_type,
    CAST(start_time AS TIMESTAMP) AS start_time_at
  FROM fields
)
SELECT
  *
FROM final
%3 199. model.reddit_ads_source.stg_reddit_ads__ad_group 199. model.reddit_ads_source.stg_reddit_ads__ad_group source_relation ad_group_id account_id bid_strategy bid_value campaign_id configured_status effective_status end_time_at expand_targeting goal_type goal_value is_processing ad_group_name optimization_strategy_type start_time_at 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp account_id id bid_strategy bid_value campaign_id configured_status effective_status end_time expand_targeting goal_type goal_value is_processing name optimization_strategy_type start_time 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp:f0->199. model.reddit_ads_source.stg_reddit_ads__ad_group:f2 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp:f1->199. model.reddit_ads_source.stg_reddit_ads__ad_group:f1 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp:f2->199. model.reddit_ads_source.stg_reddit_ads__ad_group:f3 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp:f3->199. model.reddit_ads_source.stg_reddit_ads__ad_group:f4 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp:f4->199. model.reddit_ads_source.stg_reddit_ads__ad_group:f5 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp:f5->199. model.reddit_ads_source.stg_reddit_ads__ad_group:f6 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp:f6->199. model.reddit_ads_source.stg_reddit_ads__ad_group:f7 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp:f7->199. model.reddit_ads_source.stg_reddit_ads__ad_group:f8 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp:f8->199. model.reddit_ads_source.stg_reddit_ads__ad_group:f9 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp:f9->199. model.reddit_ads_source.stg_reddit_ads__ad_group:f10 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp:f10->199. model.reddit_ads_source.stg_reddit_ads__ad_group:f11 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp:f11->199. model.reddit_ads_source.stg_reddit_ads__ad_group:f12 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp:f12->199. model.reddit_ads_source.stg_reddit_ads__ad_group:f13 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp:f13->199. model.reddit_ads_source.stg_reddit_ads__ad_group:f14 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp:f14->199. model.reddit_ads_source.stg_reddit_ads__ad_group:f15
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
ad_group_id bigint The ID representing the ad group, if present in the source data.
account_id integer The ID representing the account.
bid_strategy text The bid strategy for this entity. "MAXIMIZE_VOLUME", "MANUAL_BIDDING", or "BIDLESS"
bid_value integer The amount to pay in microcurrency per bidding event.
campaign_id bigint The ID representing the campaign, if present in the source data.
configured_status text The status configured by the account owner. "ACTIVE", "PAUSED", "ARCHIVED", "DELETED"
effective_status text The calculated status determining the real status of this entity.
end_time_at timestamp without time zone When the entity will stop delivering.
expand_targeting boolean Boolean that when selected, allows Reddit to expand your targeting to maximize your results.
goal_type text The type of goal for the entity. "IMPRESSIONS", "PERCENTAGE", "CLICKS", "CONVERSIONS", "LIFETIME_SPEND", "DAILY_SPEND", or "VIDEO_VIEWABLE_IMPRESSIONS"
goal_value integer The value used to determine the goal has been met. This is measured in microcurrency for monetary goals types.
is_processing boolean Whether or not effective status is processing
ad_group_name text The name of the ad group, if present in the source data.
optimization_strategy_type integer The strategy to use when optimizing the delivery of an ad. "DOWNSTREAM_CONVERSIONS" or "APP_INSTALLS"
start_time_at timestamp without time zone When the entity will begin to deliver.
Column Lineage
%3 199. model.reddit_ads_source.stg_reddit_ads__ad_group 199. model.reddit_ads_source.stg_reddit_ads__ad_group source_relation 193. model.reddit_ads.reddit_ads__url_report 193. model.reddit_ads.reddit_ads__url_report source_relation 199. model.reddit_ads_source.stg_reddit_ads__ad_group:f0->193. model.reddit_ads.reddit_ads__url_report:f0 191. model.reddit_ads.reddit_ads__ad_report 191. model.reddit_ads.reddit_ads__ad_report source_relation 199. model.reddit_ads_source.stg_reddit_ads__ad_group:f0->191. model.reddit_ads.reddit_ads__ad_report:f0 190. model.reddit_ads.reddit_ads__ad_group_report 190. model.reddit_ads.reddit_ads__ad_group_report source_relation 199. model.reddit_ads_source.stg_reddit_ads__ad_group:f0->190. model.reddit_ads.reddit_ads__ad_group_report:f0
190. model.reddit_ads.reddit_ads__ad_group_report
  • Input Column: 199. model.reddit_ads_source.stg_reddit_ads__ad_group[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
191. model.reddit_ads.reddit_ads__ad_report
  • Input Column: 199. model.reddit_ads_source.stg_reddit_ads__ad_group[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
193. model.reddit_ads.reddit_ads__url_report
  • Input Column: 199. model.reddit_ads_source.stg_reddit_ads__ad_group[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
Column Lineage
%3 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp id 199. model.reddit_ads_source.stg_reddit_ads__ad_group 199. model.reddit_ads_source.stg_reddit_ads__ad_group ad_group_id 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp:f0->199. model.reddit_ads_source.stg_reddit_ads__ad_group:f0 193. model.reddit_ads.reddit_ads__url_report 193. model.reddit_ads.reddit_ads__url_report ad_group_id 199. model.reddit_ads_source.stg_reddit_ads__ad_group:f0->193. model.reddit_ads.reddit_ads__url_report:f0 191. model.reddit_ads.reddit_ads__ad_report 191. model.reddit_ads.reddit_ads__ad_report ad_group_id 199. model.reddit_ads_source.stg_reddit_ads__ad_group:f0->191. model.reddit_ads.reddit_ads__ad_report:f0 190. model.reddit_ads.reddit_ads__ad_group_report 190. model.reddit_ads.reddit_ads__ad_group_report ad_group_id 199. model.reddit_ads_source.stg_reddit_ads__ad_group:f0->190. model.reddit_ads.reddit_ads__ad_group_report:f0
199. model.reddit_ads_source.stg_reddit_ads__ad_group
  • Input Column: 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp[id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • ad_group_id: Renamed from 'id' to 'ad_group_id'
190. model.reddit_ads.reddit_ads__ad_group_report
  • Input Column: 199. model.reddit_ads_source.stg_reddit_ads__ad_group[ad_group_id]
    • Integration used as the key to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_id: directly copied
191. model.reddit_ads.reddit_ads__ad_report
  • Input Column: 199. model.reddit_ads_source.stg_reddit_ads__ad_group[ad_group_id]
    • Integration used as the key to join with the ads table
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_id: directly copied
193. model.reddit_ads.reddit_ads__url_report
  • Input Column: 199. model.reddit_ads_source.stg_reddit_ads__ad_group[ad_group_id]
    • Integration used as a join key with the ads table
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_id: directly copied
Column Lineage
%3 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp account_id 199. model.reddit_ads_source.stg_reddit_ads__ad_group 199. model.reddit_ads_source.stg_reddit_ads__ad_group account_id 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp:f0->199. model.reddit_ads_source.stg_reddit_ads__ad_group:f0
199. model.reddit_ads_source.stg_reddit_ads__ad_group
  • Input Column: 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp[account_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • account_id: Directly mapped
Column Lineage
%3 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp bid_strategy 199. model.reddit_ads_source.stg_reddit_ads__ad_group 199. model.reddit_ads_source.stg_reddit_ads__ad_group bid_strategy 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp:f0->199. model.reddit_ads_source.stg_reddit_ads__ad_group:f0
199. model.reddit_ads_source.stg_reddit_ads__ad_group
  • Input Column: 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp[bid_strategy]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • bid_strategy: Directly mapped
Column Lineage
%3 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp bid_value 199. model.reddit_ads_source.stg_reddit_ads__ad_group 199. model.reddit_ads_source.stg_reddit_ads__ad_group bid_value 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp:f0->199. model.reddit_ads_source.stg_reddit_ads__ad_group:f0
199. model.reddit_ads_source.stg_reddit_ads__ad_group
  • Input Column: 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp[bid_value]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT type
    • Output Columns:
      • bid_value: Directly mapped
Column Lineage
%3 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp campaign_id 199. model.reddit_ads_source.stg_reddit_ads__ad_group 199. model.reddit_ads_source.stg_reddit_ads__ad_group campaign_id 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp:f0->199. model.reddit_ads_source.stg_reddit_ads__ad_group:f0 190. model.reddit_ads.reddit_ads__ad_group_report 190. model.reddit_ads.reddit_ads__ad_group_report campaign_id 199. model.reddit_ads_source.stg_reddit_ads__ad_group:f0->190. model.reddit_ads.reddit_ads__ad_group_report:f0
199. model.reddit_ads_source.stg_reddit_ads__ad_group
  • Input Column: 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp[campaign_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • campaign_id: Directly mapped
190. model.reddit_ads.reddit_ads__ad_group_report
  • Input Column: 199. model.reddit_ads_source.stg_reddit_ads__ad_group[campaign_id]
    • Integration used as the key to join with the campaigns table
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
Column Lineage
%3 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp configured_status 199. model.reddit_ads_source.stg_reddit_ads__ad_group 199. model.reddit_ads_source.stg_reddit_ads__ad_group configured_status 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp:f0->199. model.reddit_ads_source.stg_reddit_ads__ad_group:f0
199. model.reddit_ads_source.stg_reddit_ads__ad_group
  • Input Column: 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp[configured_status]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • configured_status: Directly mapped
Column Lineage
%3 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp effective_status 199. model.reddit_ads_source.stg_reddit_ads__ad_group 199. model.reddit_ads_source.stg_reddit_ads__ad_group effective_status 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp:f0->199. model.reddit_ads_source.stg_reddit_ads__ad_group:f0
199. model.reddit_ads_source.stg_reddit_ads__ad_group
  • Input Column: 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp[effective_status]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • effective_status: Directly mapped
Column Lineage
%3 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp end_time 199. model.reddit_ads_source.stg_reddit_ads__ad_group 199. model.reddit_ads_source.stg_reddit_ads__ad_group end_time_at 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp:f0->199. model.reddit_ads_source.stg_reddit_ads__ad_group:f0
199. model.reddit_ads_source.stg_reddit_ads__ad_group
  • Input Column: 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp[end_time]
    • Direct The column is directly copied
    • Cleaning The column is cast as TIMESTAMP type
    • Output Columns:
      • end_time_at: Renamed from 'end_time' to 'end_time_at'
Column Lineage
%3 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp expand_targeting 199. model.reddit_ads_source.stg_reddit_ads__ad_group 199. model.reddit_ads_source.stg_reddit_ads__ad_group expand_targeting 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp:f0->199. model.reddit_ads_source.stg_reddit_ads__ad_group:f0
199. model.reddit_ads_source.stg_reddit_ads__ad_group
  • Input Column: 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp[expand_targeting]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as BOOLEAN type
    • Output Columns:
      • expand_targeting: Directly mapped
Column Lineage
%3 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp goal_type 199. model.reddit_ads_source.stg_reddit_ads__ad_group 199. model.reddit_ads_source.stg_reddit_ads__ad_group goal_type 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp:f0->199. model.reddit_ads_source.stg_reddit_ads__ad_group:f0
199. model.reddit_ads_source.stg_reddit_ads__ad_group
  • Input Column: 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp[goal_type]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to TEXT data type
    • Output Columns:
      • goal_type: Directly copied after casting to TEXT
Column Lineage
%3 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp goal_value 199. model.reddit_ads_source.stg_reddit_ads__ad_group 199. model.reddit_ads_source.stg_reddit_ads__ad_group goal_value 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp:f0->199. model.reddit_ads_source.stg_reddit_ads__ad_group:f0
199. model.reddit_ads_source.stg_reddit_ads__ad_group
  • Input Column: 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp[goal_value]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to INT data type
    • Output Columns:
      • goal_value: Directly copied after casting to INT
Column Lineage
%3 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp is_processing 199. model.reddit_ads_source.stg_reddit_ads__ad_group 199. model.reddit_ads_source.stg_reddit_ads__ad_group is_processing 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp:f0->199. model.reddit_ads_source.stg_reddit_ads__ad_group:f0
199. model.reddit_ads_source.stg_reddit_ads__ad_group
  • Input Column: 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp[is_processing]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to BOOLEAN data type
    • Output Columns:
      • is_processing: Directly copied after casting to BOOLEAN
Column Lineage
%3 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp name 199. model.reddit_ads_source.stg_reddit_ads__ad_group 199. model.reddit_ads_source.stg_reddit_ads__ad_group ad_group_name 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp:f0->199. model.reddit_ads_source.stg_reddit_ads__ad_group:f0 193. model.reddit_ads.reddit_ads__url_report 193. model.reddit_ads.reddit_ads__url_report ad_group_name 199. model.reddit_ads_source.stg_reddit_ads__ad_group:f0->193. model.reddit_ads.reddit_ads__url_report:f0 191. model.reddit_ads.reddit_ads__ad_report 191. model.reddit_ads.reddit_ads__ad_report ad_group_name 199. model.reddit_ads_source.stg_reddit_ads__ad_group:f0->191. model.reddit_ads.reddit_ads__ad_report:f0 190. model.reddit_ads.reddit_ads__ad_group_report 190. model.reddit_ads.reddit_ads__ad_group_report ad_group_name 199. model.reddit_ads_source.stg_reddit_ads__ad_group:f0->190. model.reddit_ads.reddit_ads__ad_group_report:f0
199. model.reddit_ads_source.stg_reddit_ads__ad_group
  • Input Column: 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp[name]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to TEXT data type
    • Output Columns:
      • ad_group_name: Directly copied after casting to TEXT and renamed
190. model.reddit_ads.reddit_ads__ad_group_report
  • Input Column: 199. model.reddit_ads_source.stg_reddit_ads__ad_group[ad_group_name]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the report table
    • Output Columns:
      • ad_group_name: Directly mapped to the output column
191. model.reddit_ads.reddit_ads__ad_report
  • Input Column: 199. model.reddit_ads_source.stg_reddit_ads__ad_group[ad_group_name]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the ads table
    • Output Columns:
      • ad_group_name: Directly mapped to the output column
193. model.reddit_ads.reddit_ads__url_report
  • Input Column: 199. model.reddit_ads_source.stg_reddit_ads__ad_group[ad_group_name]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the JOIN condition with the ads table
    • Output Columns:
      • ad_group_name: Directly mapped to the output column
Column Lineage
%3 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp optimization_strategy_type 199. model.reddit_ads_source.stg_reddit_ads__ad_group 199. model.reddit_ads_source.stg_reddit_ads__ad_group optimization_strategy_type 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp:f0->199. model.reddit_ads_source.stg_reddit_ads__ad_group:f0
199. model.reddit_ads_source.stg_reddit_ads__ad_group
  • Input Column: 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp[optimization_strategy_type]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to TEXT data type
    • Output Columns:
      • optimization_strategy_type: Directly copied after casting to TEXT
Column Lineage
%3 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp start_time 199. model.reddit_ads_source.stg_reddit_ads__ad_group 199. model.reddit_ads_source.stg_reddit_ads__ad_group start_time_at 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp:f0->199. model.reddit_ads_source.stg_reddit_ads__ad_group:f0
199. model.reddit_ads_source.stg_reddit_ads__ad_group
  • Input Column: 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp[start_time]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to TIMESTAMP data type
    • Output Columns:
      • start_time_at: Directly copied after casting to TIMESTAMP and renamed
200. model.reddit_ads_source.stg_reddit_ads__ad_group_report

This SQL query stages data from a temporary table, casts columns to specific data types, renames some columns, and performs a minor calculation on the 'spend' column (dividing it by 1,000,000). It prepares the data for further processing or analysis by standardizing the structure and format of the data.

CleaningFeaturization
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_reddit_ads_source.stg_reddit_ads__ad_group_report_tmp
), fields AS (
  SELECT
    CAST(NULL AS TIMESTAMP) AS _fivetran_synced,
    CAST(NULL AS TEXT) AS account_id,
    CAST(NULL AS TEXT) AS ad_group_id,
    CAST(NULL AS INT) AS clicks,
    CAST(NULL AS DATE) AS date,
    CAST(NULL AS INT) AS impressions,
    CAST(NULL AS TEXT) AS region,
    CAST(NULL AS INT) AS spend,
    CAST(NULL AS DATE) AS date_day,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    account_id,
    ad_group_id,
    clicks,
    date AS date_day,
    impressions,
    region,
    (
      spend / 1000000
    ) AS spend
  FROM fields
)
SELECT
  *
FROM final
%3 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report source_relation account_id ad_group_id clicks date_day impressions region spend 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp account_id ad_group_id date clicks impressions region spend 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp:f0->200. model.reddit_ads_source.stg_reddit_ads__ad_group_report:f1 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp:f1->200. model.reddit_ads_source.stg_reddit_ads__ad_group_report:f2 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp:f2->200. model.reddit_ads_source.stg_reddit_ads__ad_group_report:f4 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp:f3->200. model.reddit_ads_source.stg_reddit_ads__ad_group_report:f3 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp:f4->200. model.reddit_ads_source.stg_reddit_ads__ad_group_report:f5 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp:f5->200. model.reddit_ads_source.stg_reddit_ads__ad_group_report:f6 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp:f6->200. model.reddit_ads_source.stg_reddit_ads__ad_group_report:f7
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
account_id bigint The ID representing the account.
ad_group_id bigint The ID representing the ad group, if present in the source data.
clicks integer The count of clicks.
date_day date YYYY-MM-DD formatted date
impressions integer The count of impressions.
region integer The region (US state or UK country) targeted for the reports
spend integer Spend converted out of microcurrency (so Spend/1,000,000)
Column Lineage
%3 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report source_relation 190. model.reddit_ads.reddit_ads__ad_group_report 190. model.reddit_ads.reddit_ads__ad_group_report source_relation 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report:f0->190. model.reddit_ads.reddit_ads__ad_group_report:f0
190. model.reddit_ads.reddit_ads__ad_group_report
  • Input Column: 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with other tables
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
Column Lineage
%3 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp account_id 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report account_id 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp:f0->200. model.reddit_ads_source.stg_reddit_ads__ad_group_report:f0 190. model.reddit_ads.reddit_ads__ad_group_report 190. model.reddit_ads.reddit_ads__ad_group_report account_id 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report:f0->190. model.reddit_ads.reddit_ads__ad_group_report:f0
200. model.reddit_ads_source.stg_reddit_ads__ad_group_report
  • Input Column: 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp[account_id]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • account_id: Directly copied to the output column 'account_id'
190. model.reddit_ads.reddit_ads__ad_group_report
  • Input Column: 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report[account_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with the accounts table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • account_id: Directly copied to the output
Column Lineage
%3 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp ad_group_id 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report ad_group_id 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp:f0->200. model.reddit_ads_source.stg_reddit_ads__ad_group_report:f0 190. model.reddit_ads.reddit_ads__ad_group_report 190. model.reddit_ads.reddit_ads__ad_group_report ad_group_id 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report:f0->190. model.reddit_ads.reddit_ads__ad_group_report:f0
200. model.reddit_ads_source.stg_reddit_ads__ad_group_report
  • Input Column: 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp[ad_group_id]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • ad_group_id: Directly copied to the output column 'ad_group_id'
190. model.reddit_ads.reddit_ads__ad_group_report
  • Input Column: 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report[ad_group_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with the ad_groups table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • ad_group_id: Directly copied to the output
Column Lineage
%3 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp clicks 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report clicks 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp:f0->200. model.reddit_ads_source.stg_reddit_ads__ad_group_report:f0 190. model.reddit_ads.reddit_ads__ad_group_report 190. model.reddit_ads.reddit_ads__ad_group_report clicks 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report:f0->190. model.reddit_ads.reddit_ads__ad_group_report:f0
200. model.reddit_ads_source.stg_reddit_ads__ad_group_report
  • Input Column: 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp[clicks]
    • Cleaning The column is cast to INT type in the fields CTE
    • Output Columns:
      • clicks: Directly mapped after casting
190. model.reddit_ads.reddit_ads__ad_group_report
  • Input Column: 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report[clicks]
    • Aggregation The column is summed up in the SELECT clause
    • Output Columns:
      • clicks: Aggregated sum in the output
Column Lineage
%3 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp date 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report date_day 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp:f0->200. model.reddit_ads_source.stg_reddit_ads__ad_group_report:f0 190. model.reddit_ads.reddit_ads__ad_group_report 190. model.reddit_ads.reddit_ads__ad_group_report date_day 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report:f0->190. model.reddit_ads.reddit_ads__ad_group_report:f0
200. model.reddit_ads_source.stg_reddit_ads__ad_group_report
  • Input Column: 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp[date]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as DATE type
    • Output Columns:
      • date_day: Directly copied to the output column 'date_day' after casting
190. model.reddit_ads.reddit_ads__ad_group_report
  • Input Column: 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp impressions 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report impressions 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp:f0->200. model.reddit_ads_source.stg_reddit_ads__ad_group_report:f0 190. model.reddit_ads.reddit_ads__ad_group_report 190. model.reddit_ads.reddit_ads__ad_group_report impressions 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report:f0->190. model.reddit_ads.reddit_ads__ad_group_report:f0
200. model.reddit_ads_source.stg_reddit_ads__ad_group_report
  • Input Column: 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp[impressions]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • impressions: Directly mapped to the output column 'impressions'
190. model.reddit_ads.reddit_ads__ad_group_report
  • Input Column: 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report[impressions]
    • Aggregation The column is summed up in the SELECT clause
    • Output Columns:
      • impressions: Aggregated sum in the output
Column Lineage
%3 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp region 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report region 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp:f0->200. model.reddit_ads_source.stg_reddit_ads__ad_group_report:f0
200. model.reddit_ads_source.stg_reddit_ads__ad_group_report
  • Input Column: 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp[region]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • region: Directly mapped to the output 'region' column
Column Lineage
%3 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp spend 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report spend 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp:f0->200. model.reddit_ads_source.stg_reddit_ads__ad_group_report:f0 190. model.reddit_ads.reddit_ads__ad_group_report 190. model.reddit_ads.reddit_ads__ad_group_report spend 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report:f0->190. model.reddit_ads.reddit_ads__ad_group_report:f0
200. model.reddit_ads_source.stg_reddit_ads__ad_group_report
  • Input Column: 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp[spend]
    • Cleaning The column is cleaned by dividing it by 1,000,000 to convert from microcurrency
    • Output Columns:
      • spend: Transformed and mapped to the output 'spend' column
190. model.reddit_ads.reddit_ads__ad_group_report
  • Input Column: 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report[spend]
    • Aggregation The column is summed up in the SELECT clause
    • Output Columns:
      • spend: Aggregated sum in the output
201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of type TEXT, which is set to NULL. The query is limited to 0 rows, effectively creating a template or schema for the 'model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp' model without actually returning any data.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp account_id ad_group_id date _fivetran_synced app_install_metrics_add_payment_info app_install_metrics_add_to_cart app_install_metrics_app_launch app_install_metrics_completed_tutorial app_install_metrics_install app_install_metrics_level_achieved app_install_metrics_purchase app_install_metrics_search app_install_metrics_sign_up app_install_metrics_spend app_install_metrics_spend_credits app_install_metrics_view_content clicks comment_downvotes comment_upvotes comments_page_views conversion_roas cpc ctr ecpm gallery_item_caption gallery_item_id impressions legacy_click_conversions_attribution_window_day legacy_click_conversions_attribution_window_month legacy_click_conversions_attribution_window_week legacy_view_conversions_attribution_window_day legacy_view_conversions_attribution_window_month legacy_view_conversions_attribution_window_week priority region spend video_fully_viewable_impressions video_plays_expanded video_plays_with_sound video_started video_viewable_impressions video_watched_100_percent video_watched_10_seconds video_watched_25_percent video_watched_3_seconds video_watched_50_percent video_watched_5_seconds video_watched_75_percent video_watched_95_percent viewable_impressions viewer_comments 347. source.reddit_ads_source.reddit_ads.ad_group_report 347. source.reddit_ads_source.reddit_ads.ad_group_report
Name Type Comment
account_id bigint None
ad_group_id bigint None
date date None
_fivetran_synced timestamp without time zone None
app_install_metrics_add_payment_info integer None
app_install_metrics_add_to_cart integer None
app_install_metrics_app_launch integer None
app_install_metrics_completed_tutorial integer None
app_install_metrics_install integer None
app_install_metrics_level_achieved integer None
app_install_metrics_purchase integer None
app_install_metrics_search integer None
app_install_metrics_sign_up integer None
app_install_metrics_spend integer None
app_install_metrics_spend_credits integer None
app_install_metrics_view_content integer None
clicks integer None
comment_downvotes integer None
comment_upvotes integer None
comments_page_views integer None
conversion_roas integer None
cpc double precision None
ctr double precision None
ecpm double precision None
gallery_item_caption integer None
gallery_item_id integer None
impressions integer None
legacy_click_conversions_attribution_window_day integer None
legacy_click_conversions_attribution_window_month integer None
legacy_click_conversions_attribution_window_week integer None
legacy_view_conversions_attribution_window_day integer None
legacy_view_conversions_attribution_window_month integer None
legacy_view_conversions_attribution_window_week integer None
priority integer None
region integer None
spend integer None
video_fully_viewable_impressions integer None
video_plays_expanded integer None
video_plays_with_sound integer None
video_started integer None
video_viewable_impressions integer None
video_watched_100_percent integer None
video_watched_10_seconds integer None
video_watched_25_percent integer None
video_watched_3_seconds integer None
video_watched_50_percent integer None
video_watched_5_seconds integer None
video_watched_75_percent integer None
video_watched_95_percent integer None
viewable_impressions integer None
viewer_comments integer None
Column Lineage
%3 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp account_id 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report account_id 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp:f0->200. model.reddit_ads_source.stg_reddit_ads__ad_group_report:f0 190. model.reddit_ads.reddit_ads__ad_group_report 190. model.reddit_ads.reddit_ads__ad_group_report account_id 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report:f0->190. model.reddit_ads.reddit_ads__ad_group_report:f0
200. model.reddit_ads_source.stg_reddit_ads__ad_group_report
  • Input Column: 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp[account_id]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • account_id: Directly copied to the output column 'account_id'
190. model.reddit_ads.reddit_ads__ad_group_report
  • Input Column: 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report[account_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with the accounts table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • account_id: Directly copied to the output
Column Lineage
%3 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp ad_group_id 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report ad_group_id 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp:f0->200. model.reddit_ads_source.stg_reddit_ads__ad_group_report:f0 190. model.reddit_ads.reddit_ads__ad_group_report 190. model.reddit_ads.reddit_ads__ad_group_report ad_group_id 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report:f0->190. model.reddit_ads.reddit_ads__ad_group_report:f0
200. model.reddit_ads_source.stg_reddit_ads__ad_group_report
  • Input Column: 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp[ad_group_id]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • ad_group_id: Directly copied to the output column 'ad_group_id'
190. model.reddit_ads.reddit_ads__ad_group_report
  • Input Column: 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report[ad_group_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with the ad_groups table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • ad_group_id: Directly copied to the output
Column Lineage
%3 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp date 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report date_day 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp:f0->200. model.reddit_ads_source.stg_reddit_ads__ad_group_report:f0 190. model.reddit_ads.reddit_ads__ad_group_report 190. model.reddit_ads.reddit_ads__ad_group_report date_day 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report:f0->190. model.reddit_ads.reddit_ads__ad_group_report:f0
200. model.reddit_ads_source.stg_reddit_ads__ad_group_report
  • Input Column: 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp[date]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as DATE type
    • Output Columns:
      • date_day: Directly copied to the output column 'date_day' after casting
190. model.reddit_ads.reddit_ads__ad_group_report
  • Input Column: 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp clicks 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report clicks 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp:f0->200. model.reddit_ads_source.stg_reddit_ads__ad_group_report:f0 190. model.reddit_ads.reddit_ads__ad_group_report 190. model.reddit_ads.reddit_ads__ad_group_report clicks 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report:f0->190. model.reddit_ads.reddit_ads__ad_group_report:f0
200. model.reddit_ads_source.stg_reddit_ads__ad_group_report
  • Input Column: 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp[clicks]
    • Cleaning The column is cast to INT type in the fields CTE
    • Output Columns:
      • clicks: Directly mapped after casting
190. model.reddit_ads.reddit_ads__ad_group_report
  • Input Column: 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report[clicks]
    • Aggregation The column is summed up in the SELECT clause
    • Output Columns:
      • clicks: Aggregated sum in the output
Column Lineage
%3 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp impressions 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report impressions 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp:f0->200. model.reddit_ads_source.stg_reddit_ads__ad_group_report:f0 190. model.reddit_ads.reddit_ads__ad_group_report 190. model.reddit_ads.reddit_ads__ad_group_report impressions 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report:f0->190. model.reddit_ads.reddit_ads__ad_group_report:f0
200. model.reddit_ads_source.stg_reddit_ads__ad_group_report
  • Input Column: 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp[impressions]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • impressions: Directly mapped to the output column 'impressions'
190. model.reddit_ads.reddit_ads__ad_group_report
  • Input Column: 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report[impressions]
    • Aggregation The column is summed up in the SELECT clause
    • Output Columns:
      • impressions: Aggregated sum in the output
Column Lineage
%3 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp region 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report region 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp:f0->200. model.reddit_ads_source.stg_reddit_ads__ad_group_report:f0
200. model.reddit_ads_source.stg_reddit_ads__ad_group_report
  • Input Column: 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp[region]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • region: Directly mapped to the output 'region' column
Column Lineage
%3 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp spend 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report spend 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp:f0->200. model.reddit_ads_source.stg_reddit_ads__ad_group_report:f0 190. model.reddit_ads.reddit_ads__ad_group_report 190. model.reddit_ads.reddit_ads__ad_group_report spend 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report:f0->190. model.reddit_ads.reddit_ads__ad_group_report:f0
200. model.reddit_ads_source.stg_reddit_ads__ad_group_report
  • Input Column: 201. model.reddit_ads_source.stg_reddit_ads__ad_group_report_tmp[spend]
    • Cleaning The column is cleaned by dividing it by 1,000,000 to convert from microcurrency
    • Output Columns:
      • spend: Transformed and mapped to the output 'spend' column
190. model.reddit_ads.reddit_ads__ad_group_report
  • Input Column: 200. model.reddit_ads_source.stg_reddit_ads__ad_group_report[spend]
    • Aggregation The column is summed up in the SELECT clause
    • Output Columns:
      • spend: Aggregated sum in the output
202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of TEXT data type. It's likely used as a placeholder or template for a staging table in a dbt (data build tool) project, specifically for Reddit ads data related to ad groups.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp account_id id _fivetran_synced bid_strategy bid_value campaign_id configured_status effective_status end_time expand_targeting goal_type goal_value is_processing name optimization_strategy_type start_time 346. source.reddit_ads_source.reddit_ads.ad_group 346. source.reddit_ads_source.reddit_ads.ad_group
Name Type Comment
account_id integer None
id bigint None
_fivetran_synced timestamp without time zone None
bid_strategy text None
bid_value integer None
campaign_id bigint None
configured_status text None
effective_status text None
end_time timestamp without time zone None
expand_targeting boolean None
goal_type text None
goal_value integer None
is_processing boolean None
name text None
optimization_strategy_type integer None
start_time timestamp without time zone None
Column Lineage
%3 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp account_id 199. model.reddit_ads_source.stg_reddit_ads__ad_group 199. model.reddit_ads_source.stg_reddit_ads__ad_group account_id 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp:f0->199. model.reddit_ads_source.stg_reddit_ads__ad_group:f0
199. model.reddit_ads_source.stg_reddit_ads__ad_group
  • Input Column: 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp[account_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • account_id: Directly mapped
Column Lineage
%3 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp id 199. model.reddit_ads_source.stg_reddit_ads__ad_group 199. model.reddit_ads_source.stg_reddit_ads__ad_group ad_group_id 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp:f0->199. model.reddit_ads_source.stg_reddit_ads__ad_group:f0 193. model.reddit_ads.reddit_ads__url_report 193. model.reddit_ads.reddit_ads__url_report ad_group_id 199. model.reddit_ads_source.stg_reddit_ads__ad_group:f0->193. model.reddit_ads.reddit_ads__url_report:f0 191. model.reddit_ads.reddit_ads__ad_report 191. model.reddit_ads.reddit_ads__ad_report ad_group_id 199. model.reddit_ads_source.stg_reddit_ads__ad_group:f0->191. model.reddit_ads.reddit_ads__ad_report:f0 190. model.reddit_ads.reddit_ads__ad_group_report 190. model.reddit_ads.reddit_ads__ad_group_report ad_group_id 199. model.reddit_ads_source.stg_reddit_ads__ad_group:f0->190. model.reddit_ads.reddit_ads__ad_group_report:f0
199. model.reddit_ads_source.stg_reddit_ads__ad_group
  • Input Column: 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp[id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • ad_group_id: Renamed from 'id' to 'ad_group_id'
190. model.reddit_ads.reddit_ads__ad_group_report
  • Input Column: 199. model.reddit_ads_source.stg_reddit_ads__ad_group[ad_group_id]
    • Integration used as the key to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_id: directly copied
191. model.reddit_ads.reddit_ads__ad_report
  • Input Column: 199. model.reddit_ads_source.stg_reddit_ads__ad_group[ad_group_id]
    • Integration used as the key to join with the ads table
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_id: directly copied
193. model.reddit_ads.reddit_ads__url_report
  • Input Column: 199. model.reddit_ads_source.stg_reddit_ads__ad_group[ad_group_id]
    • Integration used as a join key with the ads table
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_id: directly copied
Column Lineage
%3 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp bid_strategy 199. model.reddit_ads_source.stg_reddit_ads__ad_group 199. model.reddit_ads_source.stg_reddit_ads__ad_group bid_strategy 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp:f0->199. model.reddit_ads_source.stg_reddit_ads__ad_group:f0
199. model.reddit_ads_source.stg_reddit_ads__ad_group
  • Input Column: 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp[bid_strategy]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • bid_strategy: Directly mapped
Column Lineage
%3 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp bid_value 199. model.reddit_ads_source.stg_reddit_ads__ad_group 199. model.reddit_ads_source.stg_reddit_ads__ad_group bid_value 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp:f0->199. model.reddit_ads_source.stg_reddit_ads__ad_group:f0
199. model.reddit_ads_source.stg_reddit_ads__ad_group
  • Input Column: 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp[bid_value]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT type
    • Output Columns:
      • bid_value: Directly mapped
Column Lineage
%3 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp campaign_id 199. model.reddit_ads_source.stg_reddit_ads__ad_group 199. model.reddit_ads_source.stg_reddit_ads__ad_group campaign_id 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp:f0->199. model.reddit_ads_source.stg_reddit_ads__ad_group:f0 190. model.reddit_ads.reddit_ads__ad_group_report 190. model.reddit_ads.reddit_ads__ad_group_report campaign_id 199. model.reddit_ads_source.stg_reddit_ads__ad_group:f0->190. model.reddit_ads.reddit_ads__ad_group_report:f0
199. model.reddit_ads_source.stg_reddit_ads__ad_group
  • Input Column: 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp[campaign_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • campaign_id: Directly mapped
190. model.reddit_ads.reddit_ads__ad_group_report
  • Input Column: 199. model.reddit_ads_source.stg_reddit_ads__ad_group[campaign_id]
    • Integration used as the key to join with the campaigns table
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
Column Lineage
%3 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp configured_status 199. model.reddit_ads_source.stg_reddit_ads__ad_group 199. model.reddit_ads_source.stg_reddit_ads__ad_group configured_status 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp:f0->199. model.reddit_ads_source.stg_reddit_ads__ad_group:f0
199. model.reddit_ads_source.stg_reddit_ads__ad_group
  • Input Column: 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp[configured_status]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • configured_status: Directly mapped
Column Lineage
%3 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp effective_status 199. model.reddit_ads_source.stg_reddit_ads__ad_group 199. model.reddit_ads_source.stg_reddit_ads__ad_group effective_status 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp:f0->199. model.reddit_ads_source.stg_reddit_ads__ad_group:f0
199. model.reddit_ads_source.stg_reddit_ads__ad_group
  • Input Column: 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp[effective_status]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • effective_status: Directly mapped
Column Lineage
%3 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp end_time 199. model.reddit_ads_source.stg_reddit_ads__ad_group 199. model.reddit_ads_source.stg_reddit_ads__ad_group end_time_at 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp:f0->199. model.reddit_ads_source.stg_reddit_ads__ad_group:f0
199. model.reddit_ads_source.stg_reddit_ads__ad_group
  • Input Column: 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp[end_time]
    • Direct The column is directly copied
    • Cleaning The column is cast as TIMESTAMP type
    • Output Columns:
      • end_time_at: Renamed from 'end_time' to 'end_time_at'
Column Lineage
%3 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp expand_targeting 199. model.reddit_ads_source.stg_reddit_ads__ad_group 199. model.reddit_ads_source.stg_reddit_ads__ad_group expand_targeting 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp:f0->199. model.reddit_ads_source.stg_reddit_ads__ad_group:f0
199. model.reddit_ads_source.stg_reddit_ads__ad_group
  • Input Column: 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp[expand_targeting]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as BOOLEAN type
    • Output Columns:
      • expand_targeting: Directly mapped
Column Lineage
%3 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp goal_type 199. model.reddit_ads_source.stg_reddit_ads__ad_group 199. model.reddit_ads_source.stg_reddit_ads__ad_group goal_type 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp:f0->199. model.reddit_ads_source.stg_reddit_ads__ad_group:f0
199. model.reddit_ads_source.stg_reddit_ads__ad_group
  • Input Column: 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp[goal_type]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to TEXT data type
    • Output Columns:
      • goal_type: Directly copied after casting to TEXT
Column Lineage
%3 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp goal_value 199. model.reddit_ads_source.stg_reddit_ads__ad_group 199. model.reddit_ads_source.stg_reddit_ads__ad_group goal_value 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp:f0->199. model.reddit_ads_source.stg_reddit_ads__ad_group:f0
199. model.reddit_ads_source.stg_reddit_ads__ad_group
  • Input Column: 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp[goal_value]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to INT data type
    • Output Columns:
      • goal_value: Directly copied after casting to INT
Column Lineage
%3 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp is_processing 199. model.reddit_ads_source.stg_reddit_ads__ad_group 199. model.reddit_ads_source.stg_reddit_ads__ad_group is_processing 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp:f0->199. model.reddit_ads_source.stg_reddit_ads__ad_group:f0
199. model.reddit_ads_source.stg_reddit_ads__ad_group
  • Input Column: 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp[is_processing]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to BOOLEAN data type
    • Output Columns:
      • is_processing: Directly copied after casting to BOOLEAN
Column Lineage
%3 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp name 199. model.reddit_ads_source.stg_reddit_ads__ad_group 199. model.reddit_ads_source.stg_reddit_ads__ad_group ad_group_name 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp:f0->199. model.reddit_ads_source.stg_reddit_ads__ad_group:f0 193. model.reddit_ads.reddit_ads__url_report 193. model.reddit_ads.reddit_ads__url_report ad_group_name 199. model.reddit_ads_source.stg_reddit_ads__ad_group:f0->193. model.reddit_ads.reddit_ads__url_report:f0 191. model.reddit_ads.reddit_ads__ad_report 191. model.reddit_ads.reddit_ads__ad_report ad_group_name 199. model.reddit_ads_source.stg_reddit_ads__ad_group:f0->191. model.reddit_ads.reddit_ads__ad_report:f0 190. model.reddit_ads.reddit_ads__ad_group_report 190. model.reddit_ads.reddit_ads__ad_group_report ad_group_name 199. model.reddit_ads_source.stg_reddit_ads__ad_group:f0->190. model.reddit_ads.reddit_ads__ad_group_report:f0
199. model.reddit_ads_source.stg_reddit_ads__ad_group
  • Input Column: 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp[name]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to TEXT data type
    • Output Columns:
      • ad_group_name: Directly copied after casting to TEXT and renamed
190. model.reddit_ads.reddit_ads__ad_group_report
  • Input Column: 199. model.reddit_ads_source.stg_reddit_ads__ad_group[ad_group_name]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the report table
    • Output Columns:
      • ad_group_name: Directly mapped to the output column
191. model.reddit_ads.reddit_ads__ad_report
  • Input Column: 199. model.reddit_ads_source.stg_reddit_ads__ad_group[ad_group_name]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the ads table
    • Output Columns:
      • ad_group_name: Directly mapped to the output column
193. model.reddit_ads.reddit_ads__url_report
  • Input Column: 199. model.reddit_ads_source.stg_reddit_ads__ad_group[ad_group_name]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the JOIN condition with the ads table
    • Output Columns:
      • ad_group_name: Directly mapped to the output column
Column Lineage
%3 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp optimization_strategy_type 199. model.reddit_ads_source.stg_reddit_ads__ad_group 199. model.reddit_ads_source.stg_reddit_ads__ad_group optimization_strategy_type 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp:f0->199. model.reddit_ads_source.stg_reddit_ads__ad_group:f0
199. model.reddit_ads_source.stg_reddit_ads__ad_group
  • Input Column: 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp[optimization_strategy_type]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to TEXT data type
    • Output Columns:
      • optimization_strategy_type: Directly copied after casting to TEXT
Column Lineage
%3 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp start_time 199. model.reddit_ads_source.stg_reddit_ads__ad_group 199. model.reddit_ads_source.stg_reddit_ads__ad_group start_time_at 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp:f0->199. model.reddit_ads_source.stg_reddit_ads__ad_group:f0
199. model.reddit_ads_source.stg_reddit_ads__ad_group
  • Input Column: 202. model.reddit_ads_source.stg_reddit_ads__ad_group_tmp[start_time]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to TIMESTAMP data type
    • Output Columns:
      • start_time_at: Directly copied after casting to TIMESTAMP and renamed
203. model.reddit_ads_source.stg_reddit_ads__ad_report

This SQL query performs data type casting and minor transformations on the 'stg_reddit_ads__ad_report' model. It casts various columns to specific data types, renames the 'date' column to 'date_day', and converts the 'spend' column from microseconds to seconds by dividing it by 1,000,000. The query also includes a 'source_relation' column, though it's set to an empty string in this case.

CleaningFeaturization
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_reddit_ads_source.stg_reddit_ads__ad_report_tmp
), fields AS (
  SELECT
    CAST(NULL AS TIMESTAMP) AS _fivetran_synced,
    CAST(NULL AS TEXT) AS account_id,
    CAST(NULL AS TEXT) AS ad_id,
    CAST(NULL AS INT) AS clicks,
    CAST(NULL AS DATE) AS date,
    CAST(NULL AS INT) AS impressions,
    CAST(NULL AS TEXT) AS region,
    CAST(NULL AS INT) AS spend,
    CAST(NULL AS DATE) AS date_day,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    account_id,
    ad_id,
    clicks,
    date AS date_day,
    impressions,
    region,
    (
      spend / 1000000
    ) AS spend
  FROM fields
)
SELECT
  *
FROM final
%3 203. model.reddit_ads_source.stg_reddit_ads__ad_report 203. model.reddit_ads_source.stg_reddit_ads__ad_report source_relation account_id ad_id clicks date_day impressions region spend 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp account_id ad_id date clicks impressions region spend 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp:f0->203. model.reddit_ads_source.stg_reddit_ads__ad_report:f1 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp:f1->203. model.reddit_ads_source.stg_reddit_ads__ad_report:f2 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp:f2->203. model.reddit_ads_source.stg_reddit_ads__ad_report:f4 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp:f3->203. model.reddit_ads_source.stg_reddit_ads__ad_report:f3 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp:f4->203. model.reddit_ads_source.stg_reddit_ads__ad_report:f5 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp:f5->203. model.reddit_ads_source.stg_reddit_ads__ad_report:f6 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp:f6->203. model.reddit_ads_source.stg_reddit_ads__ad_report:f7
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
account_id bigint The ID representing the account.
ad_id bigint The ID representing the ad, if present in the source data.
clicks integer The count of clicks.
date_day date YYYY-MM-DD formatted date
impressions integer The count of impressions.
region integer The region (US state or UK country) targeted for the reports
spend integer Spend converted out of microcurrency (so Spend/1,000,000)
Column Lineage
%3 203. model.reddit_ads_source.stg_reddit_ads__ad_report 203. model.reddit_ads_source.stg_reddit_ads__ad_report source_relation 193. model.reddit_ads.reddit_ads__url_report 193. model.reddit_ads.reddit_ads__url_report source_relation 203. model.reddit_ads_source.stg_reddit_ads__ad_report:f0->193. model.reddit_ads.reddit_ads__url_report:f0 191. model.reddit_ads.reddit_ads__ad_report 191. model.reddit_ads.reddit_ads__ad_report source_relation 203. model.reddit_ads_source.stg_reddit_ads__ad_report:f0->191. model.reddit_ads.reddit_ads__ad_report:f0
191. model.reddit_ads.reddit_ads__ad_report
  • Input Column: 203. model.reddit_ads_source.stg_reddit_ads__ad_report[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with other tables
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
193. model.reddit_ads.reddit_ads__url_report
  • Input Column: 203. model.reddit_ads_source.stg_reddit_ads__ad_report[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with other tables
    • Output Columns:
      • source_relation: Directly copied to the output
Column Lineage
%3 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp account_id 203. model.reddit_ads_source.stg_reddit_ads__ad_report 203. model.reddit_ads_source.stg_reddit_ads__ad_report account_id 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp:f0->203. model.reddit_ads_source.stg_reddit_ads__ad_report:f0 193. model.reddit_ads.reddit_ads__url_report 193. model.reddit_ads.reddit_ads__url_report account_id 203. model.reddit_ads_source.stg_reddit_ads__ad_report:f0->193. model.reddit_ads.reddit_ads__url_report:f0 191. model.reddit_ads.reddit_ads__ad_report 191. model.reddit_ads.reddit_ads__ad_report account_id 203. model.reddit_ads_source.stg_reddit_ads__ad_report:f0->191. model.reddit_ads.reddit_ads__ad_report:f0
203. model.reddit_ads_source.stg_reddit_ads__ad_report
  • Input Column: 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp[account_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to TEXT data type
    • Output Columns:
      • account_id: Directly mapped after casting
191. model.reddit_ads.reddit_ads__ad_report
  • Input Column: 203. model.reddit_ads_source.stg_reddit_ads__ad_report[account_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with the accounts table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • account_id: Directly copied to the output
193. model.reddit_ads.reddit_ads__url_report
  • Input Column: 203. model.reddit_ads_source.stg_reddit_ads__ad_report[account_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with the accounts table
    • Output Columns:
      • account_id: Directly copied to the output
Column Lineage
%3 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp ad_id 203. model.reddit_ads_source.stg_reddit_ads__ad_report 203. model.reddit_ads_source.stg_reddit_ads__ad_report ad_id 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp:f0->203. model.reddit_ads_source.stg_reddit_ads__ad_report:f0 193. model.reddit_ads.reddit_ads__url_report 193. model.reddit_ads.reddit_ads__url_report ad_id 203. model.reddit_ads_source.stg_reddit_ads__ad_report:f0->193. model.reddit_ads.reddit_ads__url_report:f0 191. model.reddit_ads.reddit_ads__ad_report 191. model.reddit_ads.reddit_ads__ad_report ad_id 203. model.reddit_ads_source.stg_reddit_ads__ad_report:f0->191. model.reddit_ads.reddit_ads__ad_report:f0
203. model.reddit_ads_source.stg_reddit_ads__ad_report
  • Input Column: 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp[ad_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to TEXT data type
    • Output Columns:
      • ad_id: Directly mapped after casting
191. model.reddit_ads.reddit_ads__ad_report
  • Input Column: 203. model.reddit_ads_source.stg_reddit_ads__ad_report[ad_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with the ads table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • ad_id: Directly copied to the output
193. model.reddit_ads.reddit_ads__url_report
  • Input Column: 203. model.reddit_ads_source.stg_reddit_ads__ad_report[ad_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with the ads table
    • Output Columns:
      • ad_id: Directly copied to the output
Column Lineage
%3 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp clicks 203. model.reddit_ads_source.stg_reddit_ads__ad_report 203. model.reddit_ads_source.stg_reddit_ads__ad_report clicks 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp:f0->203. model.reddit_ads_source.stg_reddit_ads__ad_report:f0 193. model.reddit_ads.reddit_ads__url_report 193. model.reddit_ads.reddit_ads__url_report clicks 203. model.reddit_ads_source.stg_reddit_ads__ad_report:f0->193. model.reddit_ads.reddit_ads__url_report:f0 191. model.reddit_ads.reddit_ads__ad_report 191. model.reddit_ads.reddit_ads__ad_report clicks 203. model.reddit_ads_source.stg_reddit_ads__ad_report:f0->191. model.reddit_ads.reddit_ads__ad_report:f0
203. model.reddit_ads_source.stg_reddit_ads__ad_report
  • Input Column: 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp[clicks]
    • Cleaning The column is cast to INT data type
    • Output Columns:
      • clicks: Directly mapped after casting
191. model.reddit_ads.reddit_ads__ad_report
  • Input Column: 203. model.reddit_ads_source.stg_reddit_ads__ad_report[clicks]
    • Aggregation The column is summed up in the SELECT statement
    • Output Columns:
      • clicks: Aggregated sum of clicks
193. model.reddit_ads.reddit_ads__url_report
  • Input Column: 203. model.reddit_ads_source.stg_reddit_ads__ad_report[clicks]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • clicks: Aggregated sum of clicks
Column Lineage
%3 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp date 203. model.reddit_ads_source.stg_reddit_ads__ad_report 203. model.reddit_ads_source.stg_reddit_ads__ad_report date_day 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp:f0->203. model.reddit_ads_source.stg_reddit_ads__ad_report:f0 193. model.reddit_ads.reddit_ads__url_report 193. model.reddit_ads.reddit_ads__url_report date_day 203. model.reddit_ads_source.stg_reddit_ads__ad_report:f0->193. model.reddit_ads.reddit_ads__url_report:f0 191. model.reddit_ads.reddit_ads__ad_report 191. model.reddit_ads.reddit_ads__ad_report date_day 203. model.reddit_ads_source.stg_reddit_ads__ad_report:f0->191. model.reddit_ads.reddit_ads__ad_report:f0
203. model.reddit_ads_source.stg_reddit_ads__ad_report
  • Input Column: 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp[date]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to DATE data type and renamed
    • Output Columns:
      • date_day: Directly mapped after casting and renaming
191. model.reddit_ads.reddit_ads__ad_report
  • Input Column: 203. model.reddit_ads_source.stg_reddit_ads__ad_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
193. model.reddit_ads.reddit_ads__url_report
  • Input Column: 203. model.reddit_ads_source.stg_reddit_ads__ad_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp impressions 203. model.reddit_ads_source.stg_reddit_ads__ad_report 203. model.reddit_ads_source.stg_reddit_ads__ad_report impressions 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp:f0->203. model.reddit_ads_source.stg_reddit_ads__ad_report:f0 193. model.reddit_ads.reddit_ads__url_report 193. model.reddit_ads.reddit_ads__url_report impressions 203. model.reddit_ads_source.stg_reddit_ads__ad_report:f0->193. model.reddit_ads.reddit_ads__url_report:f0 191. model.reddit_ads.reddit_ads__ad_report 191. model.reddit_ads.reddit_ads__ad_report impressions 203. model.reddit_ads_source.stg_reddit_ads__ad_report:f0->191. model.reddit_ads.reddit_ads__ad_report:f0
203. model.reddit_ads_source.stg_reddit_ads__ad_report
  • Input Column: 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp[impressions]
    • Cleaning The column is cast to INT data type
    • Output Columns:
      • impressions: Directly mapped after casting
191. model.reddit_ads.reddit_ads__ad_report
  • Input Column: 203. model.reddit_ads_source.stg_reddit_ads__ad_report[impressions]
    • Aggregation The column is summed up in the SELECT statement
    • Output Columns:
      • impressions: Aggregated sum of impressions
193. model.reddit_ads.reddit_ads__url_report
  • Input Column: 203. model.reddit_ads_source.stg_reddit_ads__ad_report[impressions]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • impressions: Aggregated sum of impressions
Column Lineage
%3 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp region 203. model.reddit_ads_source.stg_reddit_ads__ad_report 203. model.reddit_ads_source.stg_reddit_ads__ad_report region 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp:f0->203. model.reddit_ads_source.stg_reddit_ads__ad_report:f0
203. model.reddit_ads_source.stg_reddit_ads__ad_report
  • Input Column: 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp[region]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • region: Directly copied to the output 'region' column
Column Lineage
%3 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp spend 203. model.reddit_ads_source.stg_reddit_ads__ad_report 203. model.reddit_ads_source.stg_reddit_ads__ad_report spend 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp:f0->203. model.reddit_ads_source.stg_reddit_ads__ad_report:f0 193. model.reddit_ads.reddit_ads__url_report 193. model.reddit_ads.reddit_ads__url_report spend 203. model.reddit_ads_source.stg_reddit_ads__ad_report:f0->193. model.reddit_ads.reddit_ads__url_report:f0 191. model.reddit_ads.reddit_ads__ad_report 191. model.reddit_ads.reddit_ads__ad_report spend 203. model.reddit_ads_source.stg_reddit_ads__ad_report:f0->191. model.reddit_ads.reddit_ads__ad_report:f0
203. model.reddit_ads_source.stg_reddit_ads__ad_report
  • Input Column: 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp[spend]
    • Cleaning The column is cleaned by casting to INT and then divided by 1,000,000 to convert from microcurrency
    • Output Columns:
      • spend: Transformed and mapped to the output 'spend' column
191. model.reddit_ads.reddit_ads__ad_report
  • Input Column: 203. model.reddit_ads_source.stg_reddit_ads__ad_report[spend]
    • Aggregation The column is summed up in the SELECT statement
    • Output Columns:
      • spend: Aggregated sum of spend
193. model.reddit_ads.reddit_ads__url_report
  • Input Column: 203. model.reddit_ads_source.stg_reddit_ads__ad_report[spend]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • spend: Aggregated sum of spend
204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of type TEXT. It's likely used as a placeholder or template for a staging table in dbt (data build tool) for Reddit ads data.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp account_id ad_id date _fivetran_synced app_install_metrics_add_payment_info app_install_metrics_add_to_cart app_install_metrics_app_launch app_install_metrics_completed_tutorial app_install_metrics_install app_install_metrics_level_achieved app_install_metrics_purchase app_install_metrics_search app_install_metrics_sign_up app_install_metrics_spend app_install_metrics_spend_credits app_install_metrics_view_content clicks comment_downvotes comment_upvotes comments_page_views conversion_roas cpc ctr ecpm gallery_item_caption gallery_item_id impressions legacy_click_conversions_attribution_window_day legacy_click_conversions_attribution_window_month legacy_click_conversions_attribution_window_week legacy_view_conversions_attribution_window_day legacy_view_conversions_attribution_window_month legacy_view_conversions_attribution_window_week priority region spend video_fully_viewable_impressions video_plays_expanded video_plays_with_sound video_started video_viewable_impressions video_watched_100_percent video_watched_10_seconds video_watched_25_percent video_watched_3_seconds video_watched_50_percent video_watched_5_seconds video_watched_75_percent video_watched_95_percent viewable_impressions viewer_comments 348. source.reddit_ads_source.reddit_ads.ad_report 348. source.reddit_ads_source.reddit_ads.ad_report
Name Type Comment
account_id bigint None
ad_id bigint None
date date None
_fivetran_synced timestamp without time zone None
app_install_metrics_add_payment_info integer None
app_install_metrics_add_to_cart integer None
app_install_metrics_app_launch integer None
app_install_metrics_completed_tutorial integer None
app_install_metrics_install integer None
app_install_metrics_level_achieved integer None
app_install_metrics_purchase integer None
app_install_metrics_search integer None
app_install_metrics_sign_up integer None
app_install_metrics_spend integer None
app_install_metrics_spend_credits integer None
app_install_metrics_view_content integer None
clicks integer None
comment_downvotes integer None
comment_upvotes integer None
comments_page_views integer None
conversion_roas integer None
cpc double precision None
ctr double precision None
ecpm double precision None
gallery_item_caption integer None
gallery_item_id integer None
impressions integer None
legacy_click_conversions_attribution_window_day integer None
legacy_click_conversions_attribution_window_month integer None
legacy_click_conversions_attribution_window_week integer None
legacy_view_conversions_attribution_window_day integer None
legacy_view_conversions_attribution_window_month integer None
legacy_view_conversions_attribution_window_week integer None
priority integer None
region integer None
spend integer None
video_fully_viewable_impressions integer None
video_plays_expanded integer None
video_plays_with_sound integer None
video_started integer None
video_viewable_impressions integer None
video_watched_100_percent integer None
video_watched_10_seconds integer None
video_watched_25_percent integer None
video_watched_3_seconds integer None
video_watched_50_percent integer None
video_watched_5_seconds integer None
video_watched_75_percent integer None
video_watched_95_percent integer None
viewable_impressions integer None
viewer_comments integer None
Column Lineage
%3 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp account_id 203. model.reddit_ads_source.stg_reddit_ads__ad_report 203. model.reddit_ads_source.stg_reddit_ads__ad_report account_id 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp:f0->203. model.reddit_ads_source.stg_reddit_ads__ad_report:f0 193. model.reddit_ads.reddit_ads__url_report 193. model.reddit_ads.reddit_ads__url_report account_id 203. model.reddit_ads_source.stg_reddit_ads__ad_report:f0->193. model.reddit_ads.reddit_ads__url_report:f0 191. model.reddit_ads.reddit_ads__ad_report 191. model.reddit_ads.reddit_ads__ad_report account_id 203. model.reddit_ads_source.stg_reddit_ads__ad_report:f0->191. model.reddit_ads.reddit_ads__ad_report:f0
203. model.reddit_ads_source.stg_reddit_ads__ad_report
  • Input Column: 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp[account_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to TEXT data type
    • Output Columns:
      • account_id: Directly mapped after casting
191. model.reddit_ads.reddit_ads__ad_report
  • Input Column: 203. model.reddit_ads_source.stg_reddit_ads__ad_report[account_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with the accounts table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • account_id: Directly copied to the output
193. model.reddit_ads.reddit_ads__url_report
  • Input Column: 203. model.reddit_ads_source.stg_reddit_ads__ad_report[account_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with the accounts table
    • Output Columns:
      • account_id: Directly copied to the output
Column Lineage
%3 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp ad_id 203. model.reddit_ads_source.stg_reddit_ads__ad_report 203. model.reddit_ads_source.stg_reddit_ads__ad_report ad_id 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp:f0->203. model.reddit_ads_source.stg_reddit_ads__ad_report:f0 193. model.reddit_ads.reddit_ads__url_report 193. model.reddit_ads.reddit_ads__url_report ad_id 203. model.reddit_ads_source.stg_reddit_ads__ad_report:f0->193. model.reddit_ads.reddit_ads__url_report:f0 191. model.reddit_ads.reddit_ads__ad_report 191. model.reddit_ads.reddit_ads__ad_report ad_id 203. model.reddit_ads_source.stg_reddit_ads__ad_report:f0->191. model.reddit_ads.reddit_ads__ad_report:f0
203. model.reddit_ads_source.stg_reddit_ads__ad_report
  • Input Column: 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp[ad_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to TEXT data type
    • Output Columns:
      • ad_id: Directly mapped after casting
191. model.reddit_ads.reddit_ads__ad_report
  • Input Column: 203. model.reddit_ads_source.stg_reddit_ads__ad_report[ad_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with the ads table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • ad_id: Directly copied to the output
193. model.reddit_ads.reddit_ads__url_report
  • Input Column: 203. model.reddit_ads_source.stg_reddit_ads__ad_report[ad_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with the ads table
    • Output Columns:
      • ad_id: Directly copied to the output
Column Lineage
%3 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp date 203. model.reddit_ads_source.stg_reddit_ads__ad_report 203. model.reddit_ads_source.stg_reddit_ads__ad_report date_day 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp:f0->203. model.reddit_ads_source.stg_reddit_ads__ad_report:f0 193. model.reddit_ads.reddit_ads__url_report 193. model.reddit_ads.reddit_ads__url_report date_day 203. model.reddit_ads_source.stg_reddit_ads__ad_report:f0->193. model.reddit_ads.reddit_ads__url_report:f0 191. model.reddit_ads.reddit_ads__ad_report 191. model.reddit_ads.reddit_ads__ad_report date_day 203. model.reddit_ads_source.stg_reddit_ads__ad_report:f0->191. model.reddit_ads.reddit_ads__ad_report:f0
203. model.reddit_ads_source.stg_reddit_ads__ad_report
  • Input Column: 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp[date]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to DATE data type and renamed
    • Output Columns:
      • date_day: Directly mapped after casting and renaming
191. model.reddit_ads.reddit_ads__ad_report
  • Input Column: 203. model.reddit_ads_source.stg_reddit_ads__ad_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
193. model.reddit_ads.reddit_ads__url_report
  • Input Column: 203. model.reddit_ads_source.stg_reddit_ads__ad_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp clicks 203. model.reddit_ads_source.stg_reddit_ads__ad_report 203. model.reddit_ads_source.stg_reddit_ads__ad_report clicks 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp:f0->203. model.reddit_ads_source.stg_reddit_ads__ad_report:f0 193. model.reddit_ads.reddit_ads__url_report 193. model.reddit_ads.reddit_ads__url_report clicks 203. model.reddit_ads_source.stg_reddit_ads__ad_report:f0->193. model.reddit_ads.reddit_ads__url_report:f0 191. model.reddit_ads.reddit_ads__ad_report 191. model.reddit_ads.reddit_ads__ad_report clicks 203. model.reddit_ads_source.stg_reddit_ads__ad_report:f0->191. model.reddit_ads.reddit_ads__ad_report:f0
203. model.reddit_ads_source.stg_reddit_ads__ad_report
  • Input Column: 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp[clicks]
    • Cleaning The column is cast to INT data type
    • Output Columns:
      • clicks: Directly mapped after casting
191. model.reddit_ads.reddit_ads__ad_report
  • Input Column: 203. model.reddit_ads_source.stg_reddit_ads__ad_report[clicks]
    • Aggregation The column is summed up in the SELECT statement
    • Output Columns:
      • clicks: Aggregated sum of clicks
193. model.reddit_ads.reddit_ads__url_report
  • Input Column: 203. model.reddit_ads_source.stg_reddit_ads__ad_report[clicks]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • clicks: Aggregated sum of clicks
Column Lineage
%3 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp impressions 203. model.reddit_ads_source.stg_reddit_ads__ad_report 203. model.reddit_ads_source.stg_reddit_ads__ad_report impressions 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp:f0->203. model.reddit_ads_source.stg_reddit_ads__ad_report:f0 193. model.reddit_ads.reddit_ads__url_report 193. model.reddit_ads.reddit_ads__url_report impressions 203. model.reddit_ads_source.stg_reddit_ads__ad_report:f0->193. model.reddit_ads.reddit_ads__url_report:f0 191. model.reddit_ads.reddit_ads__ad_report 191. model.reddit_ads.reddit_ads__ad_report impressions 203. model.reddit_ads_source.stg_reddit_ads__ad_report:f0->191. model.reddit_ads.reddit_ads__ad_report:f0
203. model.reddit_ads_source.stg_reddit_ads__ad_report
  • Input Column: 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp[impressions]
    • Cleaning The column is cast to INT data type
    • Output Columns:
      • impressions: Directly mapped after casting
191. model.reddit_ads.reddit_ads__ad_report
  • Input Column: 203. model.reddit_ads_source.stg_reddit_ads__ad_report[impressions]
    • Aggregation The column is summed up in the SELECT statement
    • Output Columns:
      • impressions: Aggregated sum of impressions
193. model.reddit_ads.reddit_ads__url_report
  • Input Column: 203. model.reddit_ads_source.stg_reddit_ads__ad_report[impressions]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • impressions: Aggregated sum of impressions
Column Lineage
%3 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp region 203. model.reddit_ads_source.stg_reddit_ads__ad_report 203. model.reddit_ads_source.stg_reddit_ads__ad_report region 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp:f0->203. model.reddit_ads_source.stg_reddit_ads__ad_report:f0
203. model.reddit_ads_source.stg_reddit_ads__ad_report
  • Input Column: 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp[region]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • region: Directly copied to the output 'region' column
Column Lineage
%3 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp spend 203. model.reddit_ads_source.stg_reddit_ads__ad_report 203. model.reddit_ads_source.stg_reddit_ads__ad_report spend 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp:f0->203. model.reddit_ads_source.stg_reddit_ads__ad_report:f0 193. model.reddit_ads.reddit_ads__url_report 193. model.reddit_ads.reddit_ads__url_report spend 203. model.reddit_ads_source.stg_reddit_ads__ad_report:f0->193. model.reddit_ads.reddit_ads__url_report:f0 191. model.reddit_ads.reddit_ads__ad_report 191. model.reddit_ads.reddit_ads__ad_report spend 203. model.reddit_ads_source.stg_reddit_ads__ad_report:f0->191. model.reddit_ads.reddit_ads__ad_report:f0
203. model.reddit_ads_source.stg_reddit_ads__ad_report
  • Input Column: 204. model.reddit_ads_source.stg_reddit_ads__ad_report_tmp[spend]
    • Cleaning The column is cleaned by casting to INT and then divided by 1,000,000 to convert from microcurrency
    • Output Columns:
      • spend: Transformed and mapped to the output 'spend' column
191. model.reddit_ads.reddit_ads__ad_report
  • Input Column: 203. model.reddit_ads_source.stg_reddit_ads__ad_report[spend]
    • Aggregation The column is summed up in the SELECT statement
    • Output Columns:
      • spend: Aggregated sum of spend
193. model.reddit_ads.reddit_ads__url_report
  • Input Column: 203. model.reddit_ads_source.stg_reddit_ads__ad_report[spend]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • spend: Aggregated sum of spend
205. model.reddit_ads_source.stg_reddit_ads__ad_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of type TEXT. It's likely used as a placeholder or template for generating a schema without any actual data.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp id _fivetran_synced account_id ad_group_id campaign_id click_url configured_status effective_status is_processing name post_id post_url preview_expiry preview_url rejection_reason search_term 345. source.reddit_ads_source.reddit_ads.ad 345. source.reddit_ads_source.reddit_ads.ad
Name Type Comment
id bigint None
_fivetran_synced text None
account_id text None
ad_group_id bigint None
campaign_id bigint None
click_url text None
configured_status text None
effective_status text None
is_processing boolean None
name text None
post_id text None
post_url integer None
preview_expiry integer None
preview_url integer None
rejection_reason integer None
search_term integer None
Column Lineage
%3 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp id 198. model.reddit_ads_source.stg_reddit_ads__ad 198. model.reddit_ads_source.stg_reddit_ads__ad ad_id 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp:f0->198. model.reddit_ads_source.stg_reddit_ads__ad:f0 193. model.reddit_ads.reddit_ads__url_report 193. model.reddit_ads.reddit_ads__url_report ad_id 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f0 191. model.reddit_ads.reddit_ads__ad_report 191. model.reddit_ads.reddit_ads__ad_report ad_id 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->191. model.reddit_ads.reddit_ads__ad_report:f0
198. model.reddit_ads_source.stg_reddit_ads__ad
  • Input Column: 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp[id]
    • Cleaning The column is cast as TEXT and renamed to 'ad_id'
    • Output Columns:
      • ad_id: Directly mapped after casting
191. model.reddit_ads.reddit_ads__ad_report
  • Input Column: 198. model.reddit_ads_source.stg_reddit_ads__ad[ad_id]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as a key to join with the report table
    • Output Columns:
      • ad_id: Directly copied to the output
193. model.reddit_ads.reddit_ads__url_report
  • Input Column: 198. model.reddit_ads_source.stg_reddit_ads__ad[ad_id]
    • Integration used to join with the report table
    • Direct directly copied to output
    • Output Columns:
      • ad_id: directly copied
Column Lineage
%3 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp account_id 198. model.reddit_ads_source.stg_reddit_ads__ad 198. model.reddit_ads_source.stg_reddit_ads__ad account_id 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp:f0->198. model.reddit_ads_source.stg_reddit_ads__ad:f0
198. model.reddit_ads_source.stg_reddit_ads__ad
  • Input Column: 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp[account_id]
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • account_id: Directly mapped after casting
Column Lineage
%3 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp ad_group_id 198. model.reddit_ads_source.stg_reddit_ads__ad 198. model.reddit_ads_source.stg_reddit_ads__ad ad_group_id 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp:f0->198. model.reddit_ads_source.stg_reddit_ads__ad:f0 193. model.reddit_ads.reddit_ads__url_report 193. model.reddit_ads.reddit_ads__url_report ad_group_id 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f0 191. model.reddit_ads.reddit_ads__ad_report 191. model.reddit_ads.reddit_ads__ad_report ad_group_id 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->191. model.reddit_ads.reddit_ads__ad_report:f0
198. model.reddit_ads_source.stg_reddit_ads__ad
  • Input Column: 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp[ad_group_id]
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • ad_group_id: Directly mapped after casting
191. model.reddit_ads.reddit_ads__ad_report
  • Input Column: 198. model.reddit_ads_source.stg_reddit_ads__ad[ad_group_id]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as a key to join with the ad_groups table
    • Output Columns:
      • ad_group_id: Directly copied to the output
193. model.reddit_ads.reddit_ads__url_report
  • Input Column: 198. model.reddit_ads_source.stg_reddit_ads__ad[ad_group_id]
    • Integration used to join with the ad_groups table
    • Direct directly copied to output
    • Output Columns:
      • ad_group_id: directly copied
Column Lineage
%3 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp campaign_id 198. model.reddit_ads_source.stg_reddit_ads__ad 198. model.reddit_ads_source.stg_reddit_ads__ad campaign_id 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp:f0->198. model.reddit_ads_source.stg_reddit_ads__ad:f0 193. model.reddit_ads.reddit_ads__url_report 193. model.reddit_ads.reddit_ads__url_report campaign_id 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f0 191. model.reddit_ads.reddit_ads__ad_report 191. model.reddit_ads.reddit_ads__ad_report campaign_id 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->191. model.reddit_ads.reddit_ads__ad_report:f0
198. model.reddit_ads_source.stg_reddit_ads__ad
  • Input Column: 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp[campaign_id]
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • campaign_id: Directly mapped after casting
191. model.reddit_ads.reddit_ads__ad_report
  • Input Column: 198. model.reddit_ads_source.stg_reddit_ads__ad[campaign_id]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as a key to join with the campaigns table
    • Output Columns:
      • campaign_id: Directly copied to the output
193. model.reddit_ads.reddit_ads__url_report
  • Input Column: 198. model.reddit_ads_source.stg_reddit_ads__ad[campaign_id]
    • Integration used to join with the campaigns table
    • Direct directly copied to output
    • Output Columns:
      • campaign_id: directly copied
Column Lineage
%3 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp click_url 198. model.reddit_ads_source.stg_reddit_ads__ad 198. model.reddit_ads_source.stg_reddit_ads__ad click_url 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp:f0->198. model.reddit_ads_source.stg_reddit_ads__ad:f0 193. model.reddit_ads.reddit_ads__url_report 193. model.reddit_ads.reddit_ads__url_report base_url click_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f1 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f0 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f2 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f3 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f7 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f6 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f8 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f5 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f4
198. model.reddit_ads_source.stg_reddit_ads__ad
  • Input Column: 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp[click_url]
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • click_url: Directly mapped after casting
193. model.reddit_ads.reddit_ads__url_report
  • Input Column: 198. model.reddit_ads_source.stg_reddit_ads__ad[click_url]
    • Direct directly copied to output
    • Cleaning used to extract various URL components
    • Featurization used to extract UTM parameters
    • Filtering used to filter out null values in the final output
    • Output Columns:
      • click_url: directly copied
      • base_url: extracted from click_url
      • url_host: extracted from click_url
      • url_path: extracted from click_url
      • utm_source: extracted from click_url
      • utm_medium: extracted from click_url
      • utm_term: extracted from click_url
      • utm_content: extracted from click_url
      • utm_campaign: extracted from click_url (if not null)
Column Lineage
%3 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp configured_status 198. model.reddit_ads_source.stg_reddit_ads__ad 198. model.reddit_ads_source.stg_reddit_ads__ad configured_status 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp:f0->198. model.reddit_ads_source.stg_reddit_ads__ad:f0
198. model.reddit_ads_source.stg_reddit_ads__ad
  • Input Column: 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp[configured_status]
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • configured_status: Directly mapped after casting
Column Lineage
%3 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp effective_status 198. model.reddit_ads_source.stg_reddit_ads__ad 198. model.reddit_ads_source.stg_reddit_ads__ad effective_status 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp:f0->198. model.reddit_ads_source.stg_reddit_ads__ad:f0
198. model.reddit_ads_source.stg_reddit_ads__ad
  • Input Column: 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp[effective_status]
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • effective_status: Directly mapped after casting
Column Lineage
%3 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp is_processing 198. model.reddit_ads_source.stg_reddit_ads__ad 198. model.reddit_ads_source.stg_reddit_ads__ad is_processing 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp:f0->198. model.reddit_ads_source.stg_reddit_ads__ad:f0
198. model.reddit_ads_source.stg_reddit_ads__ad
  • Input Column: 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp[is_processing]
    • Cleaning The column is cast as BOOLEAN
    • Output Columns:
      • is_processing: Directly mapped after casting
Column Lineage
%3 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp name 198. model.reddit_ads_source.stg_reddit_ads__ad 198. model.reddit_ads_source.stg_reddit_ads__ad ad_name 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp:f0->198. model.reddit_ads_source.stg_reddit_ads__ad:f0 193. model.reddit_ads.reddit_ads__url_report 193. model.reddit_ads.reddit_ads__url_report ad_name 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f0 191. model.reddit_ads.reddit_ads__ad_report 191. model.reddit_ads.reddit_ads__ad_report ad_name 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->191. model.reddit_ads.reddit_ads__ad_report:f0
198. model.reddit_ads_source.stg_reddit_ads__ad
  • Input Column: 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp[name]
    • Cleaning The column is cast as TEXT and renamed to 'ad_name'
    • Output Columns:
      • ad_name: Directly mapped after casting and renaming
191. model.reddit_ads.reddit_ads__ad_report
  • Input Column: 198. model.reddit_ads_source.stg_reddit_ads__ad[ad_name]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • ad_name: Directly copied to the output
193. model.reddit_ads.reddit_ads__url_report
  • Input Column: 198. model.reddit_ads_source.stg_reddit_ads__ad[ad_name]
    • Direct directly copied to output
    • Output Columns:
      • ad_name: directly copied
Column Lineage
%3 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp post_id 198. model.reddit_ads_source.stg_reddit_ads__ad 198. model.reddit_ads_source.stg_reddit_ads__ad post_id 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp:f0->198. model.reddit_ads_source.stg_reddit_ads__ad:f0 193. model.reddit_ads.reddit_ads__url_report 193. model.reddit_ads.reddit_ads__url_report post_id 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f0 191. model.reddit_ads.reddit_ads__ad_report 191. model.reddit_ads.reddit_ads__ad_report post_id 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->191. model.reddit_ads.reddit_ads__ad_report:f0
198. model.reddit_ads_source.stg_reddit_ads__ad
  • Input Column: 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp[post_id]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • post_id: Directly mapped to the output column 'post_id'
191. model.reddit_ads.reddit_ads__ad_report
  • Input Column: 198. model.reddit_ads_source.stg_reddit_ads__ad[post_id]
    • Direct The post_id is directly copied to the output without transformation
    • Integration The post_id is used as part of the join condition with other tables
    • Output Columns:
      • post_id: Directly copied to the output column 'post_id'
193. model.reddit_ads.reddit_ads__url_report
  • Input Column: 198. model.reddit_ads_source.stg_reddit_ads__ad[post_id]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • post_id: Directly copied to the output
Column Lineage
%3 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp post_url 198. model.reddit_ads_source.stg_reddit_ads__ad 198. model.reddit_ads_source.stg_reddit_ads__ad post_url 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp:f0->198. model.reddit_ads_source.stg_reddit_ads__ad:f0 193. model.reddit_ads.reddit_ads__url_report 193. model.reddit_ads.reddit_ads__url_report post_url 198. model.reddit_ads_source.stg_reddit_ads__ad:f0->193. model.reddit_ads.reddit_ads__url_report:f0
198. model.reddit_ads_source.stg_reddit_ads__ad
  • Input Column: 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp[post_url]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • post_url: Directly mapped to the output column 'post_url'
193. model.reddit_ads.reddit_ads__url_report
  • Input Column: 198. model.reddit_ads_source.stg_reddit_ads__ad[post_url]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • post_url: Directly copied to the output
Column Lineage
%3 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp rejection_reason 198. model.reddit_ads_source.stg_reddit_ads__ad 198. model.reddit_ads_source.stg_reddit_ads__ad rejection_reason 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp:f0->198. model.reddit_ads_source.stg_reddit_ads__ad:f0
198. model.reddit_ads_source.stg_reddit_ads__ad
  • Input Column: 205. model.reddit_ads_source.stg_reddit_ads__ad_tmp[rejection_reason]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • rejection_reason: Directly mapped to the output column 'rejection_reason'
206. model.reddit_ads_source.stg_reddit_ads__campaign

This SQL query creates a staging table for Reddit ads campaign data. It starts with a base table, then defines a fields CTE that casts all columns to specific data types (mostly setting them to NULL). Finally, it selects and renames some columns from the fields CTE to create the final output. The query appears to be setting up a structure for data that will be populated later, as all fields are currently set to NULL or empty string.

CleaningOther
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_reddit_ads_source.stg_reddit_ads__campaign_tmp
), fields AS (
  SELECT
    CAST(NULL AS TIMESTAMP) AS _fivetran_synced,
    CAST(NULL AS TEXT) AS account_id,
    CAST(NULL AS TEXT) AS configured_status,
    CAST(NULL AS TEXT) AS effective_status,
    CAST(NULL AS TEXT) AS funding_instrument_id,
    CAST(NULL AS TEXT) AS id,
    CAST(NULL AS BOOLEAN) AS is_processing,
    CAST(NULL AS TEXT) AS name,
    CAST(NULL AS TEXT) AS objective,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    account_id,
    configured_status,
    effective_status,
    funding_instrument_id,
    id AS campaign_id,
    is_processing,
    name AS campaign_name,
    objective
  FROM fields
)
SELECT
  *
FROM final
%3 206. model.reddit_ads_source.stg_reddit_ads__campaign 206. model.reddit_ads_source.stg_reddit_ads__campaign source_relation campaign_id account_id configured_status effective_status funding_instrument_id is_processing campaign_name objective 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp id account_id configured_status effective_status funding_instrument_id is_processing name objective 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp:f0->206. model.reddit_ads_source.stg_reddit_ads__campaign:f1 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp:f1->206. model.reddit_ads_source.stg_reddit_ads__campaign:f2 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp:f2->206. model.reddit_ads_source.stg_reddit_ads__campaign:f3 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp:f3->206. model.reddit_ads_source.stg_reddit_ads__campaign:f4 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp:f4->206. model.reddit_ads_source.stg_reddit_ads__campaign:f5 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp:f5->206. model.reddit_ads_source.stg_reddit_ads__campaign:f6 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp:f6->206. model.reddit_ads_source.stg_reddit_ads__campaign:f7 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp:f7->206. model.reddit_ads_source.stg_reddit_ads__campaign:f8
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
campaign_id bigint The ID representing the campaign, if present in the source data.
account_id bigint The ID representing the account.
configured_status text The status configured by the account owner. "ACTIVE", "PAUSED", "ARCHIVED", "DELETED"
effective_status text The calculated status determining the real status of this entity.
funding_instrument_id integer Campaign level funding instrument id
is_processing boolean Whether or not effective status is processing
campaign_name text The name of the campaign, if present in the source data.
objective text The objective type of a campaign.
Column Lineage
%3 206. model.reddit_ads_source.stg_reddit_ads__campaign 206. model.reddit_ads_source.stg_reddit_ads__campaign source_relation 193. model.reddit_ads.reddit_ads__url_report 193. model.reddit_ads.reddit_ads__url_report source_relation 206. model.reddit_ads_source.stg_reddit_ads__campaign:f0->193. model.reddit_ads.reddit_ads__url_report:f0 191. model.reddit_ads.reddit_ads__ad_report 191. model.reddit_ads.reddit_ads__ad_report source_relation 206. model.reddit_ads_source.stg_reddit_ads__campaign:f0->191. model.reddit_ads.reddit_ads__ad_report:f0 190. model.reddit_ads.reddit_ads__ad_group_report 190. model.reddit_ads.reddit_ads__ad_group_report source_relation 206. model.reddit_ads_source.stg_reddit_ads__campaign:f0->190. model.reddit_ads.reddit_ads__ad_group_report:f0 192. model.reddit_ads.reddit_ads__campaign_report 192. model.reddit_ads.reddit_ads__campaign_report source_relation 206. model.reddit_ads_source.stg_reddit_ads__campaign:f0->192. model.reddit_ads.reddit_ads__campaign_report:f0
190. model.reddit_ads.reddit_ads__ad_group_report
  • Input Column: 206. model.reddit_ads_source.stg_reddit_ads__campaign[source_relation]
    • Integration used as part of the JOIN condition to ensure data from the same source is combined
    • Direct directly selected in the final output
    • Output Columns:
      • source_relation: directly copied to the output
191. model.reddit_ads.reddit_ads__ad_report
  • Input Column: 206. model.reddit_ads_source.stg_reddit_ads__campaign[source_relation]
    • Integration Used as part of the join condition with other tables
    • Direct Directly included in the output
    • Output Columns:
      • source_relation: Directly copied to the output
192. model.reddit_ads.reddit_ads__campaign_report
  • Input Column: 206. model.reddit_ads_source.stg_reddit_ads__campaign[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as a key to join with other tables
    • Output Columns:
      • source_relation: Directly copied to the output
193. model.reddit_ads.reddit_ads__url_report
  • Input Column: 206. model.reddit_ads_source.stg_reddit_ads__campaign[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
Column Lineage
%3 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp id 206. model.reddit_ads_source.stg_reddit_ads__campaign 206. model.reddit_ads_source.stg_reddit_ads__campaign campaign_id 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp:f0->206. model.reddit_ads_source.stg_reddit_ads__campaign:f0 193. model.reddit_ads.reddit_ads__url_report 193. model.reddit_ads.reddit_ads__url_report campaign_id 206. model.reddit_ads_source.stg_reddit_ads__campaign:f0->193. model.reddit_ads.reddit_ads__url_report:f0 191. model.reddit_ads.reddit_ads__ad_report 191. model.reddit_ads.reddit_ads__ad_report campaign_id 206. model.reddit_ads_source.stg_reddit_ads__campaign:f0->191. model.reddit_ads.reddit_ads__ad_report:f0 190. model.reddit_ads.reddit_ads__ad_group_report 190. model.reddit_ads.reddit_ads__ad_group_report campaign_id 206. model.reddit_ads_source.stg_reddit_ads__campaign:f0->190. model.reddit_ads.reddit_ads__ad_group_report:f0 192. model.reddit_ads.reddit_ads__campaign_report 192. model.reddit_ads.reddit_ads__campaign_report campaign_id 206. model.reddit_ads_source.stg_reddit_ads__campaign:f0->192. model.reddit_ads.reddit_ads__campaign_report:f0
206. model.reddit_ads_source.stg_reddit_ads__campaign
  • Input Column: 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp[id]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • campaign_id: Directly mapped and renamed
190. model.reddit_ads.reddit_ads__ad_group_report
  • Input Column: 206. model.reddit_ads_source.stg_reddit_ads__campaign[campaign_id]
    • Integration used as the key to join the campaigns table with the ad_groups table
    • Direct directly selected in the final output
    • Output Columns:
      • campaign_id: directly copied to the output
191. model.reddit_ads.reddit_ads__ad_report
  • Input Column: 206. model.reddit_ads_source.stg_reddit_ads__campaign[campaign_id]
    • Integration Used as a key to join with the ads table
    • Direct Directly included in the output
    • Output Columns:
      • campaign_id: Directly copied to the output
192. model.reddit_ads.reddit_ads__campaign_report
  • Input Column: 206. model.reddit_ads_source.stg_reddit_ads__campaign[campaign_id]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as a key to join with the report table
    • Output Columns:
      • campaign_id: Directly copied to the output
193. model.reddit_ads.reddit_ads__url_report
  • Input Column: 206. model.reddit_ads_source.stg_reddit_ads__campaign[campaign_id]
    • Integration used as the key to join with the ads table
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
Column Lineage
%3 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp account_id 206. model.reddit_ads_source.stg_reddit_ads__campaign 206. model.reddit_ads_source.stg_reddit_ads__campaign account_id 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp:f0->206. model.reddit_ads_source.stg_reddit_ads__campaign:f0
206. model.reddit_ads_source.stg_reddit_ads__campaign
  • Input Column: 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp[account_id]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • account_id: Directly mapped
Column Lineage
%3 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp configured_status 206. model.reddit_ads_source.stg_reddit_ads__campaign 206. model.reddit_ads_source.stg_reddit_ads__campaign configured_status 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp:f0->206. model.reddit_ads_source.stg_reddit_ads__campaign:f0
206. model.reddit_ads_source.stg_reddit_ads__campaign
  • Input Column: 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp[configured_status]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • configured_status: Directly mapped
Column Lineage
%3 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp effective_status 206. model.reddit_ads_source.stg_reddit_ads__campaign 206. model.reddit_ads_source.stg_reddit_ads__campaign effective_status 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp:f0->206. model.reddit_ads_source.stg_reddit_ads__campaign:f0
206. model.reddit_ads_source.stg_reddit_ads__campaign
  • Input Column: 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp[effective_status]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • effective_status: Directly mapped
Column Lineage
%3 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp funding_instrument_id 206. model.reddit_ads_source.stg_reddit_ads__campaign 206. model.reddit_ads_source.stg_reddit_ads__campaign funding_instrument_id 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp:f0->206. model.reddit_ads_source.stg_reddit_ads__campaign:f0
206. model.reddit_ads_source.stg_reddit_ads__campaign
  • Input Column: 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp[funding_instrument_id]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • funding_instrument_id: Directly mapped
Column Lineage
%3 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp is_processing 206. model.reddit_ads_source.stg_reddit_ads__campaign 206. model.reddit_ads_source.stg_reddit_ads__campaign is_processing 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp:f0->206. model.reddit_ads_source.stg_reddit_ads__campaign:f0
206. model.reddit_ads_source.stg_reddit_ads__campaign
  • Input Column: 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp[is_processing]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as BOOLEAN
    • Output Columns:
      • is_processing: Directly mapped
Column Lineage
%3 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp name 206. model.reddit_ads_source.stg_reddit_ads__campaign 206. model.reddit_ads_source.stg_reddit_ads__campaign campaign_name 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp:f0->206. model.reddit_ads_source.stg_reddit_ads__campaign:f0 193. model.reddit_ads.reddit_ads__url_report 193. model.reddit_ads.reddit_ads__url_report campaign_name utm_campaign 206. model.reddit_ads_source.stg_reddit_ads__campaign:f0->193. model.reddit_ads.reddit_ads__url_report:f0 206. model.reddit_ads_source.stg_reddit_ads__campaign:f0->193. model.reddit_ads.reddit_ads__url_report:f1 191. model.reddit_ads.reddit_ads__ad_report 191. model.reddit_ads.reddit_ads__ad_report campaign_name 206. model.reddit_ads_source.stg_reddit_ads__campaign:f0->191. model.reddit_ads.reddit_ads__ad_report:f0 190. model.reddit_ads.reddit_ads__ad_group_report 190. model.reddit_ads.reddit_ads__ad_group_report campaign_name 206. model.reddit_ads_source.stg_reddit_ads__campaign:f0->190. model.reddit_ads.reddit_ads__ad_group_report:f0 192. model.reddit_ads.reddit_ads__campaign_report 192. model.reddit_ads.reddit_ads__campaign_report campaign_name 206. model.reddit_ads_source.stg_reddit_ads__campaign:f0->192. model.reddit_ads.reddit_ads__campaign_report:f0
206. model.reddit_ads_source.stg_reddit_ads__campaign
  • Input Column: 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp[name]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • campaign_name: Directly mapped and renamed
190. model.reddit_ads.reddit_ads__ad_group_report
  • Input Column: 206. model.reddit_ads_source.stg_reddit_ads__campaign[campaign_name]
    • Direct directly selected in the final output
    • Output Columns:
      • campaign_name: directly copied to the output
191. model.reddit_ads.reddit_ads__ad_report
  • Input Column: 206. model.reddit_ads_source.stg_reddit_ads__campaign[campaign_name]
    • Direct Directly included in the output
    • Output Columns:
      • campaign_name: Directly copied to the output
192. model.reddit_ads.reddit_ads__campaign_report
  • Input Column: 206. model.reddit_ads_source.stg_reddit_ads__campaign[campaign_name]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • campaign_name: Directly copied to the output
193. model.reddit_ads.reddit_ads__url_report
  • Input Column: 206. model.reddit_ads_source.stg_reddit_ads__campaign[campaign_name]
    • Direct directly copied to the output
    • Featurization used as a fallback value for utm_campaign
    • Output Columns:
      • campaign_name: directly copied
      • utm_campaign: used as fallback if not present in click_url
Column Lineage
%3 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp objective 206. model.reddit_ads_source.stg_reddit_ads__campaign 206. model.reddit_ads_source.stg_reddit_ads__campaign objective 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp:f0->206. model.reddit_ads_source.stg_reddit_ads__campaign:f0
206. model.reddit_ads_source.stg_reddit_ads__campaign
  • Input Column: 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp[objective]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • objective: Directly mapped
207. model.reddit_ads_source.stg_reddit_ads__campaign_report

This SQL query performs data type casting and minor transformations on the Reddit ads campaign report data. It starts by selecting all columns from a temporary staging table, then casts each column to a specific data type. The final select statement renames the 'date' column to 'date_day' and converts the 'spend' column from microseconds to seconds by dividing it by 1,000,000. The query also adds a 'source_relation' column, though it's set to an empty string.

CleaningFeaturization
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_reddit_ads_source.stg_reddit_ads__campaign_report_tmp
), fields AS (
  SELECT
    CAST(NULL AS TIMESTAMP) AS _fivetran_synced,
    CAST(NULL AS TEXT) AS account_id,
    CAST(NULL AS TEXT) AS campaign_id,
    CAST(NULL AS INT) AS clicks,
    CAST(NULL AS DATE) AS date,
    CAST(NULL AS INT) AS impressions,
    CAST(NULL AS TEXT) AS region,
    CAST(NULL AS INT) AS spend,
    CAST(NULL AS DATE) AS date_day,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    account_id,
    campaign_id,
    clicks,
    date AS date_day,
    impressions,
    region,
    (
      spend / 1000000
    ) AS spend
  FROM fields
)
SELECT
  *
FROM final
%3 207. model.reddit_ads_source.stg_reddit_ads__campaign_report 207. model.reddit_ads_source.stg_reddit_ads__campaign_report source_relation account_id campaign_id clicks date_day impressions region spend 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp account_id campaign_id date clicks impressions region spend 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp:f0->207. model.reddit_ads_source.stg_reddit_ads__campaign_report:f1 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp:f1->207. model.reddit_ads_source.stg_reddit_ads__campaign_report:f2 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp:f2->207. model.reddit_ads_source.stg_reddit_ads__campaign_report:f4 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp:f3->207. model.reddit_ads_source.stg_reddit_ads__campaign_report:f3 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp:f4->207. model.reddit_ads_source.stg_reddit_ads__campaign_report:f5 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp:f5->207. model.reddit_ads_source.stg_reddit_ads__campaign_report:f6 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp:f6->207. model.reddit_ads_source.stg_reddit_ads__campaign_report:f7
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
account_id bigint The ID representing the account.
campaign_id bigint The ID representing the campaign, if present in the source data.
clicks integer The count of clicks.
date_day date YYYY-MM-DD formatted date
impressions integer The count of impressions.
region integer The region (US state or UK country) targeted for the reports
spend integer Spend converted out of microcurrency (so Spend/1,000,000)
Column Lineage
%3 207. model.reddit_ads_source.stg_reddit_ads__campaign_report 207. model.reddit_ads_source.stg_reddit_ads__campaign_report source_relation 192. model.reddit_ads.reddit_ads__campaign_report 192. model.reddit_ads.reddit_ads__campaign_report source_relation 207. model.reddit_ads_source.stg_reddit_ads__campaign_report:f0->192. model.reddit_ads.reddit_ads__campaign_report:f0
192. model.reddit_ads.reddit_ads__campaign_report
  • Input Column: 207. model.reddit_ads_source.stg_reddit_ads__campaign_report[source_relation]
    • Direct The column is directly copied without transformation
    • Integration Used as part of the join condition with other tables
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
Column Lineage
%3 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp account_id 207. model.reddit_ads_source.stg_reddit_ads__campaign_report 207. model.reddit_ads_source.stg_reddit_ads__campaign_report account_id 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp:f0->207. model.reddit_ads_source.stg_reddit_ads__campaign_report:f0 192. model.reddit_ads.reddit_ads__campaign_report 192. model.reddit_ads.reddit_ads__campaign_report account_id 207. model.reddit_ads_source.stg_reddit_ads__campaign_report:f0->192. model.reddit_ads.reddit_ads__campaign_report:f0
207. model.reddit_ads_source.stg_reddit_ads__campaign_report
  • Input Column: 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp[account_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to TEXT data type
    • Output Columns:
      • account_id: Directly mapped
192. model.reddit_ads.reddit_ads__campaign_report
  • Input Column: 207. model.reddit_ads_source.stg_reddit_ads__campaign_report[account_id]
    • Direct The column is directly copied without transformation
    • Integration Used as a key to join with the accounts table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • account_id: Directly copied to the output
Column Lineage
%3 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp campaign_id 207. model.reddit_ads_source.stg_reddit_ads__campaign_report 207. model.reddit_ads_source.stg_reddit_ads__campaign_report campaign_id 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp:f0->207. model.reddit_ads_source.stg_reddit_ads__campaign_report:f0 192. model.reddit_ads.reddit_ads__campaign_report 192. model.reddit_ads.reddit_ads__campaign_report campaign_id 207. model.reddit_ads_source.stg_reddit_ads__campaign_report:f0->192. model.reddit_ads.reddit_ads__campaign_report:f0
207. model.reddit_ads_source.stg_reddit_ads__campaign_report
  • Input Column: 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp[campaign_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to TEXT data type
    • Output Columns:
      • campaign_id: Directly mapped
192. model.reddit_ads.reddit_ads__campaign_report
  • Input Column: 207. model.reddit_ads_source.stg_reddit_ads__campaign_report[campaign_id]
    • Direct The column is directly copied without transformation
    • Integration Used as a key to join with the campaigns table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • campaign_id: Directly copied to the output
Column Lineage
%3 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp clicks 207. model.reddit_ads_source.stg_reddit_ads__campaign_report 207. model.reddit_ads_source.stg_reddit_ads__campaign_report clicks 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp:f0->207. model.reddit_ads_source.stg_reddit_ads__campaign_report:f0 192. model.reddit_ads.reddit_ads__campaign_report 192. model.reddit_ads.reddit_ads__campaign_report clicks 207. model.reddit_ads_source.stg_reddit_ads__campaign_report:f0->192. model.reddit_ads.reddit_ads__campaign_report:f0
207. model.reddit_ads_source.stg_reddit_ads__campaign_report
  • Input Column: 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp[clicks]
    • Cleaning The column is cast to INT data type.
    • Output Columns:
      • clicks: Directly mapped after casting.
192. model.reddit_ads.reddit_ads__campaign_report
  • Input Column: 207. model.reddit_ads_source.stg_reddit_ads__campaign_report[clicks]
    • Aggregation The column is summed up in the SELECT statement
    • Output Columns:
      • clicks: Aggregated sum in the output
Column Lineage
%3 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp date 207. model.reddit_ads_source.stg_reddit_ads__campaign_report 207. model.reddit_ads_source.stg_reddit_ads__campaign_report date_day 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp:f0->207. model.reddit_ads_source.stg_reddit_ads__campaign_report:f0 192. model.reddit_ads.reddit_ads__campaign_report 192. model.reddit_ads.reddit_ads__campaign_report date_day 207. model.reddit_ads_source.stg_reddit_ads__campaign_report:f0->192. model.reddit_ads.reddit_ads__campaign_report:f0
207. model.reddit_ads_source.stg_reddit_ads__campaign_report
  • Input Column: 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp[date]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to DATE data type and renamed
    • Output Columns:
      • date_day: Directly mapped and renamed
192. model.reddit_ads.reddit_ads__campaign_report
  • Input Column: 207. model.reddit_ads_source.stg_reddit_ads__campaign_report[date_day]
    • Direct The column is directly copied without transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp impressions 207. model.reddit_ads_source.stg_reddit_ads__campaign_report 207. model.reddit_ads_source.stg_reddit_ads__campaign_report impressions 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp:f0->207. model.reddit_ads_source.stg_reddit_ads__campaign_report:f0 192. model.reddit_ads.reddit_ads__campaign_report 192. model.reddit_ads.reddit_ads__campaign_report impressions 207. model.reddit_ads_source.stg_reddit_ads__campaign_report:f0->192. model.reddit_ads.reddit_ads__campaign_report:f0
207. model.reddit_ads_source.stg_reddit_ads__campaign_report
  • Input Column: 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp[impressions]
    • Cleaning The column is cast to INT data type
    • Direct The column is directly copied after casting
    • Output Columns:
      • impressions: Directly mapped after casting to INT
192. model.reddit_ads.reddit_ads__campaign_report
  • Input Column: 207. model.reddit_ads_source.stg_reddit_ads__campaign_report[impressions]
    • Aggregation The column is summed up in the SELECT statement
    • Output Columns:
      • impressions: Aggregated sum in the output
Column Lineage
%3 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp region 207. model.reddit_ads_source.stg_reddit_ads__campaign_report 207. model.reddit_ads_source.stg_reddit_ads__campaign_report region 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp:f0->207. model.reddit_ads_source.stg_reddit_ads__campaign_report:f0
207. model.reddit_ads_source.stg_reddit_ads__campaign_report
  • Input Column: 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp[region]
    • Direct The region column is directly copied without any transformation
    • Output Columns:
      • region: Directly copied to the output 'region' column
Column Lineage
%3 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp spend 207. model.reddit_ads_source.stg_reddit_ads__campaign_report 207. model.reddit_ads_source.stg_reddit_ads__campaign_report spend 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp:f0->207. model.reddit_ads_source.stg_reddit_ads__campaign_report:f0 192. model.reddit_ads.reddit_ads__campaign_report 192. model.reddit_ads.reddit_ads__campaign_report spend 207. model.reddit_ads_source.stg_reddit_ads__campaign_report:f0->192. model.reddit_ads.reddit_ads__campaign_report:f0
207. model.reddit_ads_source.stg_reddit_ads__campaign_report
  • Input Column: 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp[spend]
    • Cleaning The spend column is cleaned by casting to INT and then divided by 1,000,000 to convert from microseconds to seconds
    • Output Columns:
      • spend: Transformed and mapped to the output 'spend' column
192. model.reddit_ads.reddit_ads__campaign_report
  • Input Column: 207. model.reddit_ads_source.stg_reddit_ads__campaign_report[spend]
    • Aggregation The column is summed up in the SELECT statement
    • Output Columns:
      • spend: Aggregated sum in the output
208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of TEXT data type. It's likely used as a placeholder or template for a staging table in a dbt (data build tool) project, specifically for Reddit ads campaign reporting.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp account_id campaign_id date _fivetran_synced app_install_metrics_add_payment_info app_install_metrics_add_to_cart app_install_metrics_app_launch app_install_metrics_completed_tutorial app_install_metrics_install app_install_metrics_level_achieved app_install_metrics_purchase app_install_metrics_search app_install_metrics_sign_up app_install_metrics_spend app_install_metrics_spend_credits app_install_metrics_view_content clicks comment_downvotes comment_upvotes comments_page_views conversion_roas cpc ctr ecpm gallery_item_caption gallery_item_id impressions legacy_click_conversions_attribution_window_day legacy_click_conversions_attribution_window_month legacy_click_conversions_attribution_window_week legacy_view_conversions_attribution_window_day legacy_view_conversions_attribution_window_month legacy_view_conversions_attribution_window_week priority region spend video_fully_viewable_impressions video_plays_expanded video_plays_with_sound video_started video_viewable_impressions video_watched_100_percent video_watched_10_seconds video_watched_25_percent video_watched_3_seconds video_watched_50_percent video_watched_5_seconds video_watched_75_percent video_watched_95_percent viewable_impressions viewer_comments 350. source.reddit_ads_source.reddit_ads.campaign_report 350. source.reddit_ads_source.reddit_ads.campaign_report
Name Type Comment
account_id bigint None
campaign_id bigint None
date date None
_fivetran_synced timestamp without time zone None
app_install_metrics_add_payment_info integer None
app_install_metrics_add_to_cart integer None
app_install_metrics_app_launch integer None
app_install_metrics_completed_tutorial integer None
app_install_metrics_install integer None
app_install_metrics_level_achieved integer None
app_install_metrics_purchase integer None
app_install_metrics_search integer None
app_install_metrics_sign_up integer None
app_install_metrics_spend integer None
app_install_metrics_spend_credits integer None
app_install_metrics_view_content integer None
clicks integer None
comment_downvotes integer None
comment_upvotes integer None
comments_page_views integer None
conversion_roas integer None
cpc double precision None
ctr double precision None
ecpm double precision None
gallery_item_caption integer None
gallery_item_id integer None
impressions integer None
legacy_click_conversions_attribution_window_day integer None
legacy_click_conversions_attribution_window_month integer None
legacy_click_conversions_attribution_window_week integer None
legacy_view_conversions_attribution_window_day integer None
legacy_view_conversions_attribution_window_month integer None
legacy_view_conversions_attribution_window_week integer None
priority integer None
region integer None
spend integer None
video_fully_viewable_impressions integer None
video_plays_expanded integer None
video_plays_with_sound integer None
video_started integer None
video_viewable_impressions integer None
video_watched_100_percent integer None
video_watched_10_seconds integer None
video_watched_25_percent integer None
video_watched_3_seconds integer None
video_watched_50_percent integer None
video_watched_5_seconds integer None
video_watched_75_percent integer None
video_watched_95_percent integer None
viewable_impressions integer None
viewer_comments integer None
Column Lineage
%3 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp account_id 207. model.reddit_ads_source.stg_reddit_ads__campaign_report 207. model.reddit_ads_source.stg_reddit_ads__campaign_report account_id 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp:f0->207. model.reddit_ads_source.stg_reddit_ads__campaign_report:f0 192. model.reddit_ads.reddit_ads__campaign_report 192. model.reddit_ads.reddit_ads__campaign_report account_id 207. model.reddit_ads_source.stg_reddit_ads__campaign_report:f0->192. model.reddit_ads.reddit_ads__campaign_report:f0
207. model.reddit_ads_source.stg_reddit_ads__campaign_report
  • Input Column: 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp[account_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to TEXT data type
    • Output Columns:
      • account_id: Directly mapped
192. model.reddit_ads.reddit_ads__campaign_report
  • Input Column: 207. model.reddit_ads_source.stg_reddit_ads__campaign_report[account_id]
    • Direct The column is directly copied without transformation
    • Integration Used as a key to join with the accounts table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • account_id: Directly copied to the output
Column Lineage
%3 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp campaign_id 207. model.reddit_ads_source.stg_reddit_ads__campaign_report 207. model.reddit_ads_source.stg_reddit_ads__campaign_report campaign_id 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp:f0->207. model.reddit_ads_source.stg_reddit_ads__campaign_report:f0 192. model.reddit_ads.reddit_ads__campaign_report 192. model.reddit_ads.reddit_ads__campaign_report campaign_id 207. model.reddit_ads_source.stg_reddit_ads__campaign_report:f0->192. model.reddit_ads.reddit_ads__campaign_report:f0
207. model.reddit_ads_source.stg_reddit_ads__campaign_report
  • Input Column: 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp[campaign_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to TEXT data type
    • Output Columns:
      • campaign_id: Directly mapped
192. model.reddit_ads.reddit_ads__campaign_report
  • Input Column: 207. model.reddit_ads_source.stg_reddit_ads__campaign_report[campaign_id]
    • Direct The column is directly copied without transformation
    • Integration Used as a key to join with the campaigns table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • campaign_id: Directly copied to the output
Column Lineage
%3 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp date 207. model.reddit_ads_source.stg_reddit_ads__campaign_report 207. model.reddit_ads_source.stg_reddit_ads__campaign_report date_day 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp:f0->207. model.reddit_ads_source.stg_reddit_ads__campaign_report:f0 192. model.reddit_ads.reddit_ads__campaign_report 192. model.reddit_ads.reddit_ads__campaign_report date_day 207. model.reddit_ads_source.stg_reddit_ads__campaign_report:f0->192. model.reddit_ads.reddit_ads__campaign_report:f0
207. model.reddit_ads_source.stg_reddit_ads__campaign_report
  • Input Column: 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp[date]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to DATE data type and renamed
    • Output Columns:
      • date_day: Directly mapped and renamed
192. model.reddit_ads.reddit_ads__campaign_report
  • Input Column: 207. model.reddit_ads_source.stg_reddit_ads__campaign_report[date_day]
    • Direct The column is directly copied without transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp clicks 207. model.reddit_ads_source.stg_reddit_ads__campaign_report 207. model.reddit_ads_source.stg_reddit_ads__campaign_report clicks 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp:f0->207. model.reddit_ads_source.stg_reddit_ads__campaign_report:f0 192. model.reddit_ads.reddit_ads__campaign_report 192. model.reddit_ads.reddit_ads__campaign_report clicks 207. model.reddit_ads_source.stg_reddit_ads__campaign_report:f0->192. model.reddit_ads.reddit_ads__campaign_report:f0
207. model.reddit_ads_source.stg_reddit_ads__campaign_report
  • Input Column: 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp[clicks]
    • Cleaning The column is cast to INT data type.
    • Output Columns:
      • clicks: Directly mapped after casting.
192. model.reddit_ads.reddit_ads__campaign_report
  • Input Column: 207. model.reddit_ads_source.stg_reddit_ads__campaign_report[clicks]
    • Aggregation The column is summed up in the SELECT statement
    • Output Columns:
      • clicks: Aggregated sum in the output
Column Lineage
%3 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp impressions 207. model.reddit_ads_source.stg_reddit_ads__campaign_report 207. model.reddit_ads_source.stg_reddit_ads__campaign_report impressions 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp:f0->207. model.reddit_ads_source.stg_reddit_ads__campaign_report:f0 192. model.reddit_ads.reddit_ads__campaign_report 192. model.reddit_ads.reddit_ads__campaign_report impressions 207. model.reddit_ads_source.stg_reddit_ads__campaign_report:f0->192. model.reddit_ads.reddit_ads__campaign_report:f0
207. model.reddit_ads_source.stg_reddit_ads__campaign_report
  • Input Column: 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp[impressions]
    • Cleaning The column is cast to INT data type
    • Direct The column is directly copied after casting
    • Output Columns:
      • impressions: Directly mapped after casting to INT
192. model.reddit_ads.reddit_ads__campaign_report
  • Input Column: 207. model.reddit_ads_source.stg_reddit_ads__campaign_report[impressions]
    • Aggregation The column is summed up in the SELECT statement
    • Output Columns:
      • impressions: Aggregated sum in the output
Column Lineage
%3 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp region 207. model.reddit_ads_source.stg_reddit_ads__campaign_report 207. model.reddit_ads_source.stg_reddit_ads__campaign_report region 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp:f0->207. model.reddit_ads_source.stg_reddit_ads__campaign_report:f0
207. model.reddit_ads_source.stg_reddit_ads__campaign_report
  • Input Column: 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp[region]
    • Direct The region column is directly copied without any transformation
    • Output Columns:
      • region: Directly copied to the output 'region' column
Column Lineage
%3 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp spend 207. model.reddit_ads_source.stg_reddit_ads__campaign_report 207. model.reddit_ads_source.stg_reddit_ads__campaign_report spend 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp:f0->207. model.reddit_ads_source.stg_reddit_ads__campaign_report:f0 192. model.reddit_ads.reddit_ads__campaign_report 192. model.reddit_ads.reddit_ads__campaign_report spend 207. model.reddit_ads_source.stg_reddit_ads__campaign_report:f0->192. model.reddit_ads.reddit_ads__campaign_report:f0
207. model.reddit_ads_source.stg_reddit_ads__campaign_report
  • Input Column: 208. model.reddit_ads_source.stg_reddit_ads__campaign_report_tmp[spend]
    • Cleaning The spend column is cleaned by casting to INT and then divided by 1,000,000 to convert from microseconds to seconds
    • Output Columns:
      • spend: Transformed and mapped to the output 'spend' column
192. model.reddit_ads.reddit_ads__campaign_report
  • Input Column: 207. model.reddit_ads_source.stg_reddit_ads__campaign_report[spend]
    • Aggregation The column is summed up in the SELECT statement
    • Output Columns:
      • spend: Aggregated sum in the output
209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp

This SQL query creates a temporary table with a single column named '_dbt_source_relation' of type TEXT, initialized with NULL values. The LIMIT 0 clause ensures that no rows are actually returned, effectively creating an empty table structure.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp id _fivetran_synced account_id configured_status effective_status funding_instrument_id is_processing name objective 349. source.reddit_ads_source.reddit_ads.campaign 349. source.reddit_ads_source.reddit_ads.campaign
Name Type Comment
id bigint None
_fivetran_synced timestamp without time zone None
account_id bigint None
configured_status text None
effective_status text None
funding_instrument_id integer None
is_processing boolean None
name text None
objective text None
Column Lineage
%3 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp id 206. model.reddit_ads_source.stg_reddit_ads__campaign 206. model.reddit_ads_source.stg_reddit_ads__campaign campaign_id 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp:f0->206. model.reddit_ads_source.stg_reddit_ads__campaign:f0 193. model.reddit_ads.reddit_ads__url_report 193. model.reddit_ads.reddit_ads__url_report campaign_id 206. model.reddit_ads_source.stg_reddit_ads__campaign:f0->193. model.reddit_ads.reddit_ads__url_report:f0 191. model.reddit_ads.reddit_ads__ad_report 191. model.reddit_ads.reddit_ads__ad_report campaign_id 206. model.reddit_ads_source.stg_reddit_ads__campaign:f0->191. model.reddit_ads.reddit_ads__ad_report:f0 190. model.reddit_ads.reddit_ads__ad_group_report 190. model.reddit_ads.reddit_ads__ad_group_report campaign_id 206. model.reddit_ads_source.stg_reddit_ads__campaign:f0->190. model.reddit_ads.reddit_ads__ad_group_report:f0 192. model.reddit_ads.reddit_ads__campaign_report 192. model.reddit_ads.reddit_ads__campaign_report campaign_id 206. model.reddit_ads_source.stg_reddit_ads__campaign:f0->192. model.reddit_ads.reddit_ads__campaign_report:f0
206. model.reddit_ads_source.stg_reddit_ads__campaign
  • Input Column: 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp[id]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • campaign_id: Directly mapped and renamed
190. model.reddit_ads.reddit_ads__ad_group_report
  • Input Column: 206. model.reddit_ads_source.stg_reddit_ads__campaign[campaign_id]
    • Integration used as the key to join the campaigns table with the ad_groups table
    • Direct directly selected in the final output
    • Output Columns:
      • campaign_id: directly copied to the output
191. model.reddit_ads.reddit_ads__ad_report
  • Input Column: 206. model.reddit_ads_source.stg_reddit_ads__campaign[campaign_id]
    • Integration Used as a key to join with the ads table
    • Direct Directly included in the output
    • Output Columns:
      • campaign_id: Directly copied to the output
192. model.reddit_ads.reddit_ads__campaign_report
  • Input Column: 206. model.reddit_ads_source.stg_reddit_ads__campaign[campaign_id]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as a key to join with the report table
    • Output Columns:
      • campaign_id: Directly copied to the output
193. model.reddit_ads.reddit_ads__url_report
  • Input Column: 206. model.reddit_ads_source.stg_reddit_ads__campaign[campaign_id]
    • Integration used as the key to join with the ads table
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
Column Lineage
%3 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp account_id 206. model.reddit_ads_source.stg_reddit_ads__campaign 206. model.reddit_ads_source.stg_reddit_ads__campaign account_id 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp:f0->206. model.reddit_ads_source.stg_reddit_ads__campaign:f0
206. model.reddit_ads_source.stg_reddit_ads__campaign
  • Input Column: 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp[account_id]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • account_id: Directly mapped
Column Lineage
%3 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp configured_status 206. model.reddit_ads_source.stg_reddit_ads__campaign 206. model.reddit_ads_source.stg_reddit_ads__campaign configured_status 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp:f0->206. model.reddit_ads_source.stg_reddit_ads__campaign:f0
206. model.reddit_ads_source.stg_reddit_ads__campaign
  • Input Column: 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp[configured_status]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • configured_status: Directly mapped
Column Lineage
%3 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp effective_status 206. model.reddit_ads_source.stg_reddit_ads__campaign 206. model.reddit_ads_source.stg_reddit_ads__campaign effective_status 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp:f0->206. model.reddit_ads_source.stg_reddit_ads__campaign:f0
206. model.reddit_ads_source.stg_reddit_ads__campaign
  • Input Column: 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp[effective_status]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • effective_status: Directly mapped
Column Lineage
%3 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp funding_instrument_id 206. model.reddit_ads_source.stg_reddit_ads__campaign 206. model.reddit_ads_source.stg_reddit_ads__campaign funding_instrument_id 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp:f0->206. model.reddit_ads_source.stg_reddit_ads__campaign:f0
206. model.reddit_ads_source.stg_reddit_ads__campaign
  • Input Column: 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp[funding_instrument_id]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • funding_instrument_id: Directly mapped
Column Lineage
%3 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp is_processing 206. model.reddit_ads_source.stg_reddit_ads__campaign 206. model.reddit_ads_source.stg_reddit_ads__campaign is_processing 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp:f0->206. model.reddit_ads_source.stg_reddit_ads__campaign:f0
206. model.reddit_ads_source.stg_reddit_ads__campaign
  • Input Column: 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp[is_processing]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as BOOLEAN
    • Output Columns:
      • is_processing: Directly mapped
Column Lineage
%3 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp name 206. model.reddit_ads_source.stg_reddit_ads__campaign 206. model.reddit_ads_source.stg_reddit_ads__campaign campaign_name 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp:f0->206. model.reddit_ads_source.stg_reddit_ads__campaign:f0 193. model.reddit_ads.reddit_ads__url_report 193. model.reddit_ads.reddit_ads__url_report campaign_name utm_campaign 206. model.reddit_ads_source.stg_reddit_ads__campaign:f0->193. model.reddit_ads.reddit_ads__url_report:f0 206. model.reddit_ads_source.stg_reddit_ads__campaign:f0->193. model.reddit_ads.reddit_ads__url_report:f1 191. model.reddit_ads.reddit_ads__ad_report 191. model.reddit_ads.reddit_ads__ad_report campaign_name 206. model.reddit_ads_source.stg_reddit_ads__campaign:f0->191. model.reddit_ads.reddit_ads__ad_report:f0 190. model.reddit_ads.reddit_ads__ad_group_report 190. model.reddit_ads.reddit_ads__ad_group_report campaign_name 206. model.reddit_ads_source.stg_reddit_ads__campaign:f0->190. model.reddit_ads.reddit_ads__ad_group_report:f0 192. model.reddit_ads.reddit_ads__campaign_report 192. model.reddit_ads.reddit_ads__campaign_report campaign_name 206. model.reddit_ads_source.stg_reddit_ads__campaign:f0->192. model.reddit_ads.reddit_ads__campaign_report:f0
206. model.reddit_ads_source.stg_reddit_ads__campaign
  • Input Column: 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp[name]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • campaign_name: Directly mapped and renamed
190. model.reddit_ads.reddit_ads__ad_group_report
  • Input Column: 206. model.reddit_ads_source.stg_reddit_ads__campaign[campaign_name]
    • Direct directly selected in the final output
    • Output Columns:
      • campaign_name: directly copied to the output
191. model.reddit_ads.reddit_ads__ad_report
  • Input Column: 206. model.reddit_ads_source.stg_reddit_ads__campaign[campaign_name]
    • Direct Directly included in the output
    • Output Columns:
      • campaign_name: Directly copied to the output
192. model.reddit_ads.reddit_ads__campaign_report
  • Input Column: 206. model.reddit_ads_source.stg_reddit_ads__campaign[campaign_name]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • campaign_name: Directly copied to the output
193. model.reddit_ads.reddit_ads__url_report
  • Input Column: 206. model.reddit_ads_source.stg_reddit_ads__campaign[campaign_name]
    • Direct directly copied to the output
    • Featurization used as a fallback value for utm_campaign
    • Output Columns:
      • campaign_name: directly copied
      • utm_campaign: used as fallback if not present in click_url
Column Lineage
%3 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp objective 206. model.reddit_ads_source.stg_reddit_ads__campaign 206. model.reddit_ads_source.stg_reddit_ads__campaign objective 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp:f0->206. model.reddit_ads_source.stg_reddit_ads__campaign:f0
206. model.reddit_ads_source.stg_reddit_ads__campaign
  • Input Column: 209. model.reddit_ads_source.stg_reddit_ads__campaign_tmp[objective]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • objective: Directly mapped
210. model.snapchat_ads.snapchat_ads__account_report

This SQL query aggregates Snapchat ad performance data at the account level. It joins several tables (ad_hourly, ads, ad_squads, campaigns, and account) to combine ad performance metrics with account information. The query filters for the most recent records in the history tables, aggregates metrics like swipes, impressions, and spend by date, account ID, account name, and currency. The result is a daily summary of ad performance for each Snapchat ad account.

FilteringIntegrationAggregation
SQL Query
WITH ad_hourly AS (
  SELECT
    *
  FROM TEST.PUBLIC_snapchat_ads_source.stg_snapchat_ads__ad_hourly_report
), account AS (
  SELECT
    *
  FROM TEST.PUBLIC_snapchat_ads_source.stg_snapchat_ads__ad_account_history
  WHERE
    is_most_recent_record = TRUE
), ads AS (
  SELECT
    *
  FROM TEST.PUBLIC_snapchat_ads_source.stg_snapchat_ads__ad_history
  WHERE
    is_most_recent_record = TRUE
), ad_squads AS (
  SELECT
    *
  FROM TEST.PUBLIC_snapchat_ads_source.stg_snapchat_ads__ad_squad_history
  WHERE
    is_most_recent_record = TRUE
), campaigns AS (
  SELECT
    *
  FROM TEST.PUBLIC_snapchat_ads_source.stg_snapchat_ads__campaign_history
  WHERE
    is_most_recent_record = TRUE
), aggregated AS (
  SELECT
    ad_hourly.source_relation,
    CAST(ad_hourly.date_hour AS DATE) AS date_day,
    account.ad_account_id,
    account.ad_account_name,
    account.currency,
    SUM(ad_hourly.swipes) AS swipes,
    SUM(ad_hourly.impressions) AS impressions,
    ROUND(SUM(ad_hourly.spend), 2) AS spend
  FROM ad_hourly
  LEFT JOIN ads
    ON ad_hourly.ad_id = ads.ad_id AND ad_hourly.source_relation = ads.source_relation
  LEFT JOIN ad_squads
    ON ads.ad_squad_id = ad_squads.ad_squad_id
    AND ads.source_relation = ad_squads.source_relation
  LEFT JOIN campaigns
    ON ad_squads.campaign_id = campaigns.campaign_id
    AND ad_squads.source_relation = campaigns.source_relation
  LEFT JOIN account
    ON campaigns.ad_account_id = account.ad_account_id
    AND campaigns.source_relation = account.source_relation
  GROUP BY
    1,
    2,
    3,
    4,
    5
)
SELECT
  *
FROM aggregated
%3 210. model.snapchat_ads.snapchat_ads__account_report 210. model.snapchat_ads.snapchat_ads__account_report source_relation date_day ad_account_id ad_account_name currency spend impressions swipes 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history source_relation ad_account_id ad_account_name currency 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f0->210. model.snapchat_ads.snapchat_ads__account_report:f0 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f1->210. model.snapchat_ads.snapchat_ads__account_report:f2 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f2->210. model.snapchat_ads.snapchat_ads__account_report:f3 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f3->210. model.snapchat_ads.snapchat_ads__account_report:f4 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history source_relation 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history:f0->210. model.snapchat_ads.snapchat_ads__account_report:f0 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report source_relation date_hour impressions spend swipes 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f0->210. model.snapchat_ads.snapchat_ads__account_report:f0 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f1->210. model.snapchat_ads.snapchat_ads__account_report:f1 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f2->210. model.snapchat_ads.snapchat_ads__account_report:f6 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f3->210. model.snapchat_ads.snapchat_ads__account_report:f5 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f4->210. model.snapchat_ads.snapchat_ads__account_report:f7 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history source_relation 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history:f0->210. model.snapchat_ads.snapchat_ads__account_report:f0 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history source_relation 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history:f0->210. model.snapchat_ads.snapchat_ads__account_report:f0
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
date_day date The date of the report.
ad_account_id text The ID of the account in Snapchat.
ad_account_name text The name of the account in Snapchat.
currency text The current used by the account in Snapchat.
spend numeric The spend on the ad in the given day.
impressions bigint The number of impressions the ad had on the given day.
swipes bigint The number of swipes the ad had on the given day.
Column Lineage
%3 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history source_relation 210. model.snapchat_ads.snapchat_ads__account_report 210. model.snapchat_ads.snapchat_ads__account_report source_relation 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f0->210. model.snapchat_ads.snapchat_ads__account_report:f0 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history source_relation 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history:f0->210. model.snapchat_ads.snapchat_ads__account_report:f0 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report source_relation 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f0->210. model.snapchat_ads.snapchat_ads__account_report:f0 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history source_relation 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history:f0->210. model.snapchat_ads.snapchat_ads__account_report:f0 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history source_relation 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history:f0->210. model.snapchat_ads.snapchat_ads__account_report:f0
210. model.snapchat_ads.snapchat_ads__account_report
  • Input Column: 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history[source_relation]
    • Integration Used to join with other tables
    • Direct Directly copied to the output
    • Output Columns:
      • source_relation: Directly copied
  • Input Column: 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history[source_relation]
    • Integration Used to join with other tables
    • Direct Directly selected in the final output
    • Output Columns:
      • source_relation: Directly copied to the output
  • Input Column: 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report[source_relation]
    • Direct The column is directly copied without any transformation
    • Aggregation The column is grouped by in the final aggregation
    • Output Columns:
      • source_relation: Directly copied to the output
  • Input Column: 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct copied directly to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history[source_relation]
    • Integration used to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
Column Lineage
%3 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report date_hour 210. model.snapchat_ads.snapchat_ads__account_report 210. model.snapchat_ads.snapchat_ads__account_report date_day 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f0->210. model.snapchat_ads.snapchat_ads__account_report:f0 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp date 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp:f0->220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f0
220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report
  • Input Column: 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp[date]
    • Cleaning The column is cast to TIMESTAMP data type
    • Output Columns:
      • date_hour: Directly copied after casting
210. model.snapchat_ads.snapchat_ads__account_report
  • Input Column: 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report[date_hour]
    • Cleaning The column is cast to DATE type
    • Aggregation The resulting date is grouped by in the final aggregation
    • Output Columns:
      • date_day: Transformed and mapped to this output column
Column Lineage
%3 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history ad_account_id 210. model.snapchat_ads.snapchat_ads__account_report 210. model.snapchat_ads.snapchat_ads__account_report ad_account_id 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f0->210. model.snapchat_ads.snapchat_ads__account_report:f0 217. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history_tmp 217. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history_tmp id 217. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history_tmp:f0->216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f0
216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history
  • Input Column: 217. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history_tmp[id]
    • Direct The column is directly copied to the output
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Cleaning Cast as TEXT in the fields CTE
    • Output Columns:
      • ad_account_id: Directly mapped and renamed
210. model.snapchat_ads.snapchat_ads__account_report
  • Input Column: 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history[ad_account_id]
    • Integration Used to join with other tables
    • Direct Directly copied to the output
    • Output Columns:
      • ad_account_id: Directly copied
Column Lineage
%3 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history ad_account_name 210. model.snapchat_ads.snapchat_ads__account_report 210. model.snapchat_ads.snapchat_ads__account_report ad_account_name 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f0->210. model.snapchat_ads.snapchat_ads__account_report:f0 217. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history_tmp 217. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history_tmp name 217. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history_tmp:f0->216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f0
216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history
  • Input Column: 217. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history_tmp[name]
    • Direct The column is directly copied to the output
    • Cleaning Cast as TEXT in the fields CTE
    • Output Columns:
      • ad_account_name: Directly mapped and renamed
210. model.snapchat_ads.snapchat_ads__account_report
  • Input Column: 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history[ad_account_name]
    • Direct Directly copied to the output
    • Output Columns:
      • ad_account_name: Directly copied
Column Lineage
%3 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history currency 210. model.snapchat_ads.snapchat_ads__account_report 210. model.snapchat_ads.snapchat_ads__account_report currency 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f0->210. model.snapchat_ads.snapchat_ads__account_report:f0
210. model.snapchat_ads.snapchat_ads__account_report
  • Input Column: 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history[currency]
    • Direct Directly copied to the output
    • Output Columns:
      • currency: Directly copied
Column Lineage
%3 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report spend 210. model.snapchat_ads.snapchat_ads__account_report 210. model.snapchat_ads.snapchat_ads__account_report spend 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f0->210. model.snapchat_ads.snapchat_ads__account_report:f0 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp spend 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp:f0->220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f0
220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report
  • Input Column: 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp[spend]
    • Cleaning The column is cast to DECIMAL(28, 6) data type
    • Other The value is divided by 1,000,000 to convert from micros
    • Output Columns:
      • spend: Transformed by dividing by 1,000,000
210. model.snapchat_ads.snapchat_ads__account_report
  • Input Column: 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report[spend]
    • Aggregation The column is summed up in the aggregated CTE
    • Cleaning The summed value is rounded to 2 decimal places
    • Output Columns:
      • spend: Summed up, rounded, and mapped to the output 'spend' column
Column Lineage
%3 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report impressions 210. model.snapchat_ads.snapchat_ads__account_report 210. model.snapchat_ads.snapchat_ads__account_report impressions 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f0->210. model.snapchat_ads.snapchat_ads__account_report:f0 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp impressions 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp:f0->220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f0
220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report
  • Input Column: 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp[impressions]
    • Cleaning The column is cast to DECIMAL(28, 6) data type
    • Output Columns:
      • impressions: Directly copied after casting
210. model.snapchat_ads.snapchat_ads__account_report
  • Input Column: 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report[impressions]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • impressions: Summed up and directly mapped to the output 'impressions' column
Column Lineage
%3 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report swipes 210. model.snapchat_ads.snapchat_ads__account_report 210. model.snapchat_ads.snapchat_ads__account_report swipes 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f0->210. model.snapchat_ads.snapchat_ads__account_report:f0 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp swipes 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp:f0->220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f0
220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report
  • Input Column: 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp[swipes]
    • Cleaning The column is cast to DECIMAL(28, 6) data type
    • Output Columns:
      • swipes: Directly copied after casting
210. model.snapchat_ads.snapchat_ads__account_report
  • Input Column: 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report[swipes]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • swipes: Summed up and directly mapped to the output 'swipes' column
211. model.snapchat_ads.snapchat_ads__ad_report

This SQL query combines data from multiple Snapchat Ads-related tables to create a comprehensive ad performance report. It processes creative history, URL tags, ad hourly reports, ad account information, and ad history. The query cleans and standardizes URL-related data, extracts UTM parameters, joins various tables to integrate information, and finally aggregates daily ad performance metrics such as swipes, impressions, and spend.

FilteringCleaningFeaturizationIntegrationAggregation
SQL Query
WITH __dbt__cte__snapchat_ads__creative_history_prep AS (
  WITH base AS (
    SELECT
      *
    FROM TEST.PUBLIC_snapchat_ads_source.stg_snapchat_ads__creative_history
    WHERE
      is_most_recent_record = TRUE
  ), url_tags AS (
    SELECT
      *
    FROM TEST.PUBLIC_snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history
    WHERE
      is_most_recent_record = TRUE
  ), url_tags_pivoted AS (
    SELECT
      source_relation,
      creative_id,
      MIN(CASE WHEN param_key = 'utm_source' THEN param_value END) AS utm_source,
      MIN(CASE WHEN param_key = 'utm_medium' THEN param_value END) AS utm_medium,
      MIN(CASE WHEN param_key = 'utm_campaign' THEN param_value END) AS utm_campaign,
      MIN(CASE WHEN param_key = 'utm_content' THEN param_value END) AS utm_content,
      MIN(CASE WHEN param_key = 'utm_term' THEN param_value END) AS utm_term
    FROM url_tags
    GROUP BY
      1,
      2
  ), fields AS (
    SELECT
      base.source_relation,
      base.creative_id,
      base.ad_account_id,
      base.creative_name,
      base.url,
      SPLIT_PART(base.url, '?', 1) AS base_url,
      TRY_CAST(SPLIT_PART(
        SPLIT_PART(
          REPLACE(REPLACE(REPLACE(base.url, 'android-app://', ''), 'http://', ''), 'https://', ''),
          '/',
          1
        ),
        '?',
        1
      ) AS TEXT) AS url_host,
      '/' || TRY_CAST(SPLIT_PART(
        CASE
          WHEN LENGTH(REPLACE(REPLACE(base.url, 'http://', ''), 'https://', '')) - COALESCE(
            NULLIF(STR_POSITION(REPLACE(REPLACE(base.url, 'http://', ''), 'https://', ''), '/'), 0),
            STR_POSITION(REPLACE(REPLACE(base.url, 'http://', ''), 'https://', ''), '?') - 1
          ) = 0
          THEN ''
          ELSE RIGHT(
            REPLACE(REPLACE(base.url, 'http://', ''), 'https://', ''),
            LENGTH(REPLACE(REPLACE(base.url, 'http://', ''), 'https://', '')) - COALESCE(
              NULLIF(STR_POSITION(REPLACE(REPLACE(base.url, 'http://', ''), 'https://', ''), '/'), 0),
              STR_POSITION(REPLACE(REPLACE(base.url, 'http://', ''), 'https://', ''), '?') - 1
            )
          )
        END,
        '?',
        1
      ) AS TEXT) AS url_path,
      COALESCE(
        url_tags_pivoted.utm_source,
        NULLIF(SPLIT_PART(SPLIT_PART(base.url, 'utm_source=', 2), '&', 1), '')
      ) AS utm_source,
      COALESCE(
        url_tags_pivoted.utm_medium,
        NULLIF(SPLIT_PART(SPLIT_PART(base.url, 'utm_medium=', 2), '&', 1), '')
      ) AS utm_medium,
      COALESCE(
        url_tags_pivoted.utm_campaign,
        NULLIF(SPLIT_PART(SPLIT_PART(base.url, 'utm_campaign=', 2), '&', 1), '')
      ) AS utm_campaign,
      COALESCE(
        url_tags_pivoted.utm_content,
        NULLIF(SPLIT_PART(SPLIT_PART(base.url, 'utm_content=', 2), '&', 1), '')
      ) AS utm_content,
      COALESCE(
        url_tags_pivoted.utm_term,
        NULLIF(SPLIT_PART(SPLIT_PART(base.url, 'utm_term=', 2), '&', 1), '')
      ) AS utm_term
    FROM base
    LEFT JOIN url_tags_pivoted
      ON base.creative_id = url_tags_pivoted.creative_id
      AND base.source_relation = url_tags_pivoted.source_relation
  )
  SELECT
    *
  FROM fields
), ad_hourly AS (
  SELECT
    *
  FROM TEST.PUBLIC_snapchat_ads_source.stg_snapchat_ads__ad_hourly_report
), creatives AS (
  SELECT
    *
  FROM __dbt__cte__snapchat_ads__creative_history_prep
), account AS (
  SELECT
    *
  FROM TEST.PUBLIC_snapchat_ads_source.stg_snapchat_ads__ad_account_history
  WHERE
    is_most_recent_record = TRUE
), ads AS (
  SELECT
    *
  FROM TEST.PUBLIC_snapchat_ads_source.stg_snapchat_ads__ad_history
  WHERE
    is_most_recent_record = TRUE
), aggregated AS (
  SELECT
    ad_hourly.source_relation,
    CAST(ad_hourly.date_hour AS DATE) AS date_day,
    account.ad_account_id,
    account.ad_account_name,
    ad_hourly.ad_id,
    ads.ad_name,
    account.currency,
    SUM(ad_hourly.swipes) AS swipes,
    SUM(ad_hourly.impressions) AS impressions,
    ROUND(SUM(ad_hourly.spend), 2) AS spend
  FROM ad_hourly
  LEFT JOIN ads
    ON ad_hourly.ad_id = ads.ad_id AND ad_hourly.source_relation = ads.source_relation
  LEFT JOIN creatives
    ON ads.creative_id = creatives.creative_id
    AND ads.source_relation = creatives.source_relation
  LEFT JOIN account
    ON creatives.ad_account_id = account.ad_account_id
    AND creatives.source_relation = account.source_relation
  GROUP BY
    1,
    2,
    3,
    4,
    5,
    6,
    7
)
SELECT
  *
FROM aggregated
%3 211. model.snapchat_ads.snapchat_ads__ad_report 211. model.snapchat_ads.snapchat_ads__ad_report source_relation date_day ad_id ad_account_id ad_account_name ad_name currency spend impressions swipes 214. model.snapchat_ads.snapchat_ads__creative_history_prep 214. model.snapchat_ads.snapchat_ads__creative_history_prep 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history source_relation ad_account_id ad_account_name currency 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f0->211. model.snapchat_ads.snapchat_ads__ad_report:f0 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f1->211. model.snapchat_ads.snapchat_ads__ad_report:f3 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f2->211. model.snapchat_ads.snapchat_ads__ad_report:f4 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f3->211. model.snapchat_ads.snapchat_ads__ad_report:f6 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history source_relation ad_id ad_name 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history:f0->211. model.snapchat_ads.snapchat_ads__ad_report:f0 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history:f1->211. model.snapchat_ads.snapchat_ads__ad_report:f2 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history:f2->211. model.snapchat_ads.snapchat_ads__ad_report:f5 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report source_relation ad_id date_hour impressions spend swipes 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f0->211. model.snapchat_ads.snapchat_ads__ad_report:f0 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f1->211. model.snapchat_ads.snapchat_ads__ad_report:f2 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f2->211. model.snapchat_ads.snapchat_ads__ad_report:f1 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f3->211. model.snapchat_ads.snapchat_ads__ad_report:f8 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f4->211. model.snapchat_ads.snapchat_ads__ad_report:f7 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f5->211. model.snapchat_ads.snapchat_ads__ad_report:f9
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
date_day date The date of the report.
ad_id text The ID of the ad in Snapchat.
ad_account_id text The ID of the account in Snapchat.
ad_account_name text The name of the account in Snapchat.
ad_name text The name of the ad in Snapchat.
currency text The current used by the account in Snapchat.
spend numeric The spend on the ad in the given day.
impressions bigint The number of impressions the ad had on the given day.
swipes bigint The number of swipes the ad had on the given day.
Column Lineage
%3 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history source_relation 211. model.snapchat_ads.snapchat_ads__ad_report 211. model.snapchat_ads.snapchat_ads__ad_report source_relation 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f0->211. model.snapchat_ads.snapchat_ads__ad_report:f0 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history source_relation 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history:f0->211. model.snapchat_ads.snapchat_ads__ad_report:f0 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report source_relation 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f0->211. model.snapchat_ads.snapchat_ads__ad_report:f0
211. model.snapchat_ads.snapchat_ads__ad_report
  • Input Column: 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history[source_relation]
    • Integration used to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history[source_relation]
    • Integration Used to join with other tables
    • Direct Directly copied to the output
    • Output Columns:
      • source_relation: Directly copied
  • Input Column: 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report[source_relation]
    • Direct The column is directly copied without transformation
    • Integration Used as part of the join condition with other tables
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
Column Lineage
%3 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report date_hour 211. model.snapchat_ads.snapchat_ads__ad_report 211. model.snapchat_ads.snapchat_ads__ad_report date_day 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f0->211. model.snapchat_ads.snapchat_ads__ad_report:f0 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp date 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp:f0->220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f0
220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report
  • Input Column: 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp[date]
    • Cleaning The column is cast to TIMESTAMP data type
    • Output Columns:
      • date_hour: Directly copied after casting
211. model.snapchat_ads.snapchat_ads__ad_report
  • Input Column: 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report[date_hour]
    • Cleaning Cast to DATE type
    • Aggregation Used in the GROUP BY clause after transformation
    • Output Columns:
      • date_day: Transformed to date and used in the output
Column Lineage
%3 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history ad_id 211. model.snapchat_ads.snapchat_ads__ad_report 211. model.snapchat_ads.snapchat_ads__ad_report ad_id 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history:f0->211. model.snapchat_ads.snapchat_ads__ad_report:f0 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report ad_id 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f0->211. model.snapchat_ads.snapchat_ads__ad_report:f0 219. model.snapchat_ads_source.stg_snapchat_ads__ad_history_tmp 219. model.snapchat_ads_source.stg_snapchat_ads__ad_history_tmp id 219. model.snapchat_ads_source.stg_snapchat_ads__ad_history_tmp:f0->218. model.snapchat_ads_source.stg_snapchat_ads__ad_history:f0 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp ad_id 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp:f0->220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f0
218. model.snapchat_ads_source.stg_snapchat_ads__ad_history
  • Input Column: 219. model.snapchat_ads_source.stg_snapchat_ads__ad_history_tmp[id]
    • Direct The column is directly copied without transformation
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • ad_id: Directly mapped and renamed
220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report
  • Input Column: 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp[ad_id]
    • Cleaning The column is cast to TEXT data type
    • Output Columns:
      • ad_id: Directly copied after casting
211. model.snapchat_ads.snapchat_ads__ad_report
  • Input Column: 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history[ad_id]
    • Integration Used as a key to join with ad_hourly table
    • Direct Directly copied to the output
    • Output Columns:
      • ad_id: Directly copied
  • Input Column: 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report[ad_id]
    • Direct The column is directly copied without transformation
    • Integration Used as the key to join with the ads table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • ad_id: Directly copied to the output
Column Lineage
%3 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history ad_account_id 211. model.snapchat_ads.snapchat_ads__ad_report 211. model.snapchat_ads.snapchat_ads__ad_report ad_account_id 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f0->211. model.snapchat_ads.snapchat_ads__ad_report:f0 217. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history_tmp 217. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history_tmp id 217. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history_tmp:f0->216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f0
216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history
  • Input Column: 217. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history_tmp[id]
    • Direct The column is directly copied to the output
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Cleaning Cast as TEXT in the fields CTE
    • Output Columns:
      • ad_account_id: Directly mapped and renamed
211. model.snapchat_ads.snapchat_ads__ad_report
  • Input Column: 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history[ad_account_id]
    • Integration used to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • ad_account_id: directly copied
Column Lineage
%3 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history ad_account_name 211. model.snapchat_ads.snapchat_ads__ad_report 211. model.snapchat_ads.snapchat_ads__ad_report ad_account_name 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f0->211. model.snapchat_ads.snapchat_ads__ad_report:f0 217. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history_tmp 217. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history_tmp name 217. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history_tmp:f0->216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f0
216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history
  • Input Column: 217. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history_tmp[name]
    • Direct The column is directly copied to the output
    • Cleaning Cast as TEXT in the fields CTE
    • Output Columns:
      • ad_account_name: Directly mapped and renamed
211. model.snapchat_ads.snapchat_ads__ad_report
  • Input Column: 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history[ad_account_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_account_name: directly copied
Column Lineage
%3 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history ad_name 211. model.snapchat_ads.snapchat_ads__ad_report 211. model.snapchat_ads.snapchat_ads__ad_report ad_name 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history:f0->211. model.snapchat_ads.snapchat_ads__ad_report:f0 219. model.snapchat_ads_source.stg_snapchat_ads__ad_history_tmp 219. model.snapchat_ads_source.stg_snapchat_ads__ad_history_tmp name 219. model.snapchat_ads_source.stg_snapchat_ads__ad_history_tmp:f0->218. model.snapchat_ads_source.stg_snapchat_ads__ad_history:f0
218. model.snapchat_ads_source.stg_snapchat_ads__ad_history
  • Input Column: 219. model.snapchat_ads_source.stg_snapchat_ads__ad_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • ad_name: Directly mapped and renamed
211. model.snapchat_ads.snapchat_ads__ad_report
  • Input Column: 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history[ad_name]
    • Direct Directly copied to the output
    • Output Columns:
      • ad_name: Directly copied
Column Lineage
%3 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history currency 211. model.snapchat_ads.snapchat_ads__ad_report 211. model.snapchat_ads.snapchat_ads__ad_report currency 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f0->211. model.snapchat_ads.snapchat_ads__ad_report:f0
211. model.snapchat_ads.snapchat_ads__ad_report
  • Input Column: 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history[currency]
    • Direct directly copied to the output
    • Output Columns:
      • currency: directly copied
Column Lineage
%3 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report spend 211. model.snapchat_ads.snapchat_ads__ad_report 211. model.snapchat_ads.snapchat_ads__ad_report spend 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f0->211. model.snapchat_ads.snapchat_ads__ad_report:f0 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp spend 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp:f0->220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f0
220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report
  • Input Column: 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp[spend]
    • Cleaning The column is cast to DECIMAL(28, 6) data type
    • Other The value is divided by 1,000,000 to convert from micros
    • Output Columns:
      • spend: Transformed by dividing by 1,000,000
211. model.snapchat_ads.snapchat_ads__ad_report
  • Input Column: 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report[spend]
    • Aggregation The column is summed up in the aggregated CTE
    • Cleaning The summed value is rounded to 2 decimal places
    • Output Columns:
      • spend: Summed up, rounded, and mapped to the output column
Column Lineage
%3 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report impressions 211. model.snapchat_ads.snapchat_ads__ad_report 211. model.snapchat_ads.snapchat_ads__ad_report impressions 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f0->211. model.snapchat_ads.snapchat_ads__ad_report:f0 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp impressions 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp:f0->220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f0
220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report
  • Input Column: 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp[impressions]
    • Cleaning The column is cast to DECIMAL(28, 6) data type
    • Output Columns:
      • impressions: Directly copied after casting
211. model.snapchat_ads.snapchat_ads__ad_report
  • Input Column: 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report[impressions]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • impressions: Summed up and directly mapped to the output column
Column Lineage
%3 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report swipes 211. model.snapchat_ads.snapchat_ads__ad_report 211. model.snapchat_ads.snapchat_ads__ad_report swipes 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f0->211. model.snapchat_ads.snapchat_ads__ad_report:f0 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp swipes 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp:f0->220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f0
220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report
  • Input Column: 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp[swipes]
    • Cleaning The column is cast to DECIMAL(28, 6) data type
    • Output Columns:
      • swipes: Directly copied after casting
211. model.snapchat_ads.snapchat_ads__ad_report
  • Input Column: 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report[swipes]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • swipes: Summed up and directly mapped to the output column
212. model.snapchat_ads.snapchat_ads__ad_squad_report

This SQL query combines data from multiple Snapchat advertising-related tables to create a comprehensive ad squad report. It joins ad squad hourly data with account, ad squad, and campaign information, filtering for the most recent records where applicable. The query then aggregates metrics such as swipes, impressions, and spend by date, account, campaign, and ad squad, providing a daily summary of ad performance across different organizational levels.

FilteringIntegrationAggregation
SQL Query
WITH ad_squad_hourly AS (
  SELECT
    *
  FROM TEST.PUBLIC_snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report
), account AS (
  SELECT
    *
  FROM TEST.PUBLIC_snapchat_ads_source.stg_snapchat_ads__ad_account_history
  WHERE
    is_most_recent_record = TRUE
), ad_squads AS (
  SELECT
    *
  FROM TEST.PUBLIC_snapchat_ads_source.stg_snapchat_ads__ad_squad_history
  WHERE
    is_most_recent_record = TRUE
), campaigns AS (
  SELECT
    *
  FROM TEST.PUBLIC_snapchat_ads_source.stg_snapchat_ads__campaign_history
  WHERE
    is_most_recent_record = TRUE
), aggregated AS (
  SELECT
    ad_squad_hourly.source_relation,
    CAST(ad_squad_hourly.date_hour AS DATE) AS date_day,
    account.ad_account_id,
    account.ad_account_name,
    campaigns.campaign_id,
    campaigns.campaign_name,
    ad_squad_hourly.ad_squad_id,
    ad_squads.ad_squad_name,
    account.currency,
    SUM(ad_squad_hourly.swipes) AS swipes,
    SUM(ad_squad_hourly.impressions) AS impressions,
    ROUND(SUM(ad_squad_hourly.spend), 2) AS spend
  FROM ad_squad_hourly
  LEFT JOIN ad_squads
    ON ad_squad_hourly.ad_squad_id = ad_squads.ad_squad_id
    AND ad_squad_hourly.source_relation = ad_squads.source_relation
  LEFT JOIN campaigns
    ON ad_squads.campaign_id = campaigns.campaign_id
    AND ad_squads.source_relation = campaigns.source_relation
  LEFT JOIN account
    ON campaigns.ad_account_id = account.ad_account_id
    AND campaigns.source_relation = account.source_relation
  GROUP BY
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9
)
SELECT
  *
FROM aggregated
%3 212. model.snapchat_ads.snapchat_ads__ad_squad_report 212. model.snapchat_ads.snapchat_ads__ad_squad_report source_relation date_day ad_squad_id ad_account_id ad_account_name campaign_id campaign_name ad_squad_name currency spend impressions swipes 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history source_relation ad_account_id ad_account_name currency 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f0->212. model.snapchat_ads.snapchat_ads__ad_squad_report:f0 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f1->212. model.snapchat_ads.snapchat_ads__ad_squad_report:f3 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f2->212. model.snapchat_ads.snapchat_ads__ad_squad_report:f4 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f3->212. model.snapchat_ads.snapchat_ads__ad_squad_report:f8 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history source_relation ad_squad_id ad_squad_name 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history:f0->212. model.snapchat_ads.snapchat_ads__ad_squad_report:f0 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history:f1->212. model.snapchat_ads.snapchat_ads__ad_squad_report:f2 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history:f2->212. model.snapchat_ads.snapchat_ads__ad_squad_report:f7 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report source_relation ad_squad_id date_hour impressions spend swipes 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f0->212. model.snapchat_ads.snapchat_ads__ad_squad_report:f0 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f1->212. model.snapchat_ads.snapchat_ads__ad_squad_report:f2 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f2->212. model.snapchat_ads.snapchat_ads__ad_squad_report:f1 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f3->212. model.snapchat_ads.snapchat_ads__ad_squad_report:f10 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f4->212. model.snapchat_ads.snapchat_ads__ad_squad_report:f9 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f5->212. model.snapchat_ads.snapchat_ads__ad_squad_report:f11 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history source_relation campaign_id campaign_name 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history:f0->212. model.snapchat_ads.snapchat_ads__ad_squad_report:f0 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history:f1->212. model.snapchat_ads.snapchat_ads__ad_squad_report:f5 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history:f2->212. model.snapchat_ads.snapchat_ads__ad_squad_report:f6
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
date_day date The date of the report.
ad_squad_id text The ID of the ad squad in Snapchat.
ad_account_id text The ID of the account in Snapchat.
ad_account_name text The name of the account in Snapchat.
campaign_id text The ID of the campaign in Snapchat.
campaign_name text The name of the campaign in Snapchat.
ad_squad_name text The name of the ad squad in Snapchat.
currency text The current used by the account in Snapchat.
spend numeric The spend on the ad in the given day.
impressions bigint The number of impressions the ad had on the given day.
swipes bigint The number of swipes the ad had on the given day.
Column Lineage
%3 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history source_relation 212. model.snapchat_ads.snapchat_ads__ad_squad_report 212. model.snapchat_ads.snapchat_ads__ad_squad_report source_relation 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f0->212. model.snapchat_ads.snapchat_ads__ad_squad_report:f0 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history source_relation 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history:f0->212. model.snapchat_ads.snapchat_ads__ad_squad_report:f0 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report source_relation 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f0->212. model.snapchat_ads.snapchat_ads__ad_squad_report:f0 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history source_relation 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history:f0->212. model.snapchat_ads.snapchat_ads__ad_squad_report:f0
212. model.snapchat_ads.snapchat_ads__ad_squad_report
  • Input Column: 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report[source_relation]
    • Direct The column is directly copied without any transformation
    • Aggregation The column is grouped by in the final aggregation
    • Output Columns:
      • source_relation: Directly copied to the output
  • Input Column: 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
Column Lineage
%3 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report date_hour 212. model.snapchat_ads.snapchat_ads__ad_squad_report 212. model.snapchat_ads.snapchat_ads__ad_squad_report date_day 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f0->212. model.snapchat_ads.snapchat_ads__ad_squad_report:f0 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp date 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp:f0->224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f0
224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report
  • Input Column: 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp[date]
    • Cleaning The column is cast as TIMESTAMP
    • Featurization Used to create the date_hour column
    • Output Columns:
      • date_hour: Mapped after casting to TIMESTAMP
212. model.snapchat_ads.snapchat_ads__ad_squad_report
  • Input Column: 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report[date_hour]
    • Cleaning The column is cast as DATE type
    • Aggregation The resulting date is grouped by in the final aggregation
    • Output Columns:
      • date_day: Transformed to date and used in the output
Column Lineage
%3 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history ad_squad_id 212. model.snapchat_ads.snapchat_ads__ad_squad_report 212. model.snapchat_ads.snapchat_ads__ad_squad_report ad_squad_id 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history:f0->212. model.snapchat_ads.snapchat_ads__ad_squad_report:f0 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report ad_squad_id 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f0->212. model.snapchat_ads.snapchat_ads__ad_squad_report:f0 223. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history_tmp 223. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history_tmp id 223. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history_tmp:f0->222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history:f0 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp ad_squad_id 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp:f0->224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f0
222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history
  • Input Column: 223. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history_tmp[id]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT in the fields CTE
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • ad_squad_id: Directly mapped and renamed
224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report
  • Input Column: 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp[ad_squad_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • ad_squad_id: Directly mapped after casting
212. model.snapchat_ads.snapchat_ads__ad_squad_report
  • Input Column: 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history[ad_squad_id]
    • Integration used as the key to join with ad_squad_hourly table
    • Direct directly copied to the output
    • Output Columns:
      • ad_squad_id: directly copied
  • Input Column: 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report[ad_squad_id]
    • Integration Used as a key to join with the ad_squads table
    • Aggregation The column is grouped by in the final aggregation
    • Output Columns:
      • ad_squad_id: Directly copied to the output
Column Lineage
%3 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history ad_account_id 212. model.snapchat_ads.snapchat_ads__ad_squad_report 212. model.snapchat_ads.snapchat_ads__ad_squad_report ad_account_id 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f0->212. model.snapchat_ads.snapchat_ads__ad_squad_report:f0 217. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history_tmp 217. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history_tmp id 217. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history_tmp:f0->216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f0
216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history
  • Input Column: 217. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history_tmp[id]
    • Direct The column is directly copied to the output
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Cleaning Cast as TEXT in the fields CTE
    • Output Columns:
      • ad_account_id: Directly mapped and renamed
212. model.snapchat_ads.snapchat_ads__ad_squad_report
  • Input Column: 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history[ad_account_id]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • ad_account_id: directly copied
Column Lineage
%3 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history ad_account_name 212. model.snapchat_ads.snapchat_ads__ad_squad_report 212. model.snapchat_ads.snapchat_ads__ad_squad_report ad_account_name 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f0->212. model.snapchat_ads.snapchat_ads__ad_squad_report:f0 217. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history_tmp 217. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history_tmp name 217. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history_tmp:f0->216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f0
216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history
  • Input Column: 217. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history_tmp[name]
    • Direct The column is directly copied to the output
    • Cleaning Cast as TEXT in the fields CTE
    • Output Columns:
      • ad_account_name: Directly mapped and renamed
212. model.snapchat_ads.snapchat_ads__ad_squad_report
  • Input Column: 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history[ad_account_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_account_name: directly copied
Column Lineage
%3 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history campaign_id 212. model.snapchat_ads.snapchat_ads__ad_squad_report 212. model.snapchat_ads.snapchat_ads__ad_squad_report campaign_id 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history:f0->212. model.snapchat_ads.snapchat_ads__ad_squad_report:f0 227. model.snapchat_ads_source.stg_snapchat_ads__campaign_history_tmp 227. model.snapchat_ads_source.stg_snapchat_ads__campaign_history_tmp id 227. model.snapchat_ads_source.stg_snapchat_ads__campaign_history_tmp:f0->226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history:f0
226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history
  • Input Column: 227. model.snapchat_ads_source.stg_snapchat_ads__campaign_history_tmp[id]
    • Direct The column is directly copied to the output
    • Cleaning The column is cast as TEXT in the fields CTE
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • campaign_id: Directly mapped and renamed
212. model.snapchat_ads.snapchat_ads__ad_squad_report
  • Input Column: 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history[campaign_id]
    • Integration used as part of the join condition with ad_squads table
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
Column Lineage
%3 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history campaign_name 212. model.snapchat_ads.snapchat_ads__ad_squad_report 212. model.snapchat_ads.snapchat_ads__ad_squad_report campaign_name 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history:f0->212. model.snapchat_ads.snapchat_ads__ad_squad_report:f0 227. model.snapchat_ads_source.stg_snapchat_ads__campaign_history_tmp 227. model.snapchat_ads_source.stg_snapchat_ads__campaign_history_tmp name 227. model.snapchat_ads_source.stg_snapchat_ads__campaign_history_tmp:f0->226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history:f0
226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history
  • Input Column: 227. model.snapchat_ads_source.stg_snapchat_ads__campaign_history_tmp[name]
    • Direct The column is directly copied to the output
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • campaign_name: Directly mapped and renamed
212. model.snapchat_ads.snapchat_ads__ad_squad_report
  • Input Column: 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history[campaign_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_name: directly copied
Column Lineage
%3 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history ad_squad_name 212. model.snapchat_ads.snapchat_ads__ad_squad_report 212. model.snapchat_ads.snapchat_ads__ad_squad_report ad_squad_name 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history:f0->212. model.snapchat_ads.snapchat_ads__ad_squad_report:f0 223. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history_tmp 223. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history_tmp name 223. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history_tmp:f0->222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history:f0
222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history
  • Input Column: 223. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • ad_squad_name: Directly mapped and renamed
212. model.snapchat_ads.snapchat_ads__ad_squad_report
  • Input Column: 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history[ad_squad_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_squad_name: directly copied
Column Lineage
%3 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history currency 212. model.snapchat_ads.snapchat_ads__ad_squad_report 212. model.snapchat_ads.snapchat_ads__ad_squad_report currency 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f0->212. model.snapchat_ads.snapchat_ads__ad_squad_report:f0
212. model.snapchat_ads.snapchat_ads__ad_squad_report
  • Input Column: 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history[currency]
    • Direct directly copied to the output
    • Output Columns:
      • currency: directly copied
Column Lineage
%3 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report spend 212. model.snapchat_ads.snapchat_ads__ad_squad_report 212. model.snapchat_ads.snapchat_ads__ad_squad_report spend 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f0->212. model.snapchat_ads.snapchat_ads__ad_squad_report:f0 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp spend 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp:f0->224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f0
224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report
  • Input Column: 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp[spend]
    • Cleaning The column is cast to INT and then divided by 1,000,000
    • Featurization The value is converted from micros to standard currency units
    • Output Columns:
      • spend: Transformed from micros to standard currency units
212. model.snapchat_ads.snapchat_ads__ad_squad_report
  • Input Column: 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report[spend]
    • Aggregation The column is summed up and rounded in the aggregated CTE
    • Cleaning The sum is rounded to 2 decimal places
    • Output Columns:
      • spend: Summed up and rounded in the final output
Column Lineage
%3 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report impressions 212. model.snapchat_ads.snapchat_ads__ad_squad_report 212. model.snapchat_ads.snapchat_ads__ad_squad_report impressions 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f0->212. model.snapchat_ads.snapchat_ads__ad_squad_report:f0 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp impressions 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp:f0->224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f0
224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report
  • Input Column: 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp[impressions]
    • Cleaning The column is cast to INT type
    • Direct The column is directly copied to the output
    • Output Columns:
      • impressions: Directly copied after casting to INT
212. model.snapchat_ads.snapchat_ads__ad_squad_report
  • Input Column: 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report[impressions]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • impressions: Summed up in the final output
Column Lineage
%3 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report swipes 212. model.snapchat_ads.snapchat_ads__ad_squad_report 212. model.snapchat_ads.snapchat_ads__ad_squad_report swipes 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f0->212. model.snapchat_ads.snapchat_ads__ad_squad_report:f0 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp swipes 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp:f0->224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f0
224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report
  • Input Column: 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp[swipes]
    • Cleaning The column is cast to INT
    • Direct The column is directly copied without transformation
    • Output Columns:
      • swipes: Directly copied after casting
212. model.snapchat_ads.snapchat_ads__ad_squad_report
  • Input Column: 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report[swipes]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • swipes: Summed up in the final output
213. model.snapchat_ads.snapchat_ads__campaign_report

This SQL query integrates data from three source tables (campaign hourly report, ad account history, and campaign history) to create a daily campaign performance report. It joins the tables, filters for the most recent records in the history tables, aggregates metrics like swipes, impressions, and spend on a daily basis, and includes relevant dimensional information such as account and campaign details.

FilteringIntegrationAggregation
SQL Query
WITH campaign_hourly AS (
  SELECT
    *
  FROM TEST.PUBLIC_snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report
), account AS (
  SELECT
    *
  FROM TEST.PUBLIC_snapchat_ads_source.stg_snapchat_ads__ad_account_history
  WHERE
    is_most_recent_record = TRUE
), campaigns AS (
  SELECT
    *
  FROM TEST.PUBLIC_snapchat_ads_source.stg_snapchat_ads__campaign_history
  WHERE
    is_most_recent_record = TRUE
), aggregated AS (
  SELECT
    campaign_hourly.source_relation,
    CAST(campaign_hourly.date_hour AS DATE) AS date_day,
    account.ad_account_id,
    account.ad_account_name,
    campaign_hourly.campaign_id,
    campaigns.campaign_name,
    account.currency,
    SUM(campaign_hourly.swipes) AS swipes,
    SUM(campaign_hourly.impressions) AS impressions,
    ROUND(SUM(campaign_hourly.spend), 2) AS spend
  FROM campaign_hourly
  LEFT JOIN campaigns
    ON campaign_hourly.campaign_id = campaigns.campaign_id
    AND campaign_hourly.source_relation = campaigns.source_relation
  LEFT JOIN account
    ON campaigns.ad_account_id = account.ad_account_id
    AND campaigns.source_relation = account.source_relation
  GROUP BY
    1,
    2,
    3,
    4,
    5,
    6,
    7
)
SELECT
  *
FROM aggregated
%3 213. model.snapchat_ads.snapchat_ads__campaign_report 213. model.snapchat_ads.snapchat_ads__campaign_report source_relation date_day campaign_id ad_account_id ad_account_name campaign_name currency spend impressions swipes 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history source_relation ad_account_id ad_account_name currency 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f0->213. model.snapchat_ads.snapchat_ads__campaign_report:f0 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f1->213. model.snapchat_ads.snapchat_ads__campaign_report:f3 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f2->213. model.snapchat_ads.snapchat_ads__campaign_report:f4 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f3->213. model.snapchat_ads.snapchat_ads__campaign_report:f6 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history source_relation campaign_id campaign_name 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history:f0->213. model.snapchat_ads.snapchat_ads__campaign_report:f0 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history:f1->213. model.snapchat_ads.snapchat_ads__campaign_report:f2 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history:f2->213. model.snapchat_ads.snapchat_ads__campaign_report:f5 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report source_relation campaign_id date_hour swipes impressions spend 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f0->213. model.snapchat_ads.snapchat_ads__campaign_report:f0 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f1->213. model.snapchat_ads.snapchat_ads__campaign_report:f2 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f2->213. model.snapchat_ads.snapchat_ads__campaign_report:f1 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f3->213. model.snapchat_ads.snapchat_ads__campaign_report:f9 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f4->213. model.snapchat_ads.snapchat_ads__campaign_report:f8 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f5->213. model.snapchat_ads.snapchat_ads__campaign_report:f7
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
date_day date The date of the report.
campaign_id text The ID of the campaign in Snapchat.
ad_account_id text The ID of the account in Snapchat.
ad_account_name text The name of the account in Snapchat.
campaign_name text The name of the campaign in Snapchat.
currency text The current used by the account in Snapchat.
spend numeric The spend on the ad in the given day.
impressions bigint The number of impressions the ad had on the given day.
swipes bigint The number of swipes the ad had on the given day.
Column Lineage
%3 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history source_relation 213. model.snapchat_ads.snapchat_ads__campaign_report 213. model.snapchat_ads.snapchat_ads__campaign_report source_relation 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f0->213. model.snapchat_ads.snapchat_ads__campaign_report:f0 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history source_relation 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history:f0->213. model.snapchat_ads.snapchat_ads__campaign_report:f0 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report source_relation 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f0->213. model.snapchat_ads.snapchat_ads__campaign_report:f0
213. model.snapchat_ads.snapchat_ads__campaign_report
  • Input Column: 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history[source_relation]
    • Integration used to join with other tables
    • Aggregation used in GROUP BY clause
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report[source_relation]
    • Direct The column is directly used without transformation
    • Integration Used as part of the join condition with other tables
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
Column Lineage
%3 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report date_hour 213. model.snapchat_ads.snapchat_ads__campaign_report 213. model.snapchat_ads.snapchat_ads__campaign_report date_day 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f0->213. model.snapchat_ads.snapchat_ads__campaign_report:f0 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp date 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp:f0->228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f0
228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report
  • Input Column: 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp[date]
    • Cleaning The column is cast as TIMESTAMP
    • Output Columns:
      • date_hour: Mapped after casting to TIMESTAMP
213. model.snapchat_ads.snapchat_ads__campaign_report
  • Input Column: 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report[date_hour]
    • Cleaning Cast to DATE type
    • Aggregation Used in the GROUP BY clause after casting
    • Output Columns:
      • date_day: Transformed to date and used in the output
Column Lineage
%3 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history campaign_id 213. model.snapchat_ads.snapchat_ads__campaign_report 213. model.snapchat_ads.snapchat_ads__campaign_report campaign_id 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history:f0->213. model.snapchat_ads.snapchat_ads__campaign_report:f0 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report campaign_id 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f0->213. model.snapchat_ads.snapchat_ads__campaign_report:f0 227. model.snapchat_ads_source.stg_snapchat_ads__campaign_history_tmp 227. model.snapchat_ads_source.stg_snapchat_ads__campaign_history_tmp id 227. model.snapchat_ads_source.stg_snapchat_ads__campaign_history_tmp:f0->226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history:f0 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp campaign_id 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp:f0->228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f0
226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history
  • Input Column: 227. model.snapchat_ads_source.stg_snapchat_ads__campaign_history_tmp[id]
    • Direct The column is directly copied to the output
    • Cleaning The column is cast as TEXT in the fields CTE
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • campaign_id: Directly mapped and renamed
228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report
  • Input Column: 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp[campaign_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • campaign_id: Directly mapped after casting
213. model.snapchat_ads.snapchat_ads__campaign_report
  • Input Column: 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history[campaign_id]
    • Integration used as the key to join with campaign_hourly table
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
  • Input Column: 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report[campaign_id]
    • Direct The column is directly used without transformation
    • Integration Used as a join key with the campaigns table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • campaign_id: Directly copied to the output
Column Lineage
%3 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history ad_account_id 213. model.snapchat_ads.snapchat_ads__campaign_report 213. model.snapchat_ads.snapchat_ads__campaign_report ad_account_id 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f0->213. model.snapchat_ads.snapchat_ads__campaign_report:f0 217. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history_tmp 217. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history_tmp id 217. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history_tmp:f0->216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f0
216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history
  • Input Column: 217. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history_tmp[id]
    • Direct The column is directly copied to the output
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Cleaning Cast as TEXT in the fields CTE
    • Output Columns:
      • ad_account_id: Directly mapped and renamed
213. model.snapchat_ads.snapchat_ads__campaign_report
  • Input Column: 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history[ad_account_id]
    • Integration used to join with campaigns table
    • Aggregation used in GROUP BY clause
    • Output Columns:
      • ad_account_id: directly copied
Column Lineage
%3 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history ad_account_name 213. model.snapchat_ads.snapchat_ads__campaign_report 213. model.snapchat_ads.snapchat_ads__campaign_report ad_account_name 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f0->213. model.snapchat_ads.snapchat_ads__campaign_report:f0 217. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history_tmp 217. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history_tmp name 217. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history_tmp:f0->216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f0
216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history
  • Input Column: 217. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history_tmp[name]
    • Direct The column is directly copied to the output
    • Cleaning Cast as TEXT in the fields CTE
    • Output Columns:
      • ad_account_name: Directly mapped and renamed
213. model.snapchat_ads.snapchat_ads__campaign_report
  • Input Column: 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history[ad_account_name]
    • Aggregation used in GROUP BY clause
    • Output Columns:
      • ad_account_name: directly copied
Column Lineage
%3 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history campaign_name 213. model.snapchat_ads.snapchat_ads__campaign_report 213. model.snapchat_ads.snapchat_ads__campaign_report campaign_name 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history:f0->213. model.snapchat_ads.snapchat_ads__campaign_report:f0 227. model.snapchat_ads_source.stg_snapchat_ads__campaign_history_tmp 227. model.snapchat_ads_source.stg_snapchat_ads__campaign_history_tmp name 227. model.snapchat_ads_source.stg_snapchat_ads__campaign_history_tmp:f0->226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history:f0
226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history
  • Input Column: 227. model.snapchat_ads_source.stg_snapchat_ads__campaign_history_tmp[name]
    • Direct The column is directly copied to the output
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • campaign_name: Directly mapped and renamed
213. model.snapchat_ads.snapchat_ads__campaign_report
  • Input Column: 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history[campaign_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_name: directly copied
Column Lineage
%3 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history currency 213. model.snapchat_ads.snapchat_ads__campaign_report 213. model.snapchat_ads.snapchat_ads__campaign_report currency 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f0->213. model.snapchat_ads.snapchat_ads__campaign_report:f0
213. model.snapchat_ads.snapchat_ads__campaign_report
  • Input Column: 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history[currency]
    • Aggregation used in GROUP BY clause
    • Output Columns:
      • currency: directly copied
Column Lineage
%3 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report spend 213. model.snapchat_ads.snapchat_ads__campaign_report 213. model.snapchat_ads.snapchat_ads__campaign_report spend 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f0->213. model.snapchat_ads.snapchat_ads__campaign_report:f0 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp spend 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp:f0->228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f0
228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report
  • Input Column: 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp[spend]
    • Cleaning The column is cast to INT and then divided by 1,000,000 to adjust the value
    • Output Columns:
      • spend: Transformed by dividing by 1,000,000
213. model.snapchat_ads.snapchat_ads__campaign_report
  • Input Column: 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report[spend]
    • Aggregation The column is summed up in the aggregated CTE
    • Cleaning The summed value is rounded to 2 decimal places
    • Output Columns:
      • spend: Summed up, rounded, and mapped to the output 'spend' column
Column Lineage
%3 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report impressions 213. model.snapchat_ads.snapchat_ads__campaign_report 213. model.snapchat_ads.snapchat_ads__campaign_report impressions 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f0->213. model.snapchat_ads.snapchat_ads__campaign_report:f0 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp impressions 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp:f0->228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f0
228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report
  • Input Column: 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp[impressions]
    • Cleaning The column is cast as INT in the fields CTE
    • Direct The column is directly copied to the output
    • Output Columns:
      • impressions: Directly copied after casting
213. model.snapchat_ads.snapchat_ads__campaign_report
  • Input Column: 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report[impressions]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • impressions: Summed up and directly mapped to the output 'impressions' column
Column Lineage
%3 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report swipes 213. model.snapchat_ads.snapchat_ads__campaign_report 213. model.snapchat_ads.snapchat_ads__campaign_report swipes 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f0->213. model.snapchat_ads.snapchat_ads__campaign_report:f0 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp swipes 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp:f0->228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f0
228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report
  • Input Column: 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp[swipes]
    • Cleaning The column is cast to INT
    • Output Columns:
      • swipes: Directly copied after casting
213. model.snapchat_ads.snapchat_ads__campaign_report
  • Input Column: 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report[swipes]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • swipes: Summed up and directly mapped to the output 'swipes' column
214. model.snapchat_ads.snapchat_ads__creative_history_prep

This SQL query processes Snapchat ad creative data. It starts by filtering for the most recent records from creative history and URL tag history. It then pivots the URL tag data to create columns for UTM parameters. The main part of the query extracts and cleans URL-related information from the creative data, including base URL, host, and path. It also combines UTM parameters from both the URL tags and the URL itself. Finally, it joins this processed data with the pivoted URL tag data to create a comprehensive view of each creative's URL and tracking information.

FilteringCleaningFeaturizationIntegrationAggregation
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_snapchat_ads_source.stg_snapchat_ads__creative_history
  WHERE
    is_most_recent_record = TRUE
), url_tags AS (
  SELECT
    *
  FROM TEST.PUBLIC_snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history
  WHERE
    is_most_recent_record = TRUE
), url_tags_pivoted AS (
  SELECT
    source_relation,
    creative_id,
    MIN(CASE WHEN param_key = 'utm_source' THEN param_value END) AS utm_source,
    MIN(CASE WHEN param_key = 'utm_medium' THEN param_value END) AS utm_medium,
    MIN(CASE WHEN param_key = 'utm_campaign' THEN param_value END) AS utm_campaign,
    MIN(CASE WHEN param_key = 'utm_content' THEN param_value END) AS utm_content,
    MIN(CASE WHEN param_key = 'utm_term' THEN param_value END) AS utm_term
  FROM url_tags
  GROUP BY
    1,
    2
), fields AS (
  SELECT
    base.source_relation,
    base.creative_id,
    base.ad_account_id,
    base.creative_name,
    base.url,
    SPLIT_PART(base.url, '?', 1) AS base_url,
    TRY_CAST(SPLIT_PART(
      SPLIT_PART(
        REPLACE(REPLACE(REPLACE(base.url, 'android-app://', ''), 'http://', ''), 'https://', ''),
        '/',
        1
      ),
      '?',
      1
    ) AS TEXT) AS url_host,
    '/' || TRY_CAST(SPLIT_PART(
      CASE
        WHEN LENGTH(REPLACE(REPLACE(base.url, 'http://', ''), 'https://', '')) - COALESCE(
          NULLIF(STR_POSITION(REPLACE(REPLACE(base.url, 'http://', ''), 'https://', ''), '/'), 0),
          STR_POSITION(REPLACE(REPLACE(base.url, 'http://', ''), 'https://', ''), '?') - 1
        ) = 0
        THEN ''
        ELSE RIGHT(
          REPLACE(REPLACE(base.url, 'http://', ''), 'https://', ''),
          LENGTH(REPLACE(REPLACE(base.url, 'http://', ''), 'https://', '')) - COALESCE(
            NULLIF(STR_POSITION(REPLACE(REPLACE(base.url, 'http://', ''), 'https://', ''), '/'), 0),
            STR_POSITION(REPLACE(REPLACE(base.url, 'http://', ''), 'https://', ''), '?') - 1
          )
        )
      END,
      '?',
      1
    ) AS TEXT) AS url_path,
    COALESCE(
      url_tags_pivoted.utm_source,
      NULLIF(SPLIT_PART(SPLIT_PART(base.url, 'utm_source=', 2), '&', 1), '')
    ) AS utm_source,
    COALESCE(
      url_tags_pivoted.utm_medium,
      NULLIF(SPLIT_PART(SPLIT_PART(base.url, 'utm_medium=', 2), '&', 1), '')
    ) AS utm_medium,
    COALESCE(
      url_tags_pivoted.utm_campaign,
      NULLIF(SPLIT_PART(SPLIT_PART(base.url, 'utm_campaign=', 2), '&', 1), '')
    ) AS utm_campaign,
    COALESCE(
      url_tags_pivoted.utm_content,
      NULLIF(SPLIT_PART(SPLIT_PART(base.url, 'utm_content=', 2), '&', 1), '')
    ) AS utm_content,
    COALESCE(
      url_tags_pivoted.utm_term,
      NULLIF(SPLIT_PART(SPLIT_PART(base.url, 'utm_term=', 2), '&', 1), '')
    ) AS utm_term
  FROM base
  LEFT JOIN url_tags_pivoted
    ON base.creative_id = url_tags_pivoted.creative_id
    AND base.source_relation = url_tags_pivoted.source_relation
)
SELECT
  *
FROM fields
%3 214. model.snapchat_ads.snapchat_ads__creative_history_prep 214. model.snapchat_ads.snapchat_ads__creative_history_prep 230. model.snapchat_ads_source.stg_snapchat_ads__creative_history 230. model.snapchat_ads_source.stg_snapchat_ads__creative_history 232. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history 232. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history
Name Type Comment
215. model.snapchat_ads.snapchat_ads__url_report

This SQL query creates a comprehensive report for Snapchat ads with URL tracking. It combines data from various sources including ad creatives, ad hourly reports, ad accounts, ad squads, and campaigns. The query extracts URL components and UTM parameters, joins this information with ad performance data, and aggregates metrics like swipes, impressions, and spend. The result is a detailed view of ad performance tied to specific URL and UTM parameter combinations, allowing for analysis of ad effectiveness across different campaigns, content, and targeting strategies.

FilteringCleaningFeaturizationIntegrationAggregation
SQL Query
WITH __dbt__cte__snapchat_ads__creative_history_prep AS (
  WITH base AS (
    SELECT
      *
    FROM TEST.PUBLIC_snapchat_ads_source.stg_snapchat_ads__creative_history
    WHERE
      is_most_recent_record = TRUE
  ), url_tags AS (
    SELECT
      *
    FROM TEST.PUBLIC_snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history
    WHERE
      is_most_recent_record = TRUE
  ), url_tags_pivoted AS (
    SELECT
      source_relation,
      creative_id,
      MIN(CASE WHEN param_key = 'utm_source' THEN param_value END) AS utm_source,
      MIN(CASE WHEN param_key = 'utm_medium' THEN param_value END) AS utm_medium,
      MIN(CASE WHEN param_key = 'utm_campaign' THEN param_value END) AS utm_campaign,
      MIN(CASE WHEN param_key = 'utm_content' THEN param_value END) AS utm_content,
      MIN(CASE WHEN param_key = 'utm_term' THEN param_value END) AS utm_term
    FROM url_tags
    GROUP BY
      1,
      2
  ), fields AS (
    SELECT
      base.source_relation,
      base.creative_id,
      base.ad_account_id,
      base.creative_name,
      base.url,
      SPLIT_PART(base.url, '?', 1) AS base_url,
      TRY_CAST(SPLIT_PART(
        SPLIT_PART(
          REPLACE(REPLACE(REPLACE(base.url, 'android-app://', ''), 'http://', ''), 'https://', ''),
          '/',
          1
        ),
        '?',
        1
      ) AS TEXT) AS url_host,
      '/' || TRY_CAST(SPLIT_PART(
        CASE
          WHEN LENGTH(REPLACE(REPLACE(base.url, 'http://', ''), 'https://', '')) - COALESCE(
            NULLIF(STR_POSITION(REPLACE(REPLACE(base.url, 'http://', ''), 'https://', ''), '/'), 0),
            STR_POSITION(REPLACE(REPLACE(base.url, 'http://', ''), 'https://', ''), '?') - 1
          ) = 0
          THEN ''
          ELSE RIGHT(
            REPLACE(REPLACE(base.url, 'http://', ''), 'https://', ''),
            LENGTH(REPLACE(REPLACE(base.url, 'http://', ''), 'https://', '')) - COALESCE(
              NULLIF(STR_POSITION(REPLACE(REPLACE(base.url, 'http://', ''), 'https://', ''), '/'), 0),
              STR_POSITION(REPLACE(REPLACE(base.url, 'http://', ''), 'https://', ''), '?') - 1
            )
          )
        END,
        '?',
        1
      ) AS TEXT) AS url_path,
      COALESCE(
        url_tags_pivoted.utm_source,
        NULLIF(SPLIT_PART(SPLIT_PART(base.url, 'utm_source=', 2), '&', 1), '')
      ) AS utm_source,
      COALESCE(
        url_tags_pivoted.utm_medium,
        NULLIF(SPLIT_PART(SPLIT_PART(base.url, 'utm_medium=', 2), '&', 1), '')
      ) AS utm_medium,
      COALESCE(
        url_tags_pivoted.utm_campaign,
        NULLIF(SPLIT_PART(SPLIT_PART(base.url, 'utm_campaign=', 2), '&', 1), '')
      ) AS utm_campaign,
      COALESCE(
        url_tags_pivoted.utm_content,
        NULLIF(SPLIT_PART(SPLIT_PART(base.url, 'utm_content=', 2), '&', 1), '')
      ) AS utm_content,
      COALESCE(
        url_tags_pivoted.utm_term,
        NULLIF(SPLIT_PART(SPLIT_PART(base.url, 'utm_term=', 2), '&', 1), '')
      ) AS utm_term
    FROM base
    LEFT JOIN url_tags_pivoted
      ON base.creative_id = url_tags_pivoted.creative_id
      AND base.source_relation = url_tags_pivoted.source_relation
  )
  SELECT
    *
  FROM fields
), ad_hourly AS (
  SELECT
    *
  FROM TEST.PUBLIC_snapchat_ads_source.stg_snapchat_ads__ad_hourly_report
), creatives AS (
  SELECT
    *
  FROM __dbt__cte__snapchat_ads__creative_history_prep
), account AS (
  SELECT
    *
  FROM TEST.PUBLIC_snapchat_ads_source.stg_snapchat_ads__ad_account_history
  WHERE
    is_most_recent_record = TRUE
), ads AS (
  SELECT
    *
  FROM TEST.PUBLIC_snapchat_ads_source.stg_snapchat_ads__ad_history
  WHERE
    is_most_recent_record = TRUE
), ad_squads AS (
  SELECT
    *
  FROM TEST.PUBLIC_snapchat_ads_source.stg_snapchat_ads__ad_squad_history
  WHERE
    is_most_recent_record = TRUE
), campaigns AS (
  SELECT
    *
  FROM TEST.PUBLIC_snapchat_ads_source.stg_snapchat_ads__campaign_history
  WHERE
    is_most_recent_record = TRUE
), aggregated AS (
  SELECT
    ad_hourly.source_relation,
    CAST(ad_hourly.date_hour AS DATE) AS date_day,
    account.ad_account_id,
    account.ad_account_name,
    ad_hourly.ad_id,
    ads.ad_name,
    ad_squads.ad_squad_id,
    ad_squads.ad_squad_name,
    campaigns.campaign_id,
    campaigns.campaign_name,
    account.currency,
    creatives.base_url,
    creatives.url_host,
    creatives.url_path,
    creatives.utm_source,
    creatives.utm_medium,
    creatives.utm_campaign,
    creatives.utm_content,
    creatives.utm_term,
    SUM(ad_hourly.swipes) AS swipes,
    SUM(ad_hourly.impressions) AS impressions,
    ROUND(SUM(ad_hourly.spend), 2) AS spend
  FROM ad_hourly
  LEFT JOIN ads
    ON ad_hourly.ad_id = ads.ad_id AND ad_hourly.source_relation = ads.source_relation
  LEFT JOIN creatives
    ON ads.creative_id = creatives.creative_id
    AND ads.source_relation = creatives.source_relation
  LEFT JOIN ad_squads
    ON ads.ad_squad_id = ad_squads.ad_squad_id
    AND ads.source_relation = ad_squads.source_relation
  LEFT JOIN campaigns
    ON ad_squads.campaign_id = campaigns.campaign_id
    AND ad_squads.source_relation = campaigns.source_relation
  LEFT JOIN account
    ON creatives.ad_account_id = account.ad_account_id
    AND creatives.source_relation = account.source_relation
  /* We only want utm ads to populate this report. Therefore, we filter where url ads are populated. */
  WHERE
    NOT creatives.url IS NULL
  GROUP BY
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10,
    11,
    12,
    13,
    14,
    15,
    16,
    17,
    18,
    19
)
SELECT
  *
FROM aggregated
%3 215. model.snapchat_ads.snapchat_ads__url_report 215. model.snapchat_ads.snapchat_ads__url_report source_relation date_day ad_id ad_squad_id campaign_id ad_account_id ad_account_name ad_name ad_squad_name campaign_name currency base_url url_host url_path utm_source utm_medium utm_campaign utm_content utm_term spend impressions swipes 214. model.snapchat_ads.snapchat_ads__creative_history_prep 214. model.snapchat_ads.snapchat_ads__creative_history_prep 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history source_relation ad_account_id ad_account_name currency 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f0->215. model.snapchat_ads.snapchat_ads__url_report:f0 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f1->215. model.snapchat_ads.snapchat_ads__url_report:f5 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f2->215. model.snapchat_ads.snapchat_ads__url_report:f6 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f3->215. model.snapchat_ads.snapchat_ads__url_report:f10 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history source_relation ad_id ad_name 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history:f0->215. model.snapchat_ads.snapchat_ads__url_report:f0 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history:f1->215. model.snapchat_ads.snapchat_ads__url_report:f2 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history:f2->215. model.snapchat_ads.snapchat_ads__url_report:f7 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report source_relation ad_id date_hour swipes impressions spend 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f0->215. model.snapchat_ads.snapchat_ads__url_report:f0 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f1->215. model.snapchat_ads.snapchat_ads__url_report:f2 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f2->215. model.snapchat_ads.snapchat_ads__url_report:f1 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f3->215. model.snapchat_ads.snapchat_ads__url_report:f21 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f4->215. model.snapchat_ads.snapchat_ads__url_report:f20 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f5->215. model.snapchat_ads.snapchat_ads__url_report:f19 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history source_relation ad_squad_id ad_squad_name campaign_id 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history:f0->215. model.snapchat_ads.snapchat_ads__url_report:f0 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history:f1->215. model.snapchat_ads.snapchat_ads__url_report:f3 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history:f2->215. model.snapchat_ads.snapchat_ads__url_report:f8 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history:f3->215. model.snapchat_ads.snapchat_ads__url_report:f4 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history source_relation campaign_id campaign_name 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history:f0->215. model.snapchat_ads.snapchat_ads__url_report:f0 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history:f1->215. model.snapchat_ads.snapchat_ads__url_report:f4 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history:f2->215. model.snapchat_ads.snapchat_ads__url_report:f9
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
date_day date The date of the report.
ad_id text The ID of the ad in Snapchat.
ad_squad_id text The ID of the ad squad in Snapchat.
campaign_id text The ID of the campaign in Snapchat.
ad_account_id text The ID of the account in Snapchat.
ad_account_name text The name of the account in Snapchat.
ad_name text The name of the ad in Snapchat.
ad_squad_name text The name of the ad squad in Snapchat.
campaign_name text The name of the campaign in Snapchat.
currency text The current used by the account in Snapchat.
base_url text The base URL of the ad, extracted from the web_view_url.
url_host text The URL host of the ad, extracted from the web_view_url.
url_path text The URL path of the ad, extracted from the web_view_url.
utm_source text The utm_source parameter of the ad, extracted from the web_view_url.
utm_medium text The utm_medium parameter of the ad, extracted from the web_view_url.
utm_campaign text The utm_campaign parameter of the ad, extracted from the web_view_url.
utm_content text The utm_content parameter of the ad, extracted from the web_view_url.
utm_term text The utm_term parameter of the ad, extracted from the web_view_url.
spend numeric The spend on the ad in the given day.
impressions bigint The number of impressions the ad had on the given day.
swipes bigint The number of swipes the ad had on the given day.
Column Lineage
%3 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history source_relation 215. model.snapchat_ads.snapchat_ads__url_report 215. model.snapchat_ads.snapchat_ads__url_report source_relation 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f0->215. model.snapchat_ads.snapchat_ads__url_report:f0 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history source_relation 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history:f0->215. model.snapchat_ads.snapchat_ads__url_report:f0 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report source_relation 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f0->215. model.snapchat_ads.snapchat_ads__url_report:f0 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history source_relation 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history:f0->215. model.snapchat_ads.snapchat_ads__url_report:f0 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history source_relation 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history:f0->215. model.snapchat_ads.snapchat_ads__url_report:f0
215. model.snapchat_ads.snapchat_ads__url_report
  • Input Column: 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Aggregation included in the GROUP BY clause
    • Output Columns:
      • source_relation: directly copied to the output
  • Input Column: 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history[source_relation]
    • Integration used to join with other tables
    • Direct copied to the output without transformation
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with other tables
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
  • Input Column: 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history[source_relation]
    • Integration Used as part of the join condition with other tables
    • Direct Directly included in the output
    • Output Columns:
      • source_relation: Directly copied to the output
  • Input Column: 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
Column Lineage
%3 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report date_hour 215. model.snapchat_ads.snapchat_ads__url_report 215. model.snapchat_ads.snapchat_ads__url_report date_day 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f0->215. model.snapchat_ads.snapchat_ads__url_report:f0 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp date 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp:f0->220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f0
220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report
  • Input Column: 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp[date]
    • Cleaning The column is cast to TIMESTAMP data type
    • Output Columns:
      • date_hour: Directly copied after casting
215. model.snapchat_ads.snapchat_ads__url_report
  • Input Column: 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report[date_hour]
    • Cleaning Cast to DATE type
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • date_day: Transformed to date_day in the output
Column Lineage
%3 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history ad_id 215. model.snapchat_ads.snapchat_ads__url_report 215. model.snapchat_ads.snapchat_ads__url_report ad_id 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history:f0->215. model.snapchat_ads.snapchat_ads__url_report:f0 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report ad_id 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f0->215. model.snapchat_ads.snapchat_ads__url_report:f0 219. model.snapchat_ads_source.stg_snapchat_ads__ad_history_tmp 219. model.snapchat_ads_source.stg_snapchat_ads__ad_history_tmp id 219. model.snapchat_ads_source.stg_snapchat_ads__ad_history_tmp:f0->218. model.snapchat_ads_source.stg_snapchat_ads__ad_history:f0 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp ad_id 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp:f0->220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f0
218. model.snapchat_ads_source.stg_snapchat_ads__ad_history
  • Input Column: 219. model.snapchat_ads_source.stg_snapchat_ads__ad_history_tmp[id]
    • Direct The column is directly copied without transformation
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • ad_id: Directly mapped and renamed
220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report
  • Input Column: 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp[ad_id]
    • Cleaning The column is cast to TEXT data type
    • Output Columns:
      • ad_id: Directly copied after casting
215. model.snapchat_ads.snapchat_ads__url_report
  • Input Column: 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history[ad_id]
    • Integration used to join with ad_hourly table
    • Direct copied to the output without transformation
    • Output Columns:
      • ad_id: directly copied
  • Input Column: 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report[ad_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as the key to join with the ads table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • ad_id: Directly copied to the output
Column Lineage
%3 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history ad_squad_id 215. model.snapchat_ads.snapchat_ads__url_report 215. model.snapchat_ads.snapchat_ads__url_report ad_squad_id 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history:f0->215. model.snapchat_ads.snapchat_ads__url_report:f0 223. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history_tmp 223. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history_tmp id 223. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history_tmp:f0->222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history:f0
222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history
  • Input Column: 223. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history_tmp[id]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT in the fields CTE
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • ad_squad_id: Directly mapped and renamed
215. model.snapchat_ads.snapchat_ads__url_report
  • Input Column: 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history[ad_squad_id]
    • Integration Used as join key with the ads table
    • Direct Directly included in the output
    • Output Columns:
      • ad_squad_id: Directly copied to the output
Column Lineage
%3 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history campaign_id 215. model.snapchat_ads.snapchat_ads__url_report 215. model.snapchat_ads.snapchat_ads__url_report campaign_id 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history:f0->215. model.snapchat_ads.snapchat_ads__url_report:f0 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history campaign_id 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history:f0->215. model.snapchat_ads.snapchat_ads__url_report:f0 223. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history_tmp 223. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history_tmp campaign_id 223. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history_tmp:f0->222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history:f0 227. model.snapchat_ads_source.stg_snapchat_ads__campaign_history_tmp 227. model.snapchat_ads_source.stg_snapchat_ads__campaign_history_tmp id 227. model.snapchat_ads_source.stg_snapchat_ads__campaign_history_tmp:f0->226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history:f0
222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history
  • Input Column: 223. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history_tmp[campaign_id]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • campaign_id: Directly mapped without renaming
226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history
  • Input Column: 227. model.snapchat_ads_source.stg_snapchat_ads__campaign_history_tmp[id]
    • Direct The column is directly copied to the output
    • Cleaning The column is cast as TEXT in the fields CTE
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • campaign_id: Directly mapped and renamed
215. model.snapchat_ads.snapchat_ads__url_report
  • Input Column: 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history[campaign_id]
    • Integration Used as join key with the campaigns table
    • Output Columns:
      • campaign_id: Indirectly mapped through join with campaigns table
  • Input Column: 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history[campaign_id]
    • Integration used as a join key with the ad_squads table
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
Column Lineage
%3 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history ad_account_id 215. model.snapchat_ads.snapchat_ads__url_report 215. model.snapchat_ads.snapchat_ads__url_report ad_account_id 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f0->215. model.snapchat_ads.snapchat_ads__url_report:f0 217. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history_tmp 217. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history_tmp id 217. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history_tmp:f0->216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f0
216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history
  • Input Column: 217. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history_tmp[id]
    • Direct The column is directly copied to the output
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Cleaning Cast as TEXT in the fields CTE
    • Output Columns:
      • ad_account_id: Directly mapped and renamed
215. model.snapchat_ads.snapchat_ads__url_report
  • Input Column: 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history[ad_account_id]
    • Integration used as part of the join condition with other tables
    • Aggregation included in the GROUP BY clause
    • Output Columns:
      • ad_account_id: directly copied to the output
Column Lineage
%3 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history ad_account_name 215. model.snapchat_ads.snapchat_ads__url_report 215. model.snapchat_ads.snapchat_ads__url_report ad_account_name 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f0->215. model.snapchat_ads.snapchat_ads__url_report:f0 217. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history_tmp 217. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history_tmp name 217. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history_tmp:f0->216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f0
216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history
  • Input Column: 217. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history_tmp[name]
    • Direct The column is directly copied to the output
    • Cleaning Cast as TEXT in the fields CTE
    • Output Columns:
      • ad_account_name: Directly mapped and renamed
215. model.snapchat_ads.snapchat_ads__url_report
  • Input Column: 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history[ad_account_name]
    • Aggregation included in the GROUP BY clause
    • Output Columns:
      • ad_account_name: directly copied to the output
Column Lineage
%3 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history ad_name 215. model.snapchat_ads.snapchat_ads__url_report 215. model.snapchat_ads.snapchat_ads__url_report ad_name 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history:f0->215. model.snapchat_ads.snapchat_ads__url_report:f0 219. model.snapchat_ads_source.stg_snapchat_ads__ad_history_tmp 219. model.snapchat_ads_source.stg_snapchat_ads__ad_history_tmp name 219. model.snapchat_ads_source.stg_snapchat_ads__ad_history_tmp:f0->218. model.snapchat_ads_source.stg_snapchat_ads__ad_history:f0
218. model.snapchat_ads_source.stg_snapchat_ads__ad_history
  • Input Column: 219. model.snapchat_ads_source.stg_snapchat_ads__ad_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • ad_name: Directly mapped and renamed
215. model.snapchat_ads.snapchat_ads__url_report
  • Input Column: 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history[ad_name]
    • Direct copied to the output without transformation
    • Output Columns:
      • ad_name: directly copied
Column Lineage
%3 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history ad_squad_name 215. model.snapchat_ads.snapchat_ads__url_report 215. model.snapchat_ads.snapchat_ads__url_report ad_squad_name 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history:f0->215. model.snapchat_ads.snapchat_ads__url_report:f0 223. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history_tmp 223. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history_tmp name 223. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history_tmp:f0->222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history:f0
222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history
  • Input Column: 223. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • ad_squad_name: Directly mapped and renamed
215. model.snapchat_ads.snapchat_ads__url_report
  • Input Column: 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history[ad_squad_name]
    • Direct Directly included in the output
    • Output Columns:
      • ad_squad_name: Directly copied to the output
Column Lineage
%3 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history campaign_name 215. model.snapchat_ads.snapchat_ads__url_report 215. model.snapchat_ads.snapchat_ads__url_report campaign_name 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history:f0->215. model.snapchat_ads.snapchat_ads__url_report:f0 227. model.snapchat_ads_source.stg_snapchat_ads__campaign_history_tmp 227. model.snapchat_ads_source.stg_snapchat_ads__campaign_history_tmp name 227. model.snapchat_ads_source.stg_snapchat_ads__campaign_history_tmp:f0->226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history:f0
226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history
  • Input Column: 227. model.snapchat_ads_source.stg_snapchat_ads__campaign_history_tmp[name]
    • Direct The column is directly copied to the output
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • campaign_name: Directly mapped and renamed
215. model.snapchat_ads.snapchat_ads__url_report
  • Input Column: 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history[campaign_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_name: directly copied
Column Lineage
%3 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history currency 215. model.snapchat_ads.snapchat_ads__url_report 215. model.snapchat_ads.snapchat_ads__url_report currency 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f0->215. model.snapchat_ads.snapchat_ads__url_report:f0
215. model.snapchat_ads.snapchat_ads__url_report
  • Input Column: 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history[currency]
    • Aggregation included in the GROUP BY clause
    • Output Columns:
      • currency: directly copied to the output
Column Lineage
%3 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report spend 215. model.snapchat_ads.snapchat_ads__url_report 215. model.snapchat_ads.snapchat_ads__url_report spend 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f0->215. model.snapchat_ads.snapchat_ads__url_report:f0 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp spend 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp:f0->220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f0
220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report
  • Input Column: 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp[spend]
    • Cleaning The column is cast to DECIMAL(28, 6) data type
    • Other The value is divided by 1,000,000 to convert from micros
    • Output Columns:
      • spend: Transformed by dividing by 1,000,000
215. model.snapchat_ads.snapchat_ads__url_report
  • Input Column: 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report[spend]
    • Aggregation This column is summed up in the aggregated CTE
    • Cleaning The sum is rounded to 2 decimal places
    • Output Columns:
      • spend: The sum of spend (rounded) is mapped to the output 'spend' column
Column Lineage
%3 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report impressions 215. model.snapchat_ads.snapchat_ads__url_report 215. model.snapchat_ads.snapchat_ads__url_report impressions 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f0->215. model.snapchat_ads.snapchat_ads__url_report:f0 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp impressions 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp:f0->220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f0
220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report
  • Input Column: 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp[impressions]
    • Cleaning The column is cast to DECIMAL(28, 6) data type
    • Output Columns:
      • impressions: Directly copied after casting
215. model.snapchat_ads.snapchat_ads__url_report
  • Input Column: 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report[impressions]
    • Aggregation This column is summed up in the aggregated CTE
    • Output Columns:
      • impressions: The sum of impressions is mapped to the output 'impressions' column
Column Lineage
%3 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report swipes 215. model.snapchat_ads.snapchat_ads__url_report 215. model.snapchat_ads.snapchat_ads__url_report swipes 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f0->215. model.snapchat_ads.snapchat_ads__url_report:f0 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp swipes 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp:f0->220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f0
220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report
  • Input Column: 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp[swipes]
    • Cleaning The column is cast to DECIMAL(28, 6) data type
    • Output Columns:
      • swipes: Directly copied after casting
215. model.snapchat_ads.snapchat_ads__url_report
  • Input Column: 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report[swipes]
    • Aggregation This column is summed up in the aggregated CTE
    • Output Columns:
      • swipes: The sum of swipes is mapped to the output 'swipes' column
216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history

This SQL query stages data from a Snapchat Ads source table, casting and renaming columns to create a standardized structure for ad account history. It includes type casting, column renaming, and adds a flag to identify the most recent record for each ad account. The query doesn't perform any filtering or aggregation but focuses on data cleaning and structuring.

CleaningDeduplication
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_snapchat_ads_source.stg_snapchat_ads__ad_account_history_tmp
), fields AS (
  SELECT
    CAST(NULL AS TIMESTAMP) AS _fivetran_synced,
    CAST(NULL AS TEXT) AS advertiser,
    CAST(NULL AS TIMESTAMP) AS created_at,
    CAST(NULL AS TEXT) AS currency,
    CAST(NULL AS TEXT) AS id,
    CAST(NULL AS TEXT) AS name,
    CAST(NULL AS TEXT) AS timezone,
    CAST(NULL AS TEXT) AS type,
    CAST(NULL AS TIMESTAMP) AS updated_at,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    id AS ad_account_id,
    name AS ad_account_name,
    CAST(created_at AS TIMESTAMP) AS created_at,
    advertiser,
    currency,
    timezone,
    CAST(_fivetran_synced AS TIMESTAMP) AS _fivetran_synced,
    CAST(updated_at AS TIMESTAMP) AS updated_at,
    ROW_NUMBER() OVER (PARTITION BY source_relation, id ORDER BY _fivetran_synced DESC) = 1 AS is_most_recent_record
  FROM fields
)
SELECT
  *
FROM final
%3 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history source_relation _fivetran_synced ad_account_id ad_account_name advertiser currency created_at updated_at timezone is_most_recent_record 217. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history_tmp 217. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history_tmp id name _fivetran_synced 217. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history_tmp:f0->216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f2 217. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history_tmp:f1->216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f3 217. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history_tmp:f2->216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f1
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
_fivetran_synced timestamp without time zone When the record was last synced by Fivetran.
ad_account_id text The ID of the account in Snapchat.
ad_account_name text The name of the account in Snapchat.
advertiser text Name of advertiser
currency text Currency used by account
created_at timestamp without time zone Created at timestamp
updated_at timestamp without time zone Timestamp of when the record was updated.
timezone text Account timezone
is_most_recent_record boolean Boolean representing whether a record is the most recent version of that record.
Column Lineage
%3 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history source_relation 211. model.snapchat_ads.snapchat_ads__ad_report 211. model.snapchat_ads.snapchat_ads__ad_report source_relation 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f0->211. model.snapchat_ads.snapchat_ads__ad_report:f0 215. model.snapchat_ads.snapchat_ads__url_report 215. model.snapchat_ads.snapchat_ads__url_report source_relation 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f0->215. model.snapchat_ads.snapchat_ads__url_report:f0 212. model.snapchat_ads.snapchat_ads__ad_squad_report 212. model.snapchat_ads.snapchat_ads__ad_squad_report source_relation 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f0->212. model.snapchat_ads.snapchat_ads__ad_squad_report:f0 210. model.snapchat_ads.snapchat_ads__account_report 210. model.snapchat_ads.snapchat_ads__account_report source_relation 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f0->210. model.snapchat_ads.snapchat_ads__account_report:f0 213. model.snapchat_ads.snapchat_ads__campaign_report 213. model.snapchat_ads.snapchat_ads__campaign_report source_relation 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f0->213. model.snapchat_ads.snapchat_ads__campaign_report:f0
210. model.snapchat_ads.snapchat_ads__account_report
  • Input Column: 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history[source_relation]
    • Integration Used to join with other tables
    • Direct Directly copied to the output
    • Output Columns:
      • source_relation: Directly copied
211. model.snapchat_ads.snapchat_ads__ad_report
  • Input Column: 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history[source_relation]
    • Integration used to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
212. model.snapchat_ads.snapchat_ads__ad_squad_report
  • Input Column: 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
213. model.snapchat_ads.snapchat_ads__campaign_report
  • Input Column: 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history[source_relation]
    • Integration used to join with other tables
    • Aggregation used in GROUP BY clause
    • Output Columns:
      • source_relation: directly copied
215. model.snapchat_ads.snapchat_ads__url_report
  • Input Column: 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Aggregation included in the GROUP BY clause
    • Output Columns:
      • source_relation: directly copied to the output
Column Lineage
%3 217. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history_tmp 217. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history_tmp _fivetran_synced 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history _fivetran_synced 217. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history_tmp:f0->216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f0
216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history
  • Input Column: 217. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history_tmp[_fivetran_synced]
    • Direct The column is directly copied to the output
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Cleaning Cast as TIMESTAMP in the fields CTE and final SELECT
    • Output Columns:
      • _fivetran_synced: Directly mapped after casting to TIMESTAMP
Column Lineage
%3 217. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history_tmp 217. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history_tmp id 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history ad_account_id 217. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history_tmp:f0->216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f0 211. model.snapchat_ads.snapchat_ads__ad_report 211. model.snapchat_ads.snapchat_ads__ad_report ad_account_id 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f0->211. model.snapchat_ads.snapchat_ads__ad_report:f0 215. model.snapchat_ads.snapchat_ads__url_report 215. model.snapchat_ads.snapchat_ads__url_report ad_account_id 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f0->215. model.snapchat_ads.snapchat_ads__url_report:f0 212. model.snapchat_ads.snapchat_ads__ad_squad_report 212. model.snapchat_ads.snapchat_ads__ad_squad_report ad_account_id 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f0->212. model.snapchat_ads.snapchat_ads__ad_squad_report:f0 210. model.snapchat_ads.snapchat_ads__account_report 210. model.snapchat_ads.snapchat_ads__account_report ad_account_id 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f0->210. model.snapchat_ads.snapchat_ads__account_report:f0 213. model.snapchat_ads.snapchat_ads__campaign_report 213. model.snapchat_ads.snapchat_ads__campaign_report ad_account_id 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f0->213. model.snapchat_ads.snapchat_ads__campaign_report:f0
216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history
  • Input Column: 217. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history_tmp[id]
    • Direct The column is directly copied to the output
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Cleaning Cast as TEXT in the fields CTE
    • Output Columns:
      • ad_account_id: Directly mapped and renamed
210. model.snapchat_ads.snapchat_ads__account_report
  • Input Column: 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history[ad_account_id]
    • Integration Used to join with other tables
    • Direct Directly copied to the output
    • Output Columns:
      • ad_account_id: Directly copied
211. model.snapchat_ads.snapchat_ads__ad_report
  • Input Column: 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history[ad_account_id]
    • Integration used to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • ad_account_id: directly copied
212. model.snapchat_ads.snapchat_ads__ad_squad_report
  • Input Column: 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history[ad_account_id]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • ad_account_id: directly copied
213. model.snapchat_ads.snapchat_ads__campaign_report
  • Input Column: 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history[ad_account_id]
    • Integration used to join with campaigns table
    • Aggregation used in GROUP BY clause
    • Output Columns:
      • ad_account_id: directly copied
215. model.snapchat_ads.snapchat_ads__url_report
  • Input Column: 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history[ad_account_id]
    • Integration used as part of the join condition with other tables
    • Aggregation included in the GROUP BY clause
    • Output Columns:
      • ad_account_id: directly copied to the output
Column Lineage
%3 217. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history_tmp 217. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history_tmp name 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history ad_account_name 217. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history_tmp:f0->216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f0 211. model.snapchat_ads.snapchat_ads__ad_report 211. model.snapchat_ads.snapchat_ads__ad_report ad_account_name 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f0->211. model.snapchat_ads.snapchat_ads__ad_report:f0 215. model.snapchat_ads.snapchat_ads__url_report 215. model.snapchat_ads.snapchat_ads__url_report ad_account_name 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f0->215. model.snapchat_ads.snapchat_ads__url_report:f0 212. model.snapchat_ads.snapchat_ads__ad_squad_report 212. model.snapchat_ads.snapchat_ads__ad_squad_report ad_account_name 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f0->212. model.snapchat_ads.snapchat_ads__ad_squad_report:f0 210. model.snapchat_ads.snapchat_ads__account_report 210. model.snapchat_ads.snapchat_ads__account_report ad_account_name 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f0->210. model.snapchat_ads.snapchat_ads__account_report:f0 213. model.snapchat_ads.snapchat_ads__campaign_report 213. model.snapchat_ads.snapchat_ads__campaign_report ad_account_name 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f0->213. model.snapchat_ads.snapchat_ads__campaign_report:f0
216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history
  • Input Column: 217. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history_tmp[name]
    • Direct The column is directly copied to the output
    • Cleaning Cast as TEXT in the fields CTE
    • Output Columns:
      • ad_account_name: Directly mapped and renamed
210. model.snapchat_ads.snapchat_ads__account_report
  • Input Column: 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history[ad_account_name]
    • Direct Directly copied to the output
    • Output Columns:
      • ad_account_name: Directly copied
211. model.snapchat_ads.snapchat_ads__ad_report
  • Input Column: 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history[ad_account_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_account_name: directly copied
212. model.snapchat_ads.snapchat_ads__ad_squad_report
  • Input Column: 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history[ad_account_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_account_name: directly copied
213. model.snapchat_ads.snapchat_ads__campaign_report
  • Input Column: 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history[ad_account_name]
    • Aggregation used in GROUP BY clause
    • Output Columns:
      • ad_account_name: directly copied
215. model.snapchat_ads.snapchat_ads__url_report
  • Input Column: 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history[ad_account_name]
    • Aggregation included in the GROUP BY clause
    • Output Columns:
      • ad_account_name: directly copied to the output
Column Lineage
%3 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history currency 211. model.snapchat_ads.snapchat_ads__ad_report 211. model.snapchat_ads.snapchat_ads__ad_report currency 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f0->211. model.snapchat_ads.snapchat_ads__ad_report:f0 215. model.snapchat_ads.snapchat_ads__url_report 215. model.snapchat_ads.snapchat_ads__url_report currency 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f0->215. model.snapchat_ads.snapchat_ads__url_report:f0 212. model.snapchat_ads.snapchat_ads__ad_squad_report 212. model.snapchat_ads.snapchat_ads__ad_squad_report currency 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f0->212. model.snapchat_ads.snapchat_ads__ad_squad_report:f0 210. model.snapchat_ads.snapchat_ads__account_report 210. model.snapchat_ads.snapchat_ads__account_report currency 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f0->210. model.snapchat_ads.snapchat_ads__account_report:f0 213. model.snapchat_ads.snapchat_ads__campaign_report 213. model.snapchat_ads.snapchat_ads__campaign_report currency 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f0->213. model.snapchat_ads.snapchat_ads__campaign_report:f0
210. model.snapchat_ads.snapchat_ads__account_report
  • Input Column: 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history[currency]
    • Direct Directly copied to the output
    • Output Columns:
      • currency: Directly copied
211. model.snapchat_ads.snapchat_ads__ad_report
  • Input Column: 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history[currency]
    • Direct directly copied to the output
    • Output Columns:
      • currency: directly copied
212. model.snapchat_ads.snapchat_ads__ad_squad_report
  • Input Column: 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history[currency]
    • Direct directly copied to the output
    • Output Columns:
      • currency: directly copied
213. model.snapchat_ads.snapchat_ads__campaign_report
  • Input Column: 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history[currency]
    • Aggregation used in GROUP BY clause
    • Output Columns:
      • currency: directly copied
215. model.snapchat_ads.snapchat_ads__url_report
  • Input Column: 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history[currency]
    • Aggregation included in the GROUP BY clause
    • Output Columns:
      • currency: directly copied to the output
217. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of type TEXT. It's likely used as a placeholder or template for further data processing or as part of a larger data modeling process in dbt (data build tool).

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 217. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history_tmp 217. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history_tmp id name _fivetran_synced 351. source.snapchat_ads_source.snapchat_ads.ad_account_history 351. source.snapchat_ads_source.snapchat_ads.ad_account_history
Name Type Comment
id text None
name text None
_fivetran_synced text None
Column Lineage
%3 217. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history_tmp 217. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history_tmp id 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history ad_account_id 217. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history_tmp:f0->216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f0 211. model.snapchat_ads.snapchat_ads__ad_report 211. model.snapchat_ads.snapchat_ads__ad_report ad_account_id 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f0->211. model.snapchat_ads.snapchat_ads__ad_report:f0 215. model.snapchat_ads.snapchat_ads__url_report 215. model.snapchat_ads.snapchat_ads__url_report ad_account_id 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f0->215. model.snapchat_ads.snapchat_ads__url_report:f0 212. model.snapchat_ads.snapchat_ads__ad_squad_report 212. model.snapchat_ads.snapchat_ads__ad_squad_report ad_account_id 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f0->212. model.snapchat_ads.snapchat_ads__ad_squad_report:f0 210. model.snapchat_ads.snapchat_ads__account_report 210. model.snapchat_ads.snapchat_ads__account_report ad_account_id 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f0->210. model.snapchat_ads.snapchat_ads__account_report:f0 213. model.snapchat_ads.snapchat_ads__campaign_report 213. model.snapchat_ads.snapchat_ads__campaign_report ad_account_id 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f0->213. model.snapchat_ads.snapchat_ads__campaign_report:f0
216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history
  • Input Column: 217. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history_tmp[id]
    • Direct The column is directly copied to the output
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Cleaning Cast as TEXT in the fields CTE
    • Output Columns:
      • ad_account_id: Directly mapped and renamed
210. model.snapchat_ads.snapchat_ads__account_report
  • Input Column: 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history[ad_account_id]
    • Integration Used to join with other tables
    • Direct Directly copied to the output
    • Output Columns:
      • ad_account_id: Directly copied
211. model.snapchat_ads.snapchat_ads__ad_report
  • Input Column: 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history[ad_account_id]
    • Integration used to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • ad_account_id: directly copied
212. model.snapchat_ads.snapchat_ads__ad_squad_report
  • Input Column: 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history[ad_account_id]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • ad_account_id: directly copied
213. model.snapchat_ads.snapchat_ads__campaign_report
  • Input Column: 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history[ad_account_id]
    • Integration used to join with campaigns table
    • Aggregation used in GROUP BY clause
    • Output Columns:
      • ad_account_id: directly copied
215. model.snapchat_ads.snapchat_ads__url_report
  • Input Column: 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history[ad_account_id]
    • Integration used as part of the join condition with other tables
    • Aggregation included in the GROUP BY clause
    • Output Columns:
      • ad_account_id: directly copied to the output
Column Lineage
%3 217. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history_tmp 217. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history_tmp name 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history ad_account_name 217. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history_tmp:f0->216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f0 211. model.snapchat_ads.snapchat_ads__ad_report 211. model.snapchat_ads.snapchat_ads__ad_report ad_account_name 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f0->211. model.snapchat_ads.snapchat_ads__ad_report:f0 215. model.snapchat_ads.snapchat_ads__url_report 215. model.snapchat_ads.snapchat_ads__url_report ad_account_name 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f0->215. model.snapchat_ads.snapchat_ads__url_report:f0 212. model.snapchat_ads.snapchat_ads__ad_squad_report 212. model.snapchat_ads.snapchat_ads__ad_squad_report ad_account_name 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f0->212. model.snapchat_ads.snapchat_ads__ad_squad_report:f0 210. model.snapchat_ads.snapchat_ads__account_report 210. model.snapchat_ads.snapchat_ads__account_report ad_account_name 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f0->210. model.snapchat_ads.snapchat_ads__account_report:f0 213. model.snapchat_ads.snapchat_ads__campaign_report 213. model.snapchat_ads.snapchat_ads__campaign_report ad_account_name 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f0->213. model.snapchat_ads.snapchat_ads__campaign_report:f0
216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history
  • Input Column: 217. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history_tmp[name]
    • Direct The column is directly copied to the output
    • Cleaning Cast as TEXT in the fields CTE
    • Output Columns:
      • ad_account_name: Directly mapped and renamed
210. model.snapchat_ads.snapchat_ads__account_report
  • Input Column: 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history[ad_account_name]
    • Direct Directly copied to the output
    • Output Columns:
      • ad_account_name: Directly copied
211. model.snapchat_ads.snapchat_ads__ad_report
  • Input Column: 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history[ad_account_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_account_name: directly copied
212. model.snapchat_ads.snapchat_ads__ad_squad_report
  • Input Column: 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history[ad_account_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_account_name: directly copied
213. model.snapchat_ads.snapchat_ads__campaign_report
  • Input Column: 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history[ad_account_name]
    • Aggregation used in GROUP BY clause
    • Output Columns:
      • ad_account_name: directly copied
215. model.snapchat_ads.snapchat_ads__url_report
  • Input Column: 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history[ad_account_name]
    • Aggregation included in the GROUP BY clause
    • Output Columns:
      • ad_account_name: directly copied to the output
Column Lineage
%3 217. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history_tmp 217. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history_tmp _fivetran_synced 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history 216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history _fivetran_synced 217. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history_tmp:f0->216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history:f0
216. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history
  • Input Column: 217. model.snapchat_ads_source.stg_snapchat_ads__ad_account_history_tmp[_fivetran_synced]
    • Direct The column is directly copied to the output
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Cleaning Cast as TIMESTAMP in the fields CTE and final SELECT
    • Output Columns:
      • _fivetran_synced: Directly mapped after casting to TIMESTAMP
218. model.snapchat_ads_source.stg_snapchat_ads__ad_history

This SQL query performs several operations on the snapchat_ads_source.stg_snapchat_ads__ad_history data. It starts by selecting all columns from a temporary table, then defines a set of fields with specific data types. The query then selects and renames certain columns, casts timestamps, and adds a column to identify the most recent record for each ad. The final result includes all columns from this transformation.

CleaningDeduplication
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_snapchat_ads_source.stg_snapchat_ads__ad_history_tmp
), fields AS (
  SELECT
    CAST(NULL AS TIMESTAMP) AS _fivetran_synced,
    CAST(NULL AS TEXT) AS ad_squad_id,
    CAST(NULL AS TIMESTAMP) AS created_at,
    CAST(NULL AS TEXT) AS creative_id,
    CAST(NULL AS TEXT) AS id,
    CAST(NULL AS TEXT) AS name,
    CAST(NULL AS TIMESTAMP) AS updated_at,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    id AS ad_id,
    name AS ad_name,
    CAST(created_at AS TIMESTAMP) AS created_at,
    ad_squad_id,
    creative_id,
    CAST(_fivetran_synced AS TIMESTAMP) AS _fivetran_synced,
    CAST(updated_at AS TIMESTAMP) AS updated_at,
    ROW_NUMBER() OVER (PARTITION BY source_relation, id ORDER BY _fivetran_synced DESC) = 1 AS is_most_recent_record
  FROM fields
)
SELECT
  *
FROM final
%3 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history source_relation _fivetran_synced ad_id ad_squad_id creative_id ad_name created_at updated_at is_most_recent_record 219. model.snapchat_ads_source.stg_snapchat_ads__ad_history_tmp 219. model.snapchat_ads_source.stg_snapchat_ads__ad_history_tmp id ad_squad_id creative_id name _fivetran_synced 219. model.snapchat_ads_source.stg_snapchat_ads__ad_history_tmp:f0->218. model.snapchat_ads_source.stg_snapchat_ads__ad_history:f2 219. model.snapchat_ads_source.stg_snapchat_ads__ad_history_tmp:f1->218. model.snapchat_ads_source.stg_snapchat_ads__ad_history:f3 219. model.snapchat_ads_source.stg_snapchat_ads__ad_history_tmp:f2->218. model.snapchat_ads_source.stg_snapchat_ads__ad_history:f4 219. model.snapchat_ads_source.stg_snapchat_ads__ad_history_tmp:f3->218. model.snapchat_ads_source.stg_snapchat_ads__ad_history:f5 219. model.snapchat_ads_source.stg_snapchat_ads__ad_history_tmp:f4->218. model.snapchat_ads_source.stg_snapchat_ads__ad_history:f1 219. model.snapchat_ads_source.stg_snapchat_ads__ad_history_tmp:f4->218. model.snapchat_ads_source.stg_snapchat_ads__ad_history:f8
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
_fivetran_synced timestamp without time zone When the record was last synced by Fivetran.
ad_id text The ID of the ad in Snapchat.
ad_squad_id text The ID of the related ad squad in Snapchat.
creative_id text The ID of the related creative in Snapchat.
ad_name text The name of the ad in Snapchat.
created_at timestamp without time zone Created at timestamp
updated_at timestamp without time zone Timestamp of when the record was updated.
is_most_recent_record boolean Boolean representing whether a record is the most recent version of that record.
Column Lineage
%3 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history source_relation 211. model.snapchat_ads.snapchat_ads__ad_report 211. model.snapchat_ads.snapchat_ads__ad_report source_relation 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history:f0->211. model.snapchat_ads.snapchat_ads__ad_report:f0 215. model.snapchat_ads.snapchat_ads__url_report 215. model.snapchat_ads.snapchat_ads__url_report source_relation 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history:f0->215. model.snapchat_ads.snapchat_ads__url_report:f0 210. model.snapchat_ads.snapchat_ads__account_report 210. model.snapchat_ads.snapchat_ads__account_report source_relation 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history:f0->210. model.snapchat_ads.snapchat_ads__account_report:f0
210. model.snapchat_ads.snapchat_ads__account_report
  • Input Column: 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history[source_relation]
    • Integration Used to join with other tables
    • Direct Directly selected in the final output
    • Output Columns:
      • source_relation: Directly copied to the output
211. model.snapchat_ads.snapchat_ads__ad_report
  • Input Column: 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history[source_relation]
    • Integration Used to join with other tables
    • Direct Directly copied to the output
    • Output Columns:
      • source_relation: Directly copied
215. model.snapchat_ads.snapchat_ads__url_report
  • Input Column: 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history[source_relation]
    • Integration used to join with other tables
    • Direct copied to the output without transformation
    • Output Columns:
      • source_relation: directly copied
Column Lineage
%3 219. model.snapchat_ads_source.stg_snapchat_ads__ad_history_tmp 219. model.snapchat_ads_source.stg_snapchat_ads__ad_history_tmp _fivetran_synced 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history _fivetran_synced is_most_recent_record 219. model.snapchat_ads_source.stg_snapchat_ads__ad_history_tmp:f0->218. model.snapchat_ads_source.stg_snapchat_ads__ad_history:f0 219. model.snapchat_ads_source.stg_snapchat_ads__ad_history_tmp:f0->218. model.snapchat_ads_source.stg_snapchat_ads__ad_history:f1
218. model.snapchat_ads_source.stg_snapchat_ads__ad_history
  • Input Column: 219. model.snapchat_ads_source.stg_snapchat_ads__ad_history_tmp[_fivetran_synced]
    • Cleaning The column is cast as TIMESTAMP
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • _fivetran_synced: Mapped after casting to TIMESTAMP
      • is_most_recent_record: Indirectly used to determine this boolean field
Column Lineage
%3 219. model.snapchat_ads_source.stg_snapchat_ads__ad_history_tmp 219. model.snapchat_ads_source.stg_snapchat_ads__ad_history_tmp id 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history ad_id 219. model.snapchat_ads_source.stg_snapchat_ads__ad_history_tmp:f0->218. model.snapchat_ads_source.stg_snapchat_ads__ad_history:f0 211. model.snapchat_ads.snapchat_ads__ad_report 211. model.snapchat_ads.snapchat_ads__ad_report ad_id 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history:f0->211. model.snapchat_ads.snapchat_ads__ad_report:f0 215. model.snapchat_ads.snapchat_ads__url_report 215. model.snapchat_ads.snapchat_ads__url_report ad_id 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history:f0->215. model.snapchat_ads.snapchat_ads__url_report:f0
218. model.snapchat_ads_source.stg_snapchat_ads__ad_history
  • Input Column: 219. model.snapchat_ads_source.stg_snapchat_ads__ad_history_tmp[id]
    • Direct The column is directly copied without transformation
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • ad_id: Directly mapped and renamed
211. model.snapchat_ads.snapchat_ads__ad_report
  • Input Column: 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history[ad_id]
    • Integration Used as a key to join with ad_hourly table
    • Direct Directly copied to the output
    • Output Columns:
      • ad_id: Directly copied
215. model.snapchat_ads.snapchat_ads__url_report
  • Input Column: 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history[ad_id]
    • Integration used to join with ad_hourly table
    • Direct copied to the output without transformation
    • Output Columns:
      • ad_id: directly copied
Column Lineage
%3 219. model.snapchat_ads_source.stg_snapchat_ads__ad_history_tmp 219. model.snapchat_ads_source.stg_snapchat_ads__ad_history_tmp ad_squad_id 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history ad_squad_id 219. model.snapchat_ads_source.stg_snapchat_ads__ad_history_tmp:f0->218. model.snapchat_ads_source.stg_snapchat_ads__ad_history:f0
218. model.snapchat_ads_source.stg_snapchat_ads__ad_history
  • Input Column: 219. model.snapchat_ads_source.stg_snapchat_ads__ad_history_tmp[ad_squad_id]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • ad_squad_id: Directly mapped
Column Lineage
%3 219. model.snapchat_ads_source.stg_snapchat_ads__ad_history_tmp 219. model.snapchat_ads_source.stg_snapchat_ads__ad_history_tmp creative_id 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history creative_id 219. model.snapchat_ads_source.stg_snapchat_ads__ad_history_tmp:f0->218. model.snapchat_ads_source.stg_snapchat_ads__ad_history:f0
218. model.snapchat_ads_source.stg_snapchat_ads__ad_history
  • Input Column: 219. model.snapchat_ads_source.stg_snapchat_ads__ad_history_tmp[creative_id]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • creative_id: Directly mapped
Column Lineage
%3 219. model.snapchat_ads_source.stg_snapchat_ads__ad_history_tmp 219. model.snapchat_ads_source.stg_snapchat_ads__ad_history_tmp name 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history ad_name 219. model.snapchat_ads_source.stg_snapchat_ads__ad_history_tmp:f0->218. model.snapchat_ads_source.stg_snapchat_ads__ad_history:f0 211. model.snapchat_ads.snapchat_ads__ad_report 211. model.snapchat_ads.snapchat_ads__ad_report ad_name 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history:f0->211. model.snapchat_ads.snapchat_ads__ad_report:f0 215. model.snapchat_ads.snapchat_ads__url_report 215. model.snapchat_ads.snapchat_ads__url_report ad_name 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history:f0->215. model.snapchat_ads.snapchat_ads__url_report:f0
218. model.snapchat_ads_source.stg_snapchat_ads__ad_history
  • Input Column: 219. model.snapchat_ads_source.stg_snapchat_ads__ad_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • ad_name: Directly mapped and renamed
211. model.snapchat_ads.snapchat_ads__ad_report
  • Input Column: 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history[ad_name]
    • Direct Directly copied to the output
    • Output Columns:
      • ad_name: Directly copied
215. model.snapchat_ads.snapchat_ads__url_report
  • Input Column: 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history[ad_name]
    • Direct copied to the output without transformation
    • Output Columns:
      • ad_name: directly copied
Column Lineage
%3 219. model.snapchat_ads_source.stg_snapchat_ads__ad_history_tmp 219. model.snapchat_ads_source.stg_snapchat_ads__ad_history_tmp _fivetran_synced 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history _fivetran_synced is_most_recent_record 219. model.snapchat_ads_source.stg_snapchat_ads__ad_history_tmp:f0->218. model.snapchat_ads_source.stg_snapchat_ads__ad_history:f0 219. model.snapchat_ads_source.stg_snapchat_ads__ad_history_tmp:f0->218. model.snapchat_ads_source.stg_snapchat_ads__ad_history:f1
218. model.snapchat_ads_source.stg_snapchat_ads__ad_history
  • Input Column: 219. model.snapchat_ads_source.stg_snapchat_ads__ad_history_tmp[_fivetran_synced]
    • Cleaning The column is cast as TIMESTAMP
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • _fivetran_synced: Mapped after casting to TIMESTAMP
      • is_most_recent_record: Indirectly used to determine this boolean field
219. model.snapchat_ads_source.stg_snapchat_ads__ad_history_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of type TEXT, initialized to NULL. The LIMIT 0 clause ensures no rows are returned. This appears to be a template or placeholder query, possibly used to define the structure of a temporary table or view without populating it with data.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 219. model.snapchat_ads_source.stg_snapchat_ads__ad_history_tmp 219. model.snapchat_ads_source.stg_snapchat_ads__ad_history_tmp id ad_squad_id creative_id name _fivetran_synced 352. source.snapchat_ads_source.snapchat_ads.ad_history 352. source.snapchat_ads_source.snapchat_ads.ad_history
Name Type Comment
id text None
ad_squad_id text None
creative_id text None
name text None
_fivetran_synced text None
Column Lineage
%3 219. model.snapchat_ads_source.stg_snapchat_ads__ad_history_tmp 219. model.snapchat_ads_source.stg_snapchat_ads__ad_history_tmp id 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history ad_id 219. model.snapchat_ads_source.stg_snapchat_ads__ad_history_tmp:f0->218. model.snapchat_ads_source.stg_snapchat_ads__ad_history:f0 211. model.snapchat_ads.snapchat_ads__ad_report 211. model.snapchat_ads.snapchat_ads__ad_report ad_id 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history:f0->211. model.snapchat_ads.snapchat_ads__ad_report:f0 215. model.snapchat_ads.snapchat_ads__url_report 215. model.snapchat_ads.snapchat_ads__url_report ad_id 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history:f0->215. model.snapchat_ads.snapchat_ads__url_report:f0
218. model.snapchat_ads_source.stg_snapchat_ads__ad_history
  • Input Column: 219. model.snapchat_ads_source.stg_snapchat_ads__ad_history_tmp[id]
    • Direct The column is directly copied without transformation
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • ad_id: Directly mapped and renamed
211. model.snapchat_ads.snapchat_ads__ad_report
  • Input Column: 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history[ad_id]
    • Integration Used as a key to join with ad_hourly table
    • Direct Directly copied to the output
    • Output Columns:
      • ad_id: Directly copied
215. model.snapchat_ads.snapchat_ads__url_report
  • Input Column: 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history[ad_id]
    • Integration used to join with ad_hourly table
    • Direct copied to the output without transformation
    • Output Columns:
      • ad_id: directly copied
Column Lineage
%3 219. model.snapchat_ads_source.stg_snapchat_ads__ad_history_tmp 219. model.snapchat_ads_source.stg_snapchat_ads__ad_history_tmp ad_squad_id 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history ad_squad_id 219. model.snapchat_ads_source.stg_snapchat_ads__ad_history_tmp:f0->218. model.snapchat_ads_source.stg_snapchat_ads__ad_history:f0
218. model.snapchat_ads_source.stg_snapchat_ads__ad_history
  • Input Column: 219. model.snapchat_ads_source.stg_snapchat_ads__ad_history_tmp[ad_squad_id]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • ad_squad_id: Directly mapped
Column Lineage
%3 219. model.snapchat_ads_source.stg_snapchat_ads__ad_history_tmp 219. model.snapchat_ads_source.stg_snapchat_ads__ad_history_tmp creative_id 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history creative_id 219. model.snapchat_ads_source.stg_snapchat_ads__ad_history_tmp:f0->218. model.snapchat_ads_source.stg_snapchat_ads__ad_history:f0
218. model.snapchat_ads_source.stg_snapchat_ads__ad_history
  • Input Column: 219. model.snapchat_ads_source.stg_snapchat_ads__ad_history_tmp[creative_id]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • creative_id: Directly mapped
Column Lineage
%3 219. model.snapchat_ads_source.stg_snapchat_ads__ad_history_tmp 219. model.snapchat_ads_source.stg_snapchat_ads__ad_history_tmp name 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history ad_name 219. model.snapchat_ads_source.stg_snapchat_ads__ad_history_tmp:f0->218. model.snapchat_ads_source.stg_snapchat_ads__ad_history:f0 211. model.snapchat_ads.snapchat_ads__ad_report 211. model.snapchat_ads.snapchat_ads__ad_report ad_name 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history:f0->211. model.snapchat_ads.snapchat_ads__ad_report:f0 215. model.snapchat_ads.snapchat_ads__url_report 215. model.snapchat_ads.snapchat_ads__url_report ad_name 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history:f0->215. model.snapchat_ads.snapchat_ads__url_report:f0
218. model.snapchat_ads_source.stg_snapchat_ads__ad_history
  • Input Column: 219. model.snapchat_ads_source.stg_snapchat_ads__ad_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • ad_name: Directly mapped and renamed
211. model.snapchat_ads.snapchat_ads__ad_report
  • Input Column: 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history[ad_name]
    • Direct Directly copied to the output
    • Output Columns:
      • ad_name: Directly copied
215. model.snapchat_ads.snapchat_ads__url_report
  • Input Column: 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history[ad_name]
    • Direct copied to the output without transformation
    • Output Columns:
      • ad_name: directly copied
Column Lineage
%3 219. model.snapchat_ads_source.stg_snapchat_ads__ad_history_tmp 219. model.snapchat_ads_source.stg_snapchat_ads__ad_history_tmp _fivetran_synced 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history 218. model.snapchat_ads_source.stg_snapchat_ads__ad_history _fivetran_synced is_most_recent_record 219. model.snapchat_ads_source.stg_snapchat_ads__ad_history_tmp:f0->218. model.snapchat_ads_source.stg_snapchat_ads__ad_history:f0 219. model.snapchat_ads_source.stg_snapchat_ads__ad_history_tmp:f0->218. model.snapchat_ads_source.stg_snapchat_ads__ad_history:f1
218. model.snapchat_ads_source.stg_snapchat_ads__ad_history
  • Input Column: 219. model.snapchat_ads_source.stg_snapchat_ads__ad_history_tmp[_fivetran_synced]
    • Cleaning The column is cast as TIMESTAMP
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • _fivetran_synced: Mapped after casting to TIMESTAMP
      • is_most_recent_record: Indirectly used to determine this boolean field
220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report

This SQL query performs data transformation and cleaning on the Snapchat ads hourly report data. It casts various fields to appropriate data types, renames some columns, and performs unit conversions (e.g., milliseconds to seconds) for time-related fields. The query also adds a source_relation column to track the data source.

CleaningFeaturization
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp
), fields AS (
  SELECT
    CAST(NULL AS TEXT) AS ad_id,
    CAST(NULL AS DECIMAL(28, 6)) AS attachment_quartile_1,
    CAST(NULL AS DECIMAL(28, 6)) AS attachment_quartile_2,
    CAST(NULL AS DECIMAL(28, 6)) AS attachment_quartile_3,
    CAST(NULL AS DECIMAL(28, 6)) AS attachment_total_view_time_millis,
    CAST(NULL AS DECIMAL(28, 6)) AS attachment_view_completion,
    CAST(NULL AS TIMESTAMP) AS date,
    CAST(NULL AS DECIMAL(28, 6)) AS impressions,
    CAST(NULL AS DECIMAL(28, 6)) AS quartile_1,
    CAST(NULL AS DECIMAL(28, 6)) AS quartile_2,
    CAST(NULL AS DECIMAL(28, 6)) AS quartile_3,
    CAST(NULL AS DECIMAL(28, 6)) AS saves,
    CAST(NULL AS DECIMAL(28, 6)) AS screen_time_millis,
    CAST(NULL AS DECIMAL(28, 6)) AS shares,
    CAST(NULL AS DECIMAL(28, 6)) AS spend,
    CAST(NULL AS DECIMAL(28, 6)) AS swipes,
    CAST(NULL AS DECIMAL(28, 6)) AS video_views,
    CAST(NULL AS DECIMAL(28, 6)) AS view_completion,
    CAST(NULL AS DECIMAL(28, 6)) AS view_time_millis,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    ad_id,
    CAST(date AS TIMESTAMP) AS date_hour,
    attachment_quartile_1,
    attachment_quartile_2,
    attachment_quartile_3,
    (
      attachment_total_view_time_millis / 1000000.0
    ) AS attachment_total_view_time,
    attachment_view_completion,
    quartile_1,
    quartile_2,
    quartile_3,
    saves,
    shares,
    (
      screen_time_millis / 1000000.0
    ) AS screen_time,
    video_views,
    view_completion,
    (
      view_time_millis / 1000000.0
    ) AS view_time,
    impressions,
    (
      spend / 1000000.0
    ) AS spend,
    swipes
  FROM fields
)
SELECT
  *
FROM final
%3 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report source_relation ad_id date_hour attachment_quartile_1 attachment_quartile_2 attachment_quartile_3 attachment_total_view_time attachment_view_completion quartile_1 quartile_2 quartile_3 saves shares screen_time video_views view_completion view_time impressions spend swipes 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp ad_id date impressions spend swipes 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp:f0->220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f1 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp:f1->220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f2 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp:f2->220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f17 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp:f3->220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f18 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp:f4->220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f19
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
ad_id text The ID of the ad that the report relates to in Snapchat.
date_hour timestamp without time zone The hour that the report relates to.
attachment_quartile_1 numeric(28,6) Number of times your Long Form Video was viewed to 25%
attachment_quartile_2 numeric(28,6) Number of times your Long Form Video was viewed to 50%
attachment_quartile_3 numeric(28,6) Number of times your Long Form Video was viewed to 75%
attachment_total_view_time numeric Total time Snapchatters spent on the attachment (HH:MM:SS)
attachment_view_completion numeric(28,6) The number of times your Long Form Video was viewed to completion (97% )
quartile_1 numeric(28,6) The number of times your video ad was viewed to 25%
quartile_2 numeric(28,6) The number of times your video ad was viewed to 50%
quartile_3 numeric(28,6) The number of times your video ad was viewed to 75%
saves numeric(28,6) Number of times a lens/filter was saved to Memories
shares numeric(28,6) Number of times a lens/filter was shared in a Chat or Story
screen_time numeric The number of milli seconds spent watching your ad across all paid impressions. Screen time starts recording as soon as the media is fully rendered on the device and the autoplay video starts
video_views numeric(28,6) The number of times your video was watched at least 2 seconds or swiped up, whichever comes first
view_completion numeric(28,6) The number of times your video ad was viewed to completion (97% )
view_time numeric The number of milli seconds spent watching your ad across all users reached.
impressions integer The number of impressions for an ad in the hour of the record.
spend numeric The amount of spend for an ad in the hour of the record converted from micros.
swipes integer The number of swipes for an ad in the hour of the record.
Column Lineage
%3 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report source_relation 211. model.snapchat_ads.snapchat_ads__ad_report 211. model.snapchat_ads.snapchat_ads__ad_report source_relation 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f0->211. model.snapchat_ads.snapchat_ads__ad_report:f0 215. model.snapchat_ads.snapchat_ads__url_report 215. model.snapchat_ads.snapchat_ads__url_report source_relation 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f0->215. model.snapchat_ads.snapchat_ads__url_report:f0 210. model.snapchat_ads.snapchat_ads__account_report 210. model.snapchat_ads.snapchat_ads__account_report source_relation 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f0->210. model.snapchat_ads.snapchat_ads__account_report:f0
210. model.snapchat_ads.snapchat_ads__account_report
  • Input Column: 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report[source_relation]
    • Direct The column is directly copied without any transformation
    • Aggregation The column is grouped by in the final aggregation
    • Output Columns:
      • source_relation: Directly copied to the output
211. model.snapchat_ads.snapchat_ads__ad_report
  • Input Column: 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report[source_relation]
    • Direct The column is directly copied without transformation
    • Integration Used as part of the join condition with other tables
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
215. model.snapchat_ads.snapchat_ads__url_report
  • Input Column: 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with other tables
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
Column Lineage
%3 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp ad_id 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report ad_id 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp:f0->220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f0 211. model.snapchat_ads.snapchat_ads__ad_report 211. model.snapchat_ads.snapchat_ads__ad_report ad_id 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f0->211. model.snapchat_ads.snapchat_ads__ad_report:f0 215. model.snapchat_ads.snapchat_ads__url_report 215. model.snapchat_ads.snapchat_ads__url_report ad_id 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f0->215. model.snapchat_ads.snapchat_ads__url_report:f0
220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report
  • Input Column: 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp[ad_id]
    • Cleaning The column is cast to TEXT data type
    • Output Columns:
      • ad_id: Directly copied after casting
211. model.snapchat_ads.snapchat_ads__ad_report
  • Input Column: 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report[ad_id]
    • Direct The column is directly copied without transformation
    • Integration Used as the key to join with the ads table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • ad_id: Directly copied to the output
215. model.snapchat_ads.snapchat_ads__url_report
  • Input Column: 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report[ad_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as the key to join with the ads table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • ad_id: Directly copied to the output
Column Lineage
%3 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp date 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report date_hour 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp:f0->220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f0 211. model.snapchat_ads.snapchat_ads__ad_report 211. model.snapchat_ads.snapchat_ads__ad_report date_day 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f0->211. model.snapchat_ads.snapchat_ads__ad_report:f0 215. model.snapchat_ads.snapchat_ads__url_report 215. model.snapchat_ads.snapchat_ads__url_report date_day 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f0->215. model.snapchat_ads.snapchat_ads__url_report:f0 210. model.snapchat_ads.snapchat_ads__account_report 210. model.snapchat_ads.snapchat_ads__account_report date_day 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f0->210. model.snapchat_ads.snapchat_ads__account_report:f0
220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report
  • Input Column: 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp[date]
    • Cleaning The column is cast to TIMESTAMP data type
    • Output Columns:
      • date_hour: Directly copied after casting
210. model.snapchat_ads.snapchat_ads__account_report
  • Input Column: 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report[date_hour]
    • Cleaning The column is cast to DATE type
    • Aggregation The resulting date is grouped by in the final aggregation
    • Output Columns:
      • date_day: Transformed and mapped to this output column
211. model.snapchat_ads.snapchat_ads__ad_report
  • Input Column: 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report[date_hour]
    • Cleaning Cast to DATE type
    • Aggregation Used in the GROUP BY clause after transformation
    • Output Columns:
      • date_day: Transformed to date and used in the output
215. model.snapchat_ads.snapchat_ads__url_report
  • Input Column: 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report[date_hour]
    • Cleaning Cast to DATE type
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • date_day: Transformed to date_day in the output
Column Lineage
%3 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp impressions 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report impressions 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp:f0->220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f0 211. model.snapchat_ads.snapchat_ads__ad_report 211. model.snapchat_ads.snapchat_ads__ad_report impressions 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f0->211. model.snapchat_ads.snapchat_ads__ad_report:f0 215. model.snapchat_ads.snapchat_ads__url_report 215. model.snapchat_ads.snapchat_ads__url_report impressions 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f0->215. model.snapchat_ads.snapchat_ads__url_report:f0 210. model.snapchat_ads.snapchat_ads__account_report 210. model.snapchat_ads.snapchat_ads__account_report impressions 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f0->210. model.snapchat_ads.snapchat_ads__account_report:f0
220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report
  • Input Column: 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp[impressions]
    • Cleaning The column is cast to DECIMAL(28, 6) data type
    • Output Columns:
      • impressions: Directly copied after casting
210. model.snapchat_ads.snapchat_ads__account_report
  • Input Column: 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report[impressions]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • impressions: Summed up and directly mapped to the output 'impressions' column
211. model.snapchat_ads.snapchat_ads__ad_report
  • Input Column: 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report[impressions]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • impressions: Summed up and directly mapped to the output column
215. model.snapchat_ads.snapchat_ads__url_report
  • Input Column: 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report[impressions]
    • Aggregation This column is summed up in the aggregated CTE
    • Output Columns:
      • impressions: The sum of impressions is mapped to the output 'impressions' column
Column Lineage
%3 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp spend 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report spend 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp:f0->220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f0 211. model.snapchat_ads.snapchat_ads__ad_report 211. model.snapchat_ads.snapchat_ads__ad_report spend 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f0->211. model.snapchat_ads.snapchat_ads__ad_report:f0 215. model.snapchat_ads.snapchat_ads__url_report 215. model.snapchat_ads.snapchat_ads__url_report spend 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f0->215. model.snapchat_ads.snapchat_ads__url_report:f0 210. model.snapchat_ads.snapchat_ads__account_report 210. model.snapchat_ads.snapchat_ads__account_report spend 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f0->210. model.snapchat_ads.snapchat_ads__account_report:f0
220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report
  • Input Column: 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp[spend]
    • Cleaning The column is cast to DECIMAL(28, 6) data type
    • Other The value is divided by 1,000,000 to convert from micros
    • Output Columns:
      • spend: Transformed by dividing by 1,000,000
210. model.snapchat_ads.snapchat_ads__account_report
  • Input Column: 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report[spend]
    • Aggregation The column is summed up in the aggregated CTE
    • Cleaning The summed value is rounded to 2 decimal places
    • Output Columns:
      • spend: Summed up, rounded, and mapped to the output 'spend' column
211. model.snapchat_ads.snapchat_ads__ad_report
  • Input Column: 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report[spend]
    • Aggregation The column is summed up in the aggregated CTE
    • Cleaning The summed value is rounded to 2 decimal places
    • Output Columns:
      • spend: Summed up, rounded, and mapped to the output column
215. model.snapchat_ads.snapchat_ads__url_report
  • Input Column: 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report[spend]
    • Aggregation This column is summed up in the aggregated CTE
    • Cleaning The sum is rounded to 2 decimal places
    • Output Columns:
      • spend: The sum of spend (rounded) is mapped to the output 'spend' column
Column Lineage
%3 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp swipes 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report swipes 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp:f0->220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f0 211. model.snapchat_ads.snapchat_ads__ad_report 211. model.snapchat_ads.snapchat_ads__ad_report swipes 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f0->211. model.snapchat_ads.snapchat_ads__ad_report:f0 215. model.snapchat_ads.snapchat_ads__url_report 215. model.snapchat_ads.snapchat_ads__url_report swipes 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f0->215. model.snapchat_ads.snapchat_ads__url_report:f0 210. model.snapchat_ads.snapchat_ads__account_report 210. model.snapchat_ads.snapchat_ads__account_report swipes 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f0->210. model.snapchat_ads.snapchat_ads__account_report:f0
220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report
  • Input Column: 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp[swipes]
    • Cleaning The column is cast to DECIMAL(28, 6) data type
    • Output Columns:
      • swipes: Directly copied after casting
210. model.snapchat_ads.snapchat_ads__account_report
  • Input Column: 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report[swipes]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • swipes: Summed up and directly mapped to the output 'swipes' column
211. model.snapchat_ads.snapchat_ads__ad_report
  • Input Column: 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report[swipes]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • swipes: Summed up and directly mapped to the output column
215. model.snapchat_ads.snapchat_ads__url_report
  • Input Column: 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report[swipes]
    • Aggregation This column is summed up in the aggregated CTE
    • Output Columns:
      • swipes: The sum of swipes is mapped to the output 'swipes' column
221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of type TEXT, which is set to NULL. The query limits the output to 0 rows, effectively creating a schema-only representation of the table without any data.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp ad_id date impressions spend swipes 353. source.snapchat_ads_source.snapchat_ads.ad_hourly_report 353. source.snapchat_ads_source.snapchat_ads.ad_hourly_report
Name Type Comment
ad_id text None
date timestamp without time zone None
impressions integer None
spend integer None
swipes integer None
Column Lineage
%3 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp ad_id 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report ad_id 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp:f0->220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f0 211. model.snapchat_ads.snapchat_ads__ad_report 211. model.snapchat_ads.snapchat_ads__ad_report ad_id 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f0->211. model.snapchat_ads.snapchat_ads__ad_report:f0 215. model.snapchat_ads.snapchat_ads__url_report 215. model.snapchat_ads.snapchat_ads__url_report ad_id 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f0->215. model.snapchat_ads.snapchat_ads__url_report:f0
220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report
  • Input Column: 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp[ad_id]
    • Cleaning The column is cast to TEXT data type
    • Output Columns:
      • ad_id: Directly copied after casting
211. model.snapchat_ads.snapchat_ads__ad_report
  • Input Column: 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report[ad_id]
    • Direct The column is directly copied without transformation
    • Integration Used as the key to join with the ads table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • ad_id: Directly copied to the output
215. model.snapchat_ads.snapchat_ads__url_report
  • Input Column: 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report[ad_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as the key to join with the ads table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • ad_id: Directly copied to the output
Column Lineage
%3 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp date 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report date_hour 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp:f0->220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f0 211. model.snapchat_ads.snapchat_ads__ad_report 211. model.snapchat_ads.snapchat_ads__ad_report date_day 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f0->211. model.snapchat_ads.snapchat_ads__ad_report:f0 215. model.snapchat_ads.snapchat_ads__url_report 215. model.snapchat_ads.snapchat_ads__url_report date_day 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f0->215. model.snapchat_ads.snapchat_ads__url_report:f0 210. model.snapchat_ads.snapchat_ads__account_report 210. model.snapchat_ads.snapchat_ads__account_report date_day 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f0->210. model.snapchat_ads.snapchat_ads__account_report:f0
220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report
  • Input Column: 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp[date]
    • Cleaning The column is cast to TIMESTAMP data type
    • Output Columns:
      • date_hour: Directly copied after casting
210. model.snapchat_ads.snapchat_ads__account_report
  • Input Column: 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report[date_hour]
    • Cleaning The column is cast to DATE type
    • Aggregation The resulting date is grouped by in the final aggregation
    • Output Columns:
      • date_day: Transformed and mapped to this output column
211. model.snapchat_ads.snapchat_ads__ad_report
  • Input Column: 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report[date_hour]
    • Cleaning Cast to DATE type
    • Aggregation Used in the GROUP BY clause after transformation
    • Output Columns:
      • date_day: Transformed to date and used in the output
215. model.snapchat_ads.snapchat_ads__url_report
  • Input Column: 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report[date_hour]
    • Cleaning Cast to DATE type
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • date_day: Transformed to date_day in the output
Column Lineage
%3 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp impressions 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report impressions 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp:f0->220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f0 211. model.snapchat_ads.snapchat_ads__ad_report 211. model.snapchat_ads.snapchat_ads__ad_report impressions 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f0->211. model.snapchat_ads.snapchat_ads__ad_report:f0 215. model.snapchat_ads.snapchat_ads__url_report 215. model.snapchat_ads.snapchat_ads__url_report impressions 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f0->215. model.snapchat_ads.snapchat_ads__url_report:f0 210. model.snapchat_ads.snapchat_ads__account_report 210. model.snapchat_ads.snapchat_ads__account_report impressions 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f0->210. model.snapchat_ads.snapchat_ads__account_report:f0
220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report
  • Input Column: 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp[impressions]
    • Cleaning The column is cast to DECIMAL(28, 6) data type
    • Output Columns:
      • impressions: Directly copied after casting
210. model.snapchat_ads.snapchat_ads__account_report
  • Input Column: 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report[impressions]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • impressions: Summed up and directly mapped to the output 'impressions' column
211. model.snapchat_ads.snapchat_ads__ad_report
  • Input Column: 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report[impressions]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • impressions: Summed up and directly mapped to the output column
215. model.snapchat_ads.snapchat_ads__url_report
  • Input Column: 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report[impressions]
    • Aggregation This column is summed up in the aggregated CTE
    • Output Columns:
      • impressions: The sum of impressions is mapped to the output 'impressions' column
Column Lineage
%3 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp spend 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report spend 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp:f0->220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f0 211. model.snapchat_ads.snapchat_ads__ad_report 211. model.snapchat_ads.snapchat_ads__ad_report spend 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f0->211. model.snapchat_ads.snapchat_ads__ad_report:f0 215. model.snapchat_ads.snapchat_ads__url_report 215. model.snapchat_ads.snapchat_ads__url_report spend 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f0->215. model.snapchat_ads.snapchat_ads__url_report:f0 210. model.snapchat_ads.snapchat_ads__account_report 210. model.snapchat_ads.snapchat_ads__account_report spend 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f0->210. model.snapchat_ads.snapchat_ads__account_report:f0
220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report
  • Input Column: 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp[spend]
    • Cleaning The column is cast to DECIMAL(28, 6) data type
    • Other The value is divided by 1,000,000 to convert from micros
    • Output Columns:
      • spend: Transformed by dividing by 1,000,000
210. model.snapchat_ads.snapchat_ads__account_report
  • Input Column: 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report[spend]
    • Aggregation The column is summed up in the aggregated CTE
    • Cleaning The summed value is rounded to 2 decimal places
    • Output Columns:
      • spend: Summed up, rounded, and mapped to the output 'spend' column
211. model.snapchat_ads.snapchat_ads__ad_report
  • Input Column: 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report[spend]
    • Aggregation The column is summed up in the aggregated CTE
    • Cleaning The summed value is rounded to 2 decimal places
    • Output Columns:
      • spend: Summed up, rounded, and mapped to the output column
215. model.snapchat_ads.snapchat_ads__url_report
  • Input Column: 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report[spend]
    • Aggregation This column is summed up in the aggregated CTE
    • Cleaning The sum is rounded to 2 decimal places
    • Output Columns:
      • spend: The sum of spend (rounded) is mapped to the output 'spend' column
Column Lineage
%3 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp swipes 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report swipes 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp:f0->220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f0 211. model.snapchat_ads.snapchat_ads__ad_report 211. model.snapchat_ads.snapchat_ads__ad_report swipes 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f0->211. model.snapchat_ads.snapchat_ads__ad_report:f0 215. model.snapchat_ads.snapchat_ads__url_report 215. model.snapchat_ads.snapchat_ads__url_report swipes 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f0->215. model.snapchat_ads.snapchat_ads__url_report:f0 210. model.snapchat_ads.snapchat_ads__account_report 210. model.snapchat_ads.snapchat_ads__account_report swipes 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report:f0->210. model.snapchat_ads.snapchat_ads__account_report:f0
220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report
  • Input Column: 221. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report_tmp[swipes]
    • Cleaning The column is cast to DECIMAL(28, 6) data type
    • Output Columns:
      • swipes: Directly copied after casting
210. model.snapchat_ads.snapchat_ads__account_report
  • Input Column: 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report[swipes]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • swipes: Summed up and directly mapped to the output 'swipes' column
211. model.snapchat_ads.snapchat_ads__ad_report
  • Input Column: 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report[swipes]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • swipes: Summed up and directly mapped to the output column
215. model.snapchat_ads.snapchat_ads__url_report
  • Input Column: 220. model.snapchat_ads_source.stg_snapchat_ads__ad_hourly_report[swipes]
    • Aggregation This column is summed up in the aggregated CTE
    • Output Columns:
      • swipes: The sum of swipes is mapped to the output 'swipes' column
222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history

This SQL query stages data from a temporary table for Snapchat ad squad history. It casts several fields to appropriate data types, renames some columns, and adds a flag to identify the most recent record for each ad squad. The query also includes a source relation field, though it's currently set to an empty string.

CleaningDeduplication
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_snapchat_ads_source.stg_snapchat_ads__ad_squad_history_tmp
), fields AS (
  SELECT
    CAST(NULL AS TIMESTAMP) AS _fivetran_synced,
    CAST(NULL AS TEXT) AS campaign_id,
    CAST(NULL AS TIMESTAMP) AS created_at,
    CAST(NULL AS TEXT) AS id,
    CAST(NULL AS TEXT) AS name,
    CAST(NULL AS TIMESTAMP) AS updated_at,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    id AS ad_squad_id,
    name AS ad_squad_name,
    CAST(created_at AS TIMESTAMP) AS created_at,
    campaign_id,
    CAST(_fivetran_synced AS TIMESTAMP) AS _fivetran_synced,
    CAST(updated_at AS TIMESTAMP) AS updated_at,
    ROW_NUMBER() OVER (PARTITION BY source_relation, id ORDER BY _fivetran_synced DESC) = 1 AS is_most_recent_record
  FROM fields
)
SELECT
  *
FROM final
%3 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history source_relation _fivetran_synced ad_squad_id ad_squad_name created_at updated_at campaign_id is_most_recent_record 223. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history_tmp 223. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history_tmp id campaign_id name _fivetran_synced 223. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history_tmp:f0->222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history:f2 223. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history_tmp:f1->222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history:f6 223. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history_tmp:f2->222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history:f3 223. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history_tmp:f3->222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history:f1
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
_fivetran_synced timestamp without time zone When the record was last synced by Fivetran.
ad_squad_id text The ID of the ad squad in Snapchat.
ad_squad_name text The name of the ad squad in Snapchat.
created_at timestamp without time zone Created at timestamp.
updated_at timestamp without time zone Timestamp of when the record was updated.
campaign_id text The ID of the related campaign in Snapchat.
is_most_recent_record boolean Boolean representing whether a record is the most recent version of that record.
Column Lineage
%3 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history source_relation 215. model.snapchat_ads.snapchat_ads__url_report 215. model.snapchat_ads.snapchat_ads__url_report source_relation 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history:f0->215. model.snapchat_ads.snapchat_ads__url_report:f0 212. model.snapchat_ads.snapchat_ads__ad_squad_report 212. model.snapchat_ads.snapchat_ads__ad_squad_report source_relation 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history:f0->212. model.snapchat_ads.snapchat_ads__ad_squad_report:f0 210. model.snapchat_ads.snapchat_ads__account_report 210. model.snapchat_ads.snapchat_ads__account_report source_relation 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history:f0->210. model.snapchat_ads.snapchat_ads__account_report:f0
210. model.snapchat_ads.snapchat_ads__account_report
  • Input Column: 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct copied directly to the output
    • Output Columns:
      • source_relation: directly copied
212. model.snapchat_ads.snapchat_ads__ad_squad_report
  • Input Column: 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
215. model.snapchat_ads.snapchat_ads__url_report
  • Input Column: 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history[source_relation]
    • Integration Used as part of the join condition with other tables
    • Direct Directly included in the output
    • Output Columns:
      • source_relation: Directly copied to the output
Column Lineage
%3 223. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history_tmp 223. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history_tmp _fivetran_synced 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history _fivetran_synced 223. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history_tmp:f0->222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history:f0
222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history
  • Input Column: 223. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history_tmp[_fivetran_synced]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TIMESTAMP in the fields CTE
    • Deduplication Used in the ROW_NUMBER() function to order and identify the most recent record
    • Output Columns:
      • _fivetran_synced: Directly mapped without renaming
Column Lineage
%3 223. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history_tmp 223. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history_tmp id 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history ad_squad_id 223. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history_tmp:f0->222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history:f0 215. model.snapchat_ads.snapchat_ads__url_report 215. model.snapchat_ads.snapchat_ads__url_report ad_squad_id 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history:f0->215. model.snapchat_ads.snapchat_ads__url_report:f0 212. model.snapchat_ads.snapchat_ads__ad_squad_report 212. model.snapchat_ads.snapchat_ads__ad_squad_report ad_squad_id 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history:f0->212. model.snapchat_ads.snapchat_ads__ad_squad_report:f0
222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history
  • Input Column: 223. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history_tmp[id]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT in the fields CTE
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • ad_squad_id: Directly mapped and renamed
212. model.snapchat_ads.snapchat_ads__ad_squad_report
  • Input Column: 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history[ad_squad_id]
    • Integration used as the key to join with ad_squad_hourly table
    • Direct directly copied to the output
    • Output Columns:
      • ad_squad_id: directly copied
215. model.snapchat_ads.snapchat_ads__url_report
  • Input Column: 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history[ad_squad_id]
    • Integration Used as join key with the ads table
    • Direct Directly included in the output
    • Output Columns:
      • ad_squad_id: Directly copied to the output
Column Lineage
%3 223. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history_tmp 223. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history_tmp name 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history ad_squad_name 223. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history_tmp:f0->222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history:f0 215. model.snapchat_ads.snapchat_ads__url_report 215. model.snapchat_ads.snapchat_ads__url_report ad_squad_name 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history:f0->215. model.snapchat_ads.snapchat_ads__url_report:f0 212. model.snapchat_ads.snapchat_ads__ad_squad_report 212. model.snapchat_ads.snapchat_ads__ad_squad_report ad_squad_name 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history:f0->212. model.snapchat_ads.snapchat_ads__ad_squad_report:f0
222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history
  • Input Column: 223. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • ad_squad_name: Directly mapped and renamed
212. model.snapchat_ads.snapchat_ads__ad_squad_report
  • Input Column: 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history[ad_squad_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_squad_name: directly copied
215. model.snapchat_ads.snapchat_ads__url_report
  • Input Column: 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history[ad_squad_name]
    • Direct Directly included in the output
    • Output Columns:
      • ad_squad_name: Directly copied to the output
Column Lineage
%3 223. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history_tmp 223. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history_tmp campaign_id 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history campaign_id 223. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history_tmp:f0->222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history:f0 215. model.snapchat_ads.snapchat_ads__url_report 215. model.snapchat_ads.snapchat_ads__url_report campaign_id 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history:f0->215. model.snapchat_ads.snapchat_ads__url_report:f0
222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history
  • Input Column: 223. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history_tmp[campaign_id]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • campaign_id: Directly mapped without renaming
215. model.snapchat_ads.snapchat_ads__url_report
  • Input Column: 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history[campaign_id]
    • Integration Used as join key with the campaigns table
    • Output Columns:
      • campaign_id: Indirectly mapped through join with campaigns table
223. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of type TEXT. The query limits the result to 0 rows, effectively creating a template or skeleton for the table structure without any actual data.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 223. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history_tmp 223. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history_tmp id campaign_id name _fivetran_synced 354. source.snapchat_ads_source.snapchat_ads.ad_squad_history 354. source.snapchat_ads_source.snapchat_ads.ad_squad_history
Name Type Comment
id text None
campaign_id text None
name text None
_fivetran_synced text None
Column Lineage
%3 223. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history_tmp 223. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history_tmp id 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history ad_squad_id 223. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history_tmp:f0->222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history:f0 215. model.snapchat_ads.snapchat_ads__url_report 215. model.snapchat_ads.snapchat_ads__url_report ad_squad_id 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history:f0->215. model.snapchat_ads.snapchat_ads__url_report:f0 212. model.snapchat_ads.snapchat_ads__ad_squad_report 212. model.snapchat_ads.snapchat_ads__ad_squad_report ad_squad_id 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history:f0->212. model.snapchat_ads.snapchat_ads__ad_squad_report:f0
222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history
  • Input Column: 223. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history_tmp[id]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT in the fields CTE
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • ad_squad_id: Directly mapped and renamed
212. model.snapchat_ads.snapchat_ads__ad_squad_report
  • Input Column: 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history[ad_squad_id]
    • Integration used as the key to join with ad_squad_hourly table
    • Direct directly copied to the output
    • Output Columns:
      • ad_squad_id: directly copied
215. model.snapchat_ads.snapchat_ads__url_report
  • Input Column: 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history[ad_squad_id]
    • Integration Used as join key with the ads table
    • Direct Directly included in the output
    • Output Columns:
      • ad_squad_id: Directly copied to the output
Column Lineage
%3 223. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history_tmp 223. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history_tmp campaign_id 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history campaign_id 223. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history_tmp:f0->222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history:f0 215. model.snapchat_ads.snapchat_ads__url_report 215. model.snapchat_ads.snapchat_ads__url_report campaign_id 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history:f0->215. model.snapchat_ads.snapchat_ads__url_report:f0
222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history
  • Input Column: 223. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history_tmp[campaign_id]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • campaign_id: Directly mapped without renaming
215. model.snapchat_ads.snapchat_ads__url_report
  • Input Column: 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history[campaign_id]
    • Integration Used as join key with the campaigns table
    • Output Columns:
      • campaign_id: Indirectly mapped through join with campaigns table
Column Lineage
%3 223. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history_tmp 223. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history_tmp name 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history ad_squad_name 223. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history_tmp:f0->222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history:f0 215. model.snapchat_ads.snapchat_ads__url_report 215. model.snapchat_ads.snapchat_ads__url_report ad_squad_name 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history:f0->215. model.snapchat_ads.snapchat_ads__url_report:f0 212. model.snapchat_ads.snapchat_ads__ad_squad_report 212. model.snapchat_ads.snapchat_ads__ad_squad_report ad_squad_name 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history:f0->212. model.snapchat_ads.snapchat_ads__ad_squad_report:f0
222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history
  • Input Column: 223. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history_tmp[name]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • ad_squad_name: Directly mapped and renamed
212. model.snapchat_ads.snapchat_ads__ad_squad_report
  • Input Column: 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history[ad_squad_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_squad_name: directly copied
215. model.snapchat_ads.snapchat_ads__url_report
  • Input Column: 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history[ad_squad_name]
    • Direct Directly included in the output
    • Output Columns:
      • ad_squad_name: Directly copied to the output
Column Lineage
%3 223. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history_tmp 223. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history_tmp _fivetran_synced 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history 222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history _fivetran_synced 223. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history_tmp:f0->222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history:f0
222. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history
  • Input Column: 223. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_history_tmp[_fivetran_synced]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast as TIMESTAMP in the fields CTE
    • Deduplication Used in the ROW_NUMBER() function to order and identify the most recent record
    • Output Columns:
      • _fivetran_synced: Directly mapped without renaming
224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report

This SQL query performs data cleaning and featurization on the snapchat_ads source table. It casts various fields to specific data types, converts time-based fields from milliseconds to seconds, and renames some columns. The query also adds a source_relation column and restructures the data into a final format.

CleaningFeaturization
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp
), fields AS (
  SELECT
    CAST(NULL AS TEXT) AS ad_squad_id,
    CAST(NULL AS INT) AS attachment_quartile_1,
    CAST(NULL AS INT) AS attachment_quartile_2,
    CAST(NULL AS INT) AS attachment_quartile_3,
    CAST(NULL AS INT) AS attachment_total_view_time_millis,
    CAST(NULL AS INT) AS attachment_view_completion,
    CAST(NULL AS TIMESTAMP) AS date,
    CAST(NULL AS INT) AS impressions,
    CAST(NULL AS INT) AS quartile_1,
    CAST(NULL AS INT) AS quartile_2,
    CAST(NULL AS INT) AS quartile_3,
    CAST(NULL AS INT) AS saves,
    CAST(NULL AS INT) AS screen_time_millis,
    CAST(NULL AS INT) AS shares,
    CAST(NULL AS INT) AS spend,
    CAST(NULL AS INT) AS swipes,
    CAST(NULL AS INT) AS video_views,
    CAST(NULL AS INT) AS view_completion,
    CAST(NULL AS INT) AS view_time_millis,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    ad_squad_id,
    CAST(date AS TIMESTAMP) AS date_hour,
    attachment_quartile_1,
    attachment_quartile_2,
    attachment_quartile_3,
    (
      attachment_total_view_time_millis / 1000000.0
    ) AS attachment_total_view_time,
    attachment_view_completion,
    quartile_1,
    quartile_2,
    quartile_3,
    saves,
    shares,
    (
      screen_time_millis / 1000000.0
    ) AS screen_time,
    video_views,
    view_completion,
    (
      view_time_millis / 1000000.0
    ) AS view_time,
    impressions,
    (
      spend / 1000000.0
    ) AS spend,
    swipes
  FROM fields
)
SELECT
  *
FROM final
%3 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report source_relation ad_squad_id date_hour attachment_quartile_1 attachment_quartile_2 attachment_quartile_3 attachment_total_view_time attachment_view_completion quartile_1 quartile_2 quartile_3 saves shares screen_time video_views view_completion view_time impressions spend swipes 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp ad_squad_id date attachment_quartile_1 attachment_quartile_2 attachment_quartile_3 attachment_total_view_time_millis attachment_view_completion impressions quartile_1 quartile_2 quartile_3 saves screen_time_millis shares spend swipes video_views view_completion view_time_millis 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp:f0->224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f1 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp:f1->224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f2 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp:f2->224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f3 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp:f3->224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f4 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp:f4->224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f5 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp:f5->224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f6 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp:f6->224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f7 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp:f7->224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f17 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp:f8->224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f8 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp:f9->224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f9 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp:f10->224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f10 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp:f11->224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f11 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp:f12->224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f13 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp:f13->224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f12 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp:f14->224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f18 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp:f15->224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f19 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp:f16->224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f14 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp:f17->224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f15 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp:f18->224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f16
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
ad_squad_id text ID of the ad squad.
date_hour timestamp without time zone The hour that the report relates to.
attachment_quartile_1 integer Number of times your Long Form Video was viewed to 25%
attachment_quartile_2 integer Number of times your Long Form Video was viewed to 50%
attachment_quartile_3 integer Number of times your Long Form Video was viewed to 75%
attachment_total_view_time numeric Total time Snapchatters spent on the attachment (HH:MM:SS)
attachment_view_completion integer The number of times your Long Form Video was viewed to completion (97% )
quartile_1 integer The number of times your video ad was viewed to 25%
quartile_2 integer The number of times your video ad was viewed to 50%
quartile_3 integer The number of times your video ad was viewed to 75%
saves integer Number of times a lens/filter was saved to Memories
shares integer Number of times a lens/filter was shared in a Chat or Story
screen_time numeric The number of milli seconds spent watching your ad across all paid impressions. Screen time starts recording as soon as the media is fully rendered on the device and the autoplay video starts
video_views integer The number of times your video was watched at least 2 seconds or swiped up, whichever comes first
view_completion integer The number of times your video ad was viewed to completion (97% )
view_time numeric The number of milli seconds spent watching your ad across all users reached.
impressions integer The number of impressions for an ad in the hour of the record.
spend numeric The amount of spend for an ad in the hour of the record.
swipes integer The number of swipes for an ad in the hour of the record. Swipes are when your ad was swiped up on or the CTA was tapped to view the attachment below.
Column Lineage
%3 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report source_relation 212. model.snapchat_ads.snapchat_ads__ad_squad_report 212. model.snapchat_ads.snapchat_ads__ad_squad_report source_relation 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f0->212. model.snapchat_ads.snapchat_ads__ad_squad_report:f0
212. model.snapchat_ads.snapchat_ads__ad_squad_report
  • Input Column: 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report[source_relation]
    • Direct The column is directly copied without any transformation
    • Aggregation The column is grouped by in the final aggregation
    • Output Columns:
      • source_relation: Directly copied to the output
Column Lineage
%3 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp ad_squad_id 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report ad_squad_id 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp:f0->224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f0 212. model.snapchat_ads.snapchat_ads__ad_squad_report 212. model.snapchat_ads.snapchat_ads__ad_squad_report ad_squad_id 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f0->212. model.snapchat_ads.snapchat_ads__ad_squad_report:f0
224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report
  • Input Column: 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp[ad_squad_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • ad_squad_id: Directly mapped after casting
212. model.snapchat_ads.snapchat_ads__ad_squad_report
  • Input Column: 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report[ad_squad_id]
    • Integration Used as a key to join with the ad_squads table
    • Aggregation The column is grouped by in the final aggregation
    • Output Columns:
      • ad_squad_id: Directly copied to the output
Column Lineage
%3 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp date 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report date_hour 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp:f0->224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f0 212. model.snapchat_ads.snapchat_ads__ad_squad_report 212. model.snapchat_ads.snapchat_ads__ad_squad_report date_day 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f0->212. model.snapchat_ads.snapchat_ads__ad_squad_report:f0
224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report
  • Input Column: 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp[date]
    • Cleaning The column is cast as TIMESTAMP
    • Featurization Used to create the date_hour column
    • Output Columns:
      • date_hour: Mapped after casting to TIMESTAMP
212. model.snapchat_ads.snapchat_ads__ad_squad_report
  • Input Column: 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report[date_hour]
    • Cleaning The column is cast as DATE type
    • Aggregation The resulting date is grouped by in the final aggregation
    • Output Columns:
      • date_day: Transformed to date and used in the output
Column Lineage
%3 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp attachment_quartile_1 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report attachment_quartile_1 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp:f0->224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f0
224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report
  • Input Column: 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp[attachment_quartile_1]
    • Direct The column is directly copied
    • Cleaning The column is cast as INT
    • Output Columns:
      • attachment_quartile_1: Directly mapped after casting
Column Lineage
%3 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp attachment_quartile_2 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report attachment_quartile_2 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp:f0->224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f0
224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report
  • Input Column: 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp[attachment_quartile_2]
    • Direct The column is directly copied
    • Cleaning The column is cast as INT
    • Output Columns:
      • attachment_quartile_2: Directly mapped after casting
Column Lineage
%3 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp attachment_quartile_3 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report attachment_quartile_3 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp:f0->224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f0
224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report
  • Input Column: 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp[attachment_quartile_3]
    • Direct The column is directly copied
    • Cleaning The column is cast as INT
    • Output Columns:
      • attachment_quartile_3: Directly mapped after casting
Column Lineage
%3 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp attachment_total_view_time_millis 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report attachment_total_view_time 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp:f0->224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f0
224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report
  • Input Column: 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp[attachment_total_view_time_millis]
    • Cleaning The column is cast as INT
    • Featurization The value is divided by 1,000,000 to convert milliseconds to seconds
    • Output Columns:
      • attachment_total_view_time: Mapped after transformation
Column Lineage
%3 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp attachment_view_completion 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report attachment_view_completion 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp:f0->224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f0
224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report
  • Input Column: 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp[attachment_view_completion]
    • Direct The column is directly copied
    • Cleaning The column is cast as INT
    • Output Columns:
      • attachment_view_completion: Directly mapped after casting
Column Lineage
%3 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp quartile_1 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report quartile_1 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp:f0->224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f0
224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report
  • Input Column: 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp[quartile_1]
    • Cleaning The column is cast to INT type
    • Direct The column is directly copied to the output
    • Output Columns:
      • quartile_1: Directly copied after casting to INT
Column Lineage
%3 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp quartile_2 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report quartile_2 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp:f0->224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f0
224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report
  • Input Column: 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp[quartile_2]
    • Cleaning The column is cast to INT type
    • Direct The column is directly copied to the output
    • Output Columns:
      • quartile_2: Directly copied after casting to INT
Column Lineage
%3 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp quartile_3 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report quartile_3 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp:f0->224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f0
224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report
  • Input Column: 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp[quartile_3]
    • Cleaning The column is cast to INT type
    • Direct The column is directly copied to the output
    • Output Columns:
      • quartile_3: Directly copied after casting to INT
Column Lineage
%3 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp saves 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report saves 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp:f0->224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f0
224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report
  • Input Column: 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp[saves]
    • Cleaning The column is cast to INT type
    • Direct The column is directly copied to the output
    • Output Columns:
      • saves: Directly copied after casting to INT
Column Lineage
%3 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp shares 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report shares 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp:f0->224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f0
224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report
  • Input Column: 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp[shares]
    • Cleaning The column is cast to INT
    • Direct The column is directly copied without transformation
    • Output Columns:
      • shares: Directly copied after casting
Column Lineage
%3 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp screen_time_millis 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report screen_time 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp:f0->224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f0
224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report
  • Input Column: 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp[screen_time_millis]
    • Cleaning The column is cast to INT and then divided by 1,000,000 to convert milliseconds to seconds
    • Featurization The value is converted from milliseconds to seconds
    • Output Columns:
      • screen_time: Transformed from milliseconds to seconds
Column Lineage
%3 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp video_views 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report video_views 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp:f0->224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f0
224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report
  • Input Column: 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp[video_views]
    • Cleaning The column is cast to INT
    • Direct The column is directly copied without transformation
    • Output Columns:
      • video_views: Directly copied after casting
Column Lineage
%3 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp view_completion 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report view_completion 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp:f0->224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f0
224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report
  • Input Column: 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp[view_completion]
    • Cleaning The column is cast to INT
    • Direct The column is directly copied without transformation
    • Output Columns:
      • view_completion: Directly copied after casting
Column Lineage
%3 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp view_time_millis 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report view_time 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp:f0->224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f0
224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report
  • Input Column: 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp[view_time_millis]
    • Cleaning The column is cast to INT type in the 'fields' CTE.
    • Featurization The value is converted from milliseconds to seconds by dividing by 1,000,000.
    • Output Columns:
      • view_time: The column is transformed by dividing by 1,000,000 to convert milliseconds to seconds, and the result is mapped to the 'view_time' output column.
Column Lineage
%3 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp impressions 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report impressions 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp:f0->224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f0 212. model.snapchat_ads.snapchat_ads__ad_squad_report 212. model.snapchat_ads.snapchat_ads__ad_squad_report impressions 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f0->212. model.snapchat_ads.snapchat_ads__ad_squad_report:f0
224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report
  • Input Column: 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp[impressions]
    • Cleaning The column is cast to INT type
    • Direct The column is directly copied to the output
    • Output Columns:
      • impressions: Directly copied after casting to INT
212. model.snapchat_ads.snapchat_ads__ad_squad_report
  • Input Column: 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report[impressions]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • impressions: Summed up in the final output
Column Lineage
%3 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp spend 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report spend 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp:f0->224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f0 212. model.snapchat_ads.snapchat_ads__ad_squad_report 212. model.snapchat_ads.snapchat_ads__ad_squad_report spend 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f0->212. model.snapchat_ads.snapchat_ads__ad_squad_report:f0
224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report
  • Input Column: 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp[spend]
    • Cleaning The column is cast to INT and then divided by 1,000,000
    • Featurization The value is converted from micros to standard currency units
    • Output Columns:
      • spend: Transformed from micros to standard currency units
212. model.snapchat_ads.snapchat_ads__ad_squad_report
  • Input Column: 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report[spend]
    • Aggregation The column is summed up and rounded in the aggregated CTE
    • Cleaning The sum is rounded to 2 decimal places
    • Output Columns:
      • spend: Summed up and rounded in the final output
Column Lineage
%3 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp swipes 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report swipes 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp:f0->224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f0 212. model.snapchat_ads.snapchat_ads__ad_squad_report 212. model.snapchat_ads.snapchat_ads__ad_squad_report swipes 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f0->212. model.snapchat_ads.snapchat_ads__ad_squad_report:f0
224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report
  • Input Column: 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp[swipes]
    • Cleaning The column is cast to INT
    • Direct The column is directly copied without transformation
    • Output Columns:
      • swipes: Directly copied after casting
212. model.snapchat_ads.snapchat_ads__ad_squad_report
  • Input Column: 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report[swipes]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • swipes: Summed up in the final output
225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of type TEXT, which is set to NULL. The LIMIT 0 clause ensures no rows are returned. This is likely used as a template or placeholder for further development or testing purposes.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp ad_squad_id date _fivetran_synced android_installs attachment_avg_view_time_millis attachment_quartile_1 attachment_quartile_2 attachment_quartile_3 attachment_total_view_time_millis attachment_view_completion avg_screen_time_millis avg_view_time_millis conversion_add_billing conversion_add_cart conversion_app_opens conversion_level_completes conversion_page_views conversion_purchases conversion_purchases_value conversion_save conversion_searches conversion_sign_ups conversion_start_checkout conversion_view_content impressions ios_installs quartile_1 quartile_2 quartile_3 saves screen_time_millis shares spend story_completes story_opens swipe_up_percent swipes total_installs video_views view_completion view_time_millis 355. source.snapchat_ads_source.snapchat_ads.ad_squad_hourly_report 355. source.snapchat_ads_source.snapchat_ads.ad_squad_hourly_report
Name Type Comment
ad_squad_id text None
date timestamp without time zone None
_fivetran_synced timestamp without time zone None
android_installs integer None
attachment_avg_view_time_millis integer None
attachment_quartile_1 integer None
attachment_quartile_2 integer None
attachment_quartile_3 integer None
attachment_total_view_time_millis integer None
attachment_view_completion integer None
avg_screen_time_millis integer None
avg_view_time_millis integer None
conversion_add_billing integer None
conversion_add_cart integer None
conversion_app_opens integer None
conversion_level_completes integer None
conversion_page_views integer None
conversion_purchases integer None
conversion_purchases_value integer None
conversion_save integer None
conversion_searches integer None
conversion_sign_ups integer None
conversion_start_checkout integer None
conversion_view_content integer None
impressions integer None
ios_installs integer None
quartile_1 integer None
quartile_2 integer None
quartile_3 integer None
saves integer None
screen_time_millis integer None
shares integer None
spend integer None
story_completes integer None
story_opens integer None
swipe_up_percent integer None
swipes integer None
total_installs integer None
video_views integer None
view_completion integer None
view_time_millis integer None
Column Lineage
%3 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp ad_squad_id 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report ad_squad_id 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp:f0->224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f0 212. model.snapchat_ads.snapchat_ads__ad_squad_report 212. model.snapchat_ads.snapchat_ads__ad_squad_report ad_squad_id 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f0->212. model.snapchat_ads.snapchat_ads__ad_squad_report:f0
224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report
  • Input Column: 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp[ad_squad_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • ad_squad_id: Directly mapped after casting
212. model.snapchat_ads.snapchat_ads__ad_squad_report
  • Input Column: 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report[ad_squad_id]
    • Integration Used as a key to join with the ad_squads table
    • Aggregation The column is grouped by in the final aggregation
    • Output Columns:
      • ad_squad_id: Directly copied to the output
Column Lineage
%3 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp date 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report date_hour 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp:f0->224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f0 212. model.snapchat_ads.snapchat_ads__ad_squad_report 212. model.snapchat_ads.snapchat_ads__ad_squad_report date_day 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f0->212. model.snapchat_ads.snapchat_ads__ad_squad_report:f0
224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report
  • Input Column: 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp[date]
    • Cleaning The column is cast as TIMESTAMP
    • Featurization Used to create the date_hour column
    • Output Columns:
      • date_hour: Mapped after casting to TIMESTAMP
212. model.snapchat_ads.snapchat_ads__ad_squad_report
  • Input Column: 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report[date_hour]
    • Cleaning The column is cast as DATE type
    • Aggregation The resulting date is grouped by in the final aggregation
    • Output Columns:
      • date_day: Transformed to date and used in the output
Column Lineage
%3 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp attachment_quartile_1 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report attachment_quartile_1 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp:f0->224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f0
224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report
  • Input Column: 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp[attachment_quartile_1]
    • Direct The column is directly copied
    • Cleaning The column is cast as INT
    • Output Columns:
      • attachment_quartile_1: Directly mapped after casting
Column Lineage
%3 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp attachment_quartile_2 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report attachment_quartile_2 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp:f0->224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f0
224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report
  • Input Column: 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp[attachment_quartile_2]
    • Direct The column is directly copied
    • Cleaning The column is cast as INT
    • Output Columns:
      • attachment_quartile_2: Directly mapped after casting
Column Lineage
%3 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp attachment_quartile_3 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report attachment_quartile_3 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp:f0->224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f0
224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report
  • Input Column: 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp[attachment_quartile_3]
    • Direct The column is directly copied
    • Cleaning The column is cast as INT
    • Output Columns:
      • attachment_quartile_3: Directly mapped after casting
Column Lineage
%3 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp attachment_total_view_time_millis 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report attachment_total_view_time 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp:f0->224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f0
224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report
  • Input Column: 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp[attachment_total_view_time_millis]
    • Cleaning The column is cast as INT
    • Featurization The value is divided by 1,000,000 to convert milliseconds to seconds
    • Output Columns:
      • attachment_total_view_time: Mapped after transformation
Column Lineage
%3 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp attachment_view_completion 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report attachment_view_completion 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp:f0->224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f0
224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report
  • Input Column: 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp[attachment_view_completion]
    • Direct The column is directly copied
    • Cleaning The column is cast as INT
    • Output Columns:
      • attachment_view_completion: Directly mapped after casting
Column Lineage
%3 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp impressions 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report impressions 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp:f0->224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f0 212. model.snapchat_ads.snapchat_ads__ad_squad_report 212. model.snapchat_ads.snapchat_ads__ad_squad_report impressions 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f0->212. model.snapchat_ads.snapchat_ads__ad_squad_report:f0
224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report
  • Input Column: 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp[impressions]
    • Cleaning The column is cast to INT type
    • Direct The column is directly copied to the output
    • Output Columns:
      • impressions: Directly copied after casting to INT
212. model.snapchat_ads.snapchat_ads__ad_squad_report
  • Input Column: 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report[impressions]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • impressions: Summed up in the final output
Column Lineage
%3 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp quartile_1 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report quartile_1 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp:f0->224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f0
224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report
  • Input Column: 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp[quartile_1]
    • Cleaning The column is cast to INT type
    • Direct The column is directly copied to the output
    • Output Columns:
      • quartile_1: Directly copied after casting to INT
Column Lineage
%3 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp quartile_2 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report quartile_2 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp:f0->224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f0
224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report
  • Input Column: 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp[quartile_2]
    • Cleaning The column is cast to INT type
    • Direct The column is directly copied to the output
    • Output Columns:
      • quartile_2: Directly copied after casting to INT
Column Lineage
%3 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp quartile_3 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report quartile_3 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp:f0->224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f0
224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report
  • Input Column: 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp[quartile_3]
    • Cleaning The column is cast to INT type
    • Direct The column is directly copied to the output
    • Output Columns:
      • quartile_3: Directly copied after casting to INT
Column Lineage
%3 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp saves 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report saves 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp:f0->224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f0
224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report
  • Input Column: 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp[saves]
    • Cleaning The column is cast to INT type
    • Direct The column is directly copied to the output
    • Output Columns:
      • saves: Directly copied after casting to INT
Column Lineage
%3 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp screen_time_millis 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report screen_time 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp:f0->224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f0
224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report
  • Input Column: 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp[screen_time_millis]
    • Cleaning The column is cast to INT and then divided by 1,000,000 to convert milliseconds to seconds
    • Featurization The value is converted from milliseconds to seconds
    • Output Columns:
      • screen_time: Transformed from milliseconds to seconds
Column Lineage
%3 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp shares 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report shares 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp:f0->224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f0
224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report
  • Input Column: 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp[shares]
    • Cleaning The column is cast to INT
    • Direct The column is directly copied without transformation
    • Output Columns:
      • shares: Directly copied after casting
Column Lineage
%3 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp spend 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report spend 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp:f0->224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f0 212. model.snapchat_ads.snapchat_ads__ad_squad_report 212. model.snapchat_ads.snapchat_ads__ad_squad_report spend 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f0->212. model.snapchat_ads.snapchat_ads__ad_squad_report:f0
224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report
  • Input Column: 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp[spend]
    • Cleaning The column is cast to INT and then divided by 1,000,000
    • Featurization The value is converted from micros to standard currency units
    • Output Columns:
      • spend: Transformed from micros to standard currency units
212. model.snapchat_ads.snapchat_ads__ad_squad_report
  • Input Column: 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report[spend]
    • Aggregation The column is summed up and rounded in the aggregated CTE
    • Cleaning The sum is rounded to 2 decimal places
    • Output Columns:
      • spend: Summed up and rounded in the final output
Column Lineage
%3 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp swipes 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report swipes 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp:f0->224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f0 212. model.snapchat_ads.snapchat_ads__ad_squad_report 212. model.snapchat_ads.snapchat_ads__ad_squad_report swipes 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f0->212. model.snapchat_ads.snapchat_ads__ad_squad_report:f0
224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report
  • Input Column: 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp[swipes]
    • Cleaning The column is cast to INT
    • Direct The column is directly copied without transformation
    • Output Columns:
      • swipes: Directly copied after casting
212. model.snapchat_ads.snapchat_ads__ad_squad_report
  • Input Column: 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report[swipes]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • swipes: Summed up in the final output
Column Lineage
%3 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp video_views 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report video_views 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp:f0->224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f0
224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report
  • Input Column: 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp[video_views]
    • Cleaning The column is cast to INT
    • Direct The column is directly copied without transformation
    • Output Columns:
      • video_views: Directly copied after casting
Column Lineage
%3 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp view_completion 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report view_completion 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp:f0->224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f0
224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report
  • Input Column: 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp[view_completion]
    • Cleaning The column is cast to INT
    • Direct The column is directly copied without transformation
    • Output Columns:
      • view_completion: Directly copied after casting
Column Lineage
%3 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp view_time_millis 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report 224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report view_time 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp:f0->224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report:f0
224. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report
  • Input Column: 225. model.snapchat_ads_source.stg_snapchat_ads__ad_squad_hourly_report_tmp[view_time_millis]
    • Cleaning The column is cast to INT type in the 'fields' CTE.
    • Featurization The value is converted from milliseconds to seconds by dividing by 1,000,000.
    • Output Columns:
      • view_time: The column is transformed by dividing by 1,000,000 to convert milliseconds to seconds, and the result is mapped to the 'view_time' output column.
226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history

This SQL query stages data from a temporary Snapchat ads campaign history table. It casts specific fields to appropriate data types, renames some columns, and adds a flag to identify the most recent record for each campaign. The query also includes a 'source_relation' field, though it's set to an empty string in this case.

CleaningDeduplication
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_snapchat_ads_source.stg_snapchat_ads__campaign_history_tmp
), fields AS (
  SELECT
    CAST(NULL AS TIMESTAMP) AS _fivetran_synced,
    CAST(NULL AS TEXT) AS ad_account_id,
    CAST(NULL AS TIMESTAMP) AS created_at,
    CAST(NULL AS TEXT) AS id,
    CAST(NULL AS TEXT) AS name,
    CAST(NULL AS TIMESTAMP) AS updated_at,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    id AS campaign_id,
    ad_account_id,
    CAST(created_at AS TIMESTAMP) AS created_at,
    name AS campaign_name,
    CAST(_fivetran_synced AS TIMESTAMP) AS _fivetran_synced,
    CAST(updated_at AS TIMESTAMP) AS updated_at,
    ROW_NUMBER() OVER (PARTITION BY source_relation, id ORDER BY _fivetran_synced DESC) = 1 AS is_most_recent_record
  FROM fields
)
SELECT
  *
FROM final
%3 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history source_relation _fivetran_synced campaign_id campaign_name ad_account_id created_at updated_at is_most_recent_record 227. model.snapchat_ads_source.stg_snapchat_ads__campaign_history_tmp 227. model.snapchat_ads_source.stg_snapchat_ads__campaign_history_tmp id ad_account_id name _fivetran_synced 227. model.snapchat_ads_source.stg_snapchat_ads__campaign_history_tmp:f0->226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history:f2 227. model.snapchat_ads_source.stg_snapchat_ads__campaign_history_tmp:f1->226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history:f4 227. model.snapchat_ads_source.stg_snapchat_ads__campaign_history_tmp:f2->226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history:f3 227. model.snapchat_ads_source.stg_snapchat_ads__campaign_history_tmp:f3->226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history:f1
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
_fivetran_synced timestamp without time zone When the record was last synced by Fivetran.
campaign_id text The id of the campaign in Snapchat.
campaign_name text The name of the campaign in Snapchat.
ad_account_id text The ID of the related ad account in Snapchat.
created_at timestamp without time zone Created at timestamp.
updated_at timestamp without time zone Timestamp of when the record was updated.
is_most_recent_record boolean Boolean representing whether a record is the most recent version of that record.
Column Lineage
%3 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history source_relation 215. model.snapchat_ads.snapchat_ads__url_report 215. model.snapchat_ads.snapchat_ads__url_report source_relation 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history:f0->215. model.snapchat_ads.snapchat_ads__url_report:f0 212. model.snapchat_ads.snapchat_ads__ad_squad_report 212. model.snapchat_ads.snapchat_ads__ad_squad_report source_relation 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history:f0->212. model.snapchat_ads.snapchat_ads__ad_squad_report:f0 210. model.snapchat_ads.snapchat_ads__account_report 210. model.snapchat_ads.snapchat_ads__account_report source_relation 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history:f0->210. model.snapchat_ads.snapchat_ads__account_report:f0 213. model.snapchat_ads.snapchat_ads__campaign_report 213. model.snapchat_ads.snapchat_ads__campaign_report source_relation 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history:f0->213. model.snapchat_ads.snapchat_ads__campaign_report:f0
210. model.snapchat_ads.snapchat_ads__account_report
  • Input Column: 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history[source_relation]
    • Integration used to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
212. model.snapchat_ads.snapchat_ads__ad_squad_report
  • Input Column: 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
213. model.snapchat_ads.snapchat_ads__campaign_report
  • Input Column: 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
215. model.snapchat_ads.snapchat_ads__url_report
  • Input Column: 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
Column Lineage
%3 227. model.snapchat_ads_source.stg_snapchat_ads__campaign_history_tmp 227. model.snapchat_ads_source.stg_snapchat_ads__campaign_history_tmp _fivetran_synced 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history _fivetran_synced 227. model.snapchat_ads_source.stg_snapchat_ads__campaign_history_tmp:f0->226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history:f0
226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history
  • Input Column: 227. model.snapchat_ads_source.stg_snapchat_ads__campaign_history_tmp[_fivetran_synced]
    • Direct The column is directly copied to the output
    • Cleaning The column is cast as TIMESTAMP in the fields CTE
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • _fivetran_synced: Directly mapped without renaming
Column Lineage
%3 227. model.snapchat_ads_source.stg_snapchat_ads__campaign_history_tmp 227. model.snapchat_ads_source.stg_snapchat_ads__campaign_history_tmp id 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history campaign_id 227. model.snapchat_ads_source.stg_snapchat_ads__campaign_history_tmp:f0->226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history:f0 215. model.snapchat_ads.snapchat_ads__url_report 215. model.snapchat_ads.snapchat_ads__url_report campaign_id 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history:f0->215. model.snapchat_ads.snapchat_ads__url_report:f0 212. model.snapchat_ads.snapchat_ads__ad_squad_report 212. model.snapchat_ads.snapchat_ads__ad_squad_report campaign_id 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history:f0->212. model.snapchat_ads.snapchat_ads__ad_squad_report:f0 213. model.snapchat_ads.snapchat_ads__campaign_report 213. model.snapchat_ads.snapchat_ads__campaign_report campaign_id 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history:f0->213. model.snapchat_ads.snapchat_ads__campaign_report:f0
226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history
  • Input Column: 227. model.snapchat_ads_source.stg_snapchat_ads__campaign_history_tmp[id]
    • Direct The column is directly copied to the output
    • Cleaning The column is cast as TEXT in the fields CTE
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • campaign_id: Directly mapped and renamed
212. model.snapchat_ads.snapchat_ads__ad_squad_report
  • Input Column: 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history[campaign_id]
    • Integration used as part of the join condition with ad_squads table
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
213. model.snapchat_ads.snapchat_ads__campaign_report
  • Input Column: 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history[campaign_id]
    • Integration used as the key to join with campaign_hourly table
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
215. model.snapchat_ads.snapchat_ads__url_report
  • Input Column: 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history[campaign_id]
    • Integration used as a join key with the ad_squads table
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
Column Lineage
%3 227. model.snapchat_ads_source.stg_snapchat_ads__campaign_history_tmp 227. model.snapchat_ads_source.stg_snapchat_ads__campaign_history_tmp name 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history campaign_name 227. model.snapchat_ads_source.stg_snapchat_ads__campaign_history_tmp:f0->226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history:f0 215. model.snapchat_ads.snapchat_ads__url_report 215. model.snapchat_ads.snapchat_ads__url_report campaign_name 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history:f0->215. model.snapchat_ads.snapchat_ads__url_report:f0 212. model.snapchat_ads.snapchat_ads__ad_squad_report 212. model.snapchat_ads.snapchat_ads__ad_squad_report campaign_name 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history:f0->212. model.snapchat_ads.snapchat_ads__ad_squad_report:f0 213. model.snapchat_ads.snapchat_ads__campaign_report 213. model.snapchat_ads.snapchat_ads__campaign_report campaign_name 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history:f0->213. model.snapchat_ads.snapchat_ads__campaign_report:f0
226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history
  • Input Column: 227. model.snapchat_ads_source.stg_snapchat_ads__campaign_history_tmp[name]
    • Direct The column is directly copied to the output
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • campaign_name: Directly mapped and renamed
212. model.snapchat_ads.snapchat_ads__ad_squad_report
  • Input Column: 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history[campaign_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_name: directly copied
213. model.snapchat_ads.snapchat_ads__campaign_report
  • Input Column: 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history[campaign_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_name: directly copied
215. model.snapchat_ads.snapchat_ads__url_report
  • Input Column: 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history[campaign_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_name: directly copied
Column Lineage
%3 227. model.snapchat_ads_source.stg_snapchat_ads__campaign_history_tmp 227. model.snapchat_ads_source.stg_snapchat_ads__campaign_history_tmp ad_account_id 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history ad_account_id 227. model.snapchat_ads_source.stg_snapchat_ads__campaign_history_tmp:f0->226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history:f0
226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history
  • Input Column: 227. model.snapchat_ads_source.stg_snapchat_ads__campaign_history_tmp[ad_account_id]
    • Direct The column is directly copied to the output
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • ad_account_id: Directly mapped without renaming
227. model.snapchat_ads_source.stg_snapchat_ads__campaign_history_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of type TEXT. It's likely used as a placeholder or template for a staging table in a dbt (data build tool) project, specifically for Snapchat ads campaign history data.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 227. model.snapchat_ads_source.stg_snapchat_ads__campaign_history_tmp 227. model.snapchat_ads_source.stg_snapchat_ads__campaign_history_tmp id ad_account_id name _fivetran_synced 356. source.snapchat_ads_source.snapchat_ads.campaign_history 356. source.snapchat_ads_source.snapchat_ads.campaign_history
Name Type Comment
id text None
ad_account_id text None
name text None
_fivetran_synced text None
Column Lineage
%3 227. model.snapchat_ads_source.stg_snapchat_ads__campaign_history_tmp 227. model.snapchat_ads_source.stg_snapchat_ads__campaign_history_tmp id 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history campaign_id 227. model.snapchat_ads_source.stg_snapchat_ads__campaign_history_tmp:f0->226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history:f0 215. model.snapchat_ads.snapchat_ads__url_report 215. model.snapchat_ads.snapchat_ads__url_report campaign_id 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history:f0->215. model.snapchat_ads.snapchat_ads__url_report:f0 212. model.snapchat_ads.snapchat_ads__ad_squad_report 212. model.snapchat_ads.snapchat_ads__ad_squad_report campaign_id 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history:f0->212. model.snapchat_ads.snapchat_ads__ad_squad_report:f0 213. model.snapchat_ads.snapchat_ads__campaign_report 213. model.snapchat_ads.snapchat_ads__campaign_report campaign_id 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history:f0->213. model.snapchat_ads.snapchat_ads__campaign_report:f0
226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history
  • Input Column: 227. model.snapchat_ads_source.stg_snapchat_ads__campaign_history_tmp[id]
    • Direct The column is directly copied to the output
    • Cleaning The column is cast as TEXT in the fields CTE
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • campaign_id: Directly mapped and renamed
212. model.snapchat_ads.snapchat_ads__ad_squad_report
  • Input Column: 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history[campaign_id]
    • Integration used as part of the join condition with ad_squads table
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
213. model.snapchat_ads.snapchat_ads__campaign_report
  • Input Column: 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history[campaign_id]
    • Integration used as the key to join with campaign_hourly table
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
215. model.snapchat_ads.snapchat_ads__url_report
  • Input Column: 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history[campaign_id]
    • Integration used as a join key with the ad_squads table
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
Column Lineage
%3 227. model.snapchat_ads_source.stg_snapchat_ads__campaign_history_tmp 227. model.snapchat_ads_source.stg_snapchat_ads__campaign_history_tmp ad_account_id 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history ad_account_id 227. model.snapchat_ads_source.stg_snapchat_ads__campaign_history_tmp:f0->226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history:f0
226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history
  • Input Column: 227. model.snapchat_ads_source.stg_snapchat_ads__campaign_history_tmp[ad_account_id]
    • Direct The column is directly copied to the output
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • ad_account_id: Directly mapped without renaming
Column Lineage
%3 227. model.snapchat_ads_source.stg_snapchat_ads__campaign_history_tmp 227. model.snapchat_ads_source.stg_snapchat_ads__campaign_history_tmp name 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history campaign_name 227. model.snapchat_ads_source.stg_snapchat_ads__campaign_history_tmp:f0->226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history:f0 215. model.snapchat_ads.snapchat_ads__url_report 215. model.snapchat_ads.snapchat_ads__url_report campaign_name 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history:f0->215. model.snapchat_ads.snapchat_ads__url_report:f0 212. model.snapchat_ads.snapchat_ads__ad_squad_report 212. model.snapchat_ads.snapchat_ads__ad_squad_report campaign_name 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history:f0->212. model.snapchat_ads.snapchat_ads__ad_squad_report:f0 213. model.snapchat_ads.snapchat_ads__campaign_report 213. model.snapchat_ads.snapchat_ads__campaign_report campaign_name 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history:f0->213. model.snapchat_ads.snapchat_ads__campaign_report:f0
226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history
  • Input Column: 227. model.snapchat_ads_source.stg_snapchat_ads__campaign_history_tmp[name]
    • Direct The column is directly copied to the output
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • campaign_name: Directly mapped and renamed
212. model.snapchat_ads.snapchat_ads__ad_squad_report
  • Input Column: 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history[campaign_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_name: directly copied
213. model.snapchat_ads.snapchat_ads__campaign_report
  • Input Column: 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history[campaign_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_name: directly copied
215. model.snapchat_ads.snapchat_ads__url_report
  • Input Column: 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history[campaign_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_name: directly copied
Column Lineage
%3 227. model.snapchat_ads_source.stg_snapchat_ads__campaign_history_tmp 227. model.snapchat_ads_source.stg_snapchat_ads__campaign_history_tmp _fivetran_synced 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history 226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history _fivetran_synced 227. model.snapchat_ads_source.stg_snapchat_ads__campaign_history_tmp:f0->226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history:f0
226. model.snapchat_ads_source.stg_snapchat_ads__campaign_history
  • Input Column: 227. model.snapchat_ads_source.stg_snapchat_ads__campaign_history_tmp[_fivetran_synced]
    • Direct The column is directly copied to the output
    • Cleaning The column is cast as TIMESTAMP in the fields CTE
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • _fivetran_synced: Directly mapped without renaming
228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report

This SQL query performs data transformation and type casting on a Snapchat ads campaign hourly report. It starts with a base table, then defines a set of fields with specific data types. The final select statement applies further transformations, including converting milliseconds to seconds for time-based fields and adjusting the spend value. The query also renames some fields and ensures consistent data types for the output.

CleaningFeaturization
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp
), fields AS (
  SELECT
    CAST(NULL AS INT) AS attachment_quartile_1,
    CAST(NULL AS INT) AS attachment_quartile_2,
    CAST(NULL AS INT) AS attachment_quartile_3,
    CAST(NULL AS INT) AS attachment_total_view_time_millis,
    CAST(NULL AS INT) AS attachment_view_completion,
    CAST(NULL AS TEXT) AS campaign_id,
    CAST(NULL AS TIMESTAMP) AS date,
    CAST(NULL AS INT) AS impressions,
    CAST(NULL AS INT) AS quartile_1,
    CAST(NULL AS INT) AS quartile_2,
    CAST(NULL AS INT) AS quartile_3,
    CAST(NULL AS INT) AS saves,
    CAST(NULL AS INT) AS screen_time_millis,
    CAST(NULL AS INT) AS shares,
    CAST(NULL AS INT) AS spend,
    CAST(NULL AS INT) AS swipes,
    CAST(NULL AS INT) AS video_views,
    CAST(NULL AS INT) AS view_completion,
    CAST(NULL AS INT) AS view_time_millis,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    campaign_id,
    CAST(date AS TIMESTAMP) AS date_hour,
    attachment_quartile_1,
    attachment_quartile_2,
    attachment_quartile_3,
    (
      attachment_total_view_time_millis / 1000000.0
    ) AS attachment_total_view_time,
    attachment_view_completion,
    quartile_1,
    quartile_2,
    quartile_3,
    saves,
    shares,
    (
      screen_time_millis / 1000000.0
    ) AS screen_time,
    video_views,
    view_completion,
    (
      view_time_millis / 1000000.0
    ) AS view_time,
    impressions,
    (
      spend / 1000000.0
    ) AS spend,
    swipes
  FROM fields
)
SELECT
  *
FROM final
%3 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report source_relation campaign_id date_hour attachment_quartile_1 attachment_quartile_2 attachment_quartile_3 attachment_total_view_time attachment_view_completion quartile_1 quartile_2 quartile_3 saves shares screen_time video_views view_completion view_time impressions spend swipes 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp campaign_id date attachment_quartile_1 attachment_quartile_2 attachment_quartile_3 attachment_total_view_time_millis attachment_view_completion impressions quartile_1 quartile_2 quartile_3 saves screen_time_millis shares spend swipes video_views view_completion view_time_millis 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp:f0->228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f1 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp:f1->228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f2 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp:f2->228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f3 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp:f3->228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f4 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp:f4->228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f5 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp:f5->228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f6 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp:f6->228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f7 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp:f7->228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f17 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp:f8->228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f8 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp:f9->228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f9 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp:f10->228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f10 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp:f11->228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f11 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp:f12->228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f13 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp:f13->228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f12 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp:f14->228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f18 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp:f15->228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f19 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp:f16->228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f14 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp:f17->228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f15 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp:f18->228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f16
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
campaign_id text ID of campaign
date_hour timestamp without time zone The hour that the report relates to.
attachment_quartile_1 integer Number of times your Long Form Video was viewed to 25%
attachment_quartile_2 integer Number of times your Long Form Video was viewed to 50%
attachment_quartile_3 integer Number of times your Long Form Video was viewed to 75%
attachment_total_view_time numeric Total time Snapchatters spent on the attachment (HH:MM:SS)
attachment_view_completion integer The number of times your Long Form Video was viewed to completion (97% )
quartile_1 integer The number of times your video ad was viewed to 25%
quartile_2 integer The number of times your video ad was viewed to 50%
quartile_3 integer The number of times your video ad was viewed to 75%
saves integer Number of times a lens/filter was saved to Memories
shares integer Number of times a lens/filter was shared in a Chat or Story
screen_time numeric The number of milli seconds spent watching your ad across all paid impressions. Screen time starts recording as soon as the media is fully rendered on the device and the autoplay video starts
video_views integer The number of times your video was watched at least 2 seconds or swiped up, whichever comes first
view_completion integer The number of times your video ad was viewed to completion (97% )
view_time numeric The number of milli seconds spent watching your ad across all users reached.
impressions integer The number of impressions for an ad in the hour of the record.
spend numeric The amount of spend for an ad in the hour of the record.
swipes integer The number of swipes for an ad in the hour of the record. Swipes are when your ad was swiped up on or the CTA was tapped to view the attachment below.
Column Lineage
%3 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report source_relation 213. model.snapchat_ads.snapchat_ads__campaign_report 213. model.snapchat_ads.snapchat_ads__campaign_report source_relation 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f0->213. model.snapchat_ads.snapchat_ads__campaign_report:f0
213. model.snapchat_ads.snapchat_ads__campaign_report
  • Input Column: 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report[source_relation]
    • Direct The column is directly used without transformation
    • Integration Used as part of the join condition with other tables
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
Column Lineage
%3 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp campaign_id 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report campaign_id 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp:f0->228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f0 213. model.snapchat_ads.snapchat_ads__campaign_report 213. model.snapchat_ads.snapchat_ads__campaign_report campaign_id 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f0->213. model.snapchat_ads.snapchat_ads__campaign_report:f0
228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report
  • Input Column: 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp[campaign_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • campaign_id: Directly mapped after casting
213. model.snapchat_ads.snapchat_ads__campaign_report
  • Input Column: 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report[campaign_id]
    • Direct The column is directly used without transformation
    • Integration Used as a join key with the campaigns table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • campaign_id: Directly copied to the output
Column Lineage
%3 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp date 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report date_hour 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp:f0->228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f0 213. model.snapchat_ads.snapchat_ads__campaign_report 213. model.snapchat_ads.snapchat_ads__campaign_report date_day 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f0->213. model.snapchat_ads.snapchat_ads__campaign_report:f0
228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report
  • Input Column: 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp[date]
    • Cleaning The column is cast as TIMESTAMP
    • Output Columns:
      • date_hour: Mapped after casting to TIMESTAMP
213. model.snapchat_ads.snapchat_ads__campaign_report
  • Input Column: 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report[date_hour]
    • Cleaning Cast to DATE type
    • Aggregation Used in the GROUP BY clause after casting
    • Output Columns:
      • date_day: Transformed to date and used in the output
Column Lineage
%3 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp attachment_quartile_1 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report attachment_quartile_1 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp:f0->228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f0
228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report
  • Input Column: 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp[attachment_quartile_1]
    • Cleaning The column is cast as INT
    • Output Columns:
      • attachment_quartile_1: Directly mapped after casting
Column Lineage
%3 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp attachment_quartile_2 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report attachment_quartile_2 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp:f0->228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f0
228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report
  • Input Column: 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp[attachment_quartile_2]
    • Cleaning The column is cast as INT
    • Output Columns:
      • attachment_quartile_2: Directly mapped after casting
Column Lineage
%3 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp attachment_quartile_3 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report attachment_quartile_3 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp:f0->228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f0
228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report
  • Input Column: 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp[attachment_quartile_3]
    • Cleaning The column is cast as INT
    • Output Columns:
      • attachment_quartile_3: Directly mapped after casting
Column Lineage
%3 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp attachment_total_view_time_millis 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report attachment_total_view_time 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp:f0->228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f0
228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report
  • Input Column: 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp[attachment_total_view_time_millis]
    • Cleaning The column is cast as INT
    • Other The value is divided by 1,000,000 to convert milliseconds to seconds
    • Output Columns:
      • attachment_total_view_time: Mapped after casting and conversion to seconds
Column Lineage
%3 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp attachment_view_completion 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report attachment_view_completion 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp:f0->228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f0
228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report
  • Input Column: 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp[attachment_view_completion]
    • Cleaning The column is cast as INT
    • Output Columns:
      • attachment_view_completion: Directly mapped after casting
Column Lineage
%3 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp quartile_1 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report quartile_1 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp:f0->228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f0
228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report
  • Input Column: 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp[quartile_1]
    • Cleaning The column is cast as INT in the fields CTE
    • Direct The column is directly copied to the output
    • Output Columns:
      • quartile_1: Directly copied after casting
Column Lineage
%3 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp quartile_2 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report quartile_2 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp:f0->228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f0
228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report
  • Input Column: 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp[quartile_2]
    • Cleaning The column is cast as INT in the fields CTE
    • Direct The column is directly copied to the output
    • Output Columns:
      • quartile_2: Directly copied after casting
Column Lineage
%3 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp quartile_3 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report quartile_3 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp:f0->228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f0
228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report
  • Input Column: 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp[quartile_3]
    • Cleaning The column is cast as INT in the fields CTE
    • Direct The column is directly copied to the output
    • Output Columns:
      • quartile_3: Directly copied after casting
Column Lineage
%3 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp saves 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report saves 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp:f0->228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f0
228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report
  • Input Column: 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp[saves]
    • Cleaning The column is cast as INT in the fields CTE
    • Direct The column is directly copied to the output
    • Output Columns:
      • saves: Directly copied after casting
Column Lineage
%3 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp shares 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report shares 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp:f0->228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f0
228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report
  • Input Column: 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp[shares]
    • Cleaning The column is cast to INT
    • Output Columns:
      • shares: Directly copied after casting
Column Lineage
%3 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp screen_time_millis 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report screen_time 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp:f0->228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f0
228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report
  • Input Column: 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp[screen_time_millis]
    • Cleaning The column is cast to INT and then divided by 1,000,000 to convert milliseconds to seconds
    • Output Columns:
      • screen_time: Transformed from milliseconds to seconds
Column Lineage
%3 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp video_views 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report video_views 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp:f0->228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f0
228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report
  • Input Column: 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp[video_views]
    • Cleaning The column is cast to INT
    • Output Columns:
      • video_views: Directly copied after casting
Column Lineage
%3 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp view_completion 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report view_completion 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp:f0->228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f0
228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report
  • Input Column: 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp[view_completion]
    • Cleaning The column is cast to INT
    • Output Columns:
      • view_completion: Directly copied after casting
Column Lineage
%3 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp view_time_millis 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report view_time 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp:f0->228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f0
228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report
  • Input Column: 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp[view_time_millis]
    • Cleaning The column is cast to INT and then transformed by dividing by 1,000,000 to convert milliseconds to seconds.
    • Output Columns:
      • view_time: The 'view_time_millis' is divided by 1,000,000 to convert milliseconds to seconds and mapped to the 'view_time' output column.
Column Lineage
%3 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp impressions 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report impressions 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp:f0->228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f0 213. model.snapchat_ads.snapchat_ads__campaign_report 213. model.snapchat_ads.snapchat_ads__campaign_report impressions 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f0->213. model.snapchat_ads.snapchat_ads__campaign_report:f0
228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report
  • Input Column: 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp[impressions]
    • Cleaning The column is cast as INT in the fields CTE
    • Direct The column is directly copied to the output
    • Output Columns:
      • impressions: Directly copied after casting
213. model.snapchat_ads.snapchat_ads__campaign_report
  • Input Column: 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report[impressions]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • impressions: Summed up and directly mapped to the output 'impressions' column
Column Lineage
%3 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp spend 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report spend 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp:f0->228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f0 213. model.snapchat_ads.snapchat_ads__campaign_report 213. model.snapchat_ads.snapchat_ads__campaign_report spend 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f0->213. model.snapchat_ads.snapchat_ads__campaign_report:f0
228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report
  • Input Column: 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp[spend]
    • Cleaning The column is cast to INT and then divided by 1,000,000 to adjust the value
    • Output Columns:
      • spend: Transformed by dividing by 1,000,000
213. model.snapchat_ads.snapchat_ads__campaign_report
  • Input Column: 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report[spend]
    • Aggregation The column is summed up in the aggregated CTE
    • Cleaning The summed value is rounded to 2 decimal places
    • Output Columns:
      • spend: Summed up, rounded, and mapped to the output 'spend' column
Column Lineage
%3 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp swipes 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report swipes 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp:f0->228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f0 213. model.snapchat_ads.snapchat_ads__campaign_report 213. model.snapchat_ads.snapchat_ads__campaign_report swipes 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f0->213. model.snapchat_ads.snapchat_ads__campaign_report:f0
228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report
  • Input Column: 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp[swipes]
    • Cleaning The column is cast to INT
    • Output Columns:
      • swipes: Directly copied after casting
213. model.snapchat_ads.snapchat_ads__campaign_report
  • Input Column: 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report[swipes]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • swipes: Summed up and directly mapped to the output 'swipes' column
229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of type TEXT, which is set to NULL. The LIMIT 0 ensures no rows are returned. This appears to be a template or placeholder query, possibly used for schema definition or testing purposes in a dbt (data build tool) project.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp campaign_id date _fivetran_synced android_installs attachment_avg_view_time_millis attachment_quartile_1 attachment_quartile_2 attachment_quartile_3 attachment_total_view_time_millis attachment_view_completion avg_screen_time_millis avg_view_time_millis conversion_add_billing conversion_add_cart conversion_app_opens conversion_level_completes conversion_page_views conversion_purchases conversion_purchases_value conversion_save conversion_searches conversion_sign_ups conversion_start_checkout conversion_view_content impressions ios_installs quartile_1 quartile_2 quartile_3 saves screen_time_millis shares spend story_completes story_opens swipe_up_percent swipes total_installs video_views view_completion view_time_millis 357. source.snapchat_ads_source.snapchat_ads.campaign_hourly_report 357. source.snapchat_ads_source.snapchat_ads.campaign_hourly_report
Name Type Comment
campaign_id text None
date timestamp without time zone None
_fivetran_synced timestamp without time zone None
android_installs integer None
attachment_avg_view_time_millis integer None
attachment_quartile_1 integer None
attachment_quartile_2 integer None
attachment_quartile_3 integer None
attachment_total_view_time_millis integer None
attachment_view_completion integer None
avg_screen_time_millis integer None
avg_view_time_millis integer None
conversion_add_billing integer None
conversion_add_cart integer None
conversion_app_opens integer None
conversion_level_completes integer None
conversion_page_views integer None
conversion_purchases integer None
conversion_purchases_value integer None
conversion_save integer None
conversion_searches integer None
conversion_sign_ups integer None
conversion_start_checkout integer None
conversion_view_content integer None
impressions integer None
ios_installs integer None
quartile_1 integer None
quartile_2 integer None
quartile_3 integer None
saves integer None
screen_time_millis integer None
shares integer None
spend integer None
story_completes integer None
story_opens integer None
swipe_up_percent integer None
swipes integer None
total_installs integer None
video_views integer None
view_completion integer None
view_time_millis integer None
Column Lineage
%3 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp campaign_id 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report campaign_id 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp:f0->228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f0 213. model.snapchat_ads.snapchat_ads__campaign_report 213. model.snapchat_ads.snapchat_ads__campaign_report campaign_id 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f0->213. model.snapchat_ads.snapchat_ads__campaign_report:f0
228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report
  • Input Column: 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp[campaign_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • campaign_id: Directly mapped after casting
213. model.snapchat_ads.snapchat_ads__campaign_report
  • Input Column: 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report[campaign_id]
    • Direct The column is directly used without transformation
    • Integration Used as a join key with the campaigns table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • campaign_id: Directly copied to the output
Column Lineage
%3 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp date 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report date_hour 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp:f0->228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f0 213. model.snapchat_ads.snapchat_ads__campaign_report 213. model.snapchat_ads.snapchat_ads__campaign_report date_day 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f0->213. model.snapchat_ads.snapchat_ads__campaign_report:f0
228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report
  • Input Column: 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp[date]
    • Cleaning The column is cast as TIMESTAMP
    • Output Columns:
      • date_hour: Mapped after casting to TIMESTAMP
213. model.snapchat_ads.snapchat_ads__campaign_report
  • Input Column: 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report[date_hour]
    • Cleaning Cast to DATE type
    • Aggregation Used in the GROUP BY clause after casting
    • Output Columns:
      • date_day: Transformed to date and used in the output
Column Lineage
%3 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp attachment_quartile_1 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report attachment_quartile_1 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp:f0->228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f0
228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report
  • Input Column: 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp[attachment_quartile_1]
    • Cleaning The column is cast as INT
    • Output Columns:
      • attachment_quartile_1: Directly mapped after casting
Column Lineage
%3 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp attachment_quartile_2 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report attachment_quartile_2 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp:f0->228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f0
228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report
  • Input Column: 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp[attachment_quartile_2]
    • Cleaning The column is cast as INT
    • Output Columns:
      • attachment_quartile_2: Directly mapped after casting
Column Lineage
%3 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp attachment_quartile_3 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report attachment_quartile_3 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp:f0->228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f0
228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report
  • Input Column: 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp[attachment_quartile_3]
    • Cleaning The column is cast as INT
    • Output Columns:
      • attachment_quartile_3: Directly mapped after casting
Column Lineage
%3 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp attachment_total_view_time_millis 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report attachment_total_view_time 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp:f0->228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f0
228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report
  • Input Column: 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp[attachment_total_view_time_millis]
    • Cleaning The column is cast as INT
    • Other The value is divided by 1,000,000 to convert milliseconds to seconds
    • Output Columns:
      • attachment_total_view_time: Mapped after casting and conversion to seconds
Column Lineage
%3 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp attachment_view_completion 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report attachment_view_completion 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp:f0->228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f0
228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report
  • Input Column: 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp[attachment_view_completion]
    • Cleaning The column is cast as INT
    • Output Columns:
      • attachment_view_completion: Directly mapped after casting
Column Lineage
%3 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp impressions 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report impressions 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp:f0->228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f0 213. model.snapchat_ads.snapchat_ads__campaign_report 213. model.snapchat_ads.snapchat_ads__campaign_report impressions 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f0->213. model.snapchat_ads.snapchat_ads__campaign_report:f0
228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report
  • Input Column: 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp[impressions]
    • Cleaning The column is cast as INT in the fields CTE
    • Direct The column is directly copied to the output
    • Output Columns:
      • impressions: Directly copied after casting
213. model.snapchat_ads.snapchat_ads__campaign_report
  • Input Column: 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report[impressions]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • impressions: Summed up and directly mapped to the output 'impressions' column
Column Lineage
%3 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp quartile_1 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report quartile_1 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp:f0->228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f0
228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report
  • Input Column: 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp[quartile_1]
    • Cleaning The column is cast as INT in the fields CTE
    • Direct The column is directly copied to the output
    • Output Columns:
      • quartile_1: Directly copied after casting
Column Lineage
%3 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp quartile_2 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report quartile_2 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp:f0->228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f0
228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report
  • Input Column: 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp[quartile_2]
    • Cleaning The column is cast as INT in the fields CTE
    • Direct The column is directly copied to the output
    • Output Columns:
      • quartile_2: Directly copied after casting
Column Lineage
%3 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp quartile_3 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report quartile_3 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp:f0->228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f0
228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report
  • Input Column: 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp[quartile_3]
    • Cleaning The column is cast as INT in the fields CTE
    • Direct The column is directly copied to the output
    • Output Columns:
      • quartile_3: Directly copied after casting
Column Lineage
%3 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp saves 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report saves 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp:f0->228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f0
228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report
  • Input Column: 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp[saves]
    • Cleaning The column is cast as INT in the fields CTE
    • Direct The column is directly copied to the output
    • Output Columns:
      • saves: Directly copied after casting
Column Lineage
%3 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp screen_time_millis 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report screen_time 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp:f0->228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f0
228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report
  • Input Column: 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp[screen_time_millis]
    • Cleaning The column is cast to INT and then divided by 1,000,000 to convert milliseconds to seconds
    • Output Columns:
      • screen_time: Transformed from milliseconds to seconds
Column Lineage
%3 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp shares 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report shares 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp:f0->228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f0
228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report
  • Input Column: 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp[shares]
    • Cleaning The column is cast to INT
    • Output Columns:
      • shares: Directly copied after casting
Column Lineage
%3 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp spend 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report spend 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp:f0->228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f0 213. model.snapchat_ads.snapchat_ads__campaign_report 213. model.snapchat_ads.snapchat_ads__campaign_report spend 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f0->213. model.snapchat_ads.snapchat_ads__campaign_report:f0
228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report
  • Input Column: 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp[spend]
    • Cleaning The column is cast to INT and then divided by 1,000,000 to adjust the value
    • Output Columns:
      • spend: Transformed by dividing by 1,000,000
213. model.snapchat_ads.snapchat_ads__campaign_report
  • Input Column: 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report[spend]
    • Aggregation The column is summed up in the aggregated CTE
    • Cleaning The summed value is rounded to 2 decimal places
    • Output Columns:
      • spend: Summed up, rounded, and mapped to the output 'spend' column
Column Lineage
%3 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp swipes 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report swipes 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp:f0->228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f0 213. model.snapchat_ads.snapchat_ads__campaign_report 213. model.snapchat_ads.snapchat_ads__campaign_report swipes 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f0->213. model.snapchat_ads.snapchat_ads__campaign_report:f0
228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report
  • Input Column: 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp[swipes]
    • Cleaning The column is cast to INT
    • Output Columns:
      • swipes: Directly copied after casting
213. model.snapchat_ads.snapchat_ads__campaign_report
  • Input Column: 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report[swipes]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • swipes: Summed up and directly mapped to the output 'swipes' column
Column Lineage
%3 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp video_views 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report video_views 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp:f0->228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f0
228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report
  • Input Column: 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp[video_views]
    • Cleaning The column is cast to INT
    • Output Columns:
      • video_views: Directly copied after casting
Column Lineage
%3 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp view_completion 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report view_completion 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp:f0->228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f0
228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report
  • Input Column: 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp[view_completion]
    • Cleaning The column is cast to INT
    • Output Columns:
      • view_completion: Directly copied after casting
Column Lineage
%3 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp view_time_millis 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report 228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report view_time 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp:f0->228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report:f0
228. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report
  • Input Column: 229. model.snapchat_ads_source.stg_snapchat_ads__campaign_hourly_report_tmp[view_time_millis]
    • Cleaning The column is cast to INT and then transformed by dividing by 1,000,000 to convert milliseconds to seconds.
    • Output Columns:
      • view_time: The 'view_time_millis' is divided by 1,000,000 to convert milliseconds to seconds and mapped to the 'view_time' output column.
230. model.snapchat_ads_source.stg_snapchat_ads__creative_history

This SQL query stages data from a Snapchat Ads creative history source. It performs type casting on various fields, renames some columns, and adds a flag to identify the most recent record for each creative ID. The query also includes a source relation field and filters for the most recent record per creative ID.

CleaningDeduplicationOther
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_snapchat_ads_source.stg_snapchat_ads__creative_history_tmp
), fields AS (
  SELECT
    CAST(NULL AS TIMESTAMP) AS _fivetran_synced,
    CAST(NULL AS TEXT) AS ad_account_id,
    CAST(NULL AS TIMESTAMP) AS created_at,
    CAST(NULL AS TEXT) AS id,
    CAST(NULL AS TEXT) AS name,
    CAST(NULL AS TIMESTAMP) AS updated_at,
    CAST(NULL AS TEXT) AS web_view_url,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    id AS creative_id,
    CAST(created_at AS TIMESTAMP) AS created_at,
    ad_account_id,
    name AS creative_name,
    web_view_url AS url,
    CAST(_fivetran_synced AS TIMESTAMP) AS _fivetran_synced,
    CAST(updated_at AS TIMESTAMP) AS updated_at,
    ROW_NUMBER() OVER (PARTITION BY source_relation, id ORDER BY _fivetran_synced DESC) = 1 AS is_most_recent_record
  FROM fields
)
SELECT
  *
FROM final
%3 230. model.snapchat_ads_source.stg_snapchat_ads__creative_history 230. model.snapchat_ads_source.stg_snapchat_ads__creative_history source_relation _fivetran_synced creative_id creative_name ad_account_id url created_at updated_at is_most_recent_record 231. model.snapchat_ads_source.stg_snapchat_ads__creative_history_tmp 231. model.snapchat_ads_source.stg_snapchat_ads__creative_history_tmp id ad_account_id name web_view_url _fivetran_synced 231. model.snapchat_ads_source.stg_snapchat_ads__creative_history_tmp:f0->230. model.snapchat_ads_source.stg_snapchat_ads__creative_history:f2 231. model.snapchat_ads_source.stg_snapchat_ads__creative_history_tmp:f1->230. model.snapchat_ads_source.stg_snapchat_ads__creative_history:f4 231. model.snapchat_ads_source.stg_snapchat_ads__creative_history_tmp:f2->230. model.snapchat_ads_source.stg_snapchat_ads__creative_history:f3 231. model.snapchat_ads_source.stg_snapchat_ads__creative_history_tmp:f3->230. model.snapchat_ads_source.stg_snapchat_ads__creative_history:f5 231. model.snapchat_ads_source.stg_snapchat_ads__creative_history_tmp:f4->230. model.snapchat_ads_source.stg_snapchat_ads__creative_history:f1
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
_fivetran_synced timestamp without time zone When the record was last synced by Fivetran.
creative_id text The ID of the creative in Snapchat.
creative_name text The name of the creative in Snapchat.
ad_account_id text The ID of the related ad account in Snapchat.
url text The URL of the creative if the creative is of type 'web view'.
created_at timestamp without time zone Created at timestamp.
updated_at timestamp without time zone Timestamp of when the record was updated.
is_most_recent_record boolean Boolean representing whether a record is the most recent version of that record.
Column Lineage
%3 231. model.snapchat_ads_source.stg_snapchat_ads__creative_history_tmp 231. model.snapchat_ads_source.stg_snapchat_ads__creative_history_tmp _fivetran_synced 230. model.snapchat_ads_source.stg_snapchat_ads__creative_history 230. model.snapchat_ads_source.stg_snapchat_ads__creative_history _fivetran_synced 231. model.snapchat_ads_source.stg_snapchat_ads__creative_history_tmp:f0->230. model.snapchat_ads_source.stg_snapchat_ads__creative_history:f0
230. model.snapchat_ads_source.stg_snapchat_ads__creative_history
  • Input Column: 231. model.snapchat_ads_source.stg_snapchat_ads__creative_history_tmp[_fivetran_synced]
    • Direct The column is directly copied to the output
    • Cleaning The column is cast as TIMESTAMP in the fields CTE
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • _fivetran_synced: Directly mapped without renaming
Column Lineage
%3 231. model.snapchat_ads_source.stg_snapchat_ads__creative_history_tmp 231. model.snapchat_ads_source.stg_snapchat_ads__creative_history_tmp id 230. model.snapchat_ads_source.stg_snapchat_ads__creative_history 230. model.snapchat_ads_source.stg_snapchat_ads__creative_history creative_id 231. model.snapchat_ads_source.stg_snapchat_ads__creative_history_tmp:f0->230. model.snapchat_ads_source.stg_snapchat_ads__creative_history:f0
230. model.snapchat_ads_source.stg_snapchat_ads__creative_history
  • Input Column: 231. model.snapchat_ads_source.stg_snapchat_ads__creative_history_tmp[id]
    • Direct The column is directly copied to the output
    • Cleaning The column is cast as TEXT in the fields CTE
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • creative_id: Directly mapped and renamed
Column Lineage
%3 231. model.snapchat_ads_source.stg_snapchat_ads__creative_history_tmp 231. model.snapchat_ads_source.stg_snapchat_ads__creative_history_tmp name 230. model.snapchat_ads_source.stg_snapchat_ads__creative_history 230. model.snapchat_ads_source.stg_snapchat_ads__creative_history creative_name 231. model.snapchat_ads_source.stg_snapchat_ads__creative_history_tmp:f0->230. model.snapchat_ads_source.stg_snapchat_ads__creative_history:f0
230. model.snapchat_ads_source.stg_snapchat_ads__creative_history
  • Input Column: 231. model.snapchat_ads_source.stg_snapchat_ads__creative_history_tmp[name]
    • Direct The column is directly copied to the output
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • creative_name: Directly mapped and renamed
Column Lineage
%3 231. model.snapchat_ads_source.stg_snapchat_ads__creative_history_tmp 231. model.snapchat_ads_source.stg_snapchat_ads__creative_history_tmp ad_account_id 230. model.snapchat_ads_source.stg_snapchat_ads__creative_history 230. model.snapchat_ads_source.stg_snapchat_ads__creative_history ad_account_id 231. model.snapchat_ads_source.stg_snapchat_ads__creative_history_tmp:f0->230. model.snapchat_ads_source.stg_snapchat_ads__creative_history:f0
230. model.snapchat_ads_source.stg_snapchat_ads__creative_history
  • Input Column: 231. model.snapchat_ads_source.stg_snapchat_ads__creative_history_tmp[ad_account_id]
    • Direct The column is directly copied to the output
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • ad_account_id: Directly mapped without renaming
Column Lineage
%3 231. model.snapchat_ads_source.stg_snapchat_ads__creative_history_tmp 231. model.snapchat_ads_source.stg_snapchat_ads__creative_history_tmp web_view_url 230. model.snapchat_ads_source.stg_snapchat_ads__creative_history 230. model.snapchat_ads_source.stg_snapchat_ads__creative_history url 231. model.snapchat_ads_source.stg_snapchat_ads__creative_history_tmp:f0->230. model.snapchat_ads_source.stg_snapchat_ads__creative_history:f0
230. model.snapchat_ads_source.stg_snapchat_ads__creative_history
  • Input Column: 231. model.snapchat_ads_source.stg_snapchat_ads__creative_history_tmp[web_view_url]
    • Direct The column is directly copied to the output
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • url: Directly mapped and renamed
231. model.snapchat_ads_source.stg_snapchat_ads__creative_history_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of type TEXT, which is set to NULL. The query is limited to 0 rows, effectively creating a schema-only representation of the table without any data.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 231. model.snapchat_ads_source.stg_snapchat_ads__creative_history_tmp 231. model.snapchat_ads_source.stg_snapchat_ads__creative_history_tmp id ad_account_id name web_view_url _fivetran_synced 358. source.snapchat_ads_source.snapchat_ads.creative_history 358. source.snapchat_ads_source.snapchat_ads.creative_history
Name Type Comment
id text None
ad_account_id text None
name text None
web_view_url text None
_fivetran_synced text None
Column Lineage
%3 231. model.snapchat_ads_source.stg_snapchat_ads__creative_history_tmp 231. model.snapchat_ads_source.stg_snapchat_ads__creative_history_tmp id 230. model.snapchat_ads_source.stg_snapchat_ads__creative_history 230. model.snapchat_ads_source.stg_snapchat_ads__creative_history creative_id 231. model.snapchat_ads_source.stg_snapchat_ads__creative_history_tmp:f0->230. model.snapchat_ads_source.stg_snapchat_ads__creative_history:f0
230. model.snapchat_ads_source.stg_snapchat_ads__creative_history
  • Input Column: 231. model.snapchat_ads_source.stg_snapchat_ads__creative_history_tmp[id]
    • Direct The column is directly copied to the output
    • Cleaning The column is cast as TEXT in the fields CTE
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • creative_id: Directly mapped and renamed
Column Lineage
%3 231. model.snapchat_ads_source.stg_snapchat_ads__creative_history_tmp 231. model.snapchat_ads_source.stg_snapchat_ads__creative_history_tmp ad_account_id 230. model.snapchat_ads_source.stg_snapchat_ads__creative_history 230. model.snapchat_ads_source.stg_snapchat_ads__creative_history ad_account_id 231. model.snapchat_ads_source.stg_snapchat_ads__creative_history_tmp:f0->230. model.snapchat_ads_source.stg_snapchat_ads__creative_history:f0
230. model.snapchat_ads_source.stg_snapchat_ads__creative_history
  • Input Column: 231. model.snapchat_ads_source.stg_snapchat_ads__creative_history_tmp[ad_account_id]
    • Direct The column is directly copied to the output
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • ad_account_id: Directly mapped without renaming
Column Lineage
%3 231. model.snapchat_ads_source.stg_snapchat_ads__creative_history_tmp 231. model.snapchat_ads_source.stg_snapchat_ads__creative_history_tmp name 230. model.snapchat_ads_source.stg_snapchat_ads__creative_history 230. model.snapchat_ads_source.stg_snapchat_ads__creative_history creative_name 231. model.snapchat_ads_source.stg_snapchat_ads__creative_history_tmp:f0->230. model.snapchat_ads_source.stg_snapchat_ads__creative_history:f0
230. model.snapchat_ads_source.stg_snapchat_ads__creative_history
  • Input Column: 231. model.snapchat_ads_source.stg_snapchat_ads__creative_history_tmp[name]
    • Direct The column is directly copied to the output
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • creative_name: Directly mapped and renamed
Column Lineage
%3 231. model.snapchat_ads_source.stg_snapchat_ads__creative_history_tmp 231. model.snapchat_ads_source.stg_snapchat_ads__creative_history_tmp web_view_url 230. model.snapchat_ads_source.stg_snapchat_ads__creative_history 230. model.snapchat_ads_source.stg_snapchat_ads__creative_history url 231. model.snapchat_ads_source.stg_snapchat_ads__creative_history_tmp:f0->230. model.snapchat_ads_source.stg_snapchat_ads__creative_history:f0
230. model.snapchat_ads_source.stg_snapchat_ads__creative_history
  • Input Column: 231. model.snapchat_ads_source.stg_snapchat_ads__creative_history_tmp[web_view_url]
    • Direct The column is directly copied to the output
    • Cleaning The column is cast as TEXT in the fields CTE
    • Output Columns:
      • url: Directly mapped and renamed
Column Lineage
%3 231. model.snapchat_ads_source.stg_snapchat_ads__creative_history_tmp 231. model.snapchat_ads_source.stg_snapchat_ads__creative_history_tmp _fivetran_synced 230. model.snapchat_ads_source.stg_snapchat_ads__creative_history 230. model.snapchat_ads_source.stg_snapchat_ads__creative_history _fivetran_synced 231. model.snapchat_ads_source.stg_snapchat_ads__creative_history_tmp:f0->230. model.snapchat_ads_source.stg_snapchat_ads__creative_history:f0
230. model.snapchat_ads_source.stg_snapchat_ads__creative_history
  • Input Column: 231. model.snapchat_ads_source.stg_snapchat_ads__creative_history_tmp[_fivetran_synced]
    • Direct The column is directly copied to the output
    • Cleaning The column is cast as TIMESTAMP in the fields CTE
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • _fivetran_synced: Directly mapped without renaming
232. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history

This SQL query stages data from a temporary table, casts specific fields to desired data types, renames some columns, and adds a flag to identify the most recent record for each unique combination of source_relation, creative_id, and key. It prepares the data for further processing or analysis in the Snapchat ads context.

CleaningDeduplicationOther
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history_tmp
), fields AS (
  SELECT
    CAST(NULL AS TEXT) AS creative_id,
    CAST(NULL AS TEXT) AS key,
    CAST(NULL AS TIMESTAMP) AS updated_at,
    CAST(NULL AS TEXT) AS value,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    creative_id,
    key AS param_key,
    value AS param_value,
    CAST(updated_at AS TIMESTAMP) AS updated_at,
    ROW_NUMBER() OVER (PARTITION BY source_relation, creative_id, key ORDER BY updated_at DESC) = 1 AS is_most_recent_record
  FROM fields
)
SELECT
  *
FROM final
%3 232. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history 232. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history source_relation creative_id param_key param_value updated_at is_most_recent_record 233. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history_tmp 233. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history_tmp creative_id key value updated_at 233. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history_tmp:f0->232. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history:f1 233. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history_tmp:f1->232. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history:f2 233. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history_tmp:f2->232. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history:f3 233. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history_tmp:f3->232. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history:f4
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
creative_id text The ID of the related creative in Snapchat.
param_key text The URL parameter key, i.e. UTM_SOURCE.
param_value text The URL parameter value, i.e. Snapchat.
updated_at timestamp without time zone Timestamp of when the record was updated.
is_most_recent_record boolean Boolean representing whether a record is the most recent version of that record.
Column Lineage
%3 233. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history_tmp 233. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history_tmp creative_id 232. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history 232. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history creative_id 233. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history_tmp:f0->232. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history:f0
232. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history
  • Input Column: 233. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history_tmp[creative_id]
    • Direct The column is directly copied without any transformation
    • Deduplication The column is used for deduplication in the ROW_NUMBER() window function
    • Output Columns:
      • creative_id: Directly copied to the output
Column Lineage
%3 233. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history_tmp 233. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history_tmp key 232. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history 232. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history param_key 233. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history_tmp:f0->232. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history:f0
232. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history
  • Input Column: 233. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history_tmp[key]
    • Direct The column is directly copied without any transformation
    • Deduplication The column is used for deduplication in the ROW_NUMBER() window function
    • Output Columns:
      • param_key: Renamed from 'key' to 'param_key' in the output
Column Lineage
%3 233. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history_tmp 233. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history_tmp value 232. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history 232. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history param_value 233. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history_tmp:f0->232. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history:f0
232. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history
  • Input Column: 233. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history_tmp[value]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • param_value: Renamed from 'value' to 'param_value' in the output
Column Lineage
%3 233. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history_tmp 233. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history_tmp updated_at 232. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history 232. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history updated_at 233. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history_tmp:f0->232. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history:f0
232. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history
  • Input Column: 233. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history_tmp[updated_at]
    • Cleaning The column is cast as TIMESTAMP
    • Deduplication The column is used for ordering in the ROW_NUMBER() window function
    • Output Columns:
      • updated_at: Cast as TIMESTAMP and directly copied to the output
233. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of type TEXT. It's likely used as a placeholder or template for further development, or to create a temporary table structure without populating it with data.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 233. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history_tmp 233. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history_tmp creative_id key value updated_at 359. source.snapchat_ads_source.snapchat_ads.creative_url_tag_history 359. source.snapchat_ads_source.snapchat_ads.creative_url_tag_history
Name Type Comment
creative_id text None
key text None
value text None
updated_at text None
Column Lineage
%3 233. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history_tmp 233. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history_tmp creative_id 232. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history 232. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history creative_id 233. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history_tmp:f0->232. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history:f0
232. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history
  • Input Column: 233. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history_tmp[creative_id]
    • Direct The column is directly copied without any transformation
    • Deduplication The column is used for deduplication in the ROW_NUMBER() window function
    • Output Columns:
      • creative_id: Directly copied to the output
Column Lineage
%3 233. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history_tmp 233. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history_tmp key 232. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history 232. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history param_key 233. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history_tmp:f0->232. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history:f0
232. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history
  • Input Column: 233. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history_tmp[key]
    • Direct The column is directly copied without any transformation
    • Deduplication The column is used for deduplication in the ROW_NUMBER() window function
    • Output Columns:
      • param_key: Renamed from 'key' to 'param_key' in the output
Column Lineage
%3 233. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history_tmp 233. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history_tmp value 232. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history 232. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history param_value 233. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history_tmp:f0->232. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history:f0
232. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history
  • Input Column: 233. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history_tmp[value]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • param_value: Renamed from 'value' to 'param_value' in the output
Column Lineage
%3 233. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history_tmp 233. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history_tmp updated_at 232. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history 232. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history updated_at 233. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history_tmp:f0->232. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history:f0
232. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history
  • Input Column: 233. model.snapchat_ads_source.stg_snapchat_ads__creative_url_tag_history_tmp[updated_at]
    • Cleaning The column is cast as TIMESTAMP
    • Deduplication The column is used for ordering in the ROW_NUMBER() window function
    • Output Columns:
      • updated_at: Cast as TIMESTAMP and directly copied to the output
234. model.tiktok_ads.tiktok_ads__ad_group_report

This SQL query aggregates TikTok ad performance data at the ad group level. It joins hourly ad group report data with ad group, advertiser, and campaign information. The query calculates various performance metrics such as impressions, clicks, spend, and engagement metrics. It also computes derived metrics like CPC, CPM, and CTR. The results are grouped by date, advertiser, campaign, and ad group details.

IntegrationAggregationFeaturization
SQL Query
WITH hourly AS (
  SELECT
    *
  FROM TEST.PUBLIC_stg_tiktok_ads.stg_tiktok_ads__ad_group_report_hourly
), ad_groups AS (
  SELECT
    *
  FROM TEST.PUBLIC_stg_tiktok_ads.stg_tiktok_ads__ad_group_history
  WHERE
    is_most_recent_record
), advertiser AS (
  SELECT
    *
  FROM TEST.PUBLIC_stg_tiktok_ads.stg_tiktok_ads__advertiser
), campaigns AS (
  SELECT
    *
  FROM TEST.PUBLIC_stg_tiktok_ads.stg_tiktok_ads__campaign_history
  WHERE
    is_most_recent_record
), aggregated AS (
  SELECT
    hourly.source_relation,
    CAST(hourly.stat_time_hour AS DATE) AS date_day,
    ad_groups.advertiser_id,
    advertiser.advertiser_name,
    campaigns.campaign_id,
    campaigns.campaign_name,
    hourly.ad_group_id,
    ad_groups.ad_group_name,
    advertiser.currency,
    ad_groups.category,
    ad_groups.gender,
    ad_groups.audience_type,
    ad_groups.budget,
    SUM(hourly.impressions) AS impressions,
    SUM(hourly.clicks) AS clicks,
    SUM(hourly.spend) AS spend,
    SUM(hourly.reach) AS reach,
    SUM(hourly.conversion) AS conversion,
    SUM(hourly.likes) AS likes,
    SUM(hourly.comments) AS comments,
    SUM(hourly.shares) AS shares,
    SUM(hourly.profile_visits) AS profile_visits,
    SUM(hourly.follows) AS follows,
    SUM(hourly.video_watched_2_s) AS video_watched_2_s,
    SUM(hourly.video_watched_6_s) AS video_watched_6_s,
    SUM(hourly.video_views_p_25) AS video_views_p_25,
    SUM(hourly.video_views_p_50) AS video_views_p_50,
    SUM(hourly.video_views_p_75) AS video_views_p_75,
    SUM(hourly.spend) / NULLIF(SUM(hourly.clicks), 0) AS daily_cpc,
    (
      SUM(hourly.spend) / NULLIF(SUM(hourly.impressions), 0)
    ) * 1000 AS daily_cpm,
    (
      SUM(hourly.clicks) / NULLIF(SUM(hourly.impressions), 0)
    ) * 100 AS daily_ctr
  FROM hourly
  LEFT JOIN ad_groups
    ON hourly.ad_group_id = ad_groups.ad_group_id
    AND hourly.source_relation = ad_groups.source_relation
  LEFT JOIN advertiser
    ON ad_groups.advertiser_id = advertiser.advertiser_id
    AND ad_groups.source_relation = advertiser.source_relation
  LEFT JOIN campaigns
    ON ad_groups.campaign_id = campaigns.campaign_id
    AND ad_groups.source_relation = campaigns.source_relation
  GROUP BY
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10,
    11,
    12,
    13
)
SELECT
  *
FROM aggregated
%3 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report source_relation date_day ad_group_id ad_group_name campaign_id campaign_name advertiser_id advertiser_name currency audience_type budget category gender impressions clicks spend reach conversion likes comments shares profile_visits follows video_watched_2_s video_watched_6_s video_views_p_25 video_views_p_50 video_views_p_75 daily_cpc daily_cpm daily_ctr 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history source_relation ad_group_id advertiser_id ad_group_name audience_type budget category display_name gender 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f1->234. model.tiktok_ads.tiktok_ads__ad_group_report:f2 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f2->234. model.tiktok_ads.tiktok_ads__ad_group_report:f6 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f3->234. model.tiktok_ads.tiktok_ads__ad_group_report:f3 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f4->234. model.tiktok_ads.tiktok_ads__ad_group_report:f9 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f5->234. model.tiktok_ads.tiktok_ads__ad_group_report:f10 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f6->234. model.tiktok_ads.tiktok_ads__ad_group_report:f11 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f7->234. model.tiktok_ads.tiktok_ads__ad_group_report:f3 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f8->234. model.tiktok_ads.tiktok_ads__ad_group_report:f12 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly source_relation ad_group_id stat_time_hour video_views_p_75 video_views_p_50 impressions comments conversion shares clicks video_views_p_25 reach profile_visits video_watched_2_s follows video_watched_6_s spend likes 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f1->234. model.tiktok_ads.tiktok_ads__ad_group_report:f2 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f2->234. model.tiktok_ads.tiktok_ads__ad_group_report:f1 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f3->234. model.tiktok_ads.tiktok_ads__ad_group_report:f27 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f4->234. model.tiktok_ads.tiktok_ads__ad_group_report:f26 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f5->234. model.tiktok_ads.tiktok_ads__ad_group_report:f13 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f5->234. model.tiktok_ads.tiktok_ads__ad_group_report:f29 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f5->234. model.tiktok_ads.tiktok_ads__ad_group_report:f30 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f6->234. model.tiktok_ads.tiktok_ads__ad_group_report:f19 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f7->234. model.tiktok_ads.tiktok_ads__ad_group_report:f17 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f8->234. model.tiktok_ads.tiktok_ads__ad_group_report:f20 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f9->234. model.tiktok_ads.tiktok_ads__ad_group_report:f14 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f9->234. model.tiktok_ads.tiktok_ads__ad_group_report:f28 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f9->234. model.tiktok_ads.tiktok_ads__ad_group_report:f30 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f10->234. model.tiktok_ads.tiktok_ads__ad_group_report:f25 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f11->234. model.tiktok_ads.tiktok_ads__ad_group_report:f16 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f12->234. model.tiktok_ads.tiktok_ads__ad_group_report:f21 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f13->234. model.tiktok_ads.tiktok_ads__ad_group_report:f23 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f14->234. model.tiktok_ads.tiktok_ads__ad_group_report:f22 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f15->234. model.tiktok_ads.tiktok_ads__ad_group_report:f24 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f16->234. model.tiktok_ads.tiktok_ads__ad_group_report:f15 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f16->234. model.tiktok_ads.tiktok_ads__ad_group_report:f28 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f16->234. model.tiktok_ads.tiktok_ads__ad_group_report:f29 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f17->234. model.tiktok_ads.tiktok_ads__ad_group_report:f18 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser source_relation advertiser_id currency advertiser_name 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f1->234. model.tiktok_ads.tiktok_ads__ad_group_report:f6 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f2->234. model.tiktok_ads.tiktok_ads__ad_group_report:f8 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f3->234. model.tiktok_ads.tiktok_ads__ad_group_report:f7 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history source_relation campaign_id campaign_name 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history:f1->234. model.tiktok_ads.tiktok_ads__ad_group_report:f4 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history:f2->234. model.tiktok_ads.tiktok_ads__ad_group_report:f5
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
date_day date Day of record
ad_group_id integer Ad group ID
ad_group_name text Ad group name
campaign_id integer Campaign ID
campaign_name text Campaign name
advertiser_id integer Advertiser ID
advertiser_name text Advertiser name.
currency text Advertiser's currency.
audience_type integer Audience Type
budget integer Ad budget. Returns 0.0 when Campaign Budget Optimization (budget_optimize_switch) is on.
category integer Ad group category.
gender text Gender that you want to target.
impressions bigint The number of impressions that occurred on the day of the record.
clicks bigint The number of clicks that occurred on the day of the record.
spend double precision The amount of spend that occurred on the day of the record.
reach bigint The number of unique users who saw your ads at least once. This metric is estimated.
conversion bigint The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)
likes bigint The number of likes your video creative received within 1 day of a user seeing a paid ad.
comments bigint The number of comments your video creative received within 1 day of a user seeing a paid ad.
shares bigint The number of shares that occurred on the day of the record.
profile_visits bigint The number of profile visits that occurred on the day of the record.
follows bigint The number of follows that occurred on the day of the record.
video_watched_2_s bigint The number of times your video played for at least 2 seconds, or completely played. Replays will not be counted.
video_watched_6_s bigint The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.
video_views_p_25 bigint The number of times your video was played at 25% of its length. Replays will not be counted.
video_views_p_50 bigint The number of times your video was played at 50% of its length. Replays will not be counted.
video_views_p_75 bigint The number of times your video was played at 75% of its length. Replays will not be counted.
daily_cpc double precision The average amount of money you've spent on a click.
daily_cpm double precision The average amount of money you've spent per 1,000 impressions.
daily_ctr bigint The percentage of times people saw your ad and performed a click.
Column Lineage
%3 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history source_relation 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report source_relation 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly source_relation 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser source_relation 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history source_relation 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history[source_relation]
    • Integration used as a key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with other tables
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
  • Input Column: 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser[source_relation]
    • Integration Used to join with other tables
    • Direct Directly copied to the output
    • Output Columns:
      • source_relation: Directly copied
  • Input Column: 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
Column Lineage
%3 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly stat_time_hour 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report date_day 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp stat_time_hour 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f0->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0
241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly
  • Input Column: 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp[stat_time_hour]
    • Cleaning The column is cast to TIMESTAMP
    • Output Columns:
      • stat_time_hour: Directly mapped after casting
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly[stat_time_hour]
    • Cleaning Cast to DATE type
    • Aggregation Included in the GROUP BY clause after transformation
    • Output Columns:
      • date_day: Transformed and mapped to this output column
Column Lineage
%3 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history ad_group_id 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report ad_group_id 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly ad_group_id 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp adgroup_id 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f0->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp adgroup_id 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f0->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0
239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history
  • Input Column: 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp[adgroup_id]
    • Cleaning The column is cast as DECIMAL(28, 6)
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • ad_group_id: Directly mapped and renamed
241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly
  • Input Column: 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp[adgroup_id]
    • Cleaning The column is cast to DECIMAL(28, 6) and renamed to 'ad_group_id'
    • Output Columns:
      • ad_group_id: Directly mapped after casting and renaming
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history[ad_group_id]
    • Integration used as a key to join with the hourly table
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_id: directly copied
  • Input Column: 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly[ad_group_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with the ad_groups table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • ad_group_id: Directly copied to the output
Column Lineage
%3 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history ad_group_name display_name 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report ad_group_name 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f1->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp adgroup_name display_name 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f0->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f1->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f1
239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history
  • Input Column: 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp[adgroup_name]
    • Cleaning Cast as TEXT
    • Output Columns:
      • ad_group_name: Directly mapped and renamed
  • Input Column: 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp[display_name]
    • Cleaning Cast as TEXT
    • Output Columns:
      • display_name: Directly mapped
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history[ad_group_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_name: directly copied
  • Input Column: 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history[display_name]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • ad_group_name: Directly copied to the output and renamed
Column Lineage
%3 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history campaign_id 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report campaign_id 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0 250. model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp 250. model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp campaign_id 250. model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp:f0->249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history:f0
249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history
  • Input Column: 250. model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp[campaign_id]
    • Cleaning Cast as DECIMAL(28, 6) in the fields CTE
    • Direct Copied without transformation from the fields CTE to the final output
    • Deduplication Used in PARTITION BY clause of ROW_NUMBER() function
    • Output Columns:
      • campaign_id: Directly mapped after casting
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history[campaign_id]
    • Integration used as the key to join with the ad_groups table
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
Column Lineage
%3 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history campaign_name 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report campaign_name 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history[campaign_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_name: directly copied
Column Lineage
%3 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history advertiser_id 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report advertiser_id 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser advertiser_id 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp advertiser_id 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f0->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp id 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp:f0->247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0
239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history
  • Input Column: 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp[advertiser_id]
    • Cleaning Cast as DECIMAL(28, 6)
    • Output Columns:
      • advertiser_id: Directly mapped
247. model.tiktok_ads_source.stg_tiktok_ads__advertiser
  • Input Column: 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp[id]
    • Cleaning The column is cast to DECIMAL(28, 6)
    • Output Columns:
      • advertiser_id: Directly mapped after casting
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history[advertiser_id]
    • Integration used as a key to join with the advertiser table
    • Direct directly copied to the output
    • Output Columns:
      • advertiser_id: directly copied
  • Input Column: 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser[advertiser_id]
    • Integration Used as a key to join with other tables
    • Direct Directly copied to the output
    • Output Columns:
      • advertiser_id: Directly copied
Column Lineage
%3 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser advertiser_name 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report advertiser_name 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp name 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp:f0->247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0
247. model.tiktok_ads_source.stg_tiktok_ads__advertiser
  • Input Column: 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp[name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • advertiser_name: Directly mapped
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser[advertiser_name]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the ad_groups table
    • Output Columns:
      • advertiser_name: Directly copied to the output
Column Lineage
%3 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser currency 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report currency 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp currency 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp:f0->247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0
247. model.tiktok_ads_source.stg_tiktok_ads__advertiser
  • Input Column: 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp[currency]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • currency: Directly mapped
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser[currency]
    • Direct Directly copied to the output
    • Output Columns:
      • currency: Directly copied
Column Lineage
%3 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history audience_type 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report audience_type 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp audience_type 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f0->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0
239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history
  • Input Column: 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp[audience_type]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to TEXT data type
    • Output Columns:
      • audience_type: Directly mapped after casting
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history[audience_type]
    • Direct directly copied to the output
    • Output Columns:
      • audience_type: directly copied
Column Lineage
%3 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history budget 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report budget 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp budget 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f0->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0
239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history
  • Input Column: 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp[budget]
    • Cleaning The column is cast to FLOAT data type
    • Output Columns:
      • budget: Directly mapped after casting
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history[budget]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • budget: Directly copied to the output
Column Lineage
%3 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history category 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report category 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp category 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f0->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0
239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history
  • Input Column: 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp[category]
    • Cleaning The column is cast as DECIMAL(28, 6) in the fields CTE
    • Direct The column is directly selected in the final CTE without further transformation
    • Output Columns:
      • category: Directly mapped to the output 'category' column
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history[category]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • category: Directly copied to the output
Column Lineage
%3 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history gender 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report gender 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp gender 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f0->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0
239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history
  • Input Column: 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp[gender]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to TEXT data type
    • Output Columns:
      • gender: Directly mapped after casting
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history[gender]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • gender: Directly copied to the output
Column Lineage
%3 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly impressions 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report daily_cpm daily_ctr impressions 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f2 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f1 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp impressions 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f0->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0
241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly
  • Input Column: 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp[impressions]
    • Cleaning The column is cast to DECIMAL(28, 6) in the 'fields' CTE.
    • Direct After casting, it's directly selected in the final output.
    • Output Columns:
      • impressions: Directly mapped after casting.
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly[impressions]
    • Aggregation Summed up in the SELECT statement
    • Other Used in calculations for daily_cpm and daily_ctr
    • Output Columns:
      • impressions: Aggregated sum in the output
      • daily_cpm: Part of the calculation
      • daily_ctr: Part of the calculation
Column Lineage
%3 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly clicks 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report clicks daily_cpc daily_ctr 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f1 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f2 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp clicks 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f0->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0
241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly
  • Input Column: 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp[clicks]
    • Cleaning The column is cast to DECIMAL(28, 6) type
    • Output Columns:
      • clicks: Directly mapped after casting
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly[clicks]
    • Aggregation The column is summed up in the aggregated CTE
    • Other Used in calculations for daily_cpc and daily_ctr
    • Output Columns:
      • clicks: Directly mapped after aggregation
      • daily_cpc: Used in calculation
      • daily_ctr: Used in calculation
Column Lineage
%3 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly spend 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report daily_cpc daily_cpm spend 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f2 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f1 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp spend 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f0->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0
241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly
  • Input Column: 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp[spend]
    • Cleaning The column is cast to DECIMAL(28, 6) in the 'fields' CTE
    • Output Columns:
      • spend: Directly mapped after casting
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly[spend]
    • Aggregation The column is summed up in the aggregated CTE
    • Other Used in calculations for daily_cpc and daily_cpm
    • Output Columns:
      • spend: Directly mapped after aggregation
      • daily_cpc: Used in calculation
      • daily_cpm: Used in calculation
Column Lineage
%3 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly reach 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report reach 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp reach 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f0->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0
241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly
  • Input Column: 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp[reach]
    • Cleaning The column is cast to DECIMAL(28, 6) type
    • Output Columns:
      • reach: Directly mapped after casting
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly[reach]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • reach: Directly mapped after aggregation
Column Lineage
%3 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly conversion 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report conversion 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp conversion 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f0->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0
241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly
  • Input Column: 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp[conversion]
    • Cleaning The column is cast to DECIMAL(28, 6) in the 'fields' CTE.
    • Direct After casting, it's directly selected in the final output.
    • Output Columns:
      • conversion: Directly mapped after casting.
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly[conversion]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • conversion: Directly mapped after aggregation
Column Lineage
%3 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly likes 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report likes 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp likes 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f0->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0
241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly
  • Input Column: 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp[likes]
    • Cleaning The column is cast to DECIMAL(28, 6) in the 'fields' CTE
    • Output Columns:
      • likes: Directly mapped after casting
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly[likes]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • likes: Directly mapped after aggregation
Column Lineage
%3 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly comments 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report comments 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp comments 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f0->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0
241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly
  • Input Column: 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp[comments]
    • Cleaning The column is cast to DECIMAL(28, 6) in the 'fields' CTE.
    • Direct After casting, it's directly selected in the final output.
    • Output Columns:
      • comments: Directly mapped after casting.
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly[comments]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • comments: Directly mapped after aggregation
Column Lineage
%3 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly shares 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report shares 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp shares 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f0->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0
241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly
  • Input Column: 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp[shares]
    • Cleaning The column is cast to DECIMAL(28, 6) in the 'fields' CTE.
    • Direct After casting, it's directly selected in the final output.
    • Output Columns:
      • shares: Directly mapped after casting.
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly[shares]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • shares: Directly mapped after aggregation
Column Lineage
%3 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly profile_visits 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report profile_visits 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp profile_visits 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f0->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0
241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly
  • Input Column: 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp[profile_visits]
    • Cleaning The column is cast to DECIMAL(28, 6) type
    • Output Columns:
      • profile_visits: Directly mapped after casting
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly[profile_visits]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • profile_visits: Directly mapped after aggregation
Column Lineage
%3 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly follows 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report follows 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp follows 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f0->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0
241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly
  • Input Column: 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp[follows]
    • Cleaning The column is cast to DECIMAL(28, 6) in the 'fields' CTE
    • Output Columns:
      • follows: Directly mapped after casting
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly[follows]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • follows: Directly mapped after aggregation
Column Lineage
%3 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly video_watched_2_s 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report video_watched_2_s 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp video_watched_2_s 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f0->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0
241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly
  • Input Column: 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp[video_watched_2_s]
    • Cleaning The column is cast to DECIMAL(28, 6) in the 'fields' CTE
    • Output Columns:
      • video_watched_2_s: Directly mapped after casting
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly[video_watched_2_s]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • video_watched_2_s: Directly mapped after aggregation
Column Lineage
%3 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly video_watched_6_s 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report video_watched_6_s 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp video_watched_6_s 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f0->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0
241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly
  • Input Column: 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp[video_watched_6_s]
    • Cleaning The column is cast to DECIMAL(28, 6) in the 'fields' CTE
    • Output Columns:
      • video_watched_6_s: Directly mapped after casting
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly[video_watched_6_s]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • video_watched_6_s: Directly mapped after aggregation
Column Lineage
%3 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly video_views_p_25 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report video_views_p_25 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp video_views_p_25 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f0->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0
241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly
  • Input Column: 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp[video_views_p_25]
    • Cleaning The column is cast to DECIMAL(28, 6) type
    • Output Columns:
      • video_views_p_25: Directly mapped after casting
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly[video_views_p_25]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • video_views_p_25: Directly mapped after aggregation
Column Lineage
%3 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly video_views_p_50 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report video_views_p_50 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp video_views_p_50 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f0->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0
241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly
  • Input Column: 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp[video_views_p_50]
    • Cleaning The column is cast to DECIMAL(28, 6)
    • Output Columns:
      • video_views_p_50: Directly mapped after casting
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly[video_views_p_50]
    • Aggregation Summed up in the SELECT statement
    • Output Columns:
      • video_views_p_50: Aggregated sum in the output
Column Lineage
%3 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly video_views_p_75 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report video_views_p_75 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp video_views_p_75 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f0->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0
241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly
  • Input Column: 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp[video_views_p_75]
    • Cleaning The column is cast to DECIMAL(28, 6)
    • Output Columns:
      • video_views_p_75: Directly mapped after casting
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly[video_views_p_75]
    • Aggregation Summed up in the SELECT statement
    • Output Columns:
      • video_views_p_75: Aggregated sum in the output
Column Lineage
%3 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly clicks spend 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report clicks daily_cpc daily_cpm daily_ctr spend 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f1 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f3 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f1->234. model.tiktok_ads.tiktok_ads__ad_group_report:f4 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f1->234. model.tiktok_ads.tiktok_ads__ad_group_report:f1 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f1->234. model.tiktok_ads.tiktok_ads__ad_group_report:f2 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp clicks spend 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f0->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f1->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f1
241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly
  • Input Column: 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp[clicks]
    • Cleaning The column is cast to DECIMAL(28, 6) type
    • Output Columns:
      • clicks: Directly mapped after casting
  • Input Column: 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp[spend]
    • Cleaning The column is cast to DECIMAL(28, 6) in the 'fields' CTE
    • Output Columns:
      • spend: Directly mapped after casting
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly[clicks]
    • Aggregation The column is summed up in the aggregated CTE
    • Other Used in calculations for daily_cpc and daily_ctr
    • Output Columns:
      • clicks: Directly mapped after aggregation
      • daily_cpc: Used in calculation
      • daily_ctr: Used in calculation
  • Input Column: 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly[spend]
    • Aggregation The column is summed up in the aggregated CTE
    • Other Used in calculations for daily_cpc and daily_cpm
    • Output Columns:
      • spend: Directly mapped after aggregation
      • daily_cpc: Used in calculation
      • daily_cpm: Used in calculation
Column Lineage
%3 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly impressions spend 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report daily_cpc daily_cpm daily_ctr impressions spend 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f3 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f1 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f2 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f1->234. model.tiktok_ads.tiktok_ads__ad_group_report:f4 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f1->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f1->234. model.tiktok_ads.tiktok_ads__ad_group_report:f1 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp impressions spend 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f0->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f1->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f1
241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly
  • Input Column: 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp[impressions]
    • Cleaning The column is cast to DECIMAL(28, 6) in the 'fields' CTE.
    • Direct After casting, it's directly selected in the final output.
    • Output Columns:
      • impressions: Directly mapped after casting.
  • Input Column: 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp[spend]
    • Cleaning The column is cast to DECIMAL(28, 6) in the 'fields' CTE
    • Output Columns:
      • spend: Directly mapped after casting
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly[impressions]
    • Aggregation Summed up in the SELECT statement
    • Other Used in calculations for daily_cpm and daily_ctr
    • Output Columns:
      • impressions: Aggregated sum in the output
      • daily_cpm: Part of the calculation
      • daily_ctr: Part of the calculation
  • Input Column: 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly[spend]
    • Aggregation The column is summed up in the aggregated CTE
    • Other Used in calculations for daily_cpc and daily_cpm
    • Output Columns:
      • spend: Directly mapped after aggregation
      • daily_cpc: Used in calculation
      • daily_cpm: Used in calculation
Column Lineage
%3 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly clicks impressions 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report clicks daily_cpc daily_cpm daily_ctr impressions 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f1->234. model.tiktok_ads.tiktok_ads__ad_group_report:f4 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f1->234. model.tiktok_ads.tiktok_ads__ad_group_report:f2 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f1->234. model.tiktok_ads.tiktok_ads__ad_group_report:f3 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f1 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f3 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp clicks impressions 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f1->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f1 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f0->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0
241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly
  • Input Column: 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp[impressions]
    • Cleaning The column is cast to DECIMAL(28, 6) in the 'fields' CTE.
    • Direct After casting, it's directly selected in the final output.
    • Output Columns:
      • impressions: Directly mapped after casting.
  • Input Column: 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp[clicks]
    • Cleaning The column is cast to DECIMAL(28, 6) type
    • Output Columns:
      • clicks: Directly mapped after casting
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly[impressions]
    • Aggregation Summed up in the SELECT statement
    • Other Used in calculations for daily_cpm and daily_ctr
    • Output Columns:
      • impressions: Aggregated sum in the output
      • daily_cpm: Part of the calculation
      • daily_ctr: Part of the calculation
  • Input Column: 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly[clicks]
    • Aggregation The column is summed up in the aggregated CTE
    • Other Used in calculations for daily_cpc and daily_ctr
    • Output Columns:
      • clicks: Directly mapped after aggregation
      • daily_cpc: Used in calculation
      • daily_ctr: Used in calculation
235. model.tiktok_ads.tiktok_ads__ad_report

This SQL query aggregates and integrates data from various TikTok ad-related tables. It combines hourly ad report data with information about ads, ad groups, advertisers, and campaigns. The query calculates various metrics such as impressions, clicks, spend, and engagement metrics (likes, comments, shares, etc.) on a daily basis. It also computes derived metrics like CPC (Cost Per Click), CPM (Cost Per Mille), and CTR (Click-Through Rate). The result is a comprehensive daily report of ad performance across different dimensions of the advertising structure.

IntegrationAggregationFeaturizationFiltering
SQL Query
WITH hourly AS (
  SELECT
    *
  FROM TEST.PUBLIC_stg_tiktok_ads.stg_tiktok_ads__ad_report_hourly
), ads AS (
  SELECT
    *
  FROM TEST.PUBLIC_stg_tiktok_ads.stg_tiktok_ads__ad_history
  WHERE
    is_most_recent_record
), ad_groups AS (
  SELECT
    *
  FROM TEST.PUBLIC_stg_tiktok_ads.stg_tiktok_ads__ad_group_history
  WHERE
    is_most_recent_record
), advertiser AS (
  SELECT
    *
  FROM TEST.PUBLIC_stg_tiktok_ads.stg_tiktok_ads__advertiser
), campaigns AS (
  SELECT
    *
  FROM TEST.PUBLIC_stg_tiktok_ads.stg_tiktok_ads__campaign_history
  WHERE
    is_most_recent_record
), aggregated AS (
  SELECT
    hourly.source_relation,
    CAST(hourly.stat_time_hour AS DATE) AS date_day,
    ad_groups.advertiser_id,
    advertiser.advertiser_name,
    campaigns.campaign_id,
    campaigns.campaign_name,
    ad_groups.ad_group_id,
    ad_groups.ad_group_name,
    hourly.ad_id,
    ads.ad_name,
    advertiser.currency,
    ad_groups.category,
    ad_groups.gender,
    ad_groups.audience_type,
    ad_groups.budget,
    SUM(hourly.impressions) AS impressions,
    SUM(hourly.clicks) AS clicks,
    SUM(hourly.spend) AS spend,
    SUM(hourly.reach) AS reach,
    SUM(hourly.conversion) AS conversion,
    SUM(hourly.likes) AS likes,
    SUM(hourly.comments) AS comments,
    SUM(hourly.shares) AS shares,
    SUM(hourly.profile_visits) AS profile_visits,
    SUM(hourly.follows) AS follows,
    SUM(hourly.video_watched_2_s) AS video_watched_2_s,
    SUM(hourly.video_watched_6_s) AS video_watched_6_s,
    SUM(hourly.video_views_p_25) AS video_views_p_25,
    SUM(hourly.video_views_p_50) AS video_views_p_50,
    SUM(hourly.video_views_p_75) AS video_views_p_75,
    SUM(hourly.spend) / NULLIF(SUM(hourly.clicks), 0) AS daily_cpc,
    (
      SUM(hourly.spend) / NULLIF(SUM(hourly.impressions), 0)
    ) * 1000 AS daily_cpm,
    (
      SUM(hourly.clicks) / NULLIF(SUM(hourly.impressions), 0)
    ) * 100 AS daily_ctr
  FROM hourly
  LEFT JOIN ads
    ON hourly.ad_id = ads.ad_id AND hourly.source_relation = ads.source_relation
  LEFT JOIN ad_groups
    ON ads.ad_group_id = ad_groups.ad_group_id
    AND ads.source_relation = ad_groups.source_relation
  LEFT JOIN advertiser
    ON ads.advertiser_id = advertiser.advertiser_id
    AND ads.source_relation = advertiser.source_relation
  LEFT JOIN campaigns
    ON ads.campaign_id = campaigns.campaign_id
    AND ads.source_relation = campaigns.source_relation
  GROUP BY
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10,
    11,
    12,
    13,
    14,
    15
)
SELECT
  *
FROM aggregated
%3 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report source_relation date_day ad_id ad_name campaign_id campaign_name advertiser_name advertiser_id ad_group_id ad_group_name audience_type budget category gender currency impressions clicks spend reach conversion likes comments shares profile_visits follows video_watched_2_s video_watched_6_s video_views_p_25 video_views_p_50 video_views_p_75 daily_cpc daily_cpm daily_ctr 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history source_relation ad_group_id advertiser_id ad_group_name audience_type category gender budget display_name 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f1->235. model.tiktok_ads.tiktok_ads__ad_report:f8 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f2->235. model.tiktok_ads.tiktok_ads__ad_report:f7 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f3->235. model.tiktok_ads.tiktok_ads__ad_report:f9 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f4->235. model.tiktok_ads.tiktok_ads__ad_report:f10 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f5->235. model.tiktok_ads.tiktok_ads__ad_report:f12 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f6->235. model.tiktok_ads.tiktok_ads__ad_report:f13 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f7->235. model.tiktok_ads.tiktok_ads__ad_report:f11 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f8->235. model.tiktok_ads.tiktok_ads__ad_report:f9 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history source_relation ad_id ad_name 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f1->235. model.tiktok_ads.tiktok_ads__ad_report:f2 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f2->235. model.tiktok_ads.tiktok_ads__ad_report:f3 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly source_relation ad_id stat_time_hour video_views_p_75 video_views_p_50 impressions comments conversion shares clicks video_views_p_25 reach profile_visits video_watched_2_s follows video_watched_6_s spend likes 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f1->235. model.tiktok_ads.tiktok_ads__ad_report:f2 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f2->235. model.tiktok_ads.tiktok_ads__ad_report:f1 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f3->235. model.tiktok_ads.tiktok_ads__ad_report:f29 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f4->235. model.tiktok_ads.tiktok_ads__ad_report:f28 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f5->235. model.tiktok_ads.tiktok_ads__ad_report:f15 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f5->235. model.tiktok_ads.tiktok_ads__ad_report:f31 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f5->235. model.tiktok_ads.tiktok_ads__ad_report:f32 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f6->235. model.tiktok_ads.tiktok_ads__ad_report:f21 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f7->235. model.tiktok_ads.tiktok_ads__ad_report:f19 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f8->235. model.tiktok_ads.tiktok_ads__ad_report:f22 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f9->235. model.tiktok_ads.tiktok_ads__ad_report:f16 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f9->235. model.tiktok_ads.tiktok_ads__ad_report:f30 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f9->235. model.tiktok_ads.tiktok_ads__ad_report:f32 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f10->235. model.tiktok_ads.tiktok_ads__ad_report:f27 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f11->235. model.tiktok_ads.tiktok_ads__ad_report:f18 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f12->235. model.tiktok_ads.tiktok_ads__ad_report:f23 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f13->235. model.tiktok_ads.tiktok_ads__ad_report:f25 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f14->235. model.tiktok_ads.tiktok_ads__ad_report:f24 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f15->235. model.tiktok_ads.tiktok_ads__ad_report:f26 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f16->235. model.tiktok_ads.tiktok_ads__ad_report:f17 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f16->235. model.tiktok_ads.tiktok_ads__ad_report:f30 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f16->235. model.tiktok_ads.tiktok_ads__ad_report:f31 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f17->235. model.tiktok_ads.tiktok_ads__ad_report:f20 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser source_relation advertiser_id currency advertiser_name 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f1->235. model.tiktok_ads.tiktok_ads__ad_report:f7 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f2->235. model.tiktok_ads.tiktok_ads__ad_report:f14 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f3->235. model.tiktok_ads.tiktok_ads__ad_report:f6 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history source_relation campaign_id campaign_name 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history:f1->235. model.tiktok_ads.tiktok_ads__ad_report:f4 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history:f2->235. model.tiktok_ads.tiktok_ads__ad_report:f5
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
date_day date Day of record.
ad_id integer Ad ID.
ad_name text Ad name.
campaign_id integer Campaign ID.
campaign_name text Campaign name.
advertiser_name text Advertiser name.
advertiser_id integer Advertiser ID.
ad_group_id integer Ad group ID.
ad_group_name text Ad group name.
audience_type integer Audience Type
budget integer Ad budget. Returns 0.0 when Campaign Budget Optimization (budget_optimize_switch) is on.
category integer Ad group category.
gender text Gender that you want to target.
currency text Advertiser's currency.
impressions bigint The number of impressions that occurred on the day of the record.
clicks bigint The number of clicks that occurred on the day of the record.
spend double precision The amount of spend that occurred on the day of the record.
reach bigint The number of unique users who saw your ads at least once. This metric is estimated.
conversion bigint The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)
likes bigint The number of likes your video creative received within 1 day of a user seeing a paid ad.
comments bigint The number of comments your video creative received within 1 day of a user seeing a paid ad.
shares bigint The number of shares that occurred on the day of the record.
profile_visits bigint The number of profile visits that occurred on the day of the record.
follows bigint The number of follows that occurred on the day of the record.
video_watched_2_s bigint The number of times your video played for at least 2 seconds, or completely played. Replays will not be counted.
video_watched_6_s bigint The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.
video_views_p_25 bigint The number of times your video was played at 25% of its length. Replays will not be counted.
video_views_p_50 bigint The number of times your video was played at 50% of its length. Replays will not be counted.
video_views_p_75 bigint The number of times your video was played at 75% of its length. Replays will not be counted.
daily_cpc double precision The average amount of money you've spent on a click.
daily_cpm double precision The average amount of money you've spent per 1,000 impressions.
daily_ctr bigint The percentage of times people saw your ad and performed a click.
Column Lineage
%3 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history source_relation 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report source_relation 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history source_relation 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly source_relation 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser source_relation 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history source_relation 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history[source_relation]
    • Integration used to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with other tables
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
  • Input Column: 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
Column Lineage
%3 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly stat_time_hour 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report date_day 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp stat_time_hour 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[stat_time_hour]
    • Cleaning The column is cast to TIMESTAMP
    • Output Columns:
      • stat_time_hour: Directly copied after casting
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[stat_time_hour]
    • Cleaning Cast to DATE type
    • Aggregation Included in the GROUP BY clause after transformation
    • Output Columns:
      • date_day: Transformed and mapped to this output column
Column Lineage
%3 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history ad_id 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report ad_id 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly ad_id 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp ad_id 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f0 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp ad_id 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0
243. model.tiktok_ads_source.stg_tiktok_ads__ad_history
  • Input Column: 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp[ad_id]
    • Direct The column is directly copied without transformation
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • ad_id: Directly copied
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[ad_id]
    • Cleaning The column is cast to DECIMAL(28, 6)
    • Output Columns:
      • ad_id: Directly copied after casting
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history[ad_id]
    • Integration used to join with the hourly table
    • Direct directly copied to the output
    • Output Columns:
      • ad_id: directly copied
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[ad_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with the ads table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • ad_id: Directly copied to the output
Column Lineage
%3 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history ad_name 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report ad_name 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp ad_name 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f0
243. model.tiktok_ads_source.stg_tiktok_ads__ad_history
  • Input Column: 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp[ad_name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • ad_name: Directly copied
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history[ad_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_name: directly copied
Column Lineage
%3 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history campaign_id 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report campaign_id 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0 250. model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp 250. model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp campaign_id 250. model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp:f0->249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history:f0
249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history
  • Input Column: 250. model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp[campaign_id]
    • Cleaning Cast as DECIMAL(28, 6) in the fields CTE
    • Direct Copied without transformation from the fields CTE to the final output
    • Deduplication Used in PARTITION BY clause of ROW_NUMBER() function
    • Output Columns:
      • campaign_id: Directly mapped after casting
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history[campaign_id]
    • Integration used as the key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
Column Lineage
%3 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history campaign_name 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report campaign_name 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history[campaign_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_name: directly copied
Column Lineage
%3 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser advertiser_name 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report advertiser_name 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp name 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp:f0->247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0
247. model.tiktok_ads_source.stg_tiktok_ads__advertiser
  • Input Column: 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp[name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • advertiser_name: Directly mapped
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser[advertiser_name]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition
    • Output Columns:
      • advertiser_name: Directly mapped to this output column
Column Lineage
%3 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history advertiser_id 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report advertiser_id 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser advertiser_id 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp advertiser_id 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f0->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp id 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp:f0->247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0
239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history
  • Input Column: 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp[advertiser_id]
    • Cleaning Cast as DECIMAL(28, 6)
    • Output Columns:
      • advertiser_id: Directly mapped
247. model.tiktok_ads_source.stg_tiktok_ads__advertiser
  • Input Column: 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp[id]
    • Cleaning The column is cast to DECIMAL(28, 6)
    • Output Columns:
      • advertiser_id: Directly mapped after casting
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history[advertiser_id]
    • Direct directly copied to the output
    • Output Columns:
      • advertiser_id: directly copied
  • Input Column: 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser[advertiser_id]
    • Integration used as the key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • advertiser_id: directly copied
Column Lineage
%3 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history ad_group_id 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report ad_group_id 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp adgroup_id 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f0->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0
239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history
  • Input Column: 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp[adgroup_id]
    • Cleaning The column is cast as DECIMAL(28, 6)
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • ad_group_id: Directly mapped and renamed
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history[ad_group_id]
    • Integration used as the key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_id: directly copied
Column Lineage
%3 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history ad_group_name display_name 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report ad_group_name 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f1->235. model.tiktok_ads.tiktok_ads__ad_report:f0 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp adgroup_name display_name 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f0->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f1->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f1
239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history
  • Input Column: 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp[adgroup_name]
    • Cleaning Cast as TEXT
    • Output Columns:
      • ad_group_name: Directly mapped and renamed
  • Input Column: 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp[display_name]
    • Cleaning Cast as TEXT
    • Output Columns:
      • display_name: Directly mapped
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history[ad_group_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_name: directly copied
  • Input Column: 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history[display_name]
    • Direct The display_name column is directly copied to the output
    • Cleaning It's likely renamed to ad_group_name in the output
    • Output Columns:
      • ad_group_name: Copied and renamed as ad_group_name in the output
Column Lineage
%3 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history audience_type 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report audience_type 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp audience_type 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f0->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0
239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history
  • Input Column: 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp[audience_type]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to TEXT data type
    • Output Columns:
      • audience_type: Directly mapped after casting
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history[audience_type]
    • Direct directly copied to the output
    • Output Columns:
      • audience_type: directly copied
Column Lineage
%3 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history budget 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report budget 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp budget 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f0->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0
239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history
  • Input Column: 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp[budget]
    • Cleaning The column is cast to FLOAT data type
    • Output Columns:
      • budget: Directly mapped after casting
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history[budget]
    • Direct The budget column is directly copied to the output without transformation
    • Output Columns:
      • budget: Directly copied to the output budget column
Column Lineage
%3 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history category 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report category 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp category 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f0->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0
239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history
  • Input Column: 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp[category]
    • Cleaning The column is cast as DECIMAL(28, 6) in the fields CTE
    • Direct The column is directly selected in the final CTE without further transformation
    • Output Columns:
      • category: Directly mapped to the output 'category' column
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history[category]
    • Direct The category column is directly copied to the output without transformation
    • Output Columns:
      • category: Directly copied to the output category column
Column Lineage
%3 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history gender 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report gender 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp gender 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f0->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0
239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history
  • Input Column: 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp[gender]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to TEXT data type
    • Output Columns:
      • gender: Directly mapped after casting
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history[gender]
    • Direct The gender column is directly copied to the output without transformation
    • Output Columns:
      • gender: Directly copied to the output gender column
Column Lineage
%3 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser currency 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report currency 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp currency 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp:f0->247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0
247. model.tiktok_ads_source.stg_tiktok_ads__advertiser
  • Input Column: 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp[currency]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • currency: Directly mapped
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser[currency]
    • Direct directly copied to the output
    • Output Columns:
      • currency: directly copied
Column Lineage
%3 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly impressions 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report daily_cpm daily_ctr impressions 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f2 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f1 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp impressions 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[impressions]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistent data type
    • Direct The column is directly copied to the output
    • Output Columns:
      • impressions: Directly mapped after casting
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[impressions]
    • Aggregation Summed up in the SELECT clause
    • Other Used in calculations for daily_cpm and daily_ctr
    • Output Columns:
      • impressions: Aggregated into this output column
      • daily_cpm: Used in calculation
      • daily_ctr: Used in calculation
Column Lineage
%3 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly clicks 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report clicks daily_cpc daily_ctr 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f1 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f2 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp clicks 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[clicks]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistent data type
    • Output Columns:
      • clicks: Directly mapped after casting
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[clicks]
    • Aggregation The column is summed up in the aggregated CTE
    • Other Used in calculation of daily_cpc and daily_ctr
    • Output Columns:
      • clicks: Directly mapped after aggregation
      • daily_cpc: Used in calculation
      • daily_ctr: Used in calculation
Column Lineage
%3 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly spend 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report daily_cpc daily_cpm spend 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f2 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f1 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp spend 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[spend]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistency
    • Output Columns:
      • spend: Directly mapped after casting
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[spend]
    • Aggregation The column is summed up in the aggregated CTE
    • Other Used in calculations for daily_cpc and daily_cpm
    • Output Columns:
      • spend: Directly mapped after aggregation
      • daily_cpc: Used in calculation
      • daily_cpm: Used in calculation
Column Lineage
%3 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly reach 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report reach 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp reach 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[reach]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistent data type
    • Output Columns:
      • reach: Directly mapped after casting
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[reach]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • reach: Directly mapped after aggregation
Column Lineage
%3 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly conversion 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report conversion 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp conversion 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[conversion]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistent data type
    • Direct The column is directly copied to the output
    • Output Columns:
      • conversion: Directly mapped after casting
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[conversion]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • conversion: Directly mapped after aggregation
Column Lineage
%3 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly likes 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report likes 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp likes 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[likes]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistency
    • Output Columns:
      • likes: Directly mapped after casting
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[likes]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • likes: Directly mapped after aggregation
Column Lineage
%3 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly comments 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report comments 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp comments 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[comments]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistent data type
    • Direct The column is directly copied to the output
    • Output Columns:
      • comments: Directly mapped after casting
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[comments]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • comments: Directly mapped after aggregation
Column Lineage
%3 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly shares 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report shares 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp shares 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[shares]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistent data type
    • Direct The column is directly copied to the output
    • Output Columns:
      • shares: Directly mapped after casting
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[shares]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • shares: Directly mapped after aggregation
Column Lineage
%3 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly profile_visits 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report profile_visits 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp profile_visits 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[profile_visits]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistent data type
    • Output Columns:
      • profile_visits: Directly mapped after casting
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[profile_visits]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • profile_visits: Directly mapped after aggregation
Column Lineage
%3 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly follows 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report follows 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp follows 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[follows]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistency
    • Output Columns:
      • follows: Directly mapped after casting
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[follows]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • follows: Directly mapped after aggregation
Column Lineage
%3 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly video_watched_2_s 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report video_watched_2_s 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp video_watched_2_s 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[video_watched_2_s]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistency
    • Output Columns:
      • video_watched_2_s: Directly mapped after casting
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[video_watched_2_s]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • video_watched_2_s: Directly mapped after aggregation
Column Lineage
%3 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly video_watched_6_s 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report video_watched_6_s 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp video_watched_6_s 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[video_watched_6_s]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistency
    • Output Columns:
      • video_watched_6_s: Directly mapped after casting
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[video_watched_6_s]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • video_watched_6_s: Directly mapped after aggregation
Column Lineage
%3 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly video_views_p_25 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report video_views_p_25 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp video_views_p_25 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[video_views_p_25]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistent data type
    • Output Columns:
      • video_views_p_25: Directly mapped after casting
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[video_views_p_25]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • video_views_p_25: Directly mapped after aggregation
Column Lineage
%3 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly video_views_p_50 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report video_views_p_50 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp video_views_p_50 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[video_views_p_50]
    • Cleaning The column is cast to DECIMAL(28, 6)
    • Output Columns:
      • video_views_p_50: Directly copied after casting
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[video_views_p_50]
    • Aggregation Summed up in the SELECT clause
    • Output Columns:
      • video_views_p_50: Aggregated into this output column
Column Lineage
%3 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly video_views_p_75 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report video_views_p_75 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp video_views_p_75 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[video_views_p_75]
    • Cleaning The column is cast to DECIMAL(28, 6)
    • Output Columns:
      • video_views_p_75: Directly copied after casting
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[video_views_p_75]
    • Aggregation Summed up in the SELECT clause
    • Output Columns:
      • video_views_p_75: Aggregated into this output column
Column Lineage
%3 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly clicks spend 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report clicks daily_cpc daily_cpm daily_ctr spend 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f1 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f3 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f1->235. model.tiktok_ads.tiktok_ads__ad_report:f4 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f1->235. model.tiktok_ads.tiktok_ads__ad_report:f1 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f1->235. model.tiktok_ads.tiktok_ads__ad_report:f2 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp clicks spend 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f1->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f1
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[clicks]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistent data type
    • Output Columns:
      • clicks: Directly mapped after casting
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[spend]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistency
    • Output Columns:
      • spend: Directly mapped after casting
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[clicks]
    • Aggregation The column is summed up in the aggregated CTE
    • Other Used in calculation of daily_cpc and daily_ctr
    • Output Columns:
      • clicks: Directly mapped after aggregation
      • daily_cpc: Used in calculation
      • daily_ctr: Used in calculation
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[spend]
    • Aggregation The column is summed up in the aggregated CTE
    • Other Used in calculations for daily_cpc and daily_cpm
    • Output Columns:
      • spend: Directly mapped after aggregation
      • daily_cpc: Used in calculation
      • daily_cpm: Used in calculation
Column Lineage
%3 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly impressions spend 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report daily_cpc daily_cpm daily_ctr impressions spend 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f3 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f1 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f2 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f1->235. model.tiktok_ads.tiktok_ads__ad_report:f4 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f1->235. model.tiktok_ads.tiktok_ads__ad_report:f0 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f1->235. model.tiktok_ads.tiktok_ads__ad_report:f1 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp impressions spend 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f1->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f1
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[impressions]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistent data type
    • Direct The column is directly copied to the output
    • Output Columns:
      • impressions: Directly mapped after casting
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[spend]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistency
    • Output Columns:
      • spend: Directly mapped after casting
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[impressions]
    • Aggregation Summed up in the SELECT clause
    • Other Used in calculations for daily_cpm and daily_ctr
    • Output Columns:
      • impressions: Aggregated into this output column
      • daily_cpm: Used in calculation
      • daily_ctr: Used in calculation
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[spend]
    • Aggregation The column is summed up in the aggregated CTE
    • Other Used in calculations for daily_cpc and daily_cpm
    • Output Columns:
      • spend: Directly mapped after aggregation
      • daily_cpc: Used in calculation
      • daily_cpm: Used in calculation
Column Lineage
%3 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly clicks impressions 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report clicks daily_cpc daily_cpm daily_ctr impressions 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f1->235. model.tiktok_ads.tiktok_ads__ad_report:f4 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f1->235. model.tiktok_ads.tiktok_ads__ad_report:f2 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f1->235. model.tiktok_ads.tiktok_ads__ad_report:f3 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f1 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f3 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp clicks impressions 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f1->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f1 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[impressions]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistent data type
    • Direct The column is directly copied to the output
    • Output Columns:
      • impressions: Directly mapped after casting
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[clicks]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistent data type
    • Output Columns:
      • clicks: Directly mapped after casting
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[impressions]
    • Aggregation Summed up in the SELECT clause
    • Other Used in calculations for daily_cpm and daily_ctr
    • Output Columns:
      • impressions: Aggregated into this output column
      • daily_cpm: Used in calculation
      • daily_ctr: Used in calculation
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[clicks]
    • Aggregation The column is summed up in the aggregated CTE
    • Other Used in calculation of daily_cpc and daily_ctr
    • Output Columns:
      • clicks: Directly mapped after aggregation
      • daily_cpc: Used in calculation
      • daily_ctr: Used in calculation
236. model.tiktok_ads.tiktok_ads__advertiser_report

This SQL query aggregates TikTok ad performance data at the advertiser level. It joins hourly ad report data with advertiser and ad history information, then calculates various performance metrics such as clicks, impressions, spend, and engagement metrics. The query also computes derived metrics like CPC, CPM, and CTR. The results are grouped by source relation, date, advertiser ID, advertiser name, and currency.

IntegrationAggregationFeaturizationFiltering
SQL Query
WITH hourly AS (
  SELECT
    *
  FROM TEST.PUBLIC_stg_tiktok_ads.stg_tiktok_ads__ad_report_hourly
), advertiser AS (
  SELECT
    *
  FROM TEST.PUBLIC_stg_tiktok_ads.stg_tiktok_ads__advertiser
), ads AS (
  SELECT
    *
  FROM TEST.PUBLIC_stg_tiktok_ads.stg_tiktok_ads__ad_history
  WHERE
    is_most_recent_record
), joined AS (
  SELECT
    hourly.source_relation,
    CAST(hourly.stat_time_hour AS DATE) AS date_day,
    ads.advertiser_id,
    advertiser.advertiser_name,
    advertiser.currency,
    SUM(hourly.clicks) AS clicks,
    SUM(hourly.impressions) AS impressions,
    SUM(hourly.spend) AS spend,
    SUM(hourly.reach) AS reach,
    SUM(hourly.conversion) AS conversion,
    SUM(hourly.likes) AS likes,
    SUM(hourly.comments) AS comments,
    SUM(hourly.shares) AS shares,
    SUM(hourly.profile_visits) AS profile_visits,
    SUM(hourly.follows) AS follows,
    SUM(hourly.video_watched_2_s) AS video_watched_2_s,
    SUM(hourly.video_watched_6_s) AS video_watched_6_s,
    SUM(hourly.video_views_p_25) AS video_views_p_25,
    SUM(hourly.video_views_p_50) AS video_views_p_50,
    SUM(hourly.video_views_p_75) AS video_views_p_75,
    SUM(hourly.spend) / NULLIF(SUM(hourly.clicks), 0) AS daily_cpc,
    (
      SUM(hourly.spend) / NULLIF(SUM(hourly.impressions), 0)
    ) * 1000 AS daily_cpm,
    (
      SUM(hourly.clicks) / NULLIF(SUM(hourly.impressions), 0)
    ) * 100 AS daily_ctr
  FROM hourly
  LEFT JOIN ads
    ON hourly.ad_id = ads.ad_id AND hourly.source_relation = ads.source_relation
  LEFT JOIN advertiser
    ON ads.advertiser_id = advertiser.advertiser_id
    AND ads.source_relation = advertiser.source_relation
  GROUP BY
    1,
    2,
    3,
    4,
    5
)
SELECT
  *
FROM joined
%3 236. model.tiktok_ads.tiktok_ads__advertiser_report 236. model.tiktok_ads.tiktok_ads__advertiser_report source_relation date_day advertiser_name advertiser_id currency impressions clicks spend reach conversion likes comments shares profile_visits follows video_watched_2_s video_watched_6_s video_views_p_25 video_views_p_50 video_views_p_75 daily_cpc daily_cpm daily_ctr 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history source_relation advertiser_id 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f0 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f1->236. model.tiktok_ads.tiktok_ads__advertiser_report:f3 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly source_relation stat_time_hour video_views_p_75 video_views_p_50 impressions comments conversion shares clicks video_views_p_25 reach profile_visits video_watched_2_s follows video_watched_6_s spend likes 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f0 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f1->236. model.tiktok_ads.tiktok_ads__advertiser_report:f1 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f2->236. model.tiktok_ads.tiktok_ads__advertiser_report:f19 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f3->236. model.tiktok_ads.tiktok_ads__advertiser_report:f18 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f4->236. model.tiktok_ads.tiktok_ads__advertiser_report:f5 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f4->236. model.tiktok_ads.tiktok_ads__advertiser_report:f21 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f4->236. model.tiktok_ads.tiktok_ads__advertiser_report:f22 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f5->236. model.tiktok_ads.tiktok_ads__advertiser_report:f11 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f6->236. model.tiktok_ads.tiktok_ads__advertiser_report:f9 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f7->236. model.tiktok_ads.tiktok_ads__advertiser_report:f12 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f8->236. model.tiktok_ads.tiktok_ads__advertiser_report:f6 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f8->236. model.tiktok_ads.tiktok_ads__advertiser_report:f20 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f8->236. model.tiktok_ads.tiktok_ads__advertiser_report:f22 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f9->236. model.tiktok_ads.tiktok_ads__advertiser_report:f17 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f10->236. model.tiktok_ads.tiktok_ads__advertiser_report:f8 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f11->236. model.tiktok_ads.tiktok_ads__advertiser_report:f13 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f12->236. model.tiktok_ads.tiktok_ads__advertiser_report:f15 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f13->236. model.tiktok_ads.tiktok_ads__advertiser_report:f14 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f14->236. model.tiktok_ads.tiktok_ads__advertiser_report:f16 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f15->236. model.tiktok_ads.tiktok_ads__advertiser_report:f7 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f15->236. model.tiktok_ads.tiktok_ads__advertiser_report:f20 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f15->236. model.tiktok_ads.tiktok_ads__advertiser_report:f21 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f16->236. model.tiktok_ads.tiktok_ads__advertiser_report:f10 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser source_relation advertiser_id currency advertiser_name 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f0 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f1->236. model.tiktok_ads.tiktok_ads__advertiser_report:f3 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f2->236. model.tiktok_ads.tiktok_ads__advertiser_report:f4 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f3->236. model.tiktok_ads.tiktok_ads__advertiser_report:f2
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
date_day date Day of record.
advertiser_name text Advertiser name.
advertiser_id integer Advertiser ID.
currency text Advertiser's currency.
impressions bigint The number of impressions that occurred on the day of the record.
clicks bigint The number of clicks that occurred on the day of the record.
spend double precision The amount of spend that occurred on the day of the record.
reach bigint The number of unique users who saw your ads at least once. This metric is estimated.
conversion bigint The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)
likes bigint The number of likes your video creative received within 1 day of a user seeing a paid ad.
comments bigint The number of comments your video creative received within 1 day of a user seeing a paid ad.
shares bigint The number of shares that occurred on the day of the record.
profile_visits bigint The number of profile visits that occurred on the day of the record.
follows bigint The number of follows that occurred on the day of the record.
video_watched_2_s bigint The number of times your video played for at least 2 seconds, or completely played. Replays will not be counted.
video_watched_6_s bigint The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.
video_views_p_25 bigint The number of times your video was played at 25% of its length. Replays will not be counted.
video_views_p_50 bigint The number of times your video was played at 50% of its length. Replays will not be counted.
video_views_p_75 bigint The number of times your video was played at 75% of its length. Replays will not be counted.
daily_cpc double precision The average amount of money you've spent on a click.
daily_cpm double precision The average amount of money you've spent per 1,000 impressions.
daily_ctr bigint The percentage of times people saw your ad and performed a click.
Column Lineage
%3 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history source_relation 236. model.tiktok_ads.tiktok_ads__advertiser_report 236. model.tiktok_ads.tiktok_ads__advertiser_report source_relation 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f0 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly source_relation 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f0 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser source_relation 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f0
236. model.tiktok_ads.tiktok_ads__advertiser_report
  • Input Column: 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with other tables
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
  • Input Column: 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
Column Lineage
%3 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly stat_time_hour 236. model.tiktok_ads.tiktok_ads__advertiser_report 236. model.tiktok_ads.tiktok_ads__advertiser_report date_day 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f0 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp stat_time_hour 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[stat_time_hour]
    • Cleaning The column is cast to TIMESTAMP
    • Output Columns:
      • stat_time_hour: Directly copied after casting
236. model.tiktok_ads.tiktok_ads__advertiser_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[stat_time_hour]
    • Cleaning Cast to DATE type
    • Aggregation Used in the GROUP BY clause after transformation
    • Output Columns:
      • date_day: Transformed and mapped to this output column
Column Lineage
%3 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser advertiser_name 236. model.tiktok_ads.tiktok_ads__advertiser_report 236. model.tiktok_ads.tiktok_ads__advertiser_report advertiser_name 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f0 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp name 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp:f0->247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0
247. model.tiktok_ads_source.stg_tiktok_ads__advertiser
  • Input Column: 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp[name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • advertiser_name: Directly mapped
236. model.tiktok_ads.tiktok_ads__advertiser_report
  • Input Column: 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser[advertiser_name]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition
    • Output Columns:
      • advertiser_name: Directly copied to the output
Column Lineage
%3 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history advertiser_id 236. model.tiktok_ads.tiktok_ads__advertiser_report 236. model.tiktok_ads.tiktok_ads__advertiser_report advertiser_id 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f0 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser advertiser_id 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f0 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp advertiser_id 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f0 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp id 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp:f0->247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0
243. model.tiktok_ads_source.stg_tiktok_ads__ad_history
  • Input Column: 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp[advertiser_id]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • advertiser_id: Directly copied
247. model.tiktok_ads_source.stg_tiktok_ads__advertiser
  • Input Column: 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp[id]
    • Cleaning The column is cast to DECIMAL(28, 6)
    • Output Columns:
      • advertiser_id: Directly mapped after casting
236. model.tiktok_ads.tiktok_ads__advertiser_report
  • Input Column: 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history[advertiser_id]
    • Integration used as the key to join with the advertiser table
    • Aggregation used in the GROUP BY clause
    • Direct directly copied to the output
    • Output Columns:
      • advertiser_id: directly copied
  • Input Column: 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser[advertiser_id]
    • Integration used as the key to join with other tables
    • Aggregation used in the GROUP BY clause
    • Output Columns:
      • advertiser_id: directly copied
Column Lineage
%3 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser currency 236. model.tiktok_ads.tiktok_ads__advertiser_report 236. model.tiktok_ads.tiktok_ads__advertiser_report currency 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f0 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp currency 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp:f0->247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0
247. model.tiktok_ads_source.stg_tiktok_ads__advertiser
  • Input Column: 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp[currency]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • currency: Directly mapped
236. model.tiktok_ads.tiktok_ads__advertiser_report
  • Input Column: 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser[currency]
    • Direct directly copied to the output
    • Aggregation used in the GROUP BY clause
    • Output Columns:
      • currency: directly copied
Column Lineage
%3 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly impressions 236. model.tiktok_ads.tiktok_ads__advertiser_report 236. model.tiktok_ads.tiktok_ads__advertiser_report daily_cpm daily_ctr impressions 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f2 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f0 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f1 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp impressions 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[impressions]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistent data type
    • Direct The column is directly copied to the output
    • Output Columns:
      • impressions: Directly mapped after casting
236. model.tiktok_ads.tiktok_ads__advertiser_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[impressions]
    • Aggregation Summed up in the SELECT clause
    • Other Used in calculations for daily_cpm and daily_ctr
    • Output Columns:
      • impressions: Aggregated and mapped to this output column
      • daily_cpm: Used in calculation
      • daily_ctr: Used in calculation
Column Lineage
%3 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly clicks 236. model.tiktok_ads.tiktok_ads__advertiser_report 236. model.tiktok_ads.tiktok_ads__advertiser_report clicks daily_cpc daily_ctr 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f0 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f1 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f2 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp clicks 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[clicks]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistent data type
    • Output Columns:
      • clicks: Directly mapped after casting
236. model.tiktok_ads.tiktok_ads__advertiser_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[clicks]
    • Aggregation The column is summed up in the GROUP BY clause
    • Featurization Used in calculating daily_cpc and daily_ctr
    • Output Columns:
      • clicks: Directly mapped after aggregation
      • daily_cpc: Used in calculation
      • daily_ctr: Used in calculation
Column Lineage
%3 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly spend 236. model.tiktok_ads.tiktok_ads__advertiser_report 236. model.tiktok_ads.tiktok_ads__advertiser_report daily_cpc daily_cpm spend 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f2 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f0 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f1 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp spend 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[spend]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistency
    • Output Columns:
      • spend: Directly mapped after casting
236. model.tiktok_ads.tiktok_ads__advertiser_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[spend]
    • Aggregation The column is summed up in the GROUP BY clause
    • Other Used in calculations for daily_cpc and daily_cpm
    • Output Columns:
      • spend: Directly mapped after aggregation
      • daily_cpc: Used in calculation
      • daily_cpm: Used in calculation
Column Lineage
%3 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly reach 236. model.tiktok_ads.tiktok_ads__advertiser_report 236. model.tiktok_ads.tiktok_ads__advertiser_report reach 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f0 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp reach 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[reach]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistent data type
    • Output Columns:
      • reach: Directly mapped after casting
236. model.tiktok_ads.tiktok_ads__advertiser_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[reach]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • reach: Directly mapped after aggregation
Column Lineage
%3 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly conversion 236. model.tiktok_ads.tiktok_ads__advertiser_report 236. model.tiktok_ads.tiktok_ads__advertiser_report conversion 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f0 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp conversion 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[conversion]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistent data type
    • Direct The column is directly copied to the output
    • Output Columns:
      • conversion: Directly mapped after casting
236. model.tiktok_ads.tiktok_ads__advertiser_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[conversion]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • conversion: Directly mapped after aggregation
Column Lineage
%3 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly likes 236. model.tiktok_ads.tiktok_ads__advertiser_report 236. model.tiktok_ads.tiktok_ads__advertiser_report likes 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f0 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp likes 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[likes]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistency
    • Output Columns:
      • likes: Directly mapped after casting
236. model.tiktok_ads.tiktok_ads__advertiser_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[likes]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • likes: Directly mapped after aggregation
Column Lineage
%3 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly comments 236. model.tiktok_ads.tiktok_ads__advertiser_report 236. model.tiktok_ads.tiktok_ads__advertiser_report comments 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f0 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp comments 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[comments]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistent data type
    • Direct The column is directly copied to the output
    • Output Columns:
      • comments: Directly mapped after casting
236. model.tiktok_ads.tiktok_ads__advertiser_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[comments]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • comments: Directly mapped after aggregation
Column Lineage
%3 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly shares 236. model.tiktok_ads.tiktok_ads__advertiser_report 236. model.tiktok_ads.tiktok_ads__advertiser_report shares 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f0 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp shares 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[shares]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistent data type
    • Direct The column is directly copied to the output
    • Output Columns:
      • shares: Directly mapped after casting
236. model.tiktok_ads.tiktok_ads__advertiser_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[shares]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • shares: Directly mapped after aggregation
Column Lineage
%3 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly profile_visits 236. model.tiktok_ads.tiktok_ads__advertiser_report 236. model.tiktok_ads.tiktok_ads__advertiser_report profile_visits 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f0 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp profile_visits 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[profile_visits]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistent data type
    • Output Columns:
      • profile_visits: Directly mapped after casting
236. model.tiktok_ads.tiktok_ads__advertiser_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[profile_visits]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • profile_visits: Directly mapped after aggregation
Column Lineage
%3 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly follows 236. model.tiktok_ads.tiktok_ads__advertiser_report 236. model.tiktok_ads.tiktok_ads__advertiser_report follows 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f0 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp follows 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[follows]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistency
    • Output Columns:
      • follows: Directly mapped after casting
236. model.tiktok_ads.tiktok_ads__advertiser_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[follows]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • follows: Directly mapped after aggregation
Column Lineage
%3 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly video_watched_2_s 236. model.tiktok_ads.tiktok_ads__advertiser_report 236. model.tiktok_ads.tiktok_ads__advertiser_report video_watched_2_s 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f0 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp video_watched_2_s 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[video_watched_2_s]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistency
    • Output Columns:
      • video_watched_2_s: Directly mapped after casting
236. model.tiktok_ads.tiktok_ads__advertiser_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[video_watched_2_s]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • video_watched_2_s: Directly mapped after aggregation
Column Lineage
%3 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly video_watched_6_s 236. model.tiktok_ads.tiktok_ads__advertiser_report 236. model.tiktok_ads.tiktok_ads__advertiser_report video_watched_6_s 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f0 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp video_watched_6_s 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[video_watched_6_s]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistency
    • Output Columns:
      • video_watched_6_s: Directly mapped after casting
236. model.tiktok_ads.tiktok_ads__advertiser_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[video_watched_6_s]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • video_watched_6_s: Directly mapped after aggregation
Column Lineage
%3 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly video_views_p_25 236. model.tiktok_ads.tiktok_ads__advertiser_report 236. model.tiktok_ads.tiktok_ads__advertiser_report video_views_p_25 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f0 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp video_views_p_25 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[video_views_p_25]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistent data type
    • Output Columns:
      • video_views_p_25: Directly mapped after casting
236. model.tiktok_ads.tiktok_ads__advertiser_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[video_views_p_25]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • video_views_p_25: Directly mapped after aggregation
Column Lineage
%3 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly video_views_p_50 236. model.tiktok_ads.tiktok_ads__advertiser_report 236. model.tiktok_ads.tiktok_ads__advertiser_report video_views_p_50 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f0 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp video_views_p_50 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[video_views_p_50]
    • Cleaning The column is cast to DECIMAL(28, 6)
    • Output Columns:
      • video_views_p_50: Directly copied after casting
236. model.tiktok_ads.tiktok_ads__advertiser_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[video_views_p_50]
    • Aggregation Summed up in the SELECT clause
    • Output Columns:
      • video_views_p_50: Aggregated and mapped to this output column
Column Lineage
%3 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly video_views_p_75 236. model.tiktok_ads.tiktok_ads__advertiser_report 236. model.tiktok_ads.tiktok_ads__advertiser_report video_views_p_75 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f0 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp video_views_p_75 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[video_views_p_75]
    • Cleaning The column is cast to DECIMAL(28, 6)
    • Output Columns:
      • video_views_p_75: Directly copied after casting
236. model.tiktok_ads.tiktok_ads__advertiser_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[video_views_p_75]
    • Aggregation Summed up in the SELECT clause
    • Output Columns:
      • video_views_p_75: Aggregated and mapped to this output column
Column Lineage
%3 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly clicks spend 236. model.tiktok_ads.tiktok_ads__advertiser_report 236. model.tiktok_ads.tiktok_ads__advertiser_report clicks daily_cpc daily_cpm daily_ctr spend 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f0 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f1 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f3 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f1->236. model.tiktok_ads.tiktok_ads__advertiser_report:f4 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f1->236. model.tiktok_ads.tiktok_ads__advertiser_report:f1 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f1->236. model.tiktok_ads.tiktok_ads__advertiser_report:f2 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp clicks spend 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f1->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f1
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[clicks]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistent data type
    • Output Columns:
      • clicks: Directly mapped after casting
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[spend]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistency
    • Output Columns:
      • spend: Directly mapped after casting
236. model.tiktok_ads.tiktok_ads__advertiser_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[clicks]
    • Aggregation The column is summed up in the GROUP BY clause
    • Featurization Used in calculating daily_cpc and daily_ctr
    • Output Columns:
      • clicks: Directly mapped after aggregation
      • daily_cpc: Used in calculation
      • daily_ctr: Used in calculation
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[spend]
    • Aggregation The column is summed up in the GROUP BY clause
    • Other Used in calculations for daily_cpc and daily_cpm
    • Output Columns:
      • spend: Directly mapped after aggregation
      • daily_cpc: Used in calculation
      • daily_cpm: Used in calculation
Column Lineage
%3 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly impressions spend 236. model.tiktok_ads.tiktok_ads__advertiser_report 236. model.tiktok_ads.tiktok_ads__advertiser_report daily_cpc daily_cpm daily_ctr impressions spend 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f3 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f1 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f2 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f1->236. model.tiktok_ads.tiktok_ads__advertiser_report:f4 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f1->236. model.tiktok_ads.tiktok_ads__advertiser_report:f0 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f1->236. model.tiktok_ads.tiktok_ads__advertiser_report:f1 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp impressions spend 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f1->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f1
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[impressions]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistent data type
    • Direct The column is directly copied to the output
    • Output Columns:
      • impressions: Directly mapped after casting
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[spend]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistency
    • Output Columns:
      • spend: Directly mapped after casting
236. model.tiktok_ads.tiktok_ads__advertiser_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[impressions]
    • Aggregation Summed up in the SELECT clause
    • Other Used in calculations for daily_cpm and daily_ctr
    • Output Columns:
      • impressions: Aggregated and mapped to this output column
      • daily_cpm: Used in calculation
      • daily_ctr: Used in calculation
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[spend]
    • Aggregation The column is summed up in the GROUP BY clause
    • Other Used in calculations for daily_cpc and daily_cpm
    • Output Columns:
      • spend: Directly mapped after aggregation
      • daily_cpc: Used in calculation
      • daily_cpm: Used in calculation
Column Lineage
%3 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly clicks impressions 236. model.tiktok_ads.tiktok_ads__advertiser_report 236. model.tiktok_ads.tiktok_ads__advertiser_report clicks daily_cpc daily_cpm daily_ctr impressions 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f1->236. model.tiktok_ads.tiktok_ads__advertiser_report:f4 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f1->236. model.tiktok_ads.tiktok_ads__advertiser_report:f2 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f1->236. model.tiktok_ads.tiktok_ads__advertiser_report:f3 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f0 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f1 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f3 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp clicks impressions 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f1->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f1 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[impressions]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistent data type
    • Direct The column is directly copied to the output
    • Output Columns:
      • impressions: Directly mapped after casting
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[clicks]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistent data type
    • Output Columns:
      • clicks: Directly mapped after casting
236. model.tiktok_ads.tiktok_ads__advertiser_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[impressions]
    • Aggregation Summed up in the SELECT clause
    • Other Used in calculations for daily_cpm and daily_ctr
    • Output Columns:
      • impressions: Aggregated and mapped to this output column
      • daily_cpm: Used in calculation
      • daily_ctr: Used in calculation
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[clicks]
    • Aggregation The column is summed up in the GROUP BY clause
    • Featurization Used in calculating daily_cpc and daily_ctr
    • Output Columns:
      • clicks: Directly mapped after aggregation
      • daily_cpc: Used in calculation
      • daily_ctr: Used in calculation
237. model.tiktok_ads.tiktok_ads__campaign_report

This SQL query combines data from three tables (campaign report, campaign history, and advertiser) to create a daily aggregated report of TikTok ad campaign performance. It joins the tables, aggregates hourly data to daily level, calculates various performance metrics (impressions, clicks, spend, etc.), and computes derived metrics like CPC, CPM, and CTR.

IntegrationAggregationFeaturization
SQL Query
WITH hourly AS (
  SELECT
    *
  FROM TEST.PUBLIC_stg_tiktok_ads.stg_tiktok_ads__campaign_report_hourly
), campaigns AS (
  SELECT
    *
  FROM TEST.PUBLIC_stg_tiktok_ads.stg_tiktok_ads__campaign_history
  WHERE
    is_most_recent_record
), advertiser AS (
  SELECT
    *
  FROM TEST.PUBLIC_stg_tiktok_ads.stg_tiktok_ads__advertiser
), aggregated AS (
  SELECT
    hourly.source_relation,
    CAST(hourly.stat_time_hour AS DATE) AS date_day,
    advertiser.advertiser_id,
    advertiser.advertiser_name,
    hourly.campaign_id,
    campaigns.campaign_name,
    advertiser.currency,
    SUM(hourly.impressions) AS impressions,
    SUM(hourly.clicks) AS clicks,
    SUM(hourly.spend) AS spend,
    SUM(hourly.reach) AS reach,
    SUM(hourly.conversion) AS conversion,
    SUM(hourly.likes) AS likes,
    SUM(hourly.comments) AS comments,
    SUM(hourly.shares) AS shares,
    SUM(hourly.profile_visits) AS profile_visits,
    SUM(hourly.follows) AS follows,
    SUM(hourly.video_watched_2_s) AS video_watched_2_s,
    SUM(hourly.video_watched_6_s) AS video_watched_6_s,
    SUM(hourly.video_views_p_25) AS video_views_p_25,
    SUM(hourly.video_views_p_50) AS video_views_p_50,
    SUM(hourly.video_views_p_75) AS video_views_p_75,
    SUM(hourly.spend) / NULLIF(SUM(hourly.clicks), 0) AS daily_cpc,
    (
      SUM(hourly.spend) / NULLIF(SUM(hourly.impressions), 0)
    ) * 1000 AS daily_cpm,
    (
      SUM(hourly.clicks) / NULLIF(SUM(hourly.impressions), 0)
    ) * 100 AS daily_ctr
  FROM hourly
  LEFT JOIN campaigns
    ON hourly.campaign_id = campaigns.campaign_id
    AND hourly.source_relation = campaigns.source_relation
  LEFT JOIN advertiser
    ON campaigns.advertiser_id = advertiser.advertiser_id
    AND campaigns.source_relation = advertiser.source_relation
  GROUP BY
    1,
    2,
    3,
    4,
    5,
    6,
    7
)
SELECT
  *
FROM aggregated
%3 237. model.tiktok_ads.tiktok_ads__campaign_report 237. model.tiktok_ads.tiktok_ads__campaign_report source_relation date_day campaign_id campaign_name currency advertiser_id advertiser_name impressions clicks spend reach conversion likes comments shares profile_visits follows video_watched_2_s video_watched_6_s video_views_p_25 video_views_p_50 video_views_p_75 daily_cpc daily_cpm daily_ctr 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser source_relation advertiser_id currency advertiser_name 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f0 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f1->237. model.tiktok_ads.tiktok_ads__campaign_report:f5 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f2->237. model.tiktok_ads.tiktok_ads__campaign_report:f4 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f3->237. model.tiktok_ads.tiktok_ads__campaign_report:f6 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history source_relation campaign_id campaign_name 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f0 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history:f1->237. model.tiktok_ads.tiktok_ads__campaign_report:f2 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history:f2->237. model.tiktok_ads.tiktok_ads__campaign_report:f3 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly source_relation campaign_id stat_time_hour video_views_p_75 video_views_p_50 impressions comments conversion shares clicks video_views_p_25 reach profile_visits video_watched_2_s follows video_watched_6_s spend likes 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f0 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f1->237. model.tiktok_ads.tiktok_ads__campaign_report:f2 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f2->237. model.tiktok_ads.tiktok_ads__campaign_report:f1 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f3->237. model.tiktok_ads.tiktok_ads__campaign_report:f21 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f4->237. model.tiktok_ads.tiktok_ads__campaign_report:f20 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f5->237. model.tiktok_ads.tiktok_ads__campaign_report:f7 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f5->237. model.tiktok_ads.tiktok_ads__campaign_report:f23 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f5->237. model.tiktok_ads.tiktok_ads__campaign_report:f24 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f6->237. model.tiktok_ads.tiktok_ads__campaign_report:f13 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f7->237. model.tiktok_ads.tiktok_ads__campaign_report:f11 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f8->237. model.tiktok_ads.tiktok_ads__campaign_report:f14 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f9->237. model.tiktok_ads.tiktok_ads__campaign_report:f8 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f9->237. model.tiktok_ads.tiktok_ads__campaign_report:f22 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f9->237. model.tiktok_ads.tiktok_ads__campaign_report:f24 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f10->237. model.tiktok_ads.tiktok_ads__campaign_report:f19 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f11->237. model.tiktok_ads.tiktok_ads__campaign_report:f10 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f12->237. model.tiktok_ads.tiktok_ads__campaign_report:f15 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f13->237. model.tiktok_ads.tiktok_ads__campaign_report:f17 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f14->237. model.tiktok_ads.tiktok_ads__campaign_report:f16 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f15->237. model.tiktok_ads.tiktok_ads__campaign_report:f18 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f16->237. model.tiktok_ads.tiktok_ads__campaign_report:f9 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f16->237. model.tiktok_ads.tiktok_ads__campaign_report:f22 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f16->237. model.tiktok_ads.tiktok_ads__campaign_report:f23 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f17->237. model.tiktok_ads.tiktok_ads__campaign_report:f12
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
date_day date Day of record
campaign_id integer Campaign ID
campaign_name text Campaign name
currency text Advertiser's currency.
advertiser_id integer Advertiser ID
advertiser_name text Advertiser name
impressions bigint The number of impressions that occurred on the day of the record.
clicks bigint The number of clicks that occurred on the day of the record.
spend double precision The amount of spend that occurred on the day of the record.
reach bigint The number of unique users who saw your ads at least once. This metric is estimated.
conversion bigint The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)
likes bigint The number of likes your video creative received within 1 day of a user seeing a paid ad.
comments bigint The number of comments your video creative received within 1 day of a user seeing a paid ad.
shares bigint The number of shares that occurred on the day of the record.
profile_visits bigint The number of profile visits that occurred on the day of the record.
follows bigint The number of follows that occurred on the day of the record.
video_watched_2_s bigint The number of times your video played for at least 2 seconds, or completely played. Replays will not be counted.
video_watched_6_s bigint The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.
video_views_p_25 bigint The number of times your video was played at 25% of its length. Replays will not be counted.
video_views_p_50 bigint The number of times your video was played at 50% of its length. Replays will not be counted.
video_views_p_75 bigint The number of times your video was played at 75% of its length. Replays will not be counted.
daily_cpc double precision The average amount of money you've spent on a click.
daily_cpm double precision The average amount of money you've spent per 1,000 impressions.
daily_ctr bigint The percentage of times people saw your ad and performed a click.
Column Lineage
%3 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser source_relation 237. model.tiktok_ads.tiktok_ads__campaign_report 237. model.tiktok_ads.tiktok_ads__campaign_report source_relation 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f0 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history source_relation 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f0 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly source_relation 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f0
237. model.tiktok_ads.tiktok_ads__campaign_report
  • Input Column: 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser[source_relation]
    • Integration The column is used as part of the join condition
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • source_relation: Directly copied to the output
  • Input Column: 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history[source_relation]
    • Integration used to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly[source_relation]
    • Direct The column is directly used in the SELECT statement
    • Integration Used in joining with other tables
    • Aggregation Used in GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to output
Column Lineage
%3 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly stat_time_hour 237. model.tiktok_ads.tiktok_ads__campaign_report 237. model.tiktok_ads.tiktok_ads__campaign_report date_day 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f0 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp stat_time_hour 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f0->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0
251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly
  • Input Column: 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp[stat_time_hour]
    • Cleaning The column is cast to TIMESTAMP
    • Output Columns:
      • stat_time_hour: Directly mapped after casting
237. model.tiktok_ads.tiktok_ads__campaign_report
  • Input Column: 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly[stat_time_hour]
    • Cleaning Cast to DATE type
    • Aggregation Used to group data by day
    • Output Columns:
      • date_day: Transformed to date and used as output
Column Lineage
%3 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history campaign_id 237. model.tiktok_ads.tiktok_ads__campaign_report 237. model.tiktok_ads.tiktok_ads__campaign_report campaign_id 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f0 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly campaign_id 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f0 250. model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp 250. model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp campaign_id 250. model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp:f0->249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history:f0 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp campaign_id 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f0->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0
249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history
  • Input Column: 250. model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp[campaign_id]
    • Cleaning Cast as DECIMAL(28, 6) in the fields CTE
    • Direct Copied without transformation from the fields CTE to the final output
    • Deduplication Used in PARTITION BY clause of ROW_NUMBER() function
    • Output Columns:
      • campaign_id: Directly mapped after casting
251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly
  • Input Column: 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp[campaign_id]
    • Cleaning The column is cast to DECIMAL(28, 6)
    • Output Columns:
      • campaign_id: Directly mapped after casting
237. model.tiktok_ads.tiktok_ads__campaign_report
  • Input Column: 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history[campaign_id]
    • Integration used to join with hourly data
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
  • Input Column: 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly[campaign_id]
    • Direct The column is directly used in the SELECT statement
    • Integration Used in joining with other tables
    • Aggregation Used in GROUP BY clause
    • Output Columns:
      • campaign_id: Directly copied to output
Column Lineage
%3 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history campaign_name 237. model.tiktok_ads.tiktok_ads__campaign_report 237. model.tiktok_ads.tiktok_ads__campaign_report campaign_name 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f0
237. model.tiktok_ads.tiktok_ads__campaign_report
  • Input Column: 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history[campaign_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_name: directly copied
Column Lineage
%3 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser currency 237. model.tiktok_ads.tiktok_ads__campaign_report 237. model.tiktok_ads.tiktok_ads__campaign_report currency 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f0 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp currency 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp:f0->247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0
247. model.tiktok_ads_source.stg_tiktok_ads__advertiser
  • Input Column: 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp[currency]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • currency: Directly mapped
237. model.tiktok_ads.tiktok_ads__campaign_report
  • Input Column: 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser[currency]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • currency: Directly copied to the output
Column Lineage
%3 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser advertiser_id 237. model.tiktok_ads.tiktok_ads__campaign_report 237. model.tiktok_ads.tiktok_ads__campaign_report advertiser_id 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f0 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp id 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp:f0->247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0
247. model.tiktok_ads_source.stg_tiktok_ads__advertiser
  • Input Column: 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp[id]
    • Cleaning The column is cast to DECIMAL(28, 6)
    • Output Columns:
      • advertiser_id: Directly mapped after casting
237. model.tiktok_ads.tiktok_ads__campaign_report
  • Input Column: 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser[advertiser_id]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as the key to join tables
    • Output Columns:
      • advertiser_id: Directly copied to the output
Column Lineage
%3 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser advertiser_name 237. model.tiktok_ads.tiktok_ads__campaign_report 237. model.tiktok_ads.tiktok_ads__campaign_report advertiser_name 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f0 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp name 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp:f0->247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0
247. model.tiktok_ads_source.stg_tiktok_ads__advertiser
  • Input Column: 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp[name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • advertiser_name: Directly mapped
237. model.tiktok_ads.tiktok_ads__campaign_report
  • Input Column: 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser[advertiser_name]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition
    • Output Columns:
      • advertiser_name: Directly copied to the output
Column Lineage
%3 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly impressions 237. model.tiktok_ads.tiktok_ads__campaign_report 237. model.tiktok_ads.tiktok_ads__campaign_report daily_cpm daily_ctr impressions 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f2 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f0 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f1 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp impressions 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f0->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0
251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly
  • Input Column: 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp[impressions]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as DECIMAL(28, 6)
    • Output Columns:
      • impressions: Directly mapped after casting
237. model.tiktok_ads.tiktok_ads__campaign_report
  • Input Column: 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly[impressions]
    • Aggregation Summed up in the aggregated CTE
    • Other Used in calculating daily_cpm and daily_ctr
    • Output Columns:
      • impressions: Aggregated sum in output
      • daily_cpm: Part of the calculation
      • daily_ctr: Part of the calculation
Column Lineage
%3 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly clicks 237. model.tiktok_ads.tiktok_ads__campaign_report 237. model.tiktok_ads.tiktok_ads__campaign_report clicks daily_cpc daily_ctr 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f0 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f1 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f2 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp clicks 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f0->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0
251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly
  • Input Column: 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp[clicks]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as DECIMAL(28, 6)
    • Output Columns:
      • clicks: Directly mapped after casting
237. model.tiktok_ads.tiktok_ads__campaign_report
  • Input Column: 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly[clicks]
    • Aggregation The column is summed up in the GROUP BY clause
    • Other Used in calculations for derived metrics (daily_cpc, daily_ctr)
    • Output Columns:
      • clicks: Directly mapped after aggregation
      • daily_cpc: Used in calculation
      • daily_ctr: Used in calculation
Column Lineage
%3 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly spend 237. model.tiktok_ads.tiktok_ads__campaign_report 237. model.tiktok_ads.tiktok_ads__campaign_report daily_cpc daily_cpm spend 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f2 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f0 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f1 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp spend 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f0->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0
251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly
  • Input Column: 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp[spend]
    • Direct This column is directly copied without any transformation
    • Cleaning The column is cast to DECIMAL(28, 6)
    • Output Columns:
      • spend: Directly mapped after casting
237. model.tiktok_ads.tiktok_ads__campaign_report
  • Input Column: 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly[spend]
    • Aggregation The column is summed up in the aggregated CTE
    • Other Used in calculations for daily_cpc and daily_cpm
    • Output Columns:
      • spend: Directly mapped after aggregation
      • daily_cpc: Used in calculation
      • daily_cpm: Used in calculation
Column Lineage
%3 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly reach 237. model.tiktok_ads.tiktok_ads__campaign_report 237. model.tiktok_ads.tiktok_ads__campaign_report reach 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f0 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp reach 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f0->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0
251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly
  • Input Column: 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp[reach]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as DECIMAL(28, 6)
    • Output Columns:
      • reach: Directly mapped after casting
237. model.tiktok_ads.tiktok_ads__campaign_report
  • Input Column: 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly[reach]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • reach: Directly mapped after aggregation
Column Lineage
%3 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly conversion 237. model.tiktok_ads.tiktok_ads__campaign_report 237. model.tiktok_ads.tiktok_ads__campaign_report conversion 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f0 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp conversion 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f0->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0
251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly
  • Input Column: 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp[conversion]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as DECIMAL(28, 6)
    • Output Columns:
      • conversion: Directly mapped after casting
237. model.tiktok_ads.tiktok_ads__campaign_report
  • Input Column: 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly[conversion]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • conversion: Directly mapped after aggregation
Column Lineage
%3 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly likes 237. model.tiktok_ads.tiktok_ads__campaign_report 237. model.tiktok_ads.tiktok_ads__campaign_report likes 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f0 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp likes 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f0->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0
251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly
  • Input Column: 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp[likes]
    • Direct This column is directly copied without any transformation
    • Cleaning The column is cast to DECIMAL(28, 6)
    • Output Columns:
      • likes: Directly mapped after casting
237. model.tiktok_ads.tiktok_ads__campaign_report
  • Input Column: 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly[likes]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • likes: Directly mapped after aggregation
Column Lineage
%3 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly comments 237. model.tiktok_ads.tiktok_ads__campaign_report 237. model.tiktok_ads.tiktok_ads__campaign_report comments 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f0 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp comments 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f0->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0
251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly
  • Input Column: 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp[comments]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as DECIMAL(28, 6)
    • Output Columns:
      • comments: Directly mapped after casting
237. model.tiktok_ads.tiktok_ads__campaign_report
  • Input Column: 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly[comments]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • comments: Directly mapped after aggregation
Column Lineage
%3 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly shares 237. model.tiktok_ads.tiktok_ads__campaign_report 237. model.tiktok_ads.tiktok_ads__campaign_report shares 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f0 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp shares 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f0->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0
251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly
  • Input Column: 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp[shares]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as DECIMAL(28, 6)
    • Output Columns:
      • shares: Directly mapped after casting
237. model.tiktok_ads.tiktok_ads__campaign_report
  • Input Column: 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly[shares]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • shares: Directly mapped after aggregation
Column Lineage
%3 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly profile_visits 237. model.tiktok_ads.tiktok_ads__campaign_report 237. model.tiktok_ads.tiktok_ads__campaign_report profile_visits 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f0 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp profile_visits 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f0->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0
251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly
  • Input Column: 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp[profile_visits]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as DECIMAL(28, 6)
    • Output Columns:
      • profile_visits: Directly mapped after casting
237. model.tiktok_ads.tiktok_ads__campaign_report
  • Input Column: 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly[profile_visits]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • profile_visits: Directly mapped after aggregation
Column Lineage
%3 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly follows 237. model.tiktok_ads.tiktok_ads__campaign_report 237. model.tiktok_ads.tiktok_ads__campaign_report follows 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f0 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp follows 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f0->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0
251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly
  • Input Column: 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp[follows]
    • Direct This column is directly copied without any transformation
    • Cleaning The column is cast to DECIMAL(28, 6)
    • Output Columns:
      • follows: Directly mapped after casting
237. model.tiktok_ads.tiktok_ads__campaign_report
  • Input Column: 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly[follows]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • follows: Directly mapped after aggregation
Column Lineage
%3 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly video_watched_2_s 237. model.tiktok_ads.tiktok_ads__campaign_report 237. model.tiktok_ads.tiktok_ads__campaign_report video_watched_2_s 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f0 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp video_watched_2_s 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f0->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0
251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly
  • Input Column: 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp[video_watched_2_s]
    • Direct This column is directly copied without any transformation
    • Cleaning The column is cast to DECIMAL(28, 6)
    • Output Columns:
      • video_watched_2_s: Directly mapped after casting
237. model.tiktok_ads.tiktok_ads__campaign_report
  • Input Column: 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly[video_watched_2_s]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • video_watched_2_s: Directly mapped after aggregation
Column Lineage
%3 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly video_watched_6_s 237. model.tiktok_ads.tiktok_ads__campaign_report 237. model.tiktok_ads.tiktok_ads__campaign_report video_watched_6_s 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f0 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp video_watched_6_s 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f0->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0
251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly
  • Input Column: 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp[video_watched_6_s]
    • Direct This column is directly copied without any transformation
    • Cleaning The column is cast to DECIMAL(28, 6)
    • Output Columns:
      • video_watched_6_s: Directly mapped after casting
237. model.tiktok_ads.tiktok_ads__campaign_report
  • Input Column: 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly[video_watched_6_s]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • video_watched_6_s: Directly mapped after aggregation
Column Lineage
%3 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly video_views_p_25 237. model.tiktok_ads.tiktok_ads__campaign_report 237. model.tiktok_ads.tiktok_ads__campaign_report video_views_p_25 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f0 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp video_views_p_25 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f0->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0
251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly
  • Input Column: 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp[video_views_p_25]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as DECIMAL(28, 6)
    • Output Columns:
      • video_views_p_25: Directly mapped after casting
237. model.tiktok_ads.tiktok_ads__campaign_report
  • Input Column: 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly[video_views_p_25]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • video_views_p_25: Directly mapped after aggregation
Column Lineage
%3 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly video_views_p_50 237. model.tiktok_ads.tiktok_ads__campaign_report 237. model.tiktok_ads.tiktok_ads__campaign_report video_views_p_50 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f0 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp video_views_p_50 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f0->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0
251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly
  • Input Column: 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp[video_views_p_50]
    • Cleaning The column is cast to DECIMAL(28, 6)
    • Output Columns:
      • video_views_p_50: Directly mapped after casting
237. model.tiktok_ads.tiktok_ads__campaign_report
  • Input Column: 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly[video_views_p_50]
    • Aggregation Summed up in the aggregated CTE
    • Output Columns:
      • video_views_p_50: Aggregated sum in output
Column Lineage
%3 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly video_views_p_75 237. model.tiktok_ads.tiktok_ads__campaign_report 237. model.tiktok_ads.tiktok_ads__campaign_report video_views_p_75 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f0 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp video_views_p_75 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f0->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0
251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly
  • Input Column: 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp[video_views_p_75]
    • Cleaning The column is cast to DECIMAL(28, 6)
    • Output Columns:
      • video_views_p_75: Directly mapped after casting
237. model.tiktok_ads.tiktok_ads__campaign_report
  • Input Column: 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly[video_views_p_75]
    • Aggregation Summed up in the aggregated CTE
    • Output Columns:
      • video_views_p_75: Aggregated sum in output
Column Lineage
%3 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly clicks spend 237. model.tiktok_ads.tiktok_ads__campaign_report 237. model.tiktok_ads.tiktok_ads__campaign_report clicks daily_cpc daily_cpm daily_ctr spend 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f0 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f1 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f3 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f1->237. model.tiktok_ads.tiktok_ads__campaign_report:f4 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f1->237. model.tiktok_ads.tiktok_ads__campaign_report:f1 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f1->237. model.tiktok_ads.tiktok_ads__campaign_report:f2 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp clicks spend 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f0->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f1->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f1
251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly
  • Input Column: 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp[clicks]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as DECIMAL(28, 6)
    • Output Columns:
      • clicks: Directly mapped after casting
  • Input Column: 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp[spend]
    • Direct This column is directly copied without any transformation
    • Cleaning The column is cast to DECIMAL(28, 6)
    • Output Columns:
      • spend: Directly mapped after casting
237. model.tiktok_ads.tiktok_ads__campaign_report
  • Input Column: 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly[clicks]
    • Aggregation The column is summed up in the GROUP BY clause
    • Other Used in calculations for derived metrics (daily_cpc, daily_ctr)
    • Output Columns:
      • clicks: Directly mapped after aggregation
      • daily_cpc: Used in calculation
      • daily_ctr: Used in calculation
  • Input Column: 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly[spend]
    • Aggregation The column is summed up in the aggregated CTE
    • Other Used in calculations for daily_cpc and daily_cpm
    • Output Columns:
      • spend: Directly mapped after aggregation
      • daily_cpc: Used in calculation
      • daily_cpm: Used in calculation
Column Lineage
%3 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly impressions spend 237. model.tiktok_ads.tiktok_ads__campaign_report 237. model.tiktok_ads.tiktok_ads__campaign_report daily_cpc daily_cpm daily_ctr impressions spend 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f3 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f1 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f2 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f1->237. model.tiktok_ads.tiktok_ads__campaign_report:f4 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f1->237. model.tiktok_ads.tiktok_ads__campaign_report:f0 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f1->237. model.tiktok_ads.tiktok_ads__campaign_report:f1 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp impressions spend 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f0->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f1->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f1
251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly
  • Input Column: 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp[impressions]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as DECIMAL(28, 6)
    • Output Columns:
      • impressions: Directly mapped after casting
  • Input Column: 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp[spend]
    • Direct This column is directly copied without any transformation
    • Cleaning The column is cast to DECIMAL(28, 6)
    • Output Columns:
      • spend: Directly mapped after casting
237. model.tiktok_ads.tiktok_ads__campaign_report
  • Input Column: 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly[impressions]
    • Aggregation Summed up in the aggregated CTE
    • Other Used in calculating daily_cpm and daily_ctr
    • Output Columns:
      • impressions: Aggregated sum in output
      • daily_cpm: Part of the calculation
      • daily_ctr: Part of the calculation
  • Input Column: 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly[spend]
    • Aggregation The column is summed up in the aggregated CTE
    • Other Used in calculations for daily_cpc and daily_cpm
    • Output Columns:
      • spend: Directly mapped after aggregation
      • daily_cpc: Used in calculation
      • daily_cpm: Used in calculation
Column Lineage
%3 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly clicks impressions 237. model.tiktok_ads.tiktok_ads__campaign_report 237. model.tiktok_ads.tiktok_ads__campaign_report clicks daily_cpc daily_cpm daily_ctr impressions 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f1->237. model.tiktok_ads.tiktok_ads__campaign_report:f4 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f1->237. model.tiktok_ads.tiktok_ads__campaign_report:f2 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f1->237. model.tiktok_ads.tiktok_ads__campaign_report:f3 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f0 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f1 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f3 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp clicks impressions 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f1->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f1 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f0->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0
251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly
  • Input Column: 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp[impressions]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as DECIMAL(28, 6)
    • Output Columns:
      • impressions: Directly mapped after casting
  • Input Column: 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp[clicks]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as DECIMAL(28, 6)
    • Output Columns:
      • clicks: Directly mapped after casting
237. model.tiktok_ads.tiktok_ads__campaign_report
  • Input Column: 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly[impressions]
    • Aggregation Summed up in the aggregated CTE
    • Other Used in calculating daily_cpm and daily_ctr
    • Output Columns:
      • impressions: Aggregated sum in output
      • daily_cpm: Part of the calculation
      • daily_ctr: Part of the calculation
  • Input Column: 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly[clicks]
    • Aggregation The column is summed up in the GROUP BY clause
    • Other Used in calculations for derived metrics (daily_cpc, daily_ctr)
    • Output Columns:
      • clicks: Directly mapped after aggregation
      • daily_cpc: Used in calculation
      • daily_ctr: Used in calculation
238. model.tiktok_ads.tiktok_ads__url_report

This SQL query combines data from multiple TikTok ad-related tables to create a comprehensive daily report of ad performance metrics. It joins ad reports with ad, ad group, advertiser, and campaign data, then aggregates various performance metrics (like impressions, clicks, spend) by date and ad details. The query also calculates derived metrics such as CPC, CPM, and CTR. It filters for ads with populated URL fields and includes various ad targeting and UTM parameters.

FilteringIntegrationAggregationFeaturization
SQL Query
WITH hourly AS (
  SELECT
    *
  FROM TEST.PUBLIC_stg_tiktok_ads.stg_tiktok_ads__ad_report_hourly
), ads AS (
  SELECT
    *
  FROM TEST.PUBLIC_stg_tiktok_ads.stg_tiktok_ads__ad_history
  WHERE
    is_most_recent_record
), ad_groups AS (
  SELECT
    *
  FROM TEST.PUBLIC_stg_tiktok_ads.stg_tiktok_ads__ad_group_history
  WHERE
    is_most_recent_record
), advertiser AS (
  SELECT
    *
  FROM TEST.PUBLIC_stg_tiktok_ads.stg_tiktok_ads__advertiser
), campaigns AS (
  SELECT
    *
  FROM TEST.PUBLIC_stg_tiktok_ads.stg_tiktok_ads__campaign_history
  WHERE
    is_most_recent_record
), aggregated AS (
  SELECT
    hourly.source_relation,
    CAST(hourly.stat_time_hour AS DATE) AS date_day,
    ad_groups.advertiser_id,
    advertiser.advertiser_name,
    campaigns.campaign_id,
    campaigns.campaign_name,
    ad_groups.ad_group_id,
    ad_groups.ad_group_name,
    hourly.ad_id,
    ads.ad_name,
    ads.base_url,
    ads.url_host,
    ads.url_path,
    ads.utm_source,
    ads.utm_medium,
    ads.utm_campaign,
    ads.utm_content,
    ads.utm_term,
    advertiser.currency,
    ad_groups.category,
    ad_groups.gender,
    ad_groups.audience_type,
    ad_groups.budget,
    SUM(hourly.impressions) AS impressions,
    SUM(hourly.clicks) AS clicks,
    SUM(hourly.spend) AS spend,
    SUM(hourly.reach) AS reach,
    SUM(hourly.conversion) AS conversion,
    SUM(hourly.likes) AS likes,
    SUM(hourly.comments) AS comments,
    SUM(hourly.shares) AS shares,
    SUM(hourly.profile_visits) AS profile_visits,
    SUM(hourly.follows) AS follows,
    SUM(hourly.video_watched_2_s) AS video_watched_2_s,
    SUM(hourly.video_watched_6_s) AS video_watched_6_s,
    SUM(hourly.video_views_p_25) AS video_views_p_25,
    SUM(hourly.video_views_p_50) AS video_views_p_50,
    SUM(hourly.video_views_p_75) AS video_views_p_75,
    SUM(hourly.spend) / NULLIF(SUM(hourly.clicks), 0) AS daily_cpc,
    (
      SUM(hourly.spend) / NULLIF(SUM(hourly.impressions), 0)
    ) * 1000 AS daily_cpm,
    (
      SUM(hourly.clicks) / NULLIF(SUM(hourly.impressions), 0)
    ) * 100 AS daily_ctr
  FROM hourly
  LEFT JOIN ads
    ON hourly.ad_id = ads.ad_id AND hourly.source_relation = ads.source_relation
  LEFT JOIN ad_groups
    ON ads.ad_group_id = ad_groups.ad_group_id
    AND ads.source_relation = ad_groups.source_relation
  LEFT JOIN advertiser
    ON ads.advertiser_id = advertiser.advertiser_id
    AND ads.source_relation = advertiser.source_relation
  LEFT JOIN campaigns
    ON ads.campaign_id = campaigns.campaign_id
    AND ads.source_relation = campaigns.source_relation
  /* We are filtering for only ads where url fields are populated. */
  WHERE
    NOT ads.landing_page_url IS NULL
  GROUP BY
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10,
    11,
    12,
    13,
    14,
    15,
    16,
    17,
    18,
    19,
    20,
    21,
    22,
    23
)
SELECT
  *
FROM aggregated
%3 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report source_relation date_day ad_id ad_name campaign_id campaign_name advertiser_name advertiser_id ad_group_id ad_group_name base_url url_host url_path utm_source utm_medium utm_campaign utm_content utm_term audience_type budget category gender currency impressions clicks spend reach conversion likes comments shares profile_visits follows video_watched_2_s video_watched_6_s video_views_p_25 video_views_p_50 video_views_p_75 daily_cpc daily_cpm daily_ctr 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history source_relation ad_group_id advertiser_id ad_group_name audience_type budget category display_name gender 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f1->238. model.tiktok_ads.tiktok_ads__url_report:f8 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f2->238. model.tiktok_ads.tiktok_ads__url_report:f7 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f3->238. model.tiktok_ads.tiktok_ads__url_report:f9 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f4->238. model.tiktok_ads.tiktok_ads__url_report:f18 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f5->238. model.tiktok_ads.tiktok_ads__url_report:f19 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f6->238. model.tiktok_ads.tiktok_ads__url_report:f20 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f7->238. model.tiktok_ads.tiktok_ads__url_report:f9 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f8->238. model.tiktok_ads.tiktok_ads__url_report:f21 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history source_relation ad_id advertiser_id base_url ad_name url_host url_path utm_source utm_medium utm_campaign utm_content utm_term 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f1->238. model.tiktok_ads.tiktok_ads__url_report:f2 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f2->238. model.tiktok_ads.tiktok_ads__url_report:f7 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f3->238. model.tiktok_ads.tiktok_ads__url_report:f10 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f4->238. model.tiktok_ads.tiktok_ads__url_report:f3 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f5->238. model.tiktok_ads.tiktok_ads__url_report:f11 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f6->238. model.tiktok_ads.tiktok_ads__url_report:f12 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f7->238. model.tiktok_ads.tiktok_ads__url_report:f13 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f8->238. model.tiktok_ads.tiktok_ads__url_report:f14 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f9->238. model.tiktok_ads.tiktok_ads__url_report:f15 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f10->238. model.tiktok_ads.tiktok_ads__url_report:f16 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f11->238. model.tiktok_ads.tiktok_ads__url_report:f17 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly source_relation ad_id stat_time_hour video_views_p_75 video_views_p_50 impressions comments conversion shares clicks video_views_p_25 reach profile_visits video_watched_2_s follows video_watched_6_s spend likes 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f1->238. model.tiktok_ads.tiktok_ads__url_report:f2 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f2->238. model.tiktok_ads.tiktok_ads__url_report:f1 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f3->238. model.tiktok_ads.tiktok_ads__url_report:f37 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f4->238. model.tiktok_ads.tiktok_ads__url_report:f36 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f5->238. model.tiktok_ads.tiktok_ads__url_report:f23 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f5->238. model.tiktok_ads.tiktok_ads__url_report:f39 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f5->238. model.tiktok_ads.tiktok_ads__url_report:f40 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f6->238. model.tiktok_ads.tiktok_ads__url_report:f29 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f7->238. model.tiktok_ads.tiktok_ads__url_report:f27 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f8->238. model.tiktok_ads.tiktok_ads__url_report:f30 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f9->238. model.tiktok_ads.tiktok_ads__url_report:f24 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f9->238. model.tiktok_ads.tiktok_ads__url_report:f38 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f9->238. model.tiktok_ads.tiktok_ads__url_report:f40 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f10->238. model.tiktok_ads.tiktok_ads__url_report:f35 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f11->238. model.tiktok_ads.tiktok_ads__url_report:f26 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f12->238. model.tiktok_ads.tiktok_ads__url_report:f31 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f13->238. model.tiktok_ads.tiktok_ads__url_report:f33 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f14->238. model.tiktok_ads.tiktok_ads__url_report:f32 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f15->238. model.tiktok_ads.tiktok_ads__url_report:f34 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f16->238. model.tiktok_ads.tiktok_ads__url_report:f25 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f16->238. model.tiktok_ads.tiktok_ads__url_report:f38 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f16->238. model.tiktok_ads.tiktok_ads__url_report:f39 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f17->238. model.tiktok_ads.tiktok_ads__url_report:f28 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser source_relation advertiser_id currency advertiser_name 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f1->238. model.tiktok_ads.tiktok_ads__url_report:f7 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f2->238. model.tiktok_ads.tiktok_ads__url_report:f22 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f3->238. model.tiktok_ads.tiktok_ads__url_report:f6 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history source_relation campaign_id campaign_name 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history:f1->238. model.tiktok_ads.tiktok_ads__url_report:f4 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history:f2->238. model.tiktok_ads.tiktok_ads__url_report:f5
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
date_day date Day of record.
ad_id integer Ad ID.
ad_name text Ad name.
campaign_id integer Campaign ID.
campaign_name text Campaign name.
advertiser_name text Advertiser name.
advertiser_id integer Advertiser ID.
ad_group_id integer Ad group ID.
ad_group_name text Ad group name.
base_url text The base URL of the ad, extracted from the `landing page url`.
url_host text The URL host of the ad, extracted from the `landing page url`.
url_path text The URL path of the ad, extracted from the `landing page url`.
utm_source text The utm_source parameter of the ad, extracted from the `landing page url`.
utm_medium text The utm_medium parameter of the ad, extracted from the `landing page url`.
utm_campaign text The utm_campaign parameter of the ad, extracted from the `landing page url`.
utm_content text The utm_content parameter of the ad, extracted from the `landing page url`.
utm_term text The utm_term parameter of the ad, extracted from the `landing page url`.
audience_type integer Audience Type
budget integer Ad budget. Returns 0.0 when Campaign Budget Optimization (budget_optimize_switch) is on.
category integer Ad group category.
gender text Gender that you want to target.
currency text Advertiser's currency.
impressions bigint The number of impressions that occurred on the day of the record.
clicks bigint The number of clicks that occurred on the day of the record.
spend double precision The amount of spend that occurred on the day of the record.
reach bigint The number of unique users who saw your ads at least once. This metric is estimated.
conversion bigint The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)
likes bigint The number of likes your video creative received within 1 day of a user seeing a paid ad.
comments bigint The number of comments your video creative received within 1 day of a user seeing a paid ad.
shares bigint The number of shares that occurred on the day of the record.
profile_visits bigint The number of profile visits that occurred on the day of the record.
follows bigint The number of follows that occurred on the day of the record.
video_watched_2_s bigint The number of times your video played for at least 2 seconds, or completely played. Replays will not be counted.
video_watched_6_s bigint The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.
video_views_p_25 bigint The number of times your video was played at 25% of its length. Replays will not be counted.
video_views_p_50 bigint The number of times your video was played at 50% of its length. Replays will not be counted.
video_views_p_75 bigint The number of times your video was played at 75% of its length. Replays will not be counted.
daily_cpc double precision The average amount of money you've spent on a click.
daily_cpm double precision The average amount of money you've spent per 1,000 impressions.
daily_ctr bigint The percentage of times people saw your ad and performed a click.
Column Lineage
%3 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history source_relation 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report source_relation 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history source_relation 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly source_relation 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser source_relation 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history source_relation 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history[source_relation]
    • Integration Used to join with other tables
    • Direct Directly selected in the output
    • Output Columns:
      • source_relation: Directly copied to output
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[source_relation]
    • Direct The column is directly copied without transformation
    • Integration Used as part of the join condition with other tables
    • Aggregation Part of the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to output
  • Input Column: 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser[source_relation]
    • Integration used to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history[source_relation]
    • Integration used to join with other tables
    • Aggregation included in the GROUP BY clause
    • Output Columns:
      • source_relation: directly copied to the output
Column Lineage
%3 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly stat_time_hour 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report date_day 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp stat_time_hour 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[stat_time_hour]
    • Cleaning The column is cast to TIMESTAMP
    • Output Columns:
      • stat_time_hour: Directly copied after casting
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[stat_time_hour]
    • Cleaning Cast to DATE type
    • Aggregation Part of the GROUP BY clause
    • Output Columns:
      • date_day: Transformed and mapped to this output column
Column Lineage
%3 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history ad_id 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report ad_id 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly ad_id 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp ad_id 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f0 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp ad_id 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0
243. model.tiktok_ads_source.stg_tiktok_ads__ad_history
  • Input Column: 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp[ad_id]
    • Direct The column is directly copied without transformation
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • ad_id: Directly copied
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[ad_id]
    • Cleaning The column is cast to DECIMAL(28, 6)
    • Output Columns:
      • ad_id: Directly copied after casting
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history[ad_id]
    • Integration Used to join with the hourly table
    • Direct Directly selected in the output
    • Output Columns:
      • ad_id: Directly copied to output
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[ad_id]
    • Direct The column is directly copied without transformation
    • Integration Used as the key to join with the ads table
    • Aggregation Part of the GROUP BY clause
    • Output Columns:
      • ad_id: Directly copied to output
Column Lineage
%3 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history ad_name 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report ad_name 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp ad_name 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f0
243. model.tiktok_ads_source.stg_tiktok_ads__ad_history
  • Input Column: 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp[ad_name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • ad_name: Directly copied
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history[ad_name]
    • Direct Directly selected in the output
    • Output Columns:
      • ad_name: Directly copied to output
Column Lineage
%3 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history campaign_id 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report campaign_id 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 250. model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp 250. model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp campaign_id 250. model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp:f0->249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history:f0
249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history
  • Input Column: 250. model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp[campaign_id]
    • Cleaning Cast as DECIMAL(28, 6) in the fields CTE
    • Direct Copied without transformation from the fields CTE to the final output
    • Deduplication Used in PARTITION BY clause of ROW_NUMBER() function
    • Output Columns:
      • campaign_id: Directly mapped after casting
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history[campaign_id]
    • Integration used to join with other tables
    • Aggregation included in the GROUP BY clause
    • Output Columns:
      • campaign_id: directly copied to the output
Column Lineage
%3 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history campaign_name 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report campaign_name 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history[campaign_name]
    • Aggregation included in the GROUP BY clause
    • Output Columns:
      • campaign_name: directly copied to the output
Column Lineage
%3 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser advertiser_name 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report advertiser_name 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp name 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp:f0->247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0
247. model.tiktok_ads_source.stg_tiktok_ads__advertiser
  • Input Column: 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp[name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • advertiser_name: Directly mapped
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser[advertiser_name]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with other tables
    • Output Columns:
      • advertiser_name: It is directly mapped to the output column 'advertiser_name'
Column Lineage
%3 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history advertiser_id 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report advertiser_id 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history advertiser_id 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser advertiser_id 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp advertiser_id 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f0->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp advertiser_id 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f0 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp id 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp:f0->247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0
239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history
  • Input Column: 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp[advertiser_id]
    • Cleaning Cast as DECIMAL(28, 6)
    • Output Columns:
      • advertiser_id: Directly mapped
243. model.tiktok_ads_source.stg_tiktok_ads__ad_history
  • Input Column: 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp[advertiser_id]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • advertiser_id: Directly copied
247. model.tiktok_ads_source.stg_tiktok_ads__advertiser
  • Input Column: 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp[id]
    • Cleaning The column is cast to DECIMAL(28, 6)
    • Output Columns:
      • advertiser_id: Directly mapped after casting
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history[advertiser_id]
    • Direct directly copied to the output
    • Output Columns:
      • advertiser_id: directly copied
  • Input Column: 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history[advertiser_id]
    • Integration Used to join with the advertiser table
    • Output Columns:
      • advertiser_id: Directly copied to output
  • Input Column: 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser[advertiser_id]
    • Integration used to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • advertiser_id: directly copied
Column Lineage
%3 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history ad_group_id 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report ad_group_id 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp adgroup_id 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f0->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0
239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history
  • Input Column: 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp[adgroup_id]
    • Cleaning The column is cast as DECIMAL(28, 6)
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • ad_group_id: Directly mapped and renamed
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history[ad_group_id]
    • Integration used as a join key with the ads table
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_id: directly copied
Column Lineage
%3 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history ad_group_name display_name 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report ad_group_name 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f1->238. model.tiktok_ads.tiktok_ads__url_report:f0 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp adgroup_name display_name 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f0->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f1->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f1
239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history
  • Input Column: 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp[adgroup_name]
    • Cleaning Cast as TEXT
    • Output Columns:
      • ad_group_name: Directly mapped and renamed
  • Input Column: 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp[display_name]
    • Cleaning Cast as TEXT
    • Output Columns:
      • display_name: Directly mapped
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history[ad_group_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_name: directly copied
  • Input Column: 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history[display_name]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • ad_group_name: Directly copied to the output and renamed
Column Lineage
%3 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history base_url landing_page_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report base_url 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp landing_page_url 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f0 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f2 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f3 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f7 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f6 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f4 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f5 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f8 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f1
243. model.tiktok_ads_source.stg_tiktok_ads__ad_history
  • Input Column: 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp[landing_page_url]
    • Cleaning The column is cleaned by removing 'http://', 'https://', and 'android-app://' prefixes
    • Featurization Various features are extracted from this column, including base_url, url_host, url_path, and UTM parameters
    • Output Columns:
      • base_url: Extracted by splitting the URL at the first '?'
      • url_host: Extracted from the cleaned URL
      • url_path: Extracted from the cleaned URL
      • utm_source: Extracted from URL parameters
      • utm_medium: Extracted from URL parameters
      • utm_campaign: Extracted from URL parameters
      • utm_content: Extracted from URL parameters
      • utm_term: Extracted from URL parameters
      • landing_page_url: Directly copied
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history[base_url]
    • Direct Directly selected in the output
    • Output Columns:
      • base_url: Directly copied to output
Column Lineage
%3 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history base_url landing_page_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report url_host 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f2->238. model.tiktok_ads.tiktok_ads__url_report:f0 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp landing_page_url 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f0 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f2 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f3 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f7 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f6 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f4 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f5 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f8 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f1
243. model.tiktok_ads_source.stg_tiktok_ads__ad_history
  • Input Column: 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp[landing_page_url]
    • Cleaning The column is cleaned by removing 'http://', 'https://', and 'android-app://' prefixes
    • Featurization Various features are extracted from this column, including base_url, url_host, url_path, and UTM parameters
    • Output Columns:
      • base_url: Extracted by splitting the URL at the first '?'
      • url_host: Extracted from the cleaned URL
      • url_path: Extracted from the cleaned URL
      • utm_source: Extracted from URL parameters
      • utm_medium: Extracted from URL parameters
      • utm_campaign: Extracted from URL parameters
      • utm_content: Extracted from URL parameters
      • utm_term: Extracted from URL parameters
      • landing_page_url: Directly copied
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history[url_host]
    • Direct Directly copied to the output
    • Output Columns:
      • url_host: Directly copied
Column Lineage
%3 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history base_url landing_page_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report url_path 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f3->238. model.tiktok_ads.tiktok_ads__url_report:f0 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp landing_page_url 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f0 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f2 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f3 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f7 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f6 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f4 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f5 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f8 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f1
243. model.tiktok_ads_source.stg_tiktok_ads__ad_history
  • Input Column: 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp[landing_page_url]
    • Cleaning The column is cleaned by removing 'http://', 'https://', and 'android-app://' prefixes
    • Featurization Various features are extracted from this column, including base_url, url_host, url_path, and UTM parameters
    • Output Columns:
      • base_url: Extracted by splitting the URL at the first '?'
      • url_host: Extracted from the cleaned URL
      • url_path: Extracted from the cleaned URL
      • utm_source: Extracted from URL parameters
      • utm_medium: Extracted from URL parameters
      • utm_campaign: Extracted from URL parameters
      • utm_content: Extracted from URL parameters
      • utm_term: Extracted from URL parameters
      • landing_page_url: Directly copied
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history[url_path]
    • Direct Directly copied to the output
    • Output Columns:
      • url_path: Directly copied
Column Lineage
%3 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history base_url landing_page_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report utm_source 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f7->238. model.tiktok_ads.tiktok_ads__url_report:f0 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp landing_page_url 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f0 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f2 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f3 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f7 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f6 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f4 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f5 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f8 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f1
243. model.tiktok_ads_source.stg_tiktok_ads__ad_history
  • Input Column: 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp[landing_page_url]
    • Cleaning The column is cleaned by removing 'http://', 'https://', and 'android-app://' prefixes
    • Featurization Various features are extracted from this column, including base_url, url_host, url_path, and UTM parameters
    • Output Columns:
      • base_url: Extracted by splitting the URL at the first '?'
      • url_host: Extracted from the cleaned URL
      • url_path: Extracted from the cleaned URL
      • utm_source: Extracted from URL parameters
      • utm_medium: Extracted from URL parameters
      • utm_campaign: Extracted from URL parameters
      • utm_content: Extracted from URL parameters
      • utm_term: Extracted from URL parameters
      • landing_page_url: Directly copied
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history[utm_source]
    • Direct Directly copied to the output
    • Output Columns:
      • utm_source: Directly copied
Column Lineage
%3 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history base_url landing_page_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report utm_medium 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f6->238. model.tiktok_ads.tiktok_ads__url_report:f0 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp landing_page_url 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f0 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f2 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f3 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f7 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f6 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f4 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f5 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f8 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f1
243. model.tiktok_ads_source.stg_tiktok_ads__ad_history
  • Input Column: 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp[landing_page_url]
    • Cleaning The column is cleaned by removing 'http://', 'https://', and 'android-app://' prefixes
    • Featurization Various features are extracted from this column, including base_url, url_host, url_path, and UTM parameters
    • Output Columns:
      • base_url: Extracted by splitting the URL at the first '?'
      • url_host: Extracted from the cleaned URL
      • url_path: Extracted from the cleaned URL
      • utm_source: Extracted from URL parameters
      • utm_medium: Extracted from URL parameters
      • utm_campaign: Extracted from URL parameters
      • utm_content: Extracted from URL parameters
      • utm_term: Extracted from URL parameters
      • landing_page_url: Directly copied
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history[utm_medium]
    • Direct Directly copied to the output
    • Output Columns:
      • utm_medium: Directly copied
Column Lineage
%3 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history base_url landing_page_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report utm_campaign 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f4->238. model.tiktok_ads.tiktok_ads__url_report:f0 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp landing_page_url 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f0 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f2 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f3 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f7 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f6 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f4 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f5 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f8 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f1
243. model.tiktok_ads_source.stg_tiktok_ads__ad_history
  • Input Column: 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp[landing_page_url]
    • Cleaning The column is cleaned by removing 'http://', 'https://', and 'android-app://' prefixes
    • Featurization Various features are extracted from this column, including base_url, url_host, url_path, and UTM parameters
    • Output Columns:
      • base_url: Extracted by splitting the URL at the first '?'
      • url_host: Extracted from the cleaned URL
      • url_path: Extracted from the cleaned URL
      • utm_source: Extracted from URL parameters
      • utm_medium: Extracted from URL parameters
      • utm_campaign: Extracted from URL parameters
      • utm_content: Extracted from URL parameters
      • utm_term: Extracted from URL parameters
      • landing_page_url: Directly copied
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history[utm_campaign]
    • Direct Directly copied to the output
    • Output Columns:
      • utm_campaign: Directly copied
Column Lineage
%3 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history base_url landing_page_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report utm_content 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f5->238. model.tiktok_ads.tiktok_ads__url_report:f0 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp landing_page_url 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f0 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f2 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f3 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f7 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f6 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f4 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f5 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f8 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f1
243. model.tiktok_ads_source.stg_tiktok_ads__ad_history
  • Input Column: 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp[landing_page_url]
    • Cleaning The column is cleaned by removing 'http://', 'https://', and 'android-app://' prefixes
    • Featurization Various features are extracted from this column, including base_url, url_host, url_path, and UTM parameters
    • Output Columns:
      • base_url: Extracted by splitting the URL at the first '?'
      • url_host: Extracted from the cleaned URL
      • url_path: Extracted from the cleaned URL
      • utm_source: Extracted from URL parameters
      • utm_medium: Extracted from URL parameters
      • utm_campaign: Extracted from URL parameters
      • utm_content: Extracted from URL parameters
      • utm_term: Extracted from URL parameters
      • landing_page_url: Directly copied
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history[utm_content]
    • Direct Directly copied to the output
    • Output Columns:
      • utm_content: Directly copied
Column Lineage
%3 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history base_url landing_page_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report utm_term 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f8->238. model.tiktok_ads.tiktok_ads__url_report:f0 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp landing_page_url 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f0 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f2 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f3 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f7 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f6 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f4 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f5 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f8 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f1
243. model.tiktok_ads_source.stg_tiktok_ads__ad_history
  • Input Column: 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp[landing_page_url]
    • Cleaning The column is cleaned by removing 'http://', 'https://', and 'android-app://' prefixes
    • Featurization Various features are extracted from this column, including base_url, url_host, url_path, and UTM parameters
    • Output Columns:
      • base_url: Extracted by splitting the URL at the first '?'
      • url_host: Extracted from the cleaned URL
      • url_path: Extracted from the cleaned URL
      • utm_source: Extracted from URL parameters
      • utm_medium: Extracted from URL parameters
      • utm_campaign: Extracted from URL parameters
      • utm_content: Extracted from URL parameters
      • utm_term: Extracted from URL parameters
      • landing_page_url: Directly copied
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history[utm_term]
    • Direct Directly copied to the output
    • Output Columns:
      • utm_term: Directly copied
Column Lineage
%3 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history audience_type 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report audience_type 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp audience_type 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f0->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0
239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history
  • Input Column: 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp[audience_type]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to TEXT data type
    • Output Columns:
      • audience_type: Directly mapped after casting
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history[audience_type]
    • Direct directly copied to the output
    • Output Columns:
      • audience_type: directly copied
Column Lineage
%3 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history budget 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report budget 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp budget 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f0->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0
239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history
  • Input Column: 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp[budget]
    • Cleaning The column is cast to FLOAT data type
    • Output Columns:
      • budget: Directly mapped after casting
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history[budget]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • budget: Directly copied to the output
Column Lineage
%3 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history category 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report category 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp category 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f0->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0
239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history
  • Input Column: 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp[category]
    • Cleaning The column is cast as DECIMAL(28, 6) in the fields CTE
    • Direct The column is directly selected in the final CTE without further transformation
    • Output Columns:
      • category: Directly mapped to the output 'category' column
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history[category]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • category: Directly copied to the output
Column Lineage
%3 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history gender 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report gender 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp gender 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f0->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0
239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history
  • Input Column: 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp[gender]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to TEXT data type
    • Output Columns:
      • gender: Directly mapped after casting
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history[gender]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • gender: Directly copied to the output
Column Lineage
%3 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser currency 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report currency 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp currency 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp:f0->247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0
247. model.tiktok_ads_source.stg_tiktok_ads__advertiser
  • Input Column: 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp[currency]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • currency: Directly mapped
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser[currency]
    • Direct directly copied to the output
    • Output Columns:
      • currency: directly copied
Column Lineage
%3 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly impressions 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report daily_cpm daily_ctr impressions 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->238. model.tiktok_ads.tiktok_ads__url_report:f2 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->238. model.tiktok_ads.tiktok_ads__url_report:f1 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp impressions 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[impressions]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistent data type
    • Direct The column is directly copied to the output
    • Output Columns:
      • impressions: Directly mapped after casting
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[impressions]
    • Aggregation Summed up in the SELECT clause
    • Featurization Used to calculate daily_cpm and daily_ctr
    • Output Columns:
      • impressions: Aggregated sum in the output
      • daily_cpm: Part of the calculation
      • daily_ctr: Part of the calculation
Column Lineage
%3 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly clicks 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report clicks daily_cpc daily_ctr 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->238. model.tiktok_ads.tiktok_ads__url_report:f1 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->238. model.tiktok_ads.tiktok_ads__url_report:f2 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp clicks 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[clicks]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistent data type
    • Output Columns:
      • clicks: Directly mapped after casting
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[clicks]
    • Aggregation The column is summed up in the GROUP BY clause
    • Other Used in calculations for derived metrics (daily_cpc, daily_ctr)
    • Output Columns:
      • clicks: Directly mapped after aggregation
      • daily_cpc: Used in calculation
      • daily_ctr: Used in calculation
Column Lineage
%3 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly spend 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report daily_cpc daily_cpm spend 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->238. model.tiktok_ads.tiktok_ads__url_report:f2 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->238. model.tiktok_ads.tiktok_ads__url_report:f1 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp spend 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[spend]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistency
    • Output Columns:
      • spend: Directly mapped after casting
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[spend]
    • Aggregation This column is summed up in the aggregated CTE
    • Other Used in calculations for daily_cpc and daily_cpm
    • Output Columns:
      • spend: Directly mapped after aggregation
      • daily_cpc: Used in calculation
      • daily_cpm: Used in calculation
Column Lineage
%3 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly reach 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report reach 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp reach 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[reach]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistent data type
    • Output Columns:
      • reach: Directly mapped after casting
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[reach]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • reach: Directly mapped after aggregation
Column Lineage
%3 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly conversion 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report conversion 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp conversion 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[conversion]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistent data type
    • Direct The column is directly copied to the output
    • Output Columns:
      • conversion: Directly mapped after casting
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[conversion]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • conversion: Directly mapped after aggregation
Column Lineage
%3 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly likes 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report likes 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp likes 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[likes]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistency
    • Output Columns:
      • likes: Directly mapped after casting
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[likes]
    • Aggregation This column is summed up in the aggregated CTE
    • Output Columns:
      • likes: Directly mapped after aggregation
Column Lineage
%3 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly comments 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report comments 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp comments 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[comments]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistent data type
    • Direct The column is directly copied to the output
    • Output Columns:
      • comments: Directly mapped after casting
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[comments]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • comments: Directly mapped after aggregation
Column Lineage
%3 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly shares 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report shares 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp shares 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[shares]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistent data type
    • Direct The column is directly copied to the output
    • Output Columns:
      • shares: Directly mapped after casting
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[shares]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • shares: Directly mapped after aggregation
Column Lineage
%3 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly profile_visits 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report profile_visits 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp profile_visits 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[profile_visits]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistent data type
    • Output Columns:
      • profile_visits: Directly mapped after casting
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[profile_visits]
    • Aggregation This column is summed up in the aggregated CTE
    • Output Columns:
      • profile_visits: Directly mapped after aggregation
Column Lineage
%3 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly follows 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report follows 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp follows 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[follows]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistency
    • Output Columns:
      • follows: Directly mapped after casting
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[follows]
    • Aggregation This column is summed up in the aggregated CTE
    • Output Columns:
      • follows: Directly mapped after aggregation
Column Lineage
%3 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly video_watched_2_s 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report video_watched_2_s 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp video_watched_2_s 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[video_watched_2_s]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistency
    • Output Columns:
      • video_watched_2_s: Directly mapped after casting
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[video_watched_2_s]
    • Aggregation This column is summed up in the aggregated CTE
    • Output Columns:
      • video_watched_2_s: Directly mapped after aggregation
Column Lineage
%3 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly video_watched_6_s 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report video_watched_6_s 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp video_watched_6_s 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[video_watched_6_s]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistency
    • Output Columns:
      • video_watched_6_s: Directly mapped after casting
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[video_watched_6_s]
    • Aggregation This column is summed up in the aggregated CTE
    • Output Columns:
      • video_watched_6_s: Directly mapped after aggregation
Column Lineage
%3 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly video_views_p_25 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report video_views_p_25 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp video_views_p_25 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[video_views_p_25]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistent data type
    • Output Columns:
      • video_views_p_25: Directly mapped after casting
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[video_views_p_25]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • video_views_p_25: Directly mapped after aggregation
Column Lineage
%3 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly video_views_p_50 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report video_views_p_50 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp video_views_p_50 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[video_views_p_50]
    • Cleaning The column is cast to DECIMAL(28, 6)
    • Output Columns:
      • video_views_p_50: Directly copied after casting
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[video_views_p_50]
    • Aggregation Summed up in the SELECT clause
    • Output Columns:
      • video_views_p_50: Aggregated sum in the output
Column Lineage
%3 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly video_views_p_75 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report video_views_p_75 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp video_views_p_75 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[video_views_p_75]
    • Cleaning The column is cast to DECIMAL(28, 6)
    • Output Columns:
      • video_views_p_75: Directly copied after casting
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[video_views_p_75]
    • Aggregation Summed up in the SELECT clause
    • Output Columns:
      • video_views_p_75: Aggregated sum in the output
Column Lineage
%3 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly clicks spend 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report clicks daily_cpc daily_cpm daily_ctr spend 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->238. model.tiktok_ads.tiktok_ads__url_report:f1 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->238. model.tiktok_ads.tiktok_ads__url_report:f3 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f1->238. model.tiktok_ads.tiktok_ads__url_report:f4 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f1->238. model.tiktok_ads.tiktok_ads__url_report:f1 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f1->238. model.tiktok_ads.tiktok_ads__url_report:f2 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp clicks spend 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f1->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f1
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[clicks]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistent data type
    • Output Columns:
      • clicks: Directly mapped after casting
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[spend]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistency
    • Output Columns:
      • spend: Directly mapped after casting
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[clicks]
    • Aggregation The column is summed up in the GROUP BY clause
    • Other Used in calculations for derived metrics (daily_cpc, daily_ctr)
    • Output Columns:
      • clicks: Directly mapped after aggregation
      • daily_cpc: Used in calculation
      • daily_ctr: Used in calculation
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[spend]
    • Aggregation This column is summed up in the aggregated CTE
    • Other Used in calculations for daily_cpc and daily_cpm
    • Output Columns:
      • spend: Directly mapped after aggregation
      • daily_cpc: Used in calculation
      • daily_cpm: Used in calculation
Column Lineage
%3 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly impressions spend 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report daily_cpc daily_cpm daily_ctr impressions spend 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->238. model.tiktok_ads.tiktok_ads__url_report:f3 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->238. model.tiktok_ads.tiktok_ads__url_report:f1 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->238. model.tiktok_ads.tiktok_ads__url_report:f2 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f1->238. model.tiktok_ads.tiktok_ads__url_report:f4 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f1->238. model.tiktok_ads.tiktok_ads__url_report:f0 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f1->238. model.tiktok_ads.tiktok_ads__url_report:f1 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp impressions spend 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f1->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f1
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[impressions]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistent data type
    • Direct The column is directly copied to the output
    • Output Columns:
      • impressions: Directly mapped after casting
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[spend]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistency
    • Output Columns:
      • spend: Directly mapped after casting
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[impressions]
    • Aggregation Summed up in the SELECT clause
    • Featurization Used to calculate daily_cpm and daily_ctr
    • Output Columns:
      • impressions: Aggregated sum in the output
      • daily_cpm: Part of the calculation
      • daily_ctr: Part of the calculation
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[spend]
    • Aggregation This column is summed up in the aggregated CTE
    • Other Used in calculations for daily_cpc and daily_cpm
    • Output Columns:
      • spend: Directly mapped after aggregation
      • daily_cpc: Used in calculation
      • daily_cpm: Used in calculation
Column Lineage
%3 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly clicks impressions 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report clicks daily_cpc daily_cpm daily_ctr impressions 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f1->238. model.tiktok_ads.tiktok_ads__url_report:f4 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f1->238. model.tiktok_ads.tiktok_ads__url_report:f2 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f1->238. model.tiktok_ads.tiktok_ads__url_report:f3 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->238. model.tiktok_ads.tiktok_ads__url_report:f1 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->238. model.tiktok_ads.tiktok_ads__url_report:f3 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp clicks impressions 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f1->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f1 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[impressions]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistent data type
    • Direct The column is directly copied to the output
    • Output Columns:
      • impressions: Directly mapped after casting
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[clicks]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistent data type
    • Output Columns:
      • clicks: Directly mapped after casting
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[impressions]
    • Aggregation Summed up in the SELECT clause
    • Featurization Used to calculate daily_cpm and daily_ctr
    • Output Columns:
      • impressions: Aggregated sum in the output
      • daily_cpm: Part of the calculation
      • daily_ctr: Part of the calculation
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[clicks]
    • Aggregation The column is summed up in the GROUP BY clause
    • Other Used in calculations for derived metrics (daily_cpc, daily_ctr)
    • Output Columns:
      • clicks: Directly mapped after aggregation
      • daily_cpc: Used in calculation
      • daily_ctr: Used in calculation
239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history

This SQL query stages data from a temporary TikTok ads table, casts various fields to specific data types, renames some columns, coalesces age-related fields, and adds a flag to identify the most recent record for each ad group. It also includes a source relation field for tracking purposes.

CleaningDeduplicationFeaturization
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_stg_tiktok_ads.stg_tiktok_ads__ad_group_history_tmp
), fields AS (
  SELECT
    CAST(NULL AS DECIMAL(28, 6)) AS action_days,
    CAST(NULL AS DECIMAL(28, 6)) AS adgroup_id,
    CAST(NULL AS TEXT) AS adgroup_name,
    CAST(NULL AS DECIMAL(28, 6)) AS advertiser_id,
    CAST(NULL AS TEXT) AS audience_type,
    CAST(NULL AS FLOAT) AS budget,
    CAST(NULL AS DECIMAL(28, 6)) AS campaign_id,
    CAST(NULL AS DECIMAL(28, 6)) AS category,
    CAST(NULL AS TEXT) AS display_name,
    CAST(NULL AS DECIMAL(28, 6)) AS frequency,
    CAST(NULL AS DECIMAL(28, 6)) AS frequency_schedule,
    CAST(NULL AS TEXT) AS gender,
    CAST(NULL AS TEXT) AS landing_page_url,
    CAST(NULL AS TIMESTAMP) AS updated_at,
    CAST(NULL AS TEXT) AS interest_category_v_2,
    CAST(NULL AS TEXT) AS action_categories,
    CAST(NULL AS TEXT) AS age,
    CAST(NULL AS TEXT) AS age_groups,
    CAST(NULL AS TEXT) AS languages,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    adgroup_id AS ad_group_id,
    CAST(updated_at AS TIMESTAMP) AS updated_at,
    advertiser_id,
    campaign_id,
    action_days,
    action_categories,
    adgroup_name AS ad_group_name,
    COALESCE(age_groups, age) AS age_groups,
    audience_type,
    budget,
    category,
    display_name,
    interest_category_v_2 AS interest_category,
    frequency,
    frequency_schedule,
    gender,
    languages,
    landing_page_url,
    ROW_NUMBER() OVER (PARTITION BY source_relation, adgroup_id ORDER BY updated_at DESC) = 1 AS is_most_recent_record
  FROM fields
)
SELECT
  *
FROM final
%3 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history source_relation ad_group_id updated_at advertiser_id action_categories campaign_id action_days ad_group_name age_groups audience_type budget category display_name interest_category frequency frequency_schedule gender landing_page_url languages is_most_recent_record 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp adgroup_id updated_at advertiser_id campaign_id adgroup_name landing_page_url display_name audience_type gender budget category frequency frequency_schedule action_days interest_category_v_2 action_categories age_groups languages _fivetran_synced 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f0->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f1 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f1->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f2 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f2->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f3 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f3->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f5 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f4->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f7 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f5->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f17 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f6->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f12 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f7->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f9 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f8->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f16 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f9->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f10 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f10->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f11 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f11->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f14 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f12->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f15 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f13->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f6 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f14->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f13 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f15->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f4 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f16->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f8 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f17->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f18 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f18->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f2 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f18->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f19
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
ad_group_id integer Ad group ID
updated_at timestamp without time zone Time the record was updated.
advertiser_id integer Advertiser ID
action_categories text IDs of the action categories (behaviors) that you want to target.
campaign_id integer The Ad group's campaign ID.
action_days integer Action days
ad_group_name text Ad group name. Character limit is 512 and cannot contain emoji.
age_groups text Age groups you want to target.
audience_type integer Audience Type
budget integer Ad budget. Returns 0.0 when Campaign Budget Optimization (budget_optimize_switch) is on.
category integer Ad group category.
display_name integer Display name of ad group.
interest_category text Interest classification. If the interest is specified, users that do not meet interest target will be excluded during delivery.
frequency integer frequency, together with frequency_schedule, controls how often people see your ad (only available for REACH ads). For example, frequency = 2 frequency_schedule = 3 means "show ads no more than twice every 3 day".
frequency_schedule integer frequency, together with frequency, controls how often people see your ad (only available for REACH ads).
gender text Gender that you want to target.
landing_page_url integer Landing page URL.
languages text Codes of the languages that you want to target.
is_most_recent_record boolean Whether record is the most recent one for this particular grain.
Column Lineage
%3 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history source_relation 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report source_relation 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report source_relation 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report source_relation 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history[source_relation]
    • Integration used as a key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
Column Lineage
%3 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp adgroup_id 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history ad_group_id 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f0->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report ad_group_id 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report ad_group_id 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report ad_group_id 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0
239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history
  • Input Column: 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp[adgroup_id]
    • Cleaning The column is cast as DECIMAL(28, 6)
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • ad_group_id: Directly mapped and renamed
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history[ad_group_id]
    • Integration used as a key to join with the hourly table
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_id: directly copied
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history[ad_group_id]
    • Integration used as the key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_id: directly copied
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history[ad_group_id]
    • Integration used as a join key with the ads table
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_id: directly copied
Column Lineage
%3 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp _fivetran_synced updated_at 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history is_most_recent_record updated_at 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f1->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f1 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f0->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f1 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f0->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0
239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history
  • Input Column: 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp[updated_at]
    • Cleaning Cast as TIMESTAMP
    • Deduplication Used in the ROW_NUMBER() function to order and identify the most recent record
    • Output Columns:
      • updated_at: Directly mapped after casting
  • Input Column: 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp[_fivetran_synced]
    • Cleaning The column is cast to TIMESTAMP type in the 'fields' CTE.
    • Deduplication The column is used in the window function to determine the most recent record for each ad group.
    • Output Columns:
      • updated_at: The '_fivetran_synced' column is cleaned (cast to TIMESTAMP) and renamed to 'updated_at' in the output.
      • is_most_recent_record: The column is used in the ROW_NUMBER() function to determine if a record is the most recent for a particular ad group.
Column Lineage
%3 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp advertiser_id 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history advertiser_id 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f0->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report advertiser_id 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report advertiser_id 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report advertiser_id 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0
239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history
  • Input Column: 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp[advertiser_id]
    • Cleaning Cast as DECIMAL(28, 6)
    • Output Columns:
      • advertiser_id: Directly mapped
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history[advertiser_id]
    • Integration used as a key to join with the advertiser table
    • Direct directly copied to the output
    • Output Columns:
      • advertiser_id: directly copied
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history[advertiser_id]
    • Direct directly copied to the output
    • Output Columns:
      • advertiser_id: directly copied
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history[advertiser_id]
    • Direct directly copied to the output
    • Output Columns:
      • advertiser_id: directly copied
Column Lineage
%3 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp action_categories 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history action_categories 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f0->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0
239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history
  • Input Column: 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp[action_categories]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • action_categories: Directly mapped to this output column
Column Lineage
%3 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp campaign_id 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history campaign_id 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f0->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0
239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history
  • Input Column: 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp[campaign_id]
    • Cleaning Cast as DECIMAL(28, 6)
    • Output Columns:
      • campaign_id: Directly mapped
Column Lineage
%3 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp action_days 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history action_days 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f0->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0
239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history
  • Input Column: 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp[action_days]
    • Cleaning The column is cast to DECIMAL(28, 6) data type
    • Direct The column is directly copied to the output
    • Output Columns:
      • action_days: Directly copied after casting
Column Lineage
%3 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp adgroup_name 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history ad_group_name 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f0->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report ad_group_name 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report ad_group_name 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report ad_group_name 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0
239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history
  • Input Column: 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp[adgroup_name]
    • Cleaning Cast as TEXT
    • Output Columns:
      • ad_group_name: Directly mapped and renamed
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history[ad_group_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_name: directly copied
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history[ad_group_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_name: directly copied
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history[ad_group_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_name: directly copied
Column Lineage
%3 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp age_groups 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history age_groups 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f0->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0
239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history
  • Input Column: 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp[age_groups]
    • Cleaning The column is cleaned by coalescing with the 'age' column
    • Output Columns:
      • age_groups: Coalesced with 'age' column and mapped to this output
Column Lineage
%3 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp audience_type 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history audience_type 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f0->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report audience_type 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report audience_type 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report audience_type 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0
239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history
  • Input Column: 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp[audience_type]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to TEXT data type
    • Output Columns:
      • audience_type: Directly mapped after casting
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history[audience_type]
    • Direct directly copied to the output
    • Output Columns:
      • audience_type: directly copied
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history[audience_type]
    • Direct directly copied to the output
    • Output Columns:
      • audience_type: directly copied
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history[audience_type]
    • Direct directly copied to the output
    • Output Columns:
      • audience_type: directly copied
Column Lineage
%3 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp budget 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history budget 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f0->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report budget 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report budget 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report budget 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0
239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history
  • Input Column: 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp[budget]
    • Cleaning The column is cast to FLOAT data type
    • Output Columns:
      • budget: Directly mapped after casting
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history[budget]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • budget: Directly copied to the output
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history[budget]
    • Direct The budget column is directly copied to the output without transformation
    • Output Columns:
      • budget: Directly copied to the output budget column
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history[budget]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • budget: Directly copied to the output
Column Lineage
%3 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp category 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history category 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f0->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report category 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report category 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report category 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0
239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history
  • Input Column: 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp[category]
    • Cleaning The column is cast as DECIMAL(28, 6) in the fields CTE
    • Direct The column is directly selected in the final CTE without further transformation
    • Output Columns:
      • category: Directly mapped to the output 'category' column
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history[category]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • category: Directly copied to the output
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history[category]
    • Direct The category column is directly copied to the output without transformation
    • Output Columns:
      • category: Directly copied to the output category column
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history[category]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • category: Directly copied to the output
Column Lineage
%3 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp display_name 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history display_name 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f0->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report ad_group_name 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report ad_group_name 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report ad_group_name 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0
239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history
  • Input Column: 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp[display_name]
    • Cleaning Cast as TEXT
    • Output Columns:
      • display_name: Directly mapped
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history[display_name]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • ad_group_name: Directly copied to the output and renamed
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history[display_name]
    • Direct The display_name column is directly copied to the output
    • Cleaning It's likely renamed to ad_group_name in the output
    • Output Columns:
      • ad_group_name: Copied and renamed as ad_group_name in the output
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history[display_name]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • ad_group_name: Directly copied to the output and renamed
Column Lineage
%3 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp interest_category_v_2 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history interest_category 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f0->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0
239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history
  • Input Column: 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp[interest_category_v_2]
    • Cleaning The column is cast to TEXT data type
    • Direct The column is directly copied to the output, but renamed
    • Output Columns:
      • interest_category: Directly copied after casting and renamed
Column Lineage
%3 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp frequency 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history frequency 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f0->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0
239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history
  • Input Column: 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp[frequency]
    • Cleaning The column is cast to DECIMAL(28, 6) data type
    • Direct The column is directly copied to the output
    • Output Columns:
      • frequency: Directly copied after casting
Column Lineage
%3 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp frequency_schedule 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history frequency_schedule 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f0->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0
239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history
  • Input Column: 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp[frequency_schedule]
    • Cleaning The column is cast to DECIMAL(28, 6) data type
    • Direct The column is directly copied to the output
    • Output Columns:
      • frequency_schedule: Directly copied after casting
Column Lineage
%3 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp gender 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history gender 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f0->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report gender 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report gender 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report gender 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0
239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history
  • Input Column: 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp[gender]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to TEXT data type
    • Output Columns:
      • gender: Directly mapped after casting
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history[gender]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • gender: Directly copied to the output
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history[gender]
    • Direct The gender column is directly copied to the output without transformation
    • Output Columns:
      • gender: Directly copied to the output gender column
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history[gender]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • gender: Directly copied to the output
Column Lineage
%3 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp landing_page_url 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history landing_page_url 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f0->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0
239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history
  • Input Column: 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp[landing_page_url]
    • Cleaning Cast as TEXT
    • Output Columns:
      • landing_page_url: Directly mapped
Column Lineage
%3 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp languages 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history languages 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f0->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0
239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history
  • Input Column: 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp[languages]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • languages: Directly mapped to this output column
Column Lineage
%3 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp _fivetran_synced 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history is_most_recent_record updated_at 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f0->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f1 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f0->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0
239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history
  • Input Column: 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp[_fivetran_synced]
    • Cleaning The column is cast to TIMESTAMP type in the 'fields' CTE.
    • Deduplication The column is used in the window function to determine the most recent record for each ad group.
    • Output Columns:
      • updated_at: The '_fivetran_synced' column is cleaned (cast to TIMESTAMP) and renamed to 'updated_at' in the output.
      • is_most_recent_record: The column is used in the ROW_NUMBER() function to determine if a record is the most recent for a particular ad group.
240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of type TEXT, which is set to NULL. The query is likely used as a placeholder or template for a staging table in a dbt (data build tool) project, specifically for TikTok ads data.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp adgroup_id updated_at advertiser_id campaign_id create_time adgroup_name placement_type profile_image landing_page_url display_name app_type app_download_url app_name optimization_event secondary_optimization_event creative_material_mode audience_type gender min_android_version min_ios_version budget_mode schedule_type dayparting optimization_goal cpv_video_duration pacing billing_event bid_type deep_bid_type impression_tracking_url click_tracking_url secondary_status operation_status statistic_type video_download open_url open_url_type fallback_type budget bid_price conversion_bid_price deep_cpa_bid schedule_start_time schedule_end_time app_id pixel_id inventory_filter_enabled is_hfss is_new_structure category is_comment_disable skip_learning_phase frequency frequency_schedule action_days audience excluded_audience location interest_category_v_2 pangle_block_app_list_id action_categories placements keywords age_groups languages operating_systems network_types carriers video_actions package _fivetran_synced 362. source.tiktok_ads_source.tiktok_ads.adgroup_history 362. source.tiktok_ads_source.tiktok_ads.adgroup_history
Name Type Comment
adgroup_id integer None
updated_at text None
advertiser_id integer None
campaign_id integer None
create_time text None
adgroup_name text None
placement_type text None
profile_image integer None
landing_page_url integer None
display_name integer None
app_type integer None
app_download_url integer None
app_name integer None
optimization_event text None
secondary_optimization_event integer None
creative_material_mode text None
audience_type integer None
gender text None
min_android_version integer None
min_ios_version integer None
budget_mode text None
schedule_type text None
dayparting integer None
optimization_goal text None
cpv_video_duration integer None
pacing text None
billing_event text None
bid_type text None
deep_bid_type integer None
impression_tracking_url integer None
click_tracking_url integer None
secondary_status text None
operation_status text None
statistic_type integer None
video_download text None
open_url integer None
open_url_type integer None
fallback_type integer None
budget integer None
bid_price integer None
conversion_bid_price integer None
deep_cpa_bid integer None
schedule_start_time text None
schedule_end_time text None
app_id integer None
pixel_id integer None
inventory_filter_enabled boolean None
is_hfss boolean None
is_new_structure boolean None
category integer None
is_comment_disable integer None
skip_learning_phase integer None
frequency integer None
frequency_schedule integer None
action_days integer None
audience text None
excluded_audience text None
location text None
interest_category_v_2 text None
pangle_block_app_list_id text None
action_categories text None
placements text None
keywords integer None
age_groups text None
languages text None
operating_systems text None
network_types text None
carriers text None
video_actions text None
package integer None
_fivetran_synced text None
Column Lineage
%3 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp adgroup_id 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history ad_group_id 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f0->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report ad_group_id 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report ad_group_id 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report ad_group_id 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0
239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history
  • Input Column: 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp[adgroup_id]
    • Cleaning The column is cast as DECIMAL(28, 6)
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • ad_group_id: Directly mapped and renamed
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history[ad_group_id]
    • Integration used as a key to join with the hourly table
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_id: directly copied
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history[ad_group_id]
    • Integration used as the key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_id: directly copied
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history[ad_group_id]
    • Integration used as a join key with the ads table
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_id: directly copied
Column Lineage
%3 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp updated_at 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history updated_at 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f0->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0
239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history
  • Input Column: 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp[updated_at]
    • Cleaning Cast as TIMESTAMP
    • Deduplication Used in the ROW_NUMBER() function to order and identify the most recent record
    • Output Columns:
      • updated_at: Directly mapped after casting
Column Lineage
%3 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp advertiser_id 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history advertiser_id 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f0->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report advertiser_id 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report advertiser_id 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report advertiser_id 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0
239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history
  • Input Column: 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp[advertiser_id]
    • Cleaning Cast as DECIMAL(28, 6)
    • Output Columns:
      • advertiser_id: Directly mapped
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history[advertiser_id]
    • Integration used as a key to join with the advertiser table
    • Direct directly copied to the output
    • Output Columns:
      • advertiser_id: directly copied
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history[advertiser_id]
    • Direct directly copied to the output
    • Output Columns:
      • advertiser_id: directly copied
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history[advertiser_id]
    • Direct directly copied to the output
    • Output Columns:
      • advertiser_id: directly copied
Column Lineage
%3 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp campaign_id 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history campaign_id 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f0->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0
239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history
  • Input Column: 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp[campaign_id]
    • Cleaning Cast as DECIMAL(28, 6)
    • Output Columns:
      • campaign_id: Directly mapped
Column Lineage
%3 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp adgroup_name 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history ad_group_name 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f0->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report ad_group_name 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report ad_group_name 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report ad_group_name 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0
239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history
  • Input Column: 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp[adgroup_name]
    • Cleaning Cast as TEXT
    • Output Columns:
      • ad_group_name: Directly mapped and renamed
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history[ad_group_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_name: directly copied
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history[ad_group_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_name: directly copied
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history[ad_group_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_group_name: directly copied
Column Lineage
%3 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp landing_page_url 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history landing_page_url 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f0->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0
239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history
  • Input Column: 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp[landing_page_url]
    • Cleaning Cast as TEXT
    • Output Columns:
      • landing_page_url: Directly mapped
Column Lineage
%3 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp display_name 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history display_name 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f0->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report ad_group_name 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report ad_group_name 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report ad_group_name 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0
239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history
  • Input Column: 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp[display_name]
    • Cleaning Cast as TEXT
    • Output Columns:
      • display_name: Directly mapped
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history[display_name]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • ad_group_name: Directly copied to the output and renamed
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history[display_name]
    • Direct The display_name column is directly copied to the output
    • Cleaning It's likely renamed to ad_group_name in the output
    • Output Columns:
      • ad_group_name: Copied and renamed as ad_group_name in the output
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history[display_name]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • ad_group_name: Directly copied to the output and renamed
Column Lineage
%3 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp audience_type 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history audience_type 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f0->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report audience_type 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report audience_type 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report audience_type 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0
239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history
  • Input Column: 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp[audience_type]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to TEXT data type
    • Output Columns:
      • audience_type: Directly mapped after casting
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history[audience_type]
    • Direct directly copied to the output
    • Output Columns:
      • audience_type: directly copied
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history[audience_type]
    • Direct directly copied to the output
    • Output Columns:
      • audience_type: directly copied
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history[audience_type]
    • Direct directly copied to the output
    • Output Columns:
      • audience_type: directly copied
Column Lineage
%3 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp gender 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history gender 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f0->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report gender 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report gender 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report gender 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0
239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history
  • Input Column: 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp[gender]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to TEXT data type
    • Output Columns:
      • gender: Directly mapped after casting
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history[gender]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • gender: Directly copied to the output
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history[gender]
    • Direct The gender column is directly copied to the output without transformation
    • Output Columns:
      • gender: Directly copied to the output gender column
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history[gender]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • gender: Directly copied to the output
Column Lineage
%3 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp budget 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history budget 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f0->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report budget 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report budget 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report budget 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0
239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history
  • Input Column: 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp[budget]
    • Cleaning The column is cast to FLOAT data type
    • Output Columns:
      • budget: Directly mapped after casting
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history[budget]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • budget: Directly copied to the output
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history[budget]
    • Direct The budget column is directly copied to the output without transformation
    • Output Columns:
      • budget: Directly copied to the output budget column
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history[budget]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • budget: Directly copied to the output
Column Lineage
%3 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp category 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history category 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f0->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report category 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report category 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report category 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0
239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history
  • Input Column: 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp[category]
    • Cleaning The column is cast as DECIMAL(28, 6) in the fields CTE
    • Direct The column is directly selected in the final CTE without further transformation
    • Output Columns:
      • category: Directly mapped to the output 'category' column
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history[category]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • category: Directly copied to the output
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history[category]
    • Direct The category column is directly copied to the output without transformation
    • Output Columns:
      • category: Directly copied to the output category column
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history[category]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • category: Directly copied to the output
Column Lineage
%3 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp frequency 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history frequency 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f0->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0
239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history
  • Input Column: 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp[frequency]
    • Cleaning The column is cast to DECIMAL(28, 6) data type
    • Direct The column is directly copied to the output
    • Output Columns:
      • frequency: Directly copied after casting
Column Lineage
%3 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp frequency_schedule 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history frequency_schedule 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f0->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0
239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history
  • Input Column: 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp[frequency_schedule]
    • Cleaning The column is cast to DECIMAL(28, 6) data type
    • Direct The column is directly copied to the output
    • Output Columns:
      • frequency_schedule: Directly copied after casting
Column Lineage
%3 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp action_days 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history action_days 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f0->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0
239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history
  • Input Column: 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp[action_days]
    • Cleaning The column is cast to DECIMAL(28, 6) data type
    • Direct The column is directly copied to the output
    • Output Columns:
      • action_days: Directly copied after casting
Column Lineage
%3 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp interest_category_v_2 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history interest_category 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f0->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0
239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history
  • Input Column: 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp[interest_category_v_2]
    • Cleaning The column is cast to TEXT data type
    • Direct The column is directly copied to the output, but renamed
    • Output Columns:
      • interest_category: Directly copied after casting and renamed
Column Lineage
%3 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp action_categories 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history action_categories 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f0->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0
239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history
  • Input Column: 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp[action_categories]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • action_categories: Directly mapped to this output column
Column Lineage
%3 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp age_groups 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history age_groups 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f0->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0
239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history
  • Input Column: 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp[age_groups]
    • Cleaning The column is cleaned by coalescing with the 'age' column
    • Output Columns:
      • age_groups: Coalesced with 'age' column and mapped to this output
Column Lineage
%3 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp languages 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history languages 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f0->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0
239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history
  • Input Column: 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp[languages]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • languages: Directly mapped to this output column
Column Lineage
%3 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp _fivetran_synced 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history 239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history is_most_recent_record updated_at 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f0->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f1 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp:f0->239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history:f0
239. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history
  • Input Column: 240. model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp[_fivetran_synced]
    • Cleaning The column is cast to TIMESTAMP type in the 'fields' CTE.
    • Deduplication The column is used in the window function to determine the most recent record for each ad group.
    • Output Columns:
      • updated_at: The '_fivetran_synced' column is cleaned (cast to TIMESTAMP) and renamed to 'updated_at' in the output.
      • is_most_recent_record: The column is used in the ROW_NUMBER() function to determine if a record is the most recent for a particular ad group.
241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly

This SQL query performs data type casting and column renaming on a TikTok ads ad group hourly report. It starts with a base table, defines the desired data types and column names in a CTE named 'fields', and then selects and rearranges these fields in the final output. The query primarily focuses on standardizing data types and column names without performing any complex transformations or aggregations.

Cleaning
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_stg_tiktok_ads.stg_tiktok_ads__ad_group_report_hourly_tmp
), fields AS (
  SELECT
    CAST(NULL AS DECIMAL(28, 6)) AS adgroup_id,
    CAST(NULL AS FLOAT) AS average_video_play,
    CAST(NULL AS FLOAT) AS average_video_play_per_user,
    CAST(NULL AS DECIMAL(28, 6)) AS clicks,
    CAST(NULL AS DECIMAL(28, 6)) AS comments,
    CAST(NULL AS DECIMAL(28, 6)) AS conversion,
    CAST(NULL AS FLOAT) AS conversion_rate,
    CAST(NULL AS FLOAT) AS cost_per_conversion,
    CAST(NULL AS FLOAT) AS cpc,
    CAST(NULL AS FLOAT) AS cpm,
    CAST(NULL AS FLOAT) AS ctr,
    CAST(NULL AS DECIMAL(28, 6)) AS follows,
    CAST(NULL AS DECIMAL(28, 6)) AS impressions,
    CAST(NULL AS DECIMAL(28, 6)) AS likes,
    CAST(NULL AS DECIMAL(28, 6)) AS profile_visits,
    CAST(NULL AS DECIMAL(28, 6)) AS reach,
    CAST(NULL AS DECIMAL(28, 6)) AS shares,
    CAST(NULL AS DECIMAL(28, 6)) AS spend,
    CAST(NULL AS TIMESTAMP) AS stat_time_hour,
    CAST(NULL AS DECIMAL(28, 6)) AS video_play_actions,
    CAST(NULL AS DECIMAL(28, 6)) AS video_views_p_25,
    CAST(NULL AS DECIMAL(28, 6)) AS video_views_p_50,
    CAST(NULL AS DECIMAL(28, 6)) AS video_views_p_75,
    CAST(NULL AS DECIMAL(28, 6)) AS video_watched_2_s,
    CAST(NULL AS DECIMAL(28, 6)) AS video_watched_6_s,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    adgroup_id AS ad_group_id,
    CAST(stat_time_hour AS TIMESTAMP) AS stat_time_hour,
    cpc,
    cpm,
    ctr,
    impressions,
    clicks,
    spend,
    reach,
    conversion,
    cost_per_conversion,
    conversion_rate,
    likes,
    comments,
    shares,
    profile_visits,
    follows,
    video_play_actions,
    video_watched_2_s,
    video_watched_6_s,
    video_views_p_25,
    video_views_p_50,
    video_views_p_75,
    average_video_play,
    average_video_play_per_user
  FROM fields
)
SELECT
  *
FROM final
%3 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly source_relation ad_group_id stat_time_hour cost_per_conversion cpc video_play_actions conversion_rate video_views_p_75 video_views_p_50 impressions comments conversion shares clicks cost_per_1000_reached video_views_p_25 reach profile_visits_rate average_video_play average_video_play_per_user profile_visits cpm ctr video_watched_2_s follows video_watched_6_s spend likes 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp adgroup_id stat_time_hour cost_per_conversion cpc video_play_actions conversion_rate video_views_p_75 video_views_p_50 impressions comments conversion shares clicks video_views_p_25 reach average_video_play profile_visits cpm ctr video_watched_2_s follows video_watched_6_s average_video_play_per_user spend likes 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f0->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f1 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f1->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f2 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f2->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f3 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f3->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f4 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f4->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f5 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f5->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f6 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f6->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f7 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f7->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f8 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f8->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f9 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f9->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f10 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f10->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f11 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f11->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f12 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f12->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f13 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f13->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f15 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f14->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f16 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f15->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f18 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f16->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f20 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f17->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f21 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f18->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f22 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f19->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f23 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f20->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f24 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f21->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f25 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f22->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f19 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f23->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f26 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f24->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f27
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
ad_group_id integer Ad group id
stat_time_hour timestamp without time zone Hour of activity
cost_per_conversion double precision The average amount of money you've spent on a conversion. (The total count is calculated based on the time each ad impression occurred.)
cpc double precision The average amount of money you've spent on a click.
video_play_actions integer The number of times your video starts to play. Replays will not be counted.
conversion_rate integer The percentage of results you received out of all the clicks of your ads. (The total count is calculated based on the time each ad impression occurred.)
video_views_p_75 integer The number of times your video was played at 75% of its length. Replays will not be counted.
video_views_p_50 integer The number of times your video was played at 50% of its length. Replays will not be counted.
impressions integer The number of times your ads were on screen.
comments integer The number of comments your video creative received within 1 day of a user seeing a paid ad.
conversion integer The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)
shares integer The number of shares your video creative received within 1 day of a user seeing a paid ad.
clicks integer The number of clicks on your ads.
cost_per_1000_reached None The average cost to reach 1,000 unique users. This metric is estimated.
video_views_p_25 integer The number of times your video was played at 25% of its length. Replays will not be counted.
reach integer The number of unique users who saw your ads at least once. This metric is estimated.
profile_visits_rate None The rate of profile visits per impression the paid ad drove during the campaign. This metric is only for Boosted TikToks.
average_video_play double precision The average time your video was played per single video view, including any time spent replaying the video.
average_video_play_per_user double precision The average time per user your video was played per single video view, including any time spent replaying the video.
profile_visits integer The number of profile visits the ad drove during the campaign. This metric is only for Boosted TikToks.
cpm double precision The average amount of money you've spent per 1,000 impressions.
ctr double precision The percentage of times people saw your ad and performed a click.
video_watched_2_s integer The number of times your video played for at least 2 seconds. Replays will not be counted.
follows integer The number of new followers that were gained within 1 day of a user seeing a paid ad. This metric is only for Boosted TikToks.
video_watched_6_s integer The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.
spend double precision The estimated total amount of money you've spent on your campaign, ad group or ad during its schedule.
likes integer The number of likes your video creative received within 1 day of a user seeing a paid ad.
Column Lineage
%3 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly source_relation 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report source_relation 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with other tables
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
Column Lineage
%3 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp adgroup_id 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly ad_group_id 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f0->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report ad_group_id 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0
241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly
  • Input Column: 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp[adgroup_id]
    • Cleaning The column is cast to DECIMAL(28, 6) and renamed to 'ad_group_id'
    • Output Columns:
      • ad_group_id: Directly mapped after casting and renaming
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly[ad_group_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with the ad_groups table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • ad_group_id: Directly copied to the output
Column Lineage
%3 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp stat_time_hour 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly stat_time_hour 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f0->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report date_day 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0
241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly
  • Input Column: 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp[stat_time_hour]
    • Cleaning The column is cast to TIMESTAMP
    • Output Columns:
      • stat_time_hour: Directly mapped after casting
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly[stat_time_hour]
    • Cleaning Cast to DATE type
    • Aggregation Included in the GROUP BY clause after transformation
    • Output Columns:
      • date_day: Transformed and mapped to this output column
Column Lineage
%3 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp cost_per_conversion 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly cost_per_conversion 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f0->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0
241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly
  • Input Column: 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp[cost_per_conversion]
    • Cleaning The column is cast to FLOAT
    • Output Columns:
      • cost_per_conversion: Directly mapped after casting
Column Lineage
%3 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp cpc 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly cpc 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f0->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0
241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly
  • Input Column: 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp[cpc]
    • Cleaning The column is cast to FLOAT
    • Output Columns:
      • cpc: Directly mapped after casting
Column Lineage
%3 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp video_play_actions 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly video_play_actions 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f0->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0
241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly
  • Input Column: 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp[video_play_actions]
    • Cleaning The column is cast to DECIMAL(28, 6)
    • Output Columns:
      • video_play_actions: Directly mapped after casting
Column Lineage
%3 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp conversion_rate 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly conversion_rate 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f0->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0
241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly
  • Input Column: 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp[conversion_rate]
    • Cleaning The column is cast to FLOAT
    • Output Columns:
      • conversion_rate: Directly mapped after casting
Column Lineage
%3 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp video_views_p_75 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly video_views_p_75 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f0->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report video_views_p_75 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0
241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly
  • Input Column: 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp[video_views_p_75]
    • Cleaning The column is cast to DECIMAL(28, 6)
    • Output Columns:
      • video_views_p_75: Directly mapped after casting
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly[video_views_p_75]
    • Aggregation Summed up in the SELECT statement
    • Output Columns:
      • video_views_p_75: Aggregated sum in the output
Column Lineage
%3 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp video_views_p_50 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly video_views_p_50 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f0->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report video_views_p_50 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0
241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly
  • Input Column: 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp[video_views_p_50]
    • Cleaning The column is cast to DECIMAL(28, 6)
    • Output Columns:
      • video_views_p_50: Directly mapped after casting
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly[video_views_p_50]
    • Aggregation Summed up in the SELECT statement
    • Output Columns:
      • video_views_p_50: Aggregated sum in the output
Column Lineage
%3 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp impressions 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly impressions 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f0->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report daily_cpm daily_ctr impressions 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f2 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f1
241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly
  • Input Column: 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp[impressions]
    • Cleaning The column is cast to DECIMAL(28, 6) in the 'fields' CTE.
    • Direct After casting, it's directly selected in the final output.
    • Output Columns:
      • impressions: Directly mapped after casting.
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly[impressions]
    • Aggregation Summed up in the SELECT statement
    • Other Used in calculations for daily_cpm and daily_ctr
    • Output Columns:
      • impressions: Aggregated sum in the output
      • daily_cpm: Part of the calculation
      • daily_ctr: Part of the calculation
Column Lineage
%3 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp comments 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly comments 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f0->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report comments 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0
241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly
  • Input Column: 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp[comments]
    • Cleaning The column is cast to DECIMAL(28, 6) in the 'fields' CTE.
    • Direct After casting, it's directly selected in the final output.
    • Output Columns:
      • comments: Directly mapped after casting.
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly[comments]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • comments: Directly mapped after aggregation
Column Lineage
%3 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp conversion 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly conversion 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f0->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report conversion 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0
241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly
  • Input Column: 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp[conversion]
    • Cleaning The column is cast to DECIMAL(28, 6) in the 'fields' CTE.
    • Direct After casting, it's directly selected in the final output.
    • Output Columns:
      • conversion: Directly mapped after casting.
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly[conversion]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • conversion: Directly mapped after aggregation
Column Lineage
%3 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp shares 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly shares 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f0->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report shares 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0
241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly
  • Input Column: 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp[shares]
    • Cleaning The column is cast to DECIMAL(28, 6) in the 'fields' CTE.
    • Direct After casting, it's directly selected in the final output.
    • Output Columns:
      • shares: Directly mapped after casting.
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly[shares]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • shares: Directly mapped after aggregation
Column Lineage
%3 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp clicks 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly clicks 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f0->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report clicks daily_cpc daily_ctr 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f1 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f2
241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly
  • Input Column: 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp[clicks]
    • Cleaning The column is cast to DECIMAL(28, 6) type
    • Output Columns:
      • clicks: Directly mapped after casting
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly[clicks]
    • Aggregation The column is summed up in the aggregated CTE
    • Other Used in calculations for daily_cpc and daily_ctr
    • Output Columns:
      • clicks: Directly mapped after aggregation
      • daily_cpc: Used in calculation
      • daily_ctr: Used in calculation
Column Lineage
%3 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp video_views_p_25 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly video_views_p_25 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f0->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report video_views_p_25 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0
241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly
  • Input Column: 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp[video_views_p_25]
    • Cleaning The column is cast to DECIMAL(28, 6) type
    • Output Columns:
      • video_views_p_25: Directly mapped after casting
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly[video_views_p_25]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • video_views_p_25: Directly mapped after aggregation
Column Lineage
%3 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp reach 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly reach 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f0->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report reach 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0
241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly
  • Input Column: 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp[reach]
    • Cleaning The column is cast to DECIMAL(28, 6) type
    • Output Columns:
      • reach: Directly mapped after casting
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly[reach]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • reach: Directly mapped after aggregation
Column Lineage
%3 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp average_video_play 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly average_video_play 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f0->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0
241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly
  • Input Column: 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp[average_video_play]
    • Cleaning The column is cast to FLOAT type
    • Output Columns:
      • average_video_play: Directly mapped after casting
Column Lineage
%3 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp average_video_play_per_user 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly average_video_play_per_user 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f0->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0
241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly
  • Input Column: 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp[average_video_play_per_user]
    • Cleaning The column is cast to FLOAT in the 'fields' CTE
    • Output Columns:
      • average_video_play_per_user: Directly mapped after casting
Column Lineage
%3 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp profile_visits 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly profile_visits 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f0->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report profile_visits 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0
241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly
  • Input Column: 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp[profile_visits]
    • Cleaning The column is cast to DECIMAL(28, 6) type
    • Output Columns:
      • profile_visits: Directly mapped after casting
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly[profile_visits]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • profile_visits: Directly mapped after aggregation
Column Lineage
%3 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp cpm 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly cpm 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f0->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0
241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly
  • Input Column: 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp[cpm]
    • Cleaning The column is cast to FLOAT type
    • Output Columns:
      • cpm: Directly mapped after casting
Column Lineage
%3 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp ctr 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly ctr 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f0->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0
241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly
  • Input Column: 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp[ctr]
    • Cleaning The column is cast to FLOAT type
    • Output Columns:
      • ctr: Directly mapped after casting
Column Lineage
%3 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp video_watched_2_s 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly video_watched_2_s 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f0->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report video_watched_2_s 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0
241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly
  • Input Column: 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp[video_watched_2_s]
    • Cleaning The column is cast to DECIMAL(28, 6) in the 'fields' CTE
    • Output Columns:
      • video_watched_2_s: Directly mapped after casting
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly[video_watched_2_s]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • video_watched_2_s: Directly mapped after aggregation
Column Lineage
%3 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp follows 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly follows 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f0->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report follows 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0
241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly
  • Input Column: 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp[follows]
    • Cleaning The column is cast to DECIMAL(28, 6) in the 'fields' CTE
    • Output Columns:
      • follows: Directly mapped after casting
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly[follows]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • follows: Directly mapped after aggregation
Column Lineage
%3 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp video_watched_6_s 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly video_watched_6_s 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f0->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report video_watched_6_s 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0
241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly
  • Input Column: 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp[video_watched_6_s]
    • Cleaning The column is cast to DECIMAL(28, 6) in the 'fields' CTE
    • Output Columns:
      • video_watched_6_s: Directly mapped after casting
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly[video_watched_6_s]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • video_watched_6_s: Directly mapped after aggregation
Column Lineage
%3 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp spend 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly spend 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f0->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report daily_cpc daily_cpm spend 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f2 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f1
241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly
  • Input Column: 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp[spend]
    • Cleaning The column is cast to DECIMAL(28, 6) in the 'fields' CTE
    • Output Columns:
      • spend: Directly mapped after casting
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly[spend]
    • Aggregation The column is summed up in the aggregated CTE
    • Other Used in calculations for daily_cpc and daily_cpm
    • Output Columns:
      • spend: Directly mapped after aggregation
      • daily_cpc: Used in calculation
      • daily_cpm: Used in calculation
Column Lineage
%3 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp likes 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly likes 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f0->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report likes 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0
241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly
  • Input Column: 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp[likes]
    • Cleaning The column is cast to DECIMAL(28, 6) in the 'fields' CTE
    • Output Columns:
      • likes: Directly mapped after casting
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly[likes]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • likes: Directly mapped after aggregation
242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of type TEXT. It's likely used as a placeholder or template for a staging table in a dbt (data build tool) project, specifically for TikTok ads data.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp adgroup_id stat_time_hour cost_per_conversion real_time_conversion cpc video_play_actions conversion_rate video_views_p_75 result video_views_p_50 impressions comments real_time_cost_per_result conversion real_time_result video_views_p_100 shares real_time_conversion_rate cost_per_secondary_goal_result secondary_goal_result_rate clicks cost_per_1000_reached video_views_p_25 reach real_time_cost_per_conversion profile_visits_rate average_video_play profile_visits cpm ctr video_watched_2_s follows result_rate video_watched_6_s secondary_goal_result cost_per_result average_video_play_per_user real_time_result_rate spend likes _fivetran_synced 363. source.tiktok_ads_source.tiktok_ads.adgroup_report_hourly 363. source.tiktok_ads_source.tiktok_ads.adgroup_report_hourly
Name Type Comment
adgroup_id integer None
stat_time_hour timestamp without time zone None
cost_per_conversion double precision None
real_time_conversion integer None
cpc double precision None
video_play_actions integer None
conversion_rate integer None
video_views_p_75 integer None
result integer None
video_views_p_50 integer None
impressions integer None
comments integer None
real_time_cost_per_result double precision None
conversion integer None
real_time_result integer None
video_views_p_100 integer None
shares integer None
real_time_conversion_rate double precision None
cost_per_secondary_goal_result text None
secondary_goal_result_rate text None
clicks integer None
cost_per_1000_reached double precision None
video_views_p_25 integer None
reach integer None
real_time_cost_per_conversion double precision None
profile_visits_rate integer None
average_video_play double precision None
profile_visits integer None
cpm double precision None
ctr double precision None
video_watched_2_s integer None
follows integer None
result_rate double precision None
video_watched_6_s integer None
secondary_goal_result text None
cost_per_result double precision None
average_video_play_per_user double precision None
real_time_result_rate double precision None
spend double precision None
likes integer None
_fivetran_synced text None
Column Lineage
%3 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp adgroup_id 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly ad_group_id 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f0->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report ad_group_id 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0
241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly
  • Input Column: 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp[adgroup_id]
    • Cleaning The column is cast to DECIMAL(28, 6) and renamed to 'ad_group_id'
    • Output Columns:
      • ad_group_id: Directly mapped after casting and renaming
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly[ad_group_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with the ad_groups table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • ad_group_id: Directly copied to the output
Column Lineage
%3 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp stat_time_hour 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly stat_time_hour 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f0->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report date_day 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0
241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly
  • Input Column: 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp[stat_time_hour]
    • Cleaning The column is cast to TIMESTAMP
    • Output Columns:
      • stat_time_hour: Directly mapped after casting
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly[stat_time_hour]
    • Cleaning Cast to DATE type
    • Aggregation Included in the GROUP BY clause after transformation
    • Output Columns:
      • date_day: Transformed and mapped to this output column
Column Lineage
%3 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp cost_per_conversion 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly cost_per_conversion 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f0->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0
241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly
  • Input Column: 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp[cost_per_conversion]
    • Cleaning The column is cast to FLOAT
    • Output Columns:
      • cost_per_conversion: Directly mapped after casting
Column Lineage
%3 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp cpc 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly cpc 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f0->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0
241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly
  • Input Column: 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp[cpc]
    • Cleaning The column is cast to FLOAT
    • Output Columns:
      • cpc: Directly mapped after casting
Column Lineage
%3 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp video_play_actions 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly video_play_actions 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f0->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0
241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly
  • Input Column: 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp[video_play_actions]
    • Cleaning The column is cast to DECIMAL(28, 6)
    • Output Columns:
      • video_play_actions: Directly mapped after casting
Column Lineage
%3 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp conversion_rate 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly conversion_rate 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f0->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0
241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly
  • Input Column: 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp[conversion_rate]
    • Cleaning The column is cast to FLOAT
    • Output Columns:
      • conversion_rate: Directly mapped after casting
Column Lineage
%3 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp video_views_p_75 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly video_views_p_75 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f0->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report video_views_p_75 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0
241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly
  • Input Column: 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp[video_views_p_75]
    • Cleaning The column is cast to DECIMAL(28, 6)
    • Output Columns:
      • video_views_p_75: Directly mapped after casting
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly[video_views_p_75]
    • Aggregation Summed up in the SELECT statement
    • Output Columns:
      • video_views_p_75: Aggregated sum in the output
Column Lineage
%3 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp video_views_p_50 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly video_views_p_50 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f0->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report video_views_p_50 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0
241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly
  • Input Column: 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp[video_views_p_50]
    • Cleaning The column is cast to DECIMAL(28, 6)
    • Output Columns:
      • video_views_p_50: Directly mapped after casting
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly[video_views_p_50]
    • Aggregation Summed up in the SELECT statement
    • Output Columns:
      • video_views_p_50: Aggregated sum in the output
Column Lineage
%3 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp impressions 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly impressions 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f0->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report daily_cpm daily_ctr impressions 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f2 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f1
241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly
  • Input Column: 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp[impressions]
    • Cleaning The column is cast to DECIMAL(28, 6) in the 'fields' CTE.
    • Direct After casting, it's directly selected in the final output.
    • Output Columns:
      • impressions: Directly mapped after casting.
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly[impressions]
    • Aggregation Summed up in the SELECT statement
    • Other Used in calculations for daily_cpm and daily_ctr
    • Output Columns:
      • impressions: Aggregated sum in the output
      • daily_cpm: Part of the calculation
      • daily_ctr: Part of the calculation
Column Lineage
%3 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp comments 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly comments 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f0->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report comments 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0
241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly
  • Input Column: 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp[comments]
    • Cleaning The column is cast to DECIMAL(28, 6) in the 'fields' CTE.
    • Direct After casting, it's directly selected in the final output.
    • Output Columns:
      • comments: Directly mapped after casting.
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly[comments]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • comments: Directly mapped after aggregation
Column Lineage
%3 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp conversion 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly conversion 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f0->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report conversion 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0
241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly
  • Input Column: 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp[conversion]
    • Cleaning The column is cast to DECIMAL(28, 6) in the 'fields' CTE.
    • Direct After casting, it's directly selected in the final output.
    • Output Columns:
      • conversion: Directly mapped after casting.
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly[conversion]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • conversion: Directly mapped after aggregation
Column Lineage
%3 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp shares 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly shares 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f0->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report shares 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0
241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly
  • Input Column: 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp[shares]
    • Cleaning The column is cast to DECIMAL(28, 6) in the 'fields' CTE.
    • Direct After casting, it's directly selected in the final output.
    • Output Columns:
      • shares: Directly mapped after casting.
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly[shares]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • shares: Directly mapped after aggregation
Column Lineage
%3 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp clicks 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly clicks 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f0->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report clicks daily_cpc daily_ctr 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f1 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f2
241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly
  • Input Column: 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp[clicks]
    • Cleaning The column is cast to DECIMAL(28, 6) type
    • Output Columns:
      • clicks: Directly mapped after casting
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly[clicks]
    • Aggregation The column is summed up in the aggregated CTE
    • Other Used in calculations for daily_cpc and daily_ctr
    • Output Columns:
      • clicks: Directly mapped after aggregation
      • daily_cpc: Used in calculation
      • daily_ctr: Used in calculation
Column Lineage
%3 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp video_views_p_25 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly video_views_p_25 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f0->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report video_views_p_25 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0
241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly
  • Input Column: 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp[video_views_p_25]
    • Cleaning The column is cast to DECIMAL(28, 6) type
    • Output Columns:
      • video_views_p_25: Directly mapped after casting
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly[video_views_p_25]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • video_views_p_25: Directly mapped after aggregation
Column Lineage
%3 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp reach 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly reach 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f0->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report reach 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0
241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly
  • Input Column: 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp[reach]
    • Cleaning The column is cast to DECIMAL(28, 6) type
    • Output Columns:
      • reach: Directly mapped after casting
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly[reach]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • reach: Directly mapped after aggregation
Column Lineage
%3 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp average_video_play 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly average_video_play 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f0->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0
241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly
  • Input Column: 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp[average_video_play]
    • Cleaning The column is cast to FLOAT type
    • Output Columns:
      • average_video_play: Directly mapped after casting
Column Lineage
%3 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp profile_visits 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly profile_visits 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f0->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report profile_visits 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0
241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly
  • Input Column: 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp[profile_visits]
    • Cleaning The column is cast to DECIMAL(28, 6) type
    • Output Columns:
      • profile_visits: Directly mapped after casting
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly[profile_visits]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • profile_visits: Directly mapped after aggregation
Column Lineage
%3 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp cpm 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly cpm 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f0->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0
241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly
  • Input Column: 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp[cpm]
    • Cleaning The column is cast to FLOAT type
    • Output Columns:
      • cpm: Directly mapped after casting
Column Lineage
%3 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp ctr 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly ctr 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f0->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0
241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly
  • Input Column: 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp[ctr]
    • Cleaning The column is cast to FLOAT type
    • Output Columns:
      • ctr: Directly mapped after casting
Column Lineage
%3 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp video_watched_2_s 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly video_watched_2_s 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f0->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report video_watched_2_s 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0
241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly
  • Input Column: 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp[video_watched_2_s]
    • Cleaning The column is cast to DECIMAL(28, 6) in the 'fields' CTE
    • Output Columns:
      • video_watched_2_s: Directly mapped after casting
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly[video_watched_2_s]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • video_watched_2_s: Directly mapped after aggregation
Column Lineage
%3 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp follows 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly follows 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f0->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report follows 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0
241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly
  • Input Column: 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp[follows]
    • Cleaning The column is cast to DECIMAL(28, 6) in the 'fields' CTE
    • Output Columns:
      • follows: Directly mapped after casting
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly[follows]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • follows: Directly mapped after aggregation
Column Lineage
%3 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp video_watched_6_s 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly video_watched_6_s 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f0->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report video_watched_6_s 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0
241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly
  • Input Column: 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp[video_watched_6_s]
    • Cleaning The column is cast to DECIMAL(28, 6) in the 'fields' CTE
    • Output Columns:
      • video_watched_6_s: Directly mapped after casting
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly[video_watched_6_s]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • video_watched_6_s: Directly mapped after aggregation
Column Lineage
%3 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp average_video_play_per_user 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly average_video_play_per_user 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f0->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0
241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly
  • Input Column: 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp[average_video_play_per_user]
    • Cleaning The column is cast to FLOAT in the 'fields' CTE
    • Output Columns:
      • average_video_play_per_user: Directly mapped after casting
Column Lineage
%3 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp spend 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly spend 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f0->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report daily_cpc daily_cpm spend 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f2 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f1
241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly
  • Input Column: 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp[spend]
    • Cleaning The column is cast to DECIMAL(28, 6) in the 'fields' CTE
    • Output Columns:
      • spend: Directly mapped after casting
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly[spend]
    • Aggregation The column is summed up in the aggregated CTE
    • Other Used in calculations for daily_cpc and daily_cpm
    • Output Columns:
      • spend: Directly mapped after aggregation
      • daily_cpc: Used in calculation
      • daily_cpm: Used in calculation
Column Lineage
%3 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp likes 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly likes 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp:f0->241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report likes 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0
241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly
  • Input Column: 242. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp[likes]
    • Cleaning The column is cast to DECIMAL(28, 6) in the 'fields' CTE
    • Output Columns:
      • likes: Directly mapped after casting
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 241. model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly[likes]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • likes: Directly mapped after aggregation
243. model.tiktok_ads_source.stg_tiktok_ads__ad_history

This SQL query processes data from a TikTok ads history source table. It performs several transformations on the data, including casting data types, extracting URL components (base URL, host, path), parsing UTM parameters, and identifying the most recent record for each ad. The query also cleans and standardizes the landing page URL by removing common prefixes and splitting it into components.

CleaningFeaturizationDeduplication
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_stg_tiktok_ads.stg_tiktok_ads__ad_history_tmp
), fields AS (
  SELECT
    CAST(NULL AS DECIMAL(28, 6)) AS ad_id,
    CAST(NULL AS TEXT) AS ad_name,
    CAST(NULL AS DECIMAL(28, 6)) AS adgroup_id,
    CAST(NULL AS DECIMAL(28, 6)) AS advertiser_id,
    CAST(NULL AS TEXT) AS call_to_action,
    CAST(NULL AS DECIMAL(28, 6)) AS campaign_id,
    CAST(NULL AS TEXT) AS click_tracking_url,
    CAST(NULL AS TEXT) AS impression_tracking_url,
    CAST(NULL AS TEXT) AS landing_page_url,
    CAST(NULL AS TIMESTAMP) AS updated_at,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    ad_id,
    CAST(updated_at AS TIMESTAMP) AS updated_at,
    adgroup_id AS ad_group_id,
    advertiser_id,
    campaign_id,
    ad_name,
    call_to_action,
    click_tracking_url,
    impression_tracking_url,
    SPLIT_PART(landing_page_url, '?', 1) AS base_url,
    TRY_CAST(SPLIT_PART(
      SPLIT_PART(
        REPLACE(
          REPLACE(REPLACE(landing_page_url, 'android-app://', ''), 'http://', ''),
          'https://',
          ''
        ),
        '/',
        1
      ),
      '?',
      1
    ) AS TEXT) AS url_host,
    '/' || TRY_CAST(SPLIT_PART(
      CASE
        WHEN LENGTH(REPLACE(REPLACE(landing_page_url, 'http://', ''), 'https://', '')) - COALESCE(
          NULLIF(
            STR_POSITION(REPLACE(REPLACE(landing_page_url, 'http://', ''), 'https://', ''), '/'),
            0
          ),
          STR_POSITION(REPLACE(REPLACE(landing_page_url, 'http://', ''), 'https://', ''), '?') - 1
        ) = 0
        THEN ''
        ELSE RIGHT(
          REPLACE(REPLACE(landing_page_url, 'http://', ''), 'https://', ''),
          LENGTH(REPLACE(REPLACE(landing_page_url, 'http://', ''), 'https://', '')) - COALESCE(
            NULLIF(
              STR_POSITION(REPLACE(REPLACE(landing_page_url, 'http://', ''), 'https://', ''), '/'),
              0
            ),
            STR_POSITION(REPLACE(REPLACE(landing_page_url, 'http://', ''), 'https://', ''), '?') - 1
          )
        )
      END,
      '?',
      1
    ) AS TEXT) AS url_path,
    NULLIF(SPLIT_PART(SPLIT_PART(landing_page_url, 'utm_source=', 2), '&', 1), '') AS utm_source,
    NULLIF(SPLIT_PART(SPLIT_PART(landing_page_url, 'utm_medium=', 2), '&', 1), '') AS utm_medium,
    NULLIF(SPLIT_PART(SPLIT_PART(landing_page_url, 'utm_campaign=', 2), '&', 1), '') AS utm_campaign,
    NULLIF(SPLIT_PART(SPLIT_PART(landing_page_url, 'utm_content=', 2), '&', 1), '') AS utm_content,
    NULLIF(SPLIT_PART(SPLIT_PART(landing_page_url, 'utm_term=', 2), '&', 1), '') AS utm_term,
    landing_page_url,
    ROW_NUMBER() OVER (PARTITION BY source_relation, ad_id ORDER BY updated_at DESC) = 1 AS is_most_recent_record
  FROM fields
)
SELECT
  *
FROM final
%3 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history source_relation ad_id updated_at ad_group_id advertiser_id base_url campaign_id ad_name call_to_action click_tracking_url impression_tracking_url landing_page_url url_host url_path utm_source utm_medium utm_campaign utm_content utm_term is_most_recent_record 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp ad_id updated_at advertiser_id adgroup_id campaign_id ad_name call_to_action landing_page_url impression_tracking_url click_tracking_url 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f1 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f1->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f2 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f2->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f4 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f3->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f3 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f4->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f6 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f5->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f7 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f6->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f8 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f7->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f5 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f7->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f12 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f7->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f13 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f7->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f14 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f7->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f15 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f7->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f16 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f7->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f17 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f7->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f18 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f7->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f11 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f8->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f10 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f9->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f9
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
ad_id integer Ad ID
updated_at timestamp without time zone Time the record was updated.
ad_group_id integer Ad group ID
advertiser_id integer Advertiser ID
base_url text The base URL of the ad, extracted from the `landing page url`.
campaign_id integer Campaign ID
ad_name text Ad Name.
call_to_action text Call to action values.
click_tracking_url integer Click monitoring URL.
impression_tracking_url integer Display monitoring URL.
landing_page_url text Landing page URL.
url_host text The URL host of the ad, extracted from the `landing_page_url`.
url_path text The URL path of the ad, extracted from the `landing_page_url`.
utm_source text The utm_source parameter of the ad, extracted from the `landing_page_url`.
utm_medium text The utm_medium parameter of the ad, extracted from the `landing_page_url`.
utm_campaign text The utm_campaign parameter of the ad, extracted from the `landing_page_url`.
utm_content text The utm_content parameter of the ad, extracted from the `landing_page_url`.
utm_term text The utm_term parameter of the ad, extracted from the `landing_page_url`.
is_most_recent_record boolean Whether record is the most recent one for this particular grain.
Column Lineage
%3 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history source_relation 236. model.tiktok_ads.tiktok_ads__advertiser_report 236. model.tiktok_ads.tiktok_ads__advertiser_report source_relation 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f0 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report source_relation 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report source_relation 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history[source_relation]
    • Integration used to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
236. model.tiktok_ads.tiktok_ads__advertiser_report
  • Input Column: 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history[source_relation]
    • Integration Used to join with other tables
    • Direct Directly selected in the output
    • Output Columns:
      • source_relation: Directly copied to output
Column Lineage
%3 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp ad_id 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history ad_id 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f0 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report ad_id 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report ad_id 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0
243. model.tiktok_ads_source.stg_tiktok_ads__ad_history
  • Input Column: 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp[ad_id]
    • Direct The column is directly copied without transformation
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • ad_id: Directly copied
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history[ad_id]
    • Integration used to join with the hourly table
    • Direct directly copied to the output
    • Output Columns:
      • ad_id: directly copied
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history[ad_id]
    • Integration Used to join with the hourly table
    • Direct Directly selected in the output
    • Output Columns:
      • ad_id: Directly copied to output
Column Lineage
%3 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp updated_at 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history updated_at 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f0
243. model.tiktok_ads_source.stg_tiktok_ads__ad_history
  • Input Column: 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp[updated_at]
    • Cleaning Cast as TIMESTAMP
    • Deduplication Used in the ROW_NUMBER() function to order and select the most recent record
    • Output Columns:
      • updated_at: Cast as TIMESTAMP
Column Lineage
%3 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp adgroup_id 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history ad_group_id 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f0
243. model.tiktok_ads_source.stg_tiktok_ads__ad_history
  • Input Column: 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp[adgroup_id]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • ad_group_id: Directly copied and renamed
Column Lineage
%3 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp advertiser_id 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history advertiser_id 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f0 236. model.tiktok_ads.tiktok_ads__advertiser_report 236. model.tiktok_ads.tiktok_ads__advertiser_report advertiser_id 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f0 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report advertiser_id 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0
243. model.tiktok_ads_source.stg_tiktok_ads__ad_history
  • Input Column: 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp[advertiser_id]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • advertiser_id: Directly copied
236. model.tiktok_ads.tiktok_ads__advertiser_report
  • Input Column: 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history[advertiser_id]
    • Integration used as the key to join with the advertiser table
    • Aggregation used in the GROUP BY clause
    • Direct directly copied to the output
    • Output Columns:
      • advertiser_id: directly copied
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history[advertiser_id]
    • Integration Used to join with the advertiser table
    • Output Columns:
      • advertiser_id: Directly copied to output
Column Lineage
%3 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp landing_page_url 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history base_url landing_page_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f0 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f2 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f3 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f7 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f6 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f4 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f5 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f8 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f1 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report base_url 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0
243. model.tiktok_ads_source.stg_tiktok_ads__ad_history
  • Input Column: 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp[landing_page_url]
    • Cleaning The column is cleaned by removing 'http://', 'https://', and 'android-app://' prefixes
    • Featurization Various features are extracted from this column, including base_url, url_host, url_path, and UTM parameters
    • Output Columns:
      • base_url: Extracted by splitting the URL at the first '?'
      • url_host: Extracted from the cleaned URL
      • url_path: Extracted from the cleaned URL
      • utm_source: Extracted from URL parameters
      • utm_medium: Extracted from URL parameters
      • utm_campaign: Extracted from URL parameters
      • utm_content: Extracted from URL parameters
      • utm_term: Extracted from URL parameters
      • landing_page_url: Directly copied
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history[base_url]
    • Direct Directly selected in the output
    • Output Columns:
      • base_url: Directly copied to output
Column Lineage
%3 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp campaign_id 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history campaign_id 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f0
243. model.tiktok_ads_source.stg_tiktok_ads__ad_history
  • Input Column: 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp[campaign_id]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • campaign_id: Directly copied
Column Lineage
%3 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp ad_name 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history ad_name 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f0 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report ad_name 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report ad_name 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0
243. model.tiktok_ads_source.stg_tiktok_ads__ad_history
  • Input Column: 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp[ad_name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • ad_name: Directly copied
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history[ad_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_name: directly copied
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history[ad_name]
    • Direct Directly selected in the output
    • Output Columns:
      • ad_name: Directly copied to output
Column Lineage
%3 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp call_to_action 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history call_to_action 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f0
243. model.tiktok_ads_source.stg_tiktok_ads__ad_history
  • Input Column: 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp[call_to_action]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • call_to_action: Directly copied
Column Lineage
%3 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp click_tracking_url 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history click_tracking_url 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f0
243. model.tiktok_ads_source.stg_tiktok_ads__ad_history
  • Input Column: 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp[click_tracking_url]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • click_tracking_url: Directly copied
Column Lineage
%3 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp impression_tracking_url 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history impression_tracking_url 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f0
243. model.tiktok_ads_source.stg_tiktok_ads__ad_history
  • Input Column: 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp[impression_tracking_url]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • impression_tracking_url: Directly copied
Column Lineage
%3 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp landing_page_url 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history base_url landing_page_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f0 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f2 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f3 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f7 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f6 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f4 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f5 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f8 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f1
243. model.tiktok_ads_source.stg_tiktok_ads__ad_history
  • Input Column: 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp[landing_page_url]
    • Cleaning The column is cleaned by removing 'http://', 'https://', and 'android-app://' prefixes
    • Featurization Various features are extracted from this column, including base_url, url_host, url_path, and UTM parameters
    • Output Columns:
      • base_url: Extracted by splitting the URL at the first '?'
      • url_host: Extracted from the cleaned URL
      • url_path: Extracted from the cleaned URL
      • utm_source: Extracted from URL parameters
      • utm_medium: Extracted from URL parameters
      • utm_campaign: Extracted from URL parameters
      • utm_content: Extracted from URL parameters
      • utm_term: Extracted from URL parameters
      • landing_page_url: Directly copied
Column Lineage
%3 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp landing_page_url 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history base_url landing_page_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f0 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f2 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f3 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f7 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f6 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f4 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f5 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f8 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f1 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report url_host 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f2->238. model.tiktok_ads.tiktok_ads__url_report:f0
243. model.tiktok_ads_source.stg_tiktok_ads__ad_history
  • Input Column: 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp[landing_page_url]
    • Cleaning The column is cleaned by removing 'http://', 'https://', and 'android-app://' prefixes
    • Featurization Various features are extracted from this column, including base_url, url_host, url_path, and UTM parameters
    • Output Columns:
      • base_url: Extracted by splitting the URL at the first '?'
      • url_host: Extracted from the cleaned URL
      • url_path: Extracted from the cleaned URL
      • utm_source: Extracted from URL parameters
      • utm_medium: Extracted from URL parameters
      • utm_campaign: Extracted from URL parameters
      • utm_content: Extracted from URL parameters
      • utm_term: Extracted from URL parameters
      • landing_page_url: Directly copied
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history[url_host]
    • Direct Directly copied to the output
    • Output Columns:
      • url_host: Directly copied
Column Lineage
%3 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp landing_page_url 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history base_url landing_page_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f0 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f2 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f3 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f7 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f6 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f4 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f5 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f8 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f1 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report url_path 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f3->238. model.tiktok_ads.tiktok_ads__url_report:f0
243. model.tiktok_ads_source.stg_tiktok_ads__ad_history
  • Input Column: 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp[landing_page_url]
    • Cleaning The column is cleaned by removing 'http://', 'https://', and 'android-app://' prefixes
    • Featurization Various features are extracted from this column, including base_url, url_host, url_path, and UTM parameters
    • Output Columns:
      • base_url: Extracted by splitting the URL at the first '?'
      • url_host: Extracted from the cleaned URL
      • url_path: Extracted from the cleaned URL
      • utm_source: Extracted from URL parameters
      • utm_medium: Extracted from URL parameters
      • utm_campaign: Extracted from URL parameters
      • utm_content: Extracted from URL parameters
      • utm_term: Extracted from URL parameters
      • landing_page_url: Directly copied
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history[url_path]
    • Direct Directly copied to the output
    • Output Columns:
      • url_path: Directly copied
Column Lineage
%3 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp landing_page_url 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history base_url landing_page_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f0 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f2 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f3 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f7 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f6 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f4 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f5 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f8 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f1 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report utm_source 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f7->238. model.tiktok_ads.tiktok_ads__url_report:f0
243. model.tiktok_ads_source.stg_tiktok_ads__ad_history
  • Input Column: 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp[landing_page_url]
    • Cleaning The column is cleaned by removing 'http://', 'https://', and 'android-app://' prefixes
    • Featurization Various features are extracted from this column, including base_url, url_host, url_path, and UTM parameters
    • Output Columns:
      • base_url: Extracted by splitting the URL at the first '?'
      • url_host: Extracted from the cleaned URL
      • url_path: Extracted from the cleaned URL
      • utm_source: Extracted from URL parameters
      • utm_medium: Extracted from URL parameters
      • utm_campaign: Extracted from URL parameters
      • utm_content: Extracted from URL parameters
      • utm_term: Extracted from URL parameters
      • landing_page_url: Directly copied
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history[utm_source]
    • Direct Directly copied to the output
    • Output Columns:
      • utm_source: Directly copied
Column Lineage
%3 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp landing_page_url 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history base_url landing_page_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f0 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f2 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f3 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f7 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f6 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f4 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f5 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f8 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f1 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report utm_medium 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f6->238. model.tiktok_ads.tiktok_ads__url_report:f0
243. model.tiktok_ads_source.stg_tiktok_ads__ad_history
  • Input Column: 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp[landing_page_url]
    • Cleaning The column is cleaned by removing 'http://', 'https://', and 'android-app://' prefixes
    • Featurization Various features are extracted from this column, including base_url, url_host, url_path, and UTM parameters
    • Output Columns:
      • base_url: Extracted by splitting the URL at the first '?'
      • url_host: Extracted from the cleaned URL
      • url_path: Extracted from the cleaned URL
      • utm_source: Extracted from URL parameters
      • utm_medium: Extracted from URL parameters
      • utm_campaign: Extracted from URL parameters
      • utm_content: Extracted from URL parameters
      • utm_term: Extracted from URL parameters
      • landing_page_url: Directly copied
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history[utm_medium]
    • Direct Directly copied to the output
    • Output Columns:
      • utm_medium: Directly copied
Column Lineage
%3 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp landing_page_url 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history base_url landing_page_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f0 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f2 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f3 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f7 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f6 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f4 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f5 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f8 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f1 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report utm_campaign 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f4->238. model.tiktok_ads.tiktok_ads__url_report:f0
243. model.tiktok_ads_source.stg_tiktok_ads__ad_history
  • Input Column: 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp[landing_page_url]
    • Cleaning The column is cleaned by removing 'http://', 'https://', and 'android-app://' prefixes
    • Featurization Various features are extracted from this column, including base_url, url_host, url_path, and UTM parameters
    • Output Columns:
      • base_url: Extracted by splitting the URL at the first '?'
      • url_host: Extracted from the cleaned URL
      • url_path: Extracted from the cleaned URL
      • utm_source: Extracted from URL parameters
      • utm_medium: Extracted from URL parameters
      • utm_campaign: Extracted from URL parameters
      • utm_content: Extracted from URL parameters
      • utm_term: Extracted from URL parameters
      • landing_page_url: Directly copied
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history[utm_campaign]
    • Direct Directly copied to the output
    • Output Columns:
      • utm_campaign: Directly copied
Column Lineage
%3 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp landing_page_url 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history base_url landing_page_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f0 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f2 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f3 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f7 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f6 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f4 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f5 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f8 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f1 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report utm_content 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f5->238. model.tiktok_ads.tiktok_ads__url_report:f0
243. model.tiktok_ads_source.stg_tiktok_ads__ad_history
  • Input Column: 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp[landing_page_url]
    • Cleaning The column is cleaned by removing 'http://', 'https://', and 'android-app://' prefixes
    • Featurization Various features are extracted from this column, including base_url, url_host, url_path, and UTM parameters
    • Output Columns:
      • base_url: Extracted by splitting the URL at the first '?'
      • url_host: Extracted from the cleaned URL
      • url_path: Extracted from the cleaned URL
      • utm_source: Extracted from URL parameters
      • utm_medium: Extracted from URL parameters
      • utm_campaign: Extracted from URL parameters
      • utm_content: Extracted from URL parameters
      • utm_term: Extracted from URL parameters
      • landing_page_url: Directly copied
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history[utm_content]
    • Direct Directly copied to the output
    • Output Columns:
      • utm_content: Directly copied
Column Lineage
%3 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp landing_page_url 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history base_url landing_page_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f0 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f2 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f3 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f7 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f6 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f4 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f5 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f8 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f1 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report utm_term 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f8->238. model.tiktok_ads.tiktok_ads__url_report:f0
243. model.tiktok_ads_source.stg_tiktok_ads__ad_history
  • Input Column: 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp[landing_page_url]
    • Cleaning The column is cleaned by removing 'http://', 'https://', and 'android-app://' prefixes
    • Featurization Various features are extracted from this column, including base_url, url_host, url_path, and UTM parameters
    • Output Columns:
      • base_url: Extracted by splitting the URL at the first '?'
      • url_host: Extracted from the cleaned URL
      • url_path: Extracted from the cleaned URL
      • utm_source: Extracted from URL parameters
      • utm_medium: Extracted from URL parameters
      • utm_campaign: Extracted from URL parameters
      • utm_content: Extracted from URL parameters
      • utm_term: Extracted from URL parameters
      • landing_page_url: Directly copied
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history[utm_term]
    • Direct Directly copied to the output
    • Output Columns:
      • utm_term: Directly copied
244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of type TEXT. It's likely used as a placeholder or template for further operations in a dbt (data build tool) project.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp ad_id updated_at advertiser_id adgroup_id campaign_id create_time ad_name call_to_action secondary_status operation_status ad_text video_id app_name deeplink landing_page_url display_name profile_image_url impression_tracking_url click_tracking_url playable_url is_aco creative_authorized is_new_structure image_ids _fivetran_synced 360. source.tiktok_ads_source.tiktok_ads.ad_history 360. source.tiktok_ads_source.tiktok_ads.ad_history
Name Type Comment
ad_id integer None
updated_at text None
advertiser_id integer None
adgroup_id integer None
campaign_id integer None
create_time text None
ad_name text None
call_to_action text None
secondary_status text None
operation_status text None
ad_text text None
video_id text None
app_name integer None
deeplink integer None
landing_page_url text None
display_name text None
profile_image_url integer None
impression_tracking_url integer None
click_tracking_url integer None
playable_url integer None
is_aco boolean None
creative_authorized boolean None
is_new_structure boolean None
image_ids text None
_fivetran_synced text None
Column Lineage
%3 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp ad_id 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history ad_id 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f0 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report ad_id 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report ad_id 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0
243. model.tiktok_ads_source.stg_tiktok_ads__ad_history
  • Input Column: 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp[ad_id]
    • Direct The column is directly copied without transformation
    • Deduplication Used in the ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • ad_id: Directly copied
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history[ad_id]
    • Integration used to join with the hourly table
    • Direct directly copied to the output
    • Output Columns:
      • ad_id: directly copied
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history[ad_id]
    • Integration Used to join with the hourly table
    • Direct Directly selected in the output
    • Output Columns:
      • ad_id: Directly copied to output
Column Lineage
%3 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp updated_at 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history updated_at 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f0
243. model.tiktok_ads_source.stg_tiktok_ads__ad_history
  • Input Column: 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp[updated_at]
    • Cleaning Cast as TIMESTAMP
    • Deduplication Used in the ROW_NUMBER() function to order and select the most recent record
    • Output Columns:
      • updated_at: Cast as TIMESTAMP
Column Lineage
%3 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp advertiser_id 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history advertiser_id 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f0 236. model.tiktok_ads.tiktok_ads__advertiser_report 236. model.tiktok_ads.tiktok_ads__advertiser_report advertiser_id 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f0 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report advertiser_id 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0
243. model.tiktok_ads_source.stg_tiktok_ads__ad_history
  • Input Column: 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp[advertiser_id]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • advertiser_id: Directly copied
236. model.tiktok_ads.tiktok_ads__advertiser_report
  • Input Column: 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history[advertiser_id]
    • Integration used as the key to join with the advertiser table
    • Aggregation used in the GROUP BY clause
    • Direct directly copied to the output
    • Output Columns:
      • advertiser_id: directly copied
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history[advertiser_id]
    • Integration Used to join with the advertiser table
    • Output Columns:
      • advertiser_id: Directly copied to output
Column Lineage
%3 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp adgroup_id 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history ad_group_id 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f0
243. model.tiktok_ads_source.stg_tiktok_ads__ad_history
  • Input Column: 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp[adgroup_id]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • ad_group_id: Directly copied and renamed
Column Lineage
%3 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp campaign_id 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history campaign_id 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f0
243. model.tiktok_ads_source.stg_tiktok_ads__ad_history
  • Input Column: 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp[campaign_id]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • campaign_id: Directly copied
Column Lineage
%3 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp ad_name 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history ad_name 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f0 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report ad_name 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report ad_name 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0
243. model.tiktok_ads_source.stg_tiktok_ads__ad_history
  • Input Column: 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp[ad_name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • ad_name: Directly copied
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history[ad_name]
    • Direct directly copied to the output
    • Output Columns:
      • ad_name: directly copied
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history[ad_name]
    • Direct Directly selected in the output
    • Output Columns:
      • ad_name: Directly copied to output
Column Lineage
%3 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp call_to_action 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history call_to_action 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f0
243. model.tiktok_ads_source.stg_tiktok_ads__ad_history
  • Input Column: 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp[call_to_action]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • call_to_action: Directly copied
Column Lineage
%3 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp landing_page_url 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history base_url landing_page_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f0 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f2 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f3 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f7 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f6 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f4 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f5 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f8 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f1 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report base_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f2->238. model.tiktok_ads.tiktok_ads__url_report:f1 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f3->238. model.tiktok_ads.tiktok_ads__url_report:f2 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f7->238. model.tiktok_ads.tiktok_ads__url_report:f6 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f6->238. model.tiktok_ads.tiktok_ads__url_report:f5 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f4->238. model.tiktok_ads.tiktok_ads__url_report:f3 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f5->238. model.tiktok_ads.tiktok_ads__url_report:f4 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f8->238. model.tiktok_ads.tiktok_ads__url_report:f7
243. model.tiktok_ads_source.stg_tiktok_ads__ad_history
  • Input Column: 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp[landing_page_url]
    • Cleaning The column is cleaned by removing 'http://', 'https://', and 'android-app://' prefixes
    • Featurization Various features are extracted from this column, including base_url, url_host, url_path, and UTM parameters
    • Output Columns:
      • base_url: Extracted by splitting the URL at the first '?'
      • url_host: Extracted from the cleaned URL
      • url_path: Extracted from the cleaned URL
      • utm_source: Extracted from URL parameters
      • utm_medium: Extracted from URL parameters
      • utm_campaign: Extracted from URL parameters
      • utm_content: Extracted from URL parameters
      • utm_term: Extracted from URL parameters
      • landing_page_url: Directly copied
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history[base_url]
    • Direct Directly selected in the output
    • Output Columns:
      • base_url: Directly copied to output
  • Input Column: 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history[url_host]
    • Direct Directly copied to the output
    • Output Columns:
      • url_host: Directly copied
  • Input Column: 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history[url_path]
    • Direct Directly copied to the output
    • Output Columns:
      • url_path: Directly copied
  • Input Column: 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history[utm_source]
    • Direct Directly copied to the output
    • Output Columns:
      • utm_source: Directly copied
  • Input Column: 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history[utm_medium]
    • Direct Directly copied to the output
    • Output Columns:
      • utm_medium: Directly copied
  • Input Column: 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history[utm_campaign]
    • Direct Directly copied to the output
    • Output Columns:
      • utm_campaign: Directly copied
  • Input Column: 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history[utm_content]
    • Direct Directly copied to the output
    • Output Columns:
      • utm_content: Directly copied
  • Input Column: 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history[utm_term]
    • Direct Directly copied to the output
    • Output Columns:
      • utm_term: Directly copied
Column Lineage
%3 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp impression_tracking_url 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history impression_tracking_url 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f0
243. model.tiktok_ads_source.stg_tiktok_ads__ad_history
  • Input Column: 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp[impression_tracking_url]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • impression_tracking_url: Directly copied
Column Lineage
%3 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp click_tracking_url 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history 243. model.tiktok_ads_source.stg_tiktok_ads__ad_history click_tracking_url 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp:f0->243. model.tiktok_ads_source.stg_tiktok_ads__ad_history:f0
243. model.tiktok_ads_source.stg_tiktok_ads__ad_history
  • Input Column: 244. model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp[click_tracking_url]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • click_tracking_url: Directly copied
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly

This SQL query performs a data type casting and column selection operation on a TikTok ads hourly report table. It starts by selecting all columns from a temporary table, then defines a set of fields with specific data types (mostly numeric and timestamp). Finally, it selects and renames these fields, ensuring consistent data types and structure for the ad report data.

CleaningOther
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_stg_tiktok_ads.stg_tiktok_ads__ad_report_hourly_tmp
), fields AS (
  SELECT
    CAST(NULL AS DECIMAL(28, 6)) AS ad_id,
    CAST(NULL AS FLOAT) AS average_video_play,
    CAST(NULL AS FLOAT) AS average_video_play_per_user,
    CAST(NULL AS DECIMAL(28, 6)) AS clicks,
    CAST(NULL AS DECIMAL(28, 6)) AS comments,
    CAST(NULL AS DECIMAL(28, 6)) AS conversion,
    CAST(NULL AS FLOAT) AS conversion_rate,
    CAST(NULL AS FLOAT) AS cost_per_conversion,
    CAST(NULL AS FLOAT) AS cpc,
    CAST(NULL AS FLOAT) AS cpm,
    CAST(NULL AS FLOAT) AS ctr,
    CAST(NULL AS DECIMAL(28, 6)) AS follows,
    CAST(NULL AS DECIMAL(28, 6)) AS impressions,
    CAST(NULL AS DECIMAL(28, 6)) AS likes,
    CAST(NULL AS DECIMAL(28, 6)) AS profile_visits,
    CAST(NULL AS DECIMAL(28, 6)) AS reach,
    CAST(NULL AS DECIMAL(28, 6)) AS shares,
    CAST(NULL AS DECIMAL(28, 6)) AS spend,
    CAST(NULL AS TIMESTAMP) AS stat_time_hour,
    CAST(NULL AS DECIMAL(28, 6)) AS video_play_actions,
    CAST(NULL AS DECIMAL(28, 6)) AS video_views_p_25,
    CAST(NULL AS DECIMAL(28, 6)) AS video_views_p_50,
    CAST(NULL AS DECIMAL(28, 6)) AS video_views_p_75,
    CAST(NULL AS DECIMAL(28, 6)) AS video_watched_2_s,
    CAST(NULL AS DECIMAL(28, 6)) AS video_watched_6_s,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    ad_id,
    CAST(stat_time_hour AS TIMESTAMP) AS stat_time_hour,
    cpc,
    cpm,
    ctr,
    impressions,
    clicks,
    spend,
    reach,
    conversion,
    cost_per_conversion,
    conversion_rate,
    likes,
    comments,
    shares,
    profile_visits,
    follows,
    video_play_actions,
    video_watched_2_s,
    video_watched_6_s,
    video_views_p_25,
    video_views_p_50,
    video_views_p_75,
    average_video_play,
    average_video_play_per_user
  FROM fields
)
SELECT
  *
FROM final
%3 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly source_relation ad_id stat_time_hour cost_per_conversion cpc video_play_actions conversion_rate video_views_p_75 video_views_p_50 impressions comments conversion shares clicks cost_per_1000_reached video_views_p_25 reach profile_visits_rate average_video_play average_video_play_per_user profile_visits cpm ctr video_watched_2_s follows video_watched_6_s spend likes 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp ad_id stat_time_hour cost_per_conversion cpc video_play_actions conversion_rate video_views_p_75 video_views_p_50 impressions comments conversion shares clicks video_views_p_25 reach average_video_play profile_visits cpm ctr video_watched_2_s follows video_watched_6_s average_video_play_per_user spend likes 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f1 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f1->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f2 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f2->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f3 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f3->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f4 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f4->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f5 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f5->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f6 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f6->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f7 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f7->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f8 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f8->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f9 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f9->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f10 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f10->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f11 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f11->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f12 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f12->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f13 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f13->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f15 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f14->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f16 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f15->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f18 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f16->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f20 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f17->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f21 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f18->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f22 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f19->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f23 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f20->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f24 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f21->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f25 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f22->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f19 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f23->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f26 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f24->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f27
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
ad_id integer Ad id
stat_time_hour timestamp without time zone Hour of activity
cost_per_conversion double precision The average amount of money you've spent on a conversion. (The total count is calculated based on the time each ad impression occurred.)
cpc double precision The average amount of money you've spent on a click.
video_play_actions integer The number of times your video starts to play. Replays will not be counted.
conversion_rate integer The percentage of results you received out of all the clicks of your ads. (The total count is calculated based on the time each ad impression occurred.)
video_views_p_75 integer The number of times your video was played at 75% of its length. Replays will not be counted.
video_views_p_50 integer The number of times your video was played at 50% of its length. Replays will not be counted.
impressions integer The number of times your ads were on screen.
comments integer The number of comments your video creative received within 1 day of a user seeing a paid ad.
conversion integer The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)
shares integer The number of shares your video creative received within 1 day of a user seeing a paid ad.
clicks integer The number of clicks on your ads.
cost_per_1000_reached None The average cost to reach 1,000 unique users. This metric is estimated.
video_views_p_25 integer The number of times your video was played at 25% of its length. Replays will not be counted.
reach integer The number of unique users who saw your ads at least once. This metric is estimated.
profile_visits_rate None The rate of profile visits per impression the paid ad drove during the campaign. This metric is only for Boosted TikToks.
average_video_play double precision The average time your video was played per single video view, including any time spent replaying the video.
average_video_play_per_user integer The average time per user your video was played per single video view, including any time spent replaying the video.
profile_visits integer The number of profile visits the ad drove during the campaign. This metric is only for Boosted TikToks.
cpm double precision The average amount of money you've spent per 1,000 impressions.
ctr double precision The percentage of times people saw your ad and performed a click.
video_watched_2_s integer The number of times your video played for at least 2 seconds. Replays will not be counted.
follows integer The number of new followers that were gained within 1 day of a user seeing a paid ad. This metric is only for Boosted TikToks.
video_watched_6_s integer The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.
spend double precision The estimated total amount of money you've spent on your campaign, ad group or ad during its schedule.
likes integer The number of likes your video creative received within 1 day of a user seeing a paid ad.
Column Lineage
%3 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly source_relation 236. model.tiktok_ads.tiktok_ads__advertiser_report 236. model.tiktok_ads.tiktok_ads__advertiser_report source_relation 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f0 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report source_relation 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report source_relation 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with other tables
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
236. model.tiktok_ads.tiktok_ads__advertiser_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with other tables
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[source_relation]
    • Direct The column is directly copied without transformation
    • Integration Used as part of the join condition with other tables
    • Aggregation Part of the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to output
Column Lineage
%3 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp ad_id 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly ad_id 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report ad_id 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report ad_id 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[ad_id]
    • Cleaning The column is cast to DECIMAL(28, 6)
    • Output Columns:
      • ad_id: Directly copied after casting
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[ad_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with the ads table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • ad_id: Directly copied to the output
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[ad_id]
    • Direct The column is directly copied without transformation
    • Integration Used as the key to join with the ads table
    • Aggregation Part of the GROUP BY clause
    • Output Columns:
      • ad_id: Directly copied to output
Column Lineage
%3 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp stat_time_hour 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly stat_time_hour 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0 236. model.tiktok_ads.tiktok_ads__advertiser_report 236. model.tiktok_ads.tiktok_ads__advertiser_report date_day 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f0 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report date_day 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report date_day 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[stat_time_hour]
    • Cleaning The column is cast to TIMESTAMP
    • Output Columns:
      • stat_time_hour: Directly copied after casting
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[stat_time_hour]
    • Cleaning Cast to DATE type
    • Aggregation Included in the GROUP BY clause after transformation
    • Output Columns:
      • date_day: Transformed and mapped to this output column
236. model.tiktok_ads.tiktok_ads__advertiser_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[stat_time_hour]
    • Cleaning Cast to DATE type
    • Aggregation Used in the GROUP BY clause after transformation
    • Output Columns:
      • date_day: Transformed and mapped to this output column
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[stat_time_hour]
    • Cleaning Cast to DATE type
    • Aggregation Part of the GROUP BY clause
    • Output Columns:
      • date_day: Transformed and mapped to this output column
Column Lineage
%3 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp cost_per_conversion 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly cost_per_conversion 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[cost_per_conversion]
    • Cleaning The column is cast to FLOAT
    • Output Columns:
      • cost_per_conversion: Directly copied after casting
Column Lineage
%3 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp cpc 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly cpc 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[cpc]
    • Cleaning The column is cast to FLOAT
    • Output Columns:
      • cpc: Directly copied after casting
Column Lineage
%3 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp video_play_actions 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly video_play_actions 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[video_play_actions]
    • Cleaning The column is cast to DECIMAL(28, 6)
    • Output Columns:
      • video_play_actions: Directly copied after casting
Column Lineage
%3 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp conversion_rate 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly conversion_rate 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[conversion_rate]
    • Cleaning The column is cast to FLOAT
    • Output Columns:
      • conversion_rate: Directly copied after casting
Column Lineage
%3 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp video_views_p_75 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly video_views_p_75 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0 236. model.tiktok_ads.tiktok_ads__advertiser_report 236. model.tiktok_ads.tiktok_ads__advertiser_report video_views_p_75 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f0 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report video_views_p_75 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report video_views_p_75 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[video_views_p_75]
    • Cleaning The column is cast to DECIMAL(28, 6)
    • Output Columns:
      • video_views_p_75: Directly copied after casting
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[video_views_p_75]
    • Aggregation Summed up in the SELECT clause
    • Output Columns:
      • video_views_p_75: Aggregated into this output column
236. model.tiktok_ads.tiktok_ads__advertiser_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[video_views_p_75]
    • Aggregation Summed up in the SELECT clause
    • Output Columns:
      • video_views_p_75: Aggregated and mapped to this output column
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[video_views_p_75]
    • Aggregation Summed up in the SELECT clause
    • Output Columns:
      • video_views_p_75: Aggregated sum in the output
Column Lineage
%3 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp video_views_p_50 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly video_views_p_50 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0 236. model.tiktok_ads.tiktok_ads__advertiser_report 236. model.tiktok_ads.tiktok_ads__advertiser_report video_views_p_50 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f0 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report video_views_p_50 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report video_views_p_50 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[video_views_p_50]
    • Cleaning The column is cast to DECIMAL(28, 6)
    • Output Columns:
      • video_views_p_50: Directly copied after casting
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[video_views_p_50]
    • Aggregation Summed up in the SELECT clause
    • Output Columns:
      • video_views_p_50: Aggregated into this output column
236. model.tiktok_ads.tiktok_ads__advertiser_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[video_views_p_50]
    • Aggregation Summed up in the SELECT clause
    • Output Columns:
      • video_views_p_50: Aggregated and mapped to this output column
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[video_views_p_50]
    • Aggregation Summed up in the SELECT clause
    • Output Columns:
      • video_views_p_50: Aggregated sum in the output
Column Lineage
%3 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp impressions 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly impressions 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0 236. model.tiktok_ads.tiktok_ads__advertiser_report 236. model.tiktok_ads.tiktok_ads__advertiser_report daily_cpm daily_ctr impressions 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f2 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f0 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f1 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report daily_cpm daily_ctr impressions 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->238. model.tiktok_ads.tiktok_ads__url_report:f2 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->238. model.tiktok_ads.tiktok_ads__url_report:f1 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report daily_cpm daily_ctr impressions 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f2 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f1
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[impressions]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistent data type
    • Direct The column is directly copied to the output
    • Output Columns:
      • impressions: Directly mapped after casting
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[impressions]
    • Aggregation Summed up in the SELECT clause
    • Other Used in calculations for daily_cpm and daily_ctr
    • Output Columns:
      • impressions: Aggregated into this output column
      • daily_cpm: Used in calculation
      • daily_ctr: Used in calculation
236. model.tiktok_ads.tiktok_ads__advertiser_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[impressions]
    • Aggregation Summed up in the SELECT clause
    • Other Used in calculations for daily_cpm and daily_ctr
    • Output Columns:
      • impressions: Aggregated and mapped to this output column
      • daily_cpm: Used in calculation
      • daily_ctr: Used in calculation
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[impressions]
    • Aggregation Summed up in the SELECT clause
    • Featurization Used to calculate daily_cpm and daily_ctr
    • Output Columns:
      • impressions: Aggregated sum in the output
      • daily_cpm: Part of the calculation
      • daily_ctr: Part of the calculation
Column Lineage
%3 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp comments 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly comments 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0 236. model.tiktok_ads.tiktok_ads__advertiser_report 236. model.tiktok_ads.tiktok_ads__advertiser_report comments 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f0 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report comments 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report comments 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[comments]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistent data type
    • Direct The column is directly copied to the output
    • Output Columns:
      • comments: Directly mapped after casting
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[comments]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • comments: Directly mapped after aggregation
236. model.tiktok_ads.tiktok_ads__advertiser_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[comments]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • comments: Directly mapped after aggregation
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[comments]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • comments: Directly mapped after aggregation
Column Lineage
%3 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp conversion 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly conversion 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0 236. model.tiktok_ads.tiktok_ads__advertiser_report 236. model.tiktok_ads.tiktok_ads__advertiser_report conversion 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f0 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report conversion 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report conversion 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[conversion]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistent data type
    • Direct The column is directly copied to the output
    • Output Columns:
      • conversion: Directly mapped after casting
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[conversion]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • conversion: Directly mapped after aggregation
236. model.tiktok_ads.tiktok_ads__advertiser_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[conversion]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • conversion: Directly mapped after aggregation
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[conversion]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • conversion: Directly mapped after aggregation
Column Lineage
%3 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp shares 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly shares 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0 236. model.tiktok_ads.tiktok_ads__advertiser_report 236. model.tiktok_ads.tiktok_ads__advertiser_report shares 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f0 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report shares 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report shares 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[shares]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistent data type
    • Direct The column is directly copied to the output
    • Output Columns:
      • shares: Directly mapped after casting
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[shares]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • shares: Directly mapped after aggregation
236. model.tiktok_ads.tiktok_ads__advertiser_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[shares]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • shares: Directly mapped after aggregation
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[shares]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • shares: Directly mapped after aggregation
Column Lineage
%3 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp clicks 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly clicks 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0 236. model.tiktok_ads.tiktok_ads__advertiser_report 236. model.tiktok_ads.tiktok_ads__advertiser_report clicks daily_cpc daily_ctr 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f0 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f1 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f2 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report clicks daily_cpc daily_ctr 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->238. model.tiktok_ads.tiktok_ads__url_report:f1 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->238. model.tiktok_ads.tiktok_ads__url_report:f2 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report clicks daily_cpc daily_ctr 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f1 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f2
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[clicks]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistent data type
    • Output Columns:
      • clicks: Directly mapped after casting
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[clicks]
    • Aggregation The column is summed up in the aggregated CTE
    • Other Used in calculation of daily_cpc and daily_ctr
    • Output Columns:
      • clicks: Directly mapped after aggregation
      • daily_cpc: Used in calculation
      • daily_ctr: Used in calculation
236. model.tiktok_ads.tiktok_ads__advertiser_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[clicks]
    • Aggregation The column is summed up in the GROUP BY clause
    • Featurization Used in calculating daily_cpc and daily_ctr
    • Output Columns:
      • clicks: Directly mapped after aggregation
      • daily_cpc: Used in calculation
      • daily_ctr: Used in calculation
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[clicks]
    • Aggregation The column is summed up in the GROUP BY clause
    • Other Used in calculations for derived metrics (daily_cpc, daily_ctr)
    • Output Columns:
      • clicks: Directly mapped after aggregation
      • daily_cpc: Used in calculation
      • daily_ctr: Used in calculation
Column Lineage
%3 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp video_views_p_25 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly video_views_p_25 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0 236. model.tiktok_ads.tiktok_ads__advertiser_report 236. model.tiktok_ads.tiktok_ads__advertiser_report video_views_p_25 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f0 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report video_views_p_25 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report video_views_p_25 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[video_views_p_25]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistent data type
    • Output Columns:
      • video_views_p_25: Directly mapped after casting
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[video_views_p_25]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • video_views_p_25: Directly mapped after aggregation
236. model.tiktok_ads.tiktok_ads__advertiser_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[video_views_p_25]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • video_views_p_25: Directly mapped after aggregation
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[video_views_p_25]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • video_views_p_25: Directly mapped after aggregation
Column Lineage
%3 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp reach 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly reach 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0 236. model.tiktok_ads.tiktok_ads__advertiser_report 236. model.tiktok_ads.tiktok_ads__advertiser_report reach 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f0 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report reach 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report reach 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[reach]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistent data type
    • Output Columns:
      • reach: Directly mapped after casting
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[reach]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • reach: Directly mapped after aggregation
236. model.tiktok_ads.tiktok_ads__advertiser_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[reach]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • reach: Directly mapped after aggregation
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[reach]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • reach: Directly mapped after aggregation
Column Lineage
%3 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp average_video_play 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly average_video_play 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[average_video_play]
    • Cleaning The column is cast to FLOAT for consistent data type
    • Output Columns:
      • average_video_play: Directly mapped after casting
Column Lineage
%3 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp average_video_play_per_user 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly average_video_play_per_user 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[average_video_play_per_user]
    • Cleaning The column is cast to FLOAT for consistency
    • Output Columns:
      • average_video_play_per_user: Directly mapped after casting
Column Lineage
%3 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp profile_visits 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly profile_visits 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0 236. model.tiktok_ads.tiktok_ads__advertiser_report 236. model.tiktok_ads.tiktok_ads__advertiser_report profile_visits 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f0 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report profile_visits 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report profile_visits 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[profile_visits]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistent data type
    • Output Columns:
      • profile_visits: Directly mapped after casting
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[profile_visits]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • profile_visits: Directly mapped after aggregation
236. model.tiktok_ads.tiktok_ads__advertiser_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[profile_visits]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • profile_visits: Directly mapped after aggregation
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[profile_visits]
    • Aggregation This column is summed up in the aggregated CTE
    • Output Columns:
      • profile_visits: Directly mapped after aggregation
Column Lineage
%3 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp cpm 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly cpm 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[cpm]
    • Cleaning The column is cast to FLOAT for consistent data type
    • Output Columns:
      • cpm: Directly mapped after casting
Column Lineage
%3 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp ctr 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly ctr 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[ctr]
    • Cleaning The column is cast to FLOAT for consistent data type
    • Output Columns:
      • ctr: Directly mapped after casting
Column Lineage
%3 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp video_watched_2_s 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly video_watched_2_s 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0 236. model.tiktok_ads.tiktok_ads__advertiser_report 236. model.tiktok_ads.tiktok_ads__advertiser_report video_watched_2_s 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f0 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report video_watched_2_s 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report video_watched_2_s 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[video_watched_2_s]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistency
    • Output Columns:
      • video_watched_2_s: Directly mapped after casting
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[video_watched_2_s]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • video_watched_2_s: Directly mapped after aggregation
236. model.tiktok_ads.tiktok_ads__advertiser_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[video_watched_2_s]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • video_watched_2_s: Directly mapped after aggregation
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[video_watched_2_s]
    • Aggregation This column is summed up in the aggregated CTE
    • Output Columns:
      • video_watched_2_s: Directly mapped after aggregation
Column Lineage
%3 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp follows 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly follows 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0 236. model.tiktok_ads.tiktok_ads__advertiser_report 236. model.tiktok_ads.tiktok_ads__advertiser_report follows 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f0 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report follows 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report follows 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[follows]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistency
    • Output Columns:
      • follows: Directly mapped after casting
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[follows]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • follows: Directly mapped after aggregation
236. model.tiktok_ads.tiktok_ads__advertiser_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[follows]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • follows: Directly mapped after aggregation
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[follows]
    • Aggregation This column is summed up in the aggregated CTE
    • Output Columns:
      • follows: Directly mapped after aggregation
Column Lineage
%3 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp video_watched_6_s 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly video_watched_6_s 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0 236. model.tiktok_ads.tiktok_ads__advertiser_report 236. model.tiktok_ads.tiktok_ads__advertiser_report video_watched_6_s 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f0 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report video_watched_6_s 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report video_watched_6_s 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[video_watched_6_s]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistency
    • Output Columns:
      • video_watched_6_s: Directly mapped after casting
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[video_watched_6_s]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • video_watched_6_s: Directly mapped after aggregation
236. model.tiktok_ads.tiktok_ads__advertiser_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[video_watched_6_s]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • video_watched_6_s: Directly mapped after aggregation
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[video_watched_6_s]
    • Aggregation This column is summed up in the aggregated CTE
    • Output Columns:
      • video_watched_6_s: Directly mapped after aggregation
Column Lineage
%3 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp spend 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly spend 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0 236. model.tiktok_ads.tiktok_ads__advertiser_report 236. model.tiktok_ads.tiktok_ads__advertiser_report daily_cpc daily_cpm spend 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f2 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f0 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f1 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report daily_cpc daily_cpm spend 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->238. model.tiktok_ads.tiktok_ads__url_report:f2 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->238. model.tiktok_ads.tiktok_ads__url_report:f1 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report daily_cpc daily_cpm spend 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f2 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f1
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[spend]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistency
    • Output Columns:
      • spend: Directly mapped after casting
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[spend]
    • Aggregation The column is summed up in the aggregated CTE
    • Other Used in calculations for daily_cpc and daily_cpm
    • Output Columns:
      • spend: Directly mapped after aggregation
      • daily_cpc: Used in calculation
      • daily_cpm: Used in calculation
236. model.tiktok_ads.tiktok_ads__advertiser_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[spend]
    • Aggregation The column is summed up in the GROUP BY clause
    • Other Used in calculations for daily_cpc and daily_cpm
    • Output Columns:
      • spend: Directly mapped after aggregation
      • daily_cpc: Used in calculation
      • daily_cpm: Used in calculation
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[spend]
    • Aggregation This column is summed up in the aggregated CTE
    • Other Used in calculations for daily_cpc and daily_cpm
    • Output Columns:
      • spend: Directly mapped after aggregation
      • daily_cpc: Used in calculation
      • daily_cpm: Used in calculation
Column Lineage
%3 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp likes 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly likes 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0 236. model.tiktok_ads.tiktok_ads__advertiser_report 236. model.tiktok_ads.tiktok_ads__advertiser_report likes 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f0 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report likes 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report likes 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[likes]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistency
    • Output Columns:
      • likes: Directly mapped after casting
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[likes]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • likes: Directly mapped after aggregation
236. model.tiktok_ads.tiktok_ads__advertiser_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[likes]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • likes: Directly mapped after aggregation
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[likes]
    • Aggregation This column is summed up in the aggregated CTE
    • Output Columns:
      • likes: Directly mapped after aggregation
246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of type TEXT, which is set to NULL. The query is limited to 0 rows, effectively creating a schema-only representation of the table without any actual data.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp ad_id stat_time_hour cost_per_conversion real_time_conversion cpc video_play_actions conversion_rate video_views_p_75 result video_views_p_50 impressions comments real_time_cost_per_result conversion real_time_result video_views_p_100 shares real_time_conversion_rate cost_per_secondary_goal_result secondary_goal_result_rate clicks cost_per_1000_reached video_views_p_25 reach real_time_cost_per_conversion profile_visits_rate average_video_play profile_visits cpm ctr video_watched_2_s follows result_rate video_watched_6_s secondary_goal_result cost_per_result average_video_play_per_user real_time_result_rate spend likes _fivetran_synced 361. source.tiktok_ads_source.tiktok_ads.ad_report_hourly 361. source.tiktok_ads_source.tiktok_ads.ad_report_hourly
Name Type Comment
ad_id integer None
stat_time_hour timestamp without time zone None
cost_per_conversion double precision None
real_time_conversion integer None
cpc double precision None
video_play_actions integer None
conversion_rate integer None
video_views_p_75 integer None
result integer None
video_views_p_50 integer None
impressions integer None
comments integer None
real_time_cost_per_result double precision None
conversion integer None
real_time_result integer None
video_views_p_100 integer None
shares integer None
real_time_conversion_rate integer None
cost_per_secondary_goal_result text None
secondary_goal_result_rate text None
clicks integer None
cost_per_1000_reached integer None
video_views_p_25 integer None
reach integer None
real_time_cost_per_conversion double precision None
profile_visits_rate integer None
average_video_play double precision None
profile_visits integer None
cpm double precision None
ctr double precision None
video_watched_2_s integer None
follows integer None
result_rate integer None
video_watched_6_s integer None
secondary_goal_result text None
cost_per_result double precision None
average_video_play_per_user integer None
real_time_result_rate integer None
spend double precision None
likes integer None
_fivetran_synced text None
Column Lineage
%3 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp ad_id 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly ad_id 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report ad_id 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report ad_id 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[ad_id]
    • Cleaning The column is cast to DECIMAL(28, 6)
    • Output Columns:
      • ad_id: Directly copied after casting
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[ad_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with the ads table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • ad_id: Directly copied to the output
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[ad_id]
    • Direct The column is directly copied without transformation
    • Integration Used as the key to join with the ads table
    • Aggregation Part of the GROUP BY clause
    • Output Columns:
      • ad_id: Directly copied to output
Column Lineage
%3 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp stat_time_hour 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly stat_time_hour 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0 236. model.tiktok_ads.tiktok_ads__advertiser_report 236. model.tiktok_ads.tiktok_ads__advertiser_report date_day 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f0 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report date_day 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report date_day 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[stat_time_hour]
    • Cleaning The column is cast to TIMESTAMP
    • Output Columns:
      • stat_time_hour: Directly copied after casting
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[stat_time_hour]
    • Cleaning Cast to DATE type
    • Aggregation Included in the GROUP BY clause after transformation
    • Output Columns:
      • date_day: Transformed and mapped to this output column
236. model.tiktok_ads.tiktok_ads__advertiser_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[stat_time_hour]
    • Cleaning Cast to DATE type
    • Aggregation Used in the GROUP BY clause after transformation
    • Output Columns:
      • date_day: Transformed and mapped to this output column
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[stat_time_hour]
    • Cleaning Cast to DATE type
    • Aggregation Part of the GROUP BY clause
    • Output Columns:
      • date_day: Transformed and mapped to this output column
Column Lineage
%3 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp cost_per_conversion 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly cost_per_conversion 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[cost_per_conversion]
    • Cleaning The column is cast to FLOAT
    • Output Columns:
      • cost_per_conversion: Directly copied after casting
Column Lineage
%3 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp cpc 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly cpc 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[cpc]
    • Cleaning The column is cast to FLOAT
    • Output Columns:
      • cpc: Directly copied after casting
Column Lineage
%3 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp video_play_actions 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly video_play_actions 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[video_play_actions]
    • Cleaning The column is cast to DECIMAL(28, 6)
    • Output Columns:
      • video_play_actions: Directly copied after casting
Column Lineage
%3 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp conversion_rate 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly conversion_rate 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[conversion_rate]
    • Cleaning The column is cast to FLOAT
    • Output Columns:
      • conversion_rate: Directly copied after casting
Column Lineage
%3 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp video_views_p_75 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly video_views_p_75 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0 236. model.tiktok_ads.tiktok_ads__advertiser_report 236. model.tiktok_ads.tiktok_ads__advertiser_report video_views_p_75 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f0 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report video_views_p_75 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report video_views_p_75 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[video_views_p_75]
    • Cleaning The column is cast to DECIMAL(28, 6)
    • Output Columns:
      • video_views_p_75: Directly copied after casting
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[video_views_p_75]
    • Aggregation Summed up in the SELECT clause
    • Output Columns:
      • video_views_p_75: Aggregated into this output column
236. model.tiktok_ads.tiktok_ads__advertiser_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[video_views_p_75]
    • Aggregation Summed up in the SELECT clause
    • Output Columns:
      • video_views_p_75: Aggregated and mapped to this output column
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[video_views_p_75]
    • Aggregation Summed up in the SELECT clause
    • Output Columns:
      • video_views_p_75: Aggregated sum in the output
Column Lineage
%3 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp video_views_p_50 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly video_views_p_50 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0 236. model.tiktok_ads.tiktok_ads__advertiser_report 236. model.tiktok_ads.tiktok_ads__advertiser_report video_views_p_50 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f0 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report video_views_p_50 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report video_views_p_50 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[video_views_p_50]
    • Cleaning The column is cast to DECIMAL(28, 6)
    • Output Columns:
      • video_views_p_50: Directly copied after casting
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[video_views_p_50]
    • Aggregation Summed up in the SELECT clause
    • Output Columns:
      • video_views_p_50: Aggregated into this output column
236. model.tiktok_ads.tiktok_ads__advertiser_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[video_views_p_50]
    • Aggregation Summed up in the SELECT clause
    • Output Columns:
      • video_views_p_50: Aggregated and mapped to this output column
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[video_views_p_50]
    • Aggregation Summed up in the SELECT clause
    • Output Columns:
      • video_views_p_50: Aggregated sum in the output
Column Lineage
%3 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp impressions 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly impressions 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0 236. model.tiktok_ads.tiktok_ads__advertiser_report 236. model.tiktok_ads.tiktok_ads__advertiser_report daily_cpm daily_ctr impressions 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f2 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f0 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f1 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report daily_cpm daily_ctr impressions 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->238. model.tiktok_ads.tiktok_ads__url_report:f2 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->238. model.tiktok_ads.tiktok_ads__url_report:f1 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report daily_cpm daily_ctr impressions 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f2 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f1
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[impressions]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistent data type
    • Direct The column is directly copied to the output
    • Output Columns:
      • impressions: Directly mapped after casting
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[impressions]
    • Aggregation Summed up in the SELECT clause
    • Other Used in calculations for daily_cpm and daily_ctr
    • Output Columns:
      • impressions: Aggregated into this output column
      • daily_cpm: Used in calculation
      • daily_ctr: Used in calculation
236. model.tiktok_ads.tiktok_ads__advertiser_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[impressions]
    • Aggregation Summed up in the SELECT clause
    • Other Used in calculations for daily_cpm and daily_ctr
    • Output Columns:
      • impressions: Aggregated and mapped to this output column
      • daily_cpm: Used in calculation
      • daily_ctr: Used in calculation
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[impressions]
    • Aggregation Summed up in the SELECT clause
    • Featurization Used to calculate daily_cpm and daily_ctr
    • Output Columns:
      • impressions: Aggregated sum in the output
      • daily_cpm: Part of the calculation
      • daily_ctr: Part of the calculation
Column Lineage
%3 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp comments 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly comments 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0 236. model.tiktok_ads.tiktok_ads__advertiser_report 236. model.tiktok_ads.tiktok_ads__advertiser_report comments 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f0 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report comments 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report comments 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[comments]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistent data type
    • Direct The column is directly copied to the output
    • Output Columns:
      • comments: Directly mapped after casting
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[comments]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • comments: Directly mapped after aggregation
236. model.tiktok_ads.tiktok_ads__advertiser_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[comments]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • comments: Directly mapped after aggregation
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[comments]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • comments: Directly mapped after aggregation
Column Lineage
%3 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp conversion 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly conversion 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0 236. model.tiktok_ads.tiktok_ads__advertiser_report 236. model.tiktok_ads.tiktok_ads__advertiser_report conversion 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f0 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report conversion 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report conversion 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[conversion]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistent data type
    • Direct The column is directly copied to the output
    • Output Columns:
      • conversion: Directly mapped after casting
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[conversion]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • conversion: Directly mapped after aggregation
236. model.tiktok_ads.tiktok_ads__advertiser_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[conversion]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • conversion: Directly mapped after aggregation
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[conversion]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • conversion: Directly mapped after aggregation
Column Lineage
%3 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp shares 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly shares 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0 236. model.tiktok_ads.tiktok_ads__advertiser_report 236. model.tiktok_ads.tiktok_ads__advertiser_report shares 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f0 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report shares 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report shares 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[shares]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistent data type
    • Direct The column is directly copied to the output
    • Output Columns:
      • shares: Directly mapped after casting
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[shares]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • shares: Directly mapped after aggregation
236. model.tiktok_ads.tiktok_ads__advertiser_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[shares]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • shares: Directly mapped after aggregation
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[shares]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • shares: Directly mapped after aggregation
Column Lineage
%3 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp clicks 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly clicks 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0 236. model.tiktok_ads.tiktok_ads__advertiser_report 236. model.tiktok_ads.tiktok_ads__advertiser_report clicks daily_cpc daily_ctr 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f0 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f1 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f2 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report clicks daily_cpc daily_ctr 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->238. model.tiktok_ads.tiktok_ads__url_report:f1 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->238. model.tiktok_ads.tiktok_ads__url_report:f2 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report clicks daily_cpc daily_ctr 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f1 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f2
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[clicks]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistent data type
    • Output Columns:
      • clicks: Directly mapped after casting
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[clicks]
    • Aggregation The column is summed up in the aggregated CTE
    • Other Used in calculation of daily_cpc and daily_ctr
    • Output Columns:
      • clicks: Directly mapped after aggregation
      • daily_cpc: Used in calculation
      • daily_ctr: Used in calculation
236. model.tiktok_ads.tiktok_ads__advertiser_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[clicks]
    • Aggregation The column is summed up in the GROUP BY clause
    • Featurization Used in calculating daily_cpc and daily_ctr
    • Output Columns:
      • clicks: Directly mapped after aggregation
      • daily_cpc: Used in calculation
      • daily_ctr: Used in calculation
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[clicks]
    • Aggregation The column is summed up in the GROUP BY clause
    • Other Used in calculations for derived metrics (daily_cpc, daily_ctr)
    • Output Columns:
      • clicks: Directly mapped after aggregation
      • daily_cpc: Used in calculation
      • daily_ctr: Used in calculation
Column Lineage
%3 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp video_views_p_25 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly video_views_p_25 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0 236. model.tiktok_ads.tiktok_ads__advertiser_report 236. model.tiktok_ads.tiktok_ads__advertiser_report video_views_p_25 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f0 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report video_views_p_25 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report video_views_p_25 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[video_views_p_25]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistent data type
    • Output Columns:
      • video_views_p_25: Directly mapped after casting
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[video_views_p_25]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • video_views_p_25: Directly mapped after aggregation
236. model.tiktok_ads.tiktok_ads__advertiser_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[video_views_p_25]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • video_views_p_25: Directly mapped after aggregation
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[video_views_p_25]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • video_views_p_25: Directly mapped after aggregation
Column Lineage
%3 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp reach 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly reach 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0 236. model.tiktok_ads.tiktok_ads__advertiser_report 236. model.tiktok_ads.tiktok_ads__advertiser_report reach 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f0 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report reach 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report reach 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[reach]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistent data type
    • Output Columns:
      • reach: Directly mapped after casting
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[reach]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • reach: Directly mapped after aggregation
236. model.tiktok_ads.tiktok_ads__advertiser_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[reach]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • reach: Directly mapped after aggregation
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[reach]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • reach: Directly mapped after aggregation
Column Lineage
%3 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp average_video_play 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly average_video_play 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[average_video_play]
    • Cleaning The column is cast to FLOAT for consistent data type
    • Output Columns:
      • average_video_play: Directly mapped after casting
Column Lineage
%3 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp profile_visits 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly profile_visits 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0 236. model.tiktok_ads.tiktok_ads__advertiser_report 236. model.tiktok_ads.tiktok_ads__advertiser_report profile_visits 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f0 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report profile_visits 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report profile_visits 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[profile_visits]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistent data type
    • Output Columns:
      • profile_visits: Directly mapped after casting
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[profile_visits]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • profile_visits: Directly mapped after aggregation
236. model.tiktok_ads.tiktok_ads__advertiser_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[profile_visits]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • profile_visits: Directly mapped after aggregation
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[profile_visits]
    • Aggregation This column is summed up in the aggregated CTE
    • Output Columns:
      • profile_visits: Directly mapped after aggregation
Column Lineage
%3 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp cpm 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly cpm 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[cpm]
    • Cleaning The column is cast to FLOAT for consistent data type
    • Output Columns:
      • cpm: Directly mapped after casting
Column Lineage
%3 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp ctr 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly ctr 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[ctr]
    • Cleaning The column is cast to FLOAT for consistent data type
    • Output Columns:
      • ctr: Directly mapped after casting
Column Lineage
%3 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp video_watched_2_s 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly video_watched_2_s 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0 236. model.tiktok_ads.tiktok_ads__advertiser_report 236. model.tiktok_ads.tiktok_ads__advertiser_report video_watched_2_s 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f0 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report video_watched_2_s 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report video_watched_2_s 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[video_watched_2_s]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistency
    • Output Columns:
      • video_watched_2_s: Directly mapped after casting
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[video_watched_2_s]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • video_watched_2_s: Directly mapped after aggregation
236. model.tiktok_ads.tiktok_ads__advertiser_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[video_watched_2_s]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • video_watched_2_s: Directly mapped after aggregation
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[video_watched_2_s]
    • Aggregation This column is summed up in the aggregated CTE
    • Output Columns:
      • video_watched_2_s: Directly mapped after aggregation
Column Lineage
%3 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp follows 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly follows 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0 236. model.tiktok_ads.tiktok_ads__advertiser_report 236. model.tiktok_ads.tiktok_ads__advertiser_report follows 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f0 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report follows 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report follows 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[follows]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistency
    • Output Columns:
      • follows: Directly mapped after casting
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[follows]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • follows: Directly mapped after aggregation
236. model.tiktok_ads.tiktok_ads__advertiser_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[follows]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • follows: Directly mapped after aggregation
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[follows]
    • Aggregation This column is summed up in the aggregated CTE
    • Output Columns:
      • follows: Directly mapped after aggregation
Column Lineage
%3 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp video_watched_6_s 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly video_watched_6_s 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0 236. model.tiktok_ads.tiktok_ads__advertiser_report 236. model.tiktok_ads.tiktok_ads__advertiser_report video_watched_6_s 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f0 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report video_watched_6_s 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report video_watched_6_s 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[video_watched_6_s]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistency
    • Output Columns:
      • video_watched_6_s: Directly mapped after casting
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[video_watched_6_s]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • video_watched_6_s: Directly mapped after aggregation
236. model.tiktok_ads.tiktok_ads__advertiser_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[video_watched_6_s]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • video_watched_6_s: Directly mapped after aggregation
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[video_watched_6_s]
    • Aggregation This column is summed up in the aggregated CTE
    • Output Columns:
      • video_watched_6_s: Directly mapped after aggregation
Column Lineage
%3 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp average_video_play_per_user 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly average_video_play_per_user 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[average_video_play_per_user]
    • Cleaning The column is cast to FLOAT for consistency
    • Output Columns:
      • average_video_play_per_user: Directly mapped after casting
Column Lineage
%3 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp spend 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly spend 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0 236. model.tiktok_ads.tiktok_ads__advertiser_report 236. model.tiktok_ads.tiktok_ads__advertiser_report daily_cpc daily_cpm spend 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f2 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f0 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f1 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report daily_cpc daily_cpm spend 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->238. model.tiktok_ads.tiktok_ads__url_report:f2 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->238. model.tiktok_ads.tiktok_ads__url_report:f1 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report daily_cpc daily_cpm spend 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f2 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f1
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[spend]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistency
    • Output Columns:
      • spend: Directly mapped after casting
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[spend]
    • Aggregation The column is summed up in the aggregated CTE
    • Other Used in calculations for daily_cpc and daily_cpm
    • Output Columns:
      • spend: Directly mapped after aggregation
      • daily_cpc: Used in calculation
      • daily_cpm: Used in calculation
236. model.tiktok_ads.tiktok_ads__advertiser_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[spend]
    • Aggregation The column is summed up in the GROUP BY clause
    • Other Used in calculations for daily_cpc and daily_cpm
    • Output Columns:
      • spend: Directly mapped after aggregation
      • daily_cpc: Used in calculation
      • daily_cpm: Used in calculation
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[spend]
    • Aggregation This column is summed up in the aggregated CTE
    • Other Used in calculations for daily_cpc and daily_cpm
    • Output Columns:
      • spend: Directly mapped after aggregation
      • daily_cpc: Used in calculation
      • daily_cpm: Used in calculation
Column Lineage
%3 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp likes 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly likes 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp:f0->245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0 236. model.tiktok_ads.tiktok_ads__advertiser_report 236. model.tiktok_ads.tiktok_ads__advertiser_report likes 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f0 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report likes 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report likes 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0
245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly
  • Input Column: 246. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp[likes]
    • Cleaning The column is cast to DECIMAL(28, 6) for consistency
    • Output Columns:
      • likes: Directly mapped after casting
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[likes]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • likes: Directly mapped after aggregation
236. model.tiktok_ads.tiktok_ads__advertiser_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[likes]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • likes: Directly mapped after aggregation
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 245. model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly[likes]
    • Aggregation This column is summed up in the aggregated CTE
    • Output Columns:
      • likes: Directly mapped after aggregation
247. model.tiktok_ads_source.stg_tiktok_ads__advertiser

This SQL query stages data for a TikTok ads advertiser model. It starts by selecting all columns from a temporary table, then defines a set of fields with specific data types (mostly as NULL or empty string placeholders). Finally, it selects and renames certain fields, and combines some fields using COALESCE to handle potential duplicates or alternatives (e.g., cellphone_number and phone_number).

CleaningFeaturization
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_stg_tiktok_ads.stg_tiktok_ads__advertiser_tmp
), fields AS (
  SELECT
    CAST(NULL AS TEXT) AS address,
    CAST(NULL AS FLOAT) AS balance,
    CAST(NULL AS TEXT) AS cellphone_number,
    CAST(NULL AS TEXT) AS company,
    CAST(NULL AS TEXT) AS contacter,
    CAST(NULL AS TEXT) AS country,
    CAST(NULL AS TEXT) AS currency,
    CAST(NULL AS TEXT) AS description,
    CAST(NULL AS TEXT) AS email,
    CAST(NULL AS DECIMAL(28, 6)) AS id,
    CAST(NULL AS TEXT) AS industry,
    CAST(NULL AS TEXT) AS language,
    CAST(NULL AS TEXT) AS name,
    CAST(NULL AS TEXT) AS phone_number,
    CAST(NULL AS TEXT) AS telephone,
    CAST(NULL AS TEXT) AS telephone_number,
    CAST(NULL AS TEXT) AS timezone,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    id AS advertiser_id,
    address,
    balance,
    company,
    contacter,
    country,
    currency,
    description,
    email,
    industry,
    language,
    name AS advertiser_name,
    COALESCE(cellphone_number, phone_number) AS cellphone_number,
    COALESCE(telephone_number, telephone) AS telephone_number,
    timezone
  FROM fields
)
SELECT
  *
FROM final
%3 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser source_relation advertiser_id address balance company contacter country create_time currency description email industry language license_no license_url advertiser_name cellphone_number telephone_number timezone 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp id name address company contacter country currency description email industry telephone_number timezone balance language cellphone_number 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp:f0->247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f1 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp:f1->247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f15 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp:f2->247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f2 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp:f3->247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f4 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp:f4->247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f5 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp:f5->247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f6 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp:f6->247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f8 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp:f7->247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f9 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp:f8->247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f10 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp:f9->247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f11 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp:f10->247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f17 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp:f11->247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f18 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp:f12->247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f3 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp:f13->247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f12 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp:f14->247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f16
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
advertiser_id integer Advertiser ID
address text Advertiser address information
balance double precision Account available balance
company text Advertiser's company name
contacter integer Contact Person
country text The advertiser's country
create_time None Advertiser's create time
currency text Type of currency used by advertisers
description text Brand description, i.e. promotional content
email text Advertiser contact email, desensitised data
industry integer Advertiser industry category
language text Language used by advertisers
license_no None License number
license_url None License preview address, the link is valid for an hour by default.
advertiser_name text Advertiser name
cellphone_number text Contact mobile number, desensitised data
telephone_number text Fixed phone number, desensitised data
timezone text Ad account time zone including GMT offset
Column Lineage
%3 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser source_relation 236. model.tiktok_ads.tiktok_ads__advertiser_report 236. model.tiktok_ads.tiktok_ads__advertiser_report source_relation 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f0 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report source_relation 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 237. model.tiktok_ads.tiktok_ads__campaign_report 237. model.tiktok_ads.tiktok_ads__campaign_report source_relation 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f0 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report source_relation 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report source_relation 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser[source_relation]
    • Integration Used to join with other tables
    • Direct Directly copied to the output
    • Output Columns:
      • source_relation: Directly copied
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
236. model.tiktok_ads.tiktok_ads__advertiser_report
  • Input Column: 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
237. model.tiktok_ads.tiktok_ads__campaign_report
  • Input Column: 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser[source_relation]
    • Integration The column is used as part of the join condition
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • source_relation: Directly copied to the output
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser[source_relation]
    • Integration used to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
Column Lineage
%3 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp id 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser advertiser_id 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp:f0->247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0 236. model.tiktok_ads.tiktok_ads__advertiser_report 236. model.tiktok_ads.tiktok_ads__advertiser_report advertiser_id 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f0 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report advertiser_id 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 237. model.tiktok_ads.tiktok_ads__campaign_report 237. model.tiktok_ads.tiktok_ads__campaign_report advertiser_id 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f0 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report advertiser_id 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report advertiser_id 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0
247. model.tiktok_ads_source.stg_tiktok_ads__advertiser
  • Input Column: 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp[id]
    • Cleaning The column is cast to DECIMAL(28, 6)
    • Output Columns:
      • advertiser_id: Directly mapped after casting
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser[advertiser_id]
    • Integration Used as a key to join with other tables
    • Direct Directly copied to the output
    • Output Columns:
      • advertiser_id: Directly copied
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser[advertiser_id]
    • Integration used as the key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • advertiser_id: directly copied
236. model.tiktok_ads.tiktok_ads__advertiser_report
  • Input Column: 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser[advertiser_id]
    • Integration used as the key to join with other tables
    • Aggregation used in the GROUP BY clause
    • Output Columns:
      • advertiser_id: directly copied
237. model.tiktok_ads.tiktok_ads__campaign_report
  • Input Column: 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser[advertiser_id]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as the key to join tables
    • Output Columns:
      • advertiser_id: Directly copied to the output
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser[advertiser_id]
    • Integration used to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • advertiser_id: directly copied
Column Lineage
%3 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp address 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser address 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp:f0->247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0
247. model.tiktok_ads_source.stg_tiktok_ads__advertiser
  • Input Column: 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp[address]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • address: Directly mapped
Column Lineage
%3 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp balance 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser balance 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp:f0->247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0
247. model.tiktok_ads_source.stg_tiktok_ads__advertiser
  • Input Column: 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp[balance]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • balance: It is directly mapped to the output 'balance' column
Column Lineage
%3 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp company 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser company 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp:f0->247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0
247. model.tiktok_ads_source.stg_tiktok_ads__advertiser
  • Input Column: 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp[company]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • company: Directly mapped
Column Lineage
%3 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp contacter 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser contacter 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp:f0->247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0
247. model.tiktok_ads_source.stg_tiktok_ads__advertiser
  • Input Column: 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp[contacter]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • contacter: Directly mapped
Column Lineage
%3 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp country 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser country 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp:f0->247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0
247. model.tiktok_ads_source.stg_tiktok_ads__advertiser
  • Input Column: 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp[country]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • country: Directly mapped
Column Lineage
%3 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp currency 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser currency 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp:f0->247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0 236. model.tiktok_ads.tiktok_ads__advertiser_report 236. model.tiktok_ads.tiktok_ads__advertiser_report currency 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f0 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report currency 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 237. model.tiktok_ads.tiktok_ads__campaign_report 237. model.tiktok_ads.tiktok_ads__campaign_report currency 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f0 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report currency 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report currency 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0
247. model.tiktok_ads_source.stg_tiktok_ads__advertiser
  • Input Column: 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp[currency]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • currency: Directly mapped
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser[currency]
    • Direct Directly copied to the output
    • Output Columns:
      • currency: Directly copied
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser[currency]
    • Direct directly copied to the output
    • Output Columns:
      • currency: directly copied
236. model.tiktok_ads.tiktok_ads__advertiser_report
  • Input Column: 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser[currency]
    • Direct directly copied to the output
    • Aggregation used in the GROUP BY clause
    • Output Columns:
      • currency: directly copied
237. model.tiktok_ads.tiktok_ads__campaign_report
  • Input Column: 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser[currency]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • currency: Directly copied to the output
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser[currency]
    • Direct directly copied to the output
    • Output Columns:
      • currency: directly copied
Column Lineage
%3 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp description 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser description 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp:f0->247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0
247. model.tiktok_ads_source.stg_tiktok_ads__advertiser
  • Input Column: 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp[description]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • description: Directly mapped
Column Lineage
%3 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp email 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser email 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp:f0->247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0
247. model.tiktok_ads_source.stg_tiktok_ads__advertiser
  • Input Column: 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp[email]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • email: Directly mapped
Column Lineage
%3 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp industry 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser industry 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp:f0->247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0
247. model.tiktok_ads_source.stg_tiktok_ads__advertiser
  • Input Column: 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp[industry]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • industry: Directly mapped
Column Lineage
%3 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp language 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser language 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp:f0->247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0
247. model.tiktok_ads_source.stg_tiktok_ads__advertiser
  • Input Column: 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp[language]
    • Direct The language column is directly copied without any transformation
    • Output Columns:
      • language: Directly copied to the output 'language' column
Column Lineage
%3 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp name 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser advertiser_name 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp:f0->247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0 236. model.tiktok_ads.tiktok_ads__advertiser_report 236. model.tiktok_ads.tiktok_ads__advertiser_report advertiser_name 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f0 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report advertiser_name 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 237. model.tiktok_ads.tiktok_ads__campaign_report 237. model.tiktok_ads.tiktok_ads__campaign_report advertiser_name 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f0 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report advertiser_name 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report advertiser_name 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0
247. model.tiktok_ads_source.stg_tiktok_ads__advertiser
  • Input Column: 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp[name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • advertiser_name: Directly mapped
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser[advertiser_name]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the ad_groups table
    • Output Columns:
      • advertiser_name: Directly copied to the output
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser[advertiser_name]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition
    • Output Columns:
      • advertiser_name: Directly mapped to this output column
236. model.tiktok_ads.tiktok_ads__advertiser_report
  • Input Column: 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser[advertiser_name]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition
    • Output Columns:
      • advertiser_name: Directly copied to the output
237. model.tiktok_ads.tiktok_ads__campaign_report
  • Input Column: 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser[advertiser_name]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition
    • Output Columns:
      • advertiser_name: Directly copied to the output
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser[advertiser_name]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with other tables
    • Output Columns:
      • advertiser_name: It is directly mapped to the output column 'advertiser_name'
Column Lineage
%3 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp cellphone_number 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser cellphone_number 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp:f0->247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0
247. model.tiktok_ads_source.stg_tiktok_ads__advertiser
  • Input Column: 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp[cellphone_number]
    • Cleaning The cellphone_number is used in a COALESCE function with phone_number
    • Output Columns:
      • cellphone_number: Mapped to the output 'cellphone_number' column through COALESCE(cellphone_number, phone_number)
Column Lineage
%3 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp telephone_number 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser telephone_number 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp:f0->247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0
247. model.tiktok_ads_source.stg_tiktok_ads__advertiser
  • Input Column: 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp[telephone_number]
    • Cleaning The column is cleaned by using COALESCE to handle potential duplicates or alternatives with 'telephone'
    • Output Columns:
      • telephone_number: It is mapped using COALESCE(telephone_number, telephone)
Column Lineage
%3 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp timezone 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser timezone 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp:f0->247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0
247. model.tiktok_ads_source.stg_tiktok_ads__advertiser
  • Input Column: 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp[timezone]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • timezone: It is directly mapped to the output 'timezone' column
248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of type TEXT. It's likely used as a placeholder or template for further development, or to establish a schema without actually populating data.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp id name address company contacter country currency description email industry license_no license_url promotion_area rejected_reason role status telephone_number timezone balance create_time language cellphone_number _fivetran_synced 364. source.tiktok_ads_source.tiktok_ads.advertiser 364. source.tiktok_ads_source.tiktok_ads.advertiser
Name Type Comment
id integer None
name text None
address text None
company text None
contacter integer None
country text None
currency text None
description text None
email text None
industry integer None
license_no integer None
license_url integer None
promotion_area integer None
rejected_reason integer None
role text None
status text None
telephone_number text None
timezone text None
balance double precision None
create_time text None
language text None
cellphone_number text None
_fivetran_synced text None
Column Lineage
%3 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp id 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser advertiser_id 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp:f0->247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0 236. model.tiktok_ads.tiktok_ads__advertiser_report 236. model.tiktok_ads.tiktok_ads__advertiser_report advertiser_id 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f0 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report advertiser_id 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 237. model.tiktok_ads.tiktok_ads__campaign_report 237. model.tiktok_ads.tiktok_ads__campaign_report advertiser_id 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f0 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report advertiser_id 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report advertiser_id 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0
247. model.tiktok_ads_source.stg_tiktok_ads__advertiser
  • Input Column: 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp[id]
    • Cleaning The column is cast to DECIMAL(28, 6)
    • Output Columns:
      • advertiser_id: Directly mapped after casting
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser[advertiser_id]
    • Integration Used as a key to join with other tables
    • Direct Directly copied to the output
    • Output Columns:
      • advertiser_id: Directly copied
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser[advertiser_id]
    • Integration used as the key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • advertiser_id: directly copied
236. model.tiktok_ads.tiktok_ads__advertiser_report
  • Input Column: 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser[advertiser_id]
    • Integration used as the key to join with other tables
    • Aggregation used in the GROUP BY clause
    • Output Columns:
      • advertiser_id: directly copied
237. model.tiktok_ads.tiktok_ads__campaign_report
  • Input Column: 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser[advertiser_id]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as the key to join tables
    • Output Columns:
      • advertiser_id: Directly copied to the output
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser[advertiser_id]
    • Integration used to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • advertiser_id: directly copied
Column Lineage
%3 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp name 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser advertiser_name 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp:f0->247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0 236. model.tiktok_ads.tiktok_ads__advertiser_report 236. model.tiktok_ads.tiktok_ads__advertiser_report advertiser_name 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f0 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report advertiser_name 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 237. model.tiktok_ads.tiktok_ads__campaign_report 237. model.tiktok_ads.tiktok_ads__campaign_report advertiser_name 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f0 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report advertiser_name 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report advertiser_name 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0
247. model.tiktok_ads_source.stg_tiktok_ads__advertiser
  • Input Column: 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp[name]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • advertiser_name: Directly mapped
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser[advertiser_name]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with the ad_groups table
    • Output Columns:
      • advertiser_name: Directly copied to the output
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser[advertiser_name]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition
    • Output Columns:
      • advertiser_name: Directly mapped to this output column
236. model.tiktok_ads.tiktok_ads__advertiser_report
  • Input Column: 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser[advertiser_name]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition
    • Output Columns:
      • advertiser_name: Directly copied to the output
237. model.tiktok_ads.tiktok_ads__campaign_report
  • Input Column: 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser[advertiser_name]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition
    • Output Columns:
      • advertiser_name: Directly copied to the output
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser[advertiser_name]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with other tables
    • Output Columns:
      • advertiser_name: It is directly mapped to the output column 'advertiser_name'
Column Lineage
%3 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp address 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser address 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp:f0->247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0
247. model.tiktok_ads_source.stg_tiktok_ads__advertiser
  • Input Column: 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp[address]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • address: Directly mapped
Column Lineage
%3 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp company 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser company 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp:f0->247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0
247. model.tiktok_ads_source.stg_tiktok_ads__advertiser
  • Input Column: 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp[company]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • company: Directly mapped
Column Lineage
%3 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp contacter 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser contacter 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp:f0->247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0
247. model.tiktok_ads_source.stg_tiktok_ads__advertiser
  • Input Column: 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp[contacter]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • contacter: Directly mapped
Column Lineage
%3 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp country 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser country 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp:f0->247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0
247. model.tiktok_ads_source.stg_tiktok_ads__advertiser
  • Input Column: 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp[country]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • country: Directly mapped
Column Lineage
%3 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp currency 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser currency 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp:f0->247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0 236. model.tiktok_ads.tiktok_ads__advertiser_report 236. model.tiktok_ads.tiktok_ads__advertiser_report currency 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0->236. model.tiktok_ads.tiktok_ads__advertiser_report:f0 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report currency 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 237. model.tiktok_ads.tiktok_ads__campaign_report 237. model.tiktok_ads.tiktok_ads__campaign_report currency 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f0 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report currency 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report currency 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0
247. model.tiktok_ads_source.stg_tiktok_ads__advertiser
  • Input Column: 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp[currency]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • currency: Directly mapped
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser[currency]
    • Direct Directly copied to the output
    • Output Columns:
      • currency: Directly copied
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser[currency]
    • Direct directly copied to the output
    • Output Columns:
      • currency: directly copied
236. model.tiktok_ads.tiktok_ads__advertiser_report
  • Input Column: 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser[currency]
    • Direct directly copied to the output
    • Aggregation used in the GROUP BY clause
    • Output Columns:
      • currency: directly copied
237. model.tiktok_ads.tiktok_ads__campaign_report
  • Input Column: 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser[currency]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • currency: Directly copied to the output
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser[currency]
    • Direct directly copied to the output
    • Output Columns:
      • currency: directly copied
Column Lineage
%3 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp description 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser description 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp:f0->247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0
247. model.tiktok_ads_source.stg_tiktok_ads__advertiser
  • Input Column: 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp[description]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • description: Directly mapped
Column Lineage
%3 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp email 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser email 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp:f0->247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0
247. model.tiktok_ads_source.stg_tiktok_ads__advertiser
  • Input Column: 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp[email]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • email: Directly mapped
Column Lineage
%3 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp industry 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser industry 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp:f0->247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0
247. model.tiktok_ads_source.stg_tiktok_ads__advertiser
  • Input Column: 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp[industry]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • industry: Directly mapped
Column Lineage
%3 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp telephone_number 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser telephone_number 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp:f0->247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0
247. model.tiktok_ads_source.stg_tiktok_ads__advertiser
  • Input Column: 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp[telephone_number]
    • Cleaning The column is cleaned by using COALESCE to handle potential duplicates or alternatives with 'telephone'
    • Output Columns:
      • telephone_number: It is mapped using COALESCE(telephone_number, telephone)
Column Lineage
%3 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp timezone 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser timezone 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp:f0->247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0
247. model.tiktok_ads_source.stg_tiktok_ads__advertiser
  • Input Column: 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp[timezone]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • timezone: It is directly mapped to the output 'timezone' column
Column Lineage
%3 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp balance 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser balance 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp:f0->247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0
247. model.tiktok_ads_source.stg_tiktok_ads__advertiser
  • Input Column: 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp[balance]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • balance: It is directly mapped to the output 'balance' column
Column Lineage
%3 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp language 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser language 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp:f0->247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0
247. model.tiktok_ads_source.stg_tiktok_ads__advertiser
  • Input Column: 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp[language]
    • Direct The language column is directly copied without any transformation
    • Output Columns:
      • language: Directly copied to the output 'language' column
Column Lineage
%3 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp cellphone_number 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser 247. model.tiktok_ads_source.stg_tiktok_ads__advertiser cellphone_number 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp:f0->247. model.tiktok_ads_source.stg_tiktok_ads__advertiser:f0
247. model.tiktok_ads_source.stg_tiktok_ads__advertiser
  • Input Column: 248. model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp[cellphone_number]
    • Cleaning The cellphone_number is used in a COALESCE function with phone_number
    • Output Columns:
      • cellphone_number: Mapped to the output 'cellphone_number' column through COALESCE(cellphone_number, phone_number)
249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history

This SQL query stages data from a temporary table, casts fields to specific data types, and identifies the most recent record for each campaign. It structures the data into a standardized format with specific column names and types, preparing it for further processing or analysis.

CleaningDeduplication
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_stg_tiktok_ads.stg_tiktok_ads__campaign_history_tmp
), fields AS (
  SELECT
    CAST(NULL AS DECIMAL(28, 6)) AS advertiser_id,
    CAST(NULL AS DECIMAL(28, 6)) AS campaign_id,
    CAST(NULL AS TEXT) AS campaign_name,
    CAST(NULL AS TEXT) AS campaign_type,
    CAST(NULL AS TEXT) AS split_test_variable,
    CAST(NULL AS TIMESTAMP) AS updated_at,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    campaign_id,
    CAST(updated_at AS TIMESTAMP) AS updated_at,
    advertiser_id,
    campaign_name,
    campaign_type,
    split_test_variable,
    ROW_NUMBER() OVER (PARTITION BY source_relation, campaign_id ORDER BY updated_at DESC) = 1 AS is_most_recent_record
  FROM fields
)
SELECT
  *
FROM final
%3 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history source_relation campaign_id updated_at advertiser_id campaign_name campaign_type split_test_variable is_most_recent_record 250. model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp 250. model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp updated_at advertiser_id campaign_id 250. model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp:f0->249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history:f2 250. model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp:f1->249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history:f3 250. model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp:f2->249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history:f1
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
campaign_id integer Campaign ID
updated_at timestamp without time zone Time the record was updated.
advertiser_id integer Advertiser ID
campaign_name text Campaign name
campaign_type text Campaign Type, indicates the campaign is a regular campaign or iOS 14 campaign.
split_test_variable text Split Test variables. Optional values; TARGETING, BIDDING_OPTIMIZATION , CREATIVE.
is_most_recent_record boolean Whether record is the most recent one for this particular grain.
Column Lineage
%3 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history source_relation 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report source_relation 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 237. model.tiktok_ads.tiktok_ads__campaign_report 237. model.tiktok_ads.tiktok_ads__campaign_report source_relation 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f0 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report source_relation 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report source_relation 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
237. model.tiktok_ads.tiktok_ads__campaign_report
  • Input Column: 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history[source_relation]
    • Integration used to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history[source_relation]
    • Integration used to join with other tables
    • Aggregation included in the GROUP BY clause
    • Output Columns:
      • source_relation: directly copied to the output
Column Lineage
%3 250. model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp 250. model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp campaign_id 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history campaign_id 250. model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp:f0->249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history:f0 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report campaign_id 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 237. model.tiktok_ads.tiktok_ads__campaign_report 237. model.tiktok_ads.tiktok_ads__campaign_report campaign_id 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f0 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report campaign_id 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report campaign_id 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0
249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history
  • Input Column: 250. model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp[campaign_id]
    • Cleaning Cast as DECIMAL(28, 6) in the fields CTE
    • Direct Copied without transformation from the fields CTE to the final output
    • Deduplication Used in PARTITION BY clause of ROW_NUMBER() function
    • Output Columns:
      • campaign_id: Directly mapped after casting
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history[campaign_id]
    • Integration used as the key to join with the ad_groups table
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history[campaign_id]
    • Integration used as the key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
237. model.tiktok_ads.tiktok_ads__campaign_report
  • Input Column: 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history[campaign_id]
    • Integration used to join with hourly data
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history[campaign_id]
    • Integration used to join with other tables
    • Aggregation included in the GROUP BY clause
    • Output Columns:
      • campaign_id: directly copied to the output
Column Lineage
%3 250. model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp 250. model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp updated_at 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history updated_at 250. model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp:f0->249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history:f0
249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history
  • Input Column: 250. model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp[updated_at]
    • Cleaning The column is cast as TIMESTAMP
    • Deduplication Used in ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • updated_at: Directly mapped after casting to TIMESTAMP
Column Lineage
%3 250. model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp 250. model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp advertiser_id 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history advertiser_id 250. model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp:f0->249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history:f0
249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history
  • Input Column: 250. model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp[advertiser_id]
    • Cleaning Cast as DECIMAL(28, 6) in the fields CTE
    • Direct Copied without transformation from the fields CTE to the final output
    • Output Columns:
      • advertiser_id: Directly mapped after casting
Column Lineage
%3 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history campaign_name 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report campaign_name 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 237. model.tiktok_ads.tiktok_ads__campaign_report 237. model.tiktok_ads.tiktok_ads__campaign_report campaign_name 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f0 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report campaign_name 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report campaign_name 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history[campaign_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_name: directly copied
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history[campaign_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_name: directly copied
237. model.tiktok_ads.tiktok_ads__campaign_report
  • Input Column: 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history[campaign_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_name: directly copied
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history[campaign_name]
    • Aggregation included in the GROUP BY clause
    • Output Columns:
      • campaign_name: directly copied to the output
250. model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of type TEXT. It's likely used as a placeholder or template for further development or testing purposes in a data modeling context.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 250. model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp 250. model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp ad_id updated_at advertiser_id adgroup_id campaign_id create_time ad_name call_to_action secondary_status operation_status ad_text video_id app_name deeplink landing_page_url display_name profile_image_url impression_tracking_url click_tracking_url playable_url is_aco creative_authorized is_new_structure image_ids _fivetran_synced 365. source.tiktok_ads_source.tiktok_ads.campaign_history 365. source.tiktok_ads_source.tiktok_ads.campaign_history
Name Type Comment
ad_id integer None
updated_at text None
advertiser_id integer None
adgroup_id integer None
campaign_id integer None
create_time text None
ad_name text None
call_to_action text None
secondary_status text None
operation_status text None
ad_text text None
video_id text None
app_name integer None
deeplink integer None
landing_page_url text None
display_name text None
profile_image_url integer None
impression_tracking_url integer None
click_tracking_url integer None
playable_url integer None
is_aco boolean None
creative_authorized boolean None
is_new_structure boolean None
image_ids text None
_fivetran_synced text None
Column Lineage
%3 250. model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp 250. model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp updated_at 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history updated_at 250. model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp:f0->249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history:f0
249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history
  • Input Column: 250. model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp[updated_at]
    • Cleaning The column is cast as TIMESTAMP
    • Deduplication Used in ROW_NUMBER() function to identify the most recent record
    • Output Columns:
      • updated_at: Directly mapped after casting to TIMESTAMP
Column Lineage
%3 250. model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp 250. model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp advertiser_id 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history advertiser_id 250. model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp:f0->249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history:f0
249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history
  • Input Column: 250. model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp[advertiser_id]
    • Cleaning Cast as DECIMAL(28, 6) in the fields CTE
    • Direct Copied without transformation from the fields CTE to the final output
    • Output Columns:
      • advertiser_id: Directly mapped after casting
Column Lineage
%3 250. model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp 250. model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp campaign_id 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history campaign_id 250. model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp:f0->249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history:f0 238. model.tiktok_ads.tiktok_ads__url_report 238. model.tiktok_ads.tiktok_ads__url_report campaign_id 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history:f0->238. model.tiktok_ads.tiktok_ads__url_report:f0 237. model.tiktok_ads.tiktok_ads__campaign_report 237. model.tiktok_ads.tiktok_ads__campaign_report campaign_id 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f0 235. model.tiktok_ads.tiktok_ads__ad_report 235. model.tiktok_ads.tiktok_ads__ad_report campaign_id 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history:f0->235. model.tiktok_ads.tiktok_ads__ad_report:f0 234. model.tiktok_ads.tiktok_ads__ad_group_report 234. model.tiktok_ads.tiktok_ads__ad_group_report campaign_id 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history:f0->234. model.tiktok_ads.tiktok_ads__ad_group_report:f0
249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history
  • Input Column: 250. model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp[campaign_id]
    • Cleaning Cast as DECIMAL(28, 6) in the fields CTE
    • Direct Copied without transformation from the fields CTE to the final output
    • Deduplication Used in PARTITION BY clause of ROW_NUMBER() function
    • Output Columns:
      • campaign_id: Directly mapped after casting
234. model.tiktok_ads.tiktok_ads__ad_group_report
  • Input Column: 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history[campaign_id]
    • Integration used as the key to join with the ad_groups table
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
235. model.tiktok_ads.tiktok_ads__ad_report
  • Input Column: 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history[campaign_id]
    • Integration used as the key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
237. model.tiktok_ads.tiktok_ads__campaign_report
  • Input Column: 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history[campaign_id]
    • Integration used to join with hourly data
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
238. model.tiktok_ads.tiktok_ads__url_report
  • Input Column: 249. model.tiktok_ads_source.stg_tiktok_ads__campaign_history[campaign_id]
    • Integration used to join with other tables
    • Aggregation included in the GROUP BY clause
    • Output Columns:
      • campaign_id: directly copied to the output
251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly

This SQL query stages data for a TikTok ads campaign report. It starts by selecting all columns from a temporary table, then defines a set of fields with specific data types and nulls or empty values. Finally, it selects and renames these fields, casting the stat_time_hour to a TIMESTAMP. The query appears to be setting up a structure for data that will be populated later, rather than performing operations on existing data.

CleaningOther
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_stg_tiktok_ads.stg_tiktok_ads__campaign_report_hourly_tmp
), fields AS (
  SELECT
    CAST(NULL AS DECIMAL(28, 6)) AS campaign_id,
    CAST(NULL AS FLOAT) AS average_video_play,
    CAST(NULL AS FLOAT) AS average_video_play_per_user,
    CAST(NULL AS DECIMAL(28, 6)) AS clicks,
    CAST(NULL AS DECIMAL(28, 6)) AS comments,
    CAST(NULL AS DECIMAL(28, 6)) AS conversion,
    CAST(NULL AS FLOAT) AS conversion_rate,
    CAST(NULL AS FLOAT) AS cost_per_conversion,
    CAST(NULL AS FLOAT) AS cpc,
    CAST(NULL AS FLOAT) AS cpm,
    CAST(NULL AS FLOAT) AS ctr,
    CAST(NULL AS DECIMAL(28, 6)) AS follows,
    CAST(NULL AS DECIMAL(28, 6)) AS impressions,
    CAST(NULL AS DECIMAL(28, 6)) AS likes,
    CAST(NULL AS DECIMAL(28, 6)) AS profile_visits,
    CAST(NULL AS DECIMAL(28, 6)) AS reach,
    CAST(NULL AS DECIMAL(28, 6)) AS shares,
    CAST(NULL AS DECIMAL(28, 6)) AS spend,
    CAST(NULL AS TIMESTAMP) AS stat_time_hour,
    CAST(NULL AS DECIMAL(28, 6)) AS video_play_actions,
    CAST(NULL AS DECIMAL(28, 6)) AS video_views_p_25,
    CAST(NULL AS DECIMAL(28, 6)) AS video_views_p_50,
    CAST(NULL AS DECIMAL(28, 6)) AS video_views_p_75,
    CAST(NULL AS DECIMAL(28, 6)) AS video_watched_2_s,
    CAST(NULL AS DECIMAL(28, 6)) AS video_watched_6_s,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    campaign_id,
    CAST(stat_time_hour AS TIMESTAMP) AS stat_time_hour,
    cpc,
    cpm,
    ctr,
    impressions,
    clicks,
    spend,
    reach,
    conversion,
    cost_per_conversion,
    conversion_rate,
    likes,
    comments,
    shares,
    profile_visits,
    follows,
    video_play_actions,
    video_watched_2_s,
    video_watched_6_s,
    video_views_p_25,
    video_views_p_50,
    video_views_p_75,
    average_video_play,
    average_video_play_per_user
  FROM fields
)
SELECT
  *
FROM final
%3 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly source_relation campaign_id stat_time_hour cost_per_conversion cpc video_play_actions conversion_rate video_views_p_75 video_views_p_50 impressions comments conversion shares clicks cost_per_1000_reached video_views_p_25 reach profile_visits_rate average_video_play average_video_play_per_user profile_visits cpm ctr video_watched_2_s follows video_watched_6_s spend likes 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp campaign_id stat_time_hour cost_per_conversion cpc video_play_actions conversion_rate video_views_p_75 video_views_p_50 impressions comments conversion shares clicks video_views_p_25 reach average_video_play profile_visits cpm ctr video_watched_2_s follows video_watched_6_s average_video_play_per_user spend likes 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f0->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f1 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f1->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f2 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f2->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f3 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f3->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f4 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f4->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f5 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f5->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f6 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f6->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f7 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f7->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f8 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f8->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f9 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f9->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f10 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f10->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f11 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f11->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f12 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f12->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f13 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f13->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f15 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f14->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f16 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f15->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f18 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f16->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f20 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f17->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f21 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f18->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f22 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f19->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f23 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f20->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f24 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f21->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f25 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f22->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f19 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f23->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f26 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f24->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f27
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
campaign_id integer Campaign id
stat_time_hour timestamp without time zone Hour of activity
cost_per_conversion double precision The average amount of money you've spent on a conversion. (The total count is calculated based on the time each ad impression occurred.)
cpc double precision The average amount of money you've spent on a click.
video_play_actions integer The number of times your video starts to play. Replays will not be counted.
conversion_rate integer The percentage of results you received out of all the clicks of your ads. (The total count is calculated based on the time each ad impression occurred.)
video_views_p_75 integer The number of times your video was played at 75% of its length. Replays will not be counted.
video_views_p_50 integer The number of times your video was played at 50% of its length. Replays will not be counted.
impressions integer The number of times your ads were on screen.
comments integer The number of comments your video creative received within 1 day of a user seeing a paid ad.
conversion integer The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)
shares integer The number of shares your video creative received within 1 day of a user seeing a paid ad.
clicks integer The number of clicks on your ads.
cost_per_1000_reached None The average cost to reach 1,000 unique users. This metric is estimated.
video_views_p_25 integer The number of times your video was played at 25% of its length. Replays will not be counted.
reach integer The number of unique users who saw your ads at least once. This metric is estimated.
profile_visits_rate None The rate of profile visits per impression the paid ad drove during the campaign. This metric is only for Boosted TikToks.
average_video_play double precision The average time your video was played per single video view, including any time spent replaying the video.
average_video_play_per_user double precision The average time per user your video was played per single video view, including any time spent replaying the video.
profile_visits integer The number of profile visits the ad drove during the campaign. This metric is only for Boosted TikToks.
cpm double precision The average amount of money you've spent per 1,000 impressions.
ctr double precision The percentage of times people saw your ad and performed a click.
video_watched_2_s integer The number of times your video played for at least 2 seconds. Replays will not be counted.
follows integer The number of new followers that were gained within 1 day of a user seeing a paid ad. This metric is only for Boosted TikToks.
video_watched_6_s integer The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.
spend double precision The estimated total amount of money you've spent on your campaign, ad group or ad during its schedule.
likes integer The number of likes your video creative received within 1 day of a user seeing a paid ad.
Column Lineage
%3 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly source_relation 237. model.tiktok_ads.tiktok_ads__campaign_report 237. model.tiktok_ads.tiktok_ads__campaign_report source_relation 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f0
237. model.tiktok_ads.tiktok_ads__campaign_report
  • Input Column: 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly[source_relation]
    • Direct The column is directly used in the SELECT statement
    • Integration Used in joining with other tables
    • Aggregation Used in GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to output
Column Lineage
%3 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp campaign_id 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly campaign_id 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f0->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0 237. model.tiktok_ads.tiktok_ads__campaign_report 237. model.tiktok_ads.tiktok_ads__campaign_report campaign_id 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f0
251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly
  • Input Column: 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp[campaign_id]
    • Cleaning The column is cast to DECIMAL(28, 6)
    • Output Columns:
      • campaign_id: Directly mapped after casting
237. model.tiktok_ads.tiktok_ads__campaign_report
  • Input Column: 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly[campaign_id]
    • Direct The column is directly used in the SELECT statement
    • Integration Used in joining with other tables
    • Aggregation Used in GROUP BY clause
    • Output Columns:
      • campaign_id: Directly copied to output
Column Lineage
%3 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp stat_time_hour 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly stat_time_hour 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f0->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0 237. model.tiktok_ads.tiktok_ads__campaign_report 237. model.tiktok_ads.tiktok_ads__campaign_report date_day 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f0
251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly
  • Input Column: 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp[stat_time_hour]
    • Cleaning The column is cast to TIMESTAMP
    • Output Columns:
      • stat_time_hour: Directly mapped after casting
237. model.tiktok_ads.tiktok_ads__campaign_report
  • Input Column: 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly[stat_time_hour]
    • Cleaning Cast to DATE type
    • Aggregation Used to group data by day
    • Output Columns:
      • date_day: Transformed to date and used as output
Column Lineage
%3 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp cost_per_conversion 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly cost_per_conversion 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f0->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0
251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly
  • Input Column: 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp[cost_per_conversion]
    • Cleaning The column is cast to FLOAT
    • Output Columns:
      • cost_per_conversion: Directly mapped after casting
Column Lineage
%3 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp cpc 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly cpc 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f0->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0
251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly
  • Input Column: 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp[cpc]
    • Cleaning The column is cast to FLOAT
    • Output Columns:
      • cpc: Directly mapped after casting
Column Lineage
%3 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp video_play_actions 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly video_play_actions 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f0->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0
251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly
  • Input Column: 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp[video_play_actions]
    • Cleaning The column is cast to DECIMAL(28, 6)
    • Output Columns:
      • video_play_actions: Directly mapped after casting
Column Lineage
%3 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp conversion_rate 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly conversion_rate 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f0->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0
251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly
  • Input Column: 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp[conversion_rate]
    • Cleaning The column is cast to FLOAT
    • Output Columns:
      • conversion_rate: Directly mapped after casting
Column Lineage
%3 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp video_views_p_75 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly video_views_p_75 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f0->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0 237. model.tiktok_ads.tiktok_ads__campaign_report 237. model.tiktok_ads.tiktok_ads__campaign_report video_views_p_75 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f0
251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly
  • Input Column: 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp[video_views_p_75]
    • Cleaning The column is cast to DECIMAL(28, 6)
    • Output Columns:
      • video_views_p_75: Directly mapped after casting
237. model.tiktok_ads.tiktok_ads__campaign_report
  • Input Column: 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly[video_views_p_75]
    • Aggregation Summed up in the aggregated CTE
    • Output Columns:
      • video_views_p_75: Aggregated sum in output
Column Lineage
%3 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp video_views_p_50 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly video_views_p_50 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f0->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0 237. model.tiktok_ads.tiktok_ads__campaign_report 237. model.tiktok_ads.tiktok_ads__campaign_report video_views_p_50 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f0
251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly
  • Input Column: 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp[video_views_p_50]
    • Cleaning The column is cast to DECIMAL(28, 6)
    • Output Columns:
      • video_views_p_50: Directly mapped after casting
237. model.tiktok_ads.tiktok_ads__campaign_report
  • Input Column: 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly[video_views_p_50]
    • Aggregation Summed up in the aggregated CTE
    • Output Columns:
      • video_views_p_50: Aggregated sum in output
Column Lineage
%3 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp impressions 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly impressions 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f0->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0 237. model.tiktok_ads.tiktok_ads__campaign_report 237. model.tiktok_ads.tiktok_ads__campaign_report daily_cpm daily_ctr impressions 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f2 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f0 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f1
251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly
  • Input Column: 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp[impressions]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as DECIMAL(28, 6)
    • Output Columns:
      • impressions: Directly mapped after casting
237. model.tiktok_ads.tiktok_ads__campaign_report
  • Input Column: 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly[impressions]
    • Aggregation Summed up in the aggregated CTE
    • Other Used in calculating daily_cpm and daily_ctr
    • Output Columns:
      • impressions: Aggregated sum in output
      • daily_cpm: Part of the calculation
      • daily_ctr: Part of the calculation
Column Lineage
%3 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp comments 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly comments 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f0->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0 237. model.tiktok_ads.tiktok_ads__campaign_report 237. model.tiktok_ads.tiktok_ads__campaign_report comments 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f0
251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly
  • Input Column: 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp[comments]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as DECIMAL(28, 6)
    • Output Columns:
      • comments: Directly mapped after casting
237. model.tiktok_ads.tiktok_ads__campaign_report
  • Input Column: 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly[comments]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • comments: Directly mapped after aggregation
Column Lineage
%3 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp conversion 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly conversion 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f0->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0 237. model.tiktok_ads.tiktok_ads__campaign_report 237. model.tiktok_ads.tiktok_ads__campaign_report conversion 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f0
251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly
  • Input Column: 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp[conversion]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as DECIMAL(28, 6)
    • Output Columns:
      • conversion: Directly mapped after casting
237. model.tiktok_ads.tiktok_ads__campaign_report
  • Input Column: 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly[conversion]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • conversion: Directly mapped after aggregation
Column Lineage
%3 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp shares 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly shares 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f0->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0 237. model.tiktok_ads.tiktok_ads__campaign_report 237. model.tiktok_ads.tiktok_ads__campaign_report shares 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f0
251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly
  • Input Column: 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp[shares]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as DECIMAL(28, 6)
    • Output Columns:
      • shares: Directly mapped after casting
237. model.tiktok_ads.tiktok_ads__campaign_report
  • Input Column: 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly[shares]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • shares: Directly mapped after aggregation
Column Lineage
%3 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp clicks 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly clicks 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f0->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0 237. model.tiktok_ads.tiktok_ads__campaign_report 237. model.tiktok_ads.tiktok_ads__campaign_report clicks daily_cpc daily_ctr 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f0 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f1 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f2
251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly
  • Input Column: 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp[clicks]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as DECIMAL(28, 6)
    • Output Columns:
      • clicks: Directly mapped after casting
237. model.tiktok_ads.tiktok_ads__campaign_report
  • Input Column: 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly[clicks]
    • Aggregation The column is summed up in the GROUP BY clause
    • Other Used in calculations for derived metrics (daily_cpc, daily_ctr)
    • Output Columns:
      • clicks: Directly mapped after aggregation
      • daily_cpc: Used in calculation
      • daily_ctr: Used in calculation
Column Lineage
%3 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp video_views_p_25 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly video_views_p_25 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f0->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0 237. model.tiktok_ads.tiktok_ads__campaign_report 237. model.tiktok_ads.tiktok_ads__campaign_report video_views_p_25 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f0
251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly
  • Input Column: 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp[video_views_p_25]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as DECIMAL(28, 6)
    • Output Columns:
      • video_views_p_25: Directly mapped after casting
237. model.tiktok_ads.tiktok_ads__campaign_report
  • Input Column: 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly[video_views_p_25]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • video_views_p_25: Directly mapped after aggregation
Column Lineage
%3 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp reach 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly reach 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f0->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0 237. model.tiktok_ads.tiktok_ads__campaign_report 237. model.tiktok_ads.tiktok_ads__campaign_report reach 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f0
251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly
  • Input Column: 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp[reach]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as DECIMAL(28, 6)
    • Output Columns:
      • reach: Directly mapped after casting
237. model.tiktok_ads.tiktok_ads__campaign_report
  • Input Column: 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly[reach]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • reach: Directly mapped after aggregation
Column Lineage
%3 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp average_video_play 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly average_video_play 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f0->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0
251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly
  • Input Column: 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp[average_video_play]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as FLOAT
    • Output Columns:
      • average_video_play: Directly mapped after casting
Column Lineage
%3 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp average_video_play_per_user 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly average_video_play_per_user 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f0->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0
251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly
  • Input Column: 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp[average_video_play_per_user]
    • Direct This column is directly copied without any transformation
    • Cleaning The column is cast to FLOAT
    • Output Columns:
      • average_video_play_per_user: Directly mapped after casting
Column Lineage
%3 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp profile_visits 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly profile_visits 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f0->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0 237. model.tiktok_ads.tiktok_ads__campaign_report 237. model.tiktok_ads.tiktok_ads__campaign_report profile_visits 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f0
251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly
  • Input Column: 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp[profile_visits]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as DECIMAL(28, 6)
    • Output Columns:
      • profile_visits: Directly mapped after casting
237. model.tiktok_ads.tiktok_ads__campaign_report
  • Input Column: 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly[profile_visits]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • profile_visits: Directly mapped after aggregation
Column Lineage
%3 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp cpm 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly cpm 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f0->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0
251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly
  • Input Column: 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp[cpm]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as FLOAT
    • Output Columns:
      • cpm: Directly mapped after casting
Column Lineage
%3 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp ctr 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly ctr 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f0->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0
251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly
  • Input Column: 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp[ctr]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as FLOAT
    • Output Columns:
      • ctr: Directly mapped after casting
Column Lineage
%3 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp video_watched_2_s 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly video_watched_2_s 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f0->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0 237. model.tiktok_ads.tiktok_ads__campaign_report 237. model.tiktok_ads.tiktok_ads__campaign_report video_watched_2_s 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f0
251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly
  • Input Column: 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp[video_watched_2_s]
    • Direct This column is directly copied without any transformation
    • Cleaning The column is cast to DECIMAL(28, 6)
    • Output Columns:
      • video_watched_2_s: Directly mapped after casting
237. model.tiktok_ads.tiktok_ads__campaign_report
  • Input Column: 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly[video_watched_2_s]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • video_watched_2_s: Directly mapped after aggregation
Column Lineage
%3 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp follows 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly follows 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f0->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0 237. model.tiktok_ads.tiktok_ads__campaign_report 237. model.tiktok_ads.tiktok_ads__campaign_report follows 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f0
251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly
  • Input Column: 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp[follows]
    • Direct This column is directly copied without any transformation
    • Cleaning The column is cast to DECIMAL(28, 6)
    • Output Columns:
      • follows: Directly mapped after casting
237. model.tiktok_ads.tiktok_ads__campaign_report
  • Input Column: 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly[follows]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • follows: Directly mapped after aggregation
Column Lineage
%3 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp video_watched_6_s 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly video_watched_6_s 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f0->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0 237. model.tiktok_ads.tiktok_ads__campaign_report 237. model.tiktok_ads.tiktok_ads__campaign_report video_watched_6_s 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f0
251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly
  • Input Column: 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp[video_watched_6_s]
    • Direct This column is directly copied without any transformation
    • Cleaning The column is cast to DECIMAL(28, 6)
    • Output Columns:
      • video_watched_6_s: Directly mapped after casting
237. model.tiktok_ads.tiktok_ads__campaign_report
  • Input Column: 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly[video_watched_6_s]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • video_watched_6_s: Directly mapped after aggregation
Column Lineage
%3 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp spend 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly spend 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f0->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0 237. model.tiktok_ads.tiktok_ads__campaign_report 237. model.tiktok_ads.tiktok_ads__campaign_report daily_cpc daily_cpm spend 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f2 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f0 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f1
251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly
  • Input Column: 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp[spend]
    • Direct This column is directly copied without any transformation
    • Cleaning The column is cast to DECIMAL(28, 6)
    • Output Columns:
      • spend: Directly mapped after casting
237. model.tiktok_ads.tiktok_ads__campaign_report
  • Input Column: 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly[spend]
    • Aggregation The column is summed up in the aggregated CTE
    • Other Used in calculations for daily_cpc and daily_cpm
    • Output Columns:
      • spend: Directly mapped after aggregation
      • daily_cpc: Used in calculation
      • daily_cpm: Used in calculation
Column Lineage
%3 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp likes 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly likes 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f0->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0 237. model.tiktok_ads.tiktok_ads__campaign_report 237. model.tiktok_ads.tiktok_ads__campaign_report likes 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f0
251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly
  • Input Column: 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp[likes]
    • Direct This column is directly copied without any transformation
    • Cleaning The column is cast to DECIMAL(28, 6)
    • Output Columns:
      • likes: Directly mapped after casting
237. model.tiktok_ads.tiktok_ads__campaign_report
  • Input Column: 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly[likes]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • likes: Directly mapped after aggregation
252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of TEXT data type. It's likely used as a placeholder or template for further development or testing purposes in the dbt (data build tool) framework, specifically for the TikTok ads campaign report hourly staging model.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp campaign_id stat_time_hour cost_per_conversion real_time_conversion cpc video_play_actions conversion_rate video_views_p_75 result video_views_p_50 impressions comments real_time_cost_per_result conversion real_time_result video_views_p_100 shares real_time_conversion_rate cost_per_secondary_goal_result secondary_goal_result_rate clicks cost_per_1000_reached video_views_p_25 reach real_time_cost_per_conversion profile_visits_rate average_video_play profile_visits cpm ctr video_watched_2_s follows result_rate video_watched_6_s secondary_goal_result cost_per_result average_video_play_per_user real_time_result_rate spend likes _fivetran_synced 366. source.tiktok_ads_source.tiktok_ads.campaign_report_hourly 366. source.tiktok_ads_source.tiktok_ads.campaign_report_hourly
Name Type Comment
campaign_id integer None
stat_time_hour timestamp without time zone None
cost_per_conversion double precision None
real_time_conversion integer None
cpc double precision None
video_play_actions integer None
conversion_rate integer None
video_views_p_75 integer None
result integer None
video_views_p_50 integer None
impressions integer None
comments integer None
real_time_cost_per_result double precision None
conversion integer None
real_time_result integer None
video_views_p_100 integer None
shares integer None
real_time_conversion_rate double precision None
cost_per_secondary_goal_result text None
secondary_goal_result_rate text None
clicks integer None
cost_per_1000_reached double precision None
video_views_p_25 integer None
reach integer None
real_time_cost_per_conversion double precision None
profile_visits_rate integer None
average_video_play double precision None
profile_visits integer None
cpm double precision None
ctr double precision None
video_watched_2_s integer None
follows integer None
result_rate double precision None
video_watched_6_s integer None
secondary_goal_result text None
cost_per_result double precision None
average_video_play_per_user double precision None
real_time_result_rate double precision None
spend double precision None
likes integer None
_fivetran_synced text None
Column Lineage
%3 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp campaign_id 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly campaign_id 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f0->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0 237. model.tiktok_ads.tiktok_ads__campaign_report 237. model.tiktok_ads.tiktok_ads__campaign_report campaign_id 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f0
251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly
  • Input Column: 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp[campaign_id]
    • Cleaning The column is cast to DECIMAL(28, 6)
    • Output Columns:
      • campaign_id: Directly mapped after casting
237. model.tiktok_ads.tiktok_ads__campaign_report
  • Input Column: 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly[campaign_id]
    • Direct The column is directly used in the SELECT statement
    • Integration Used in joining with other tables
    • Aggregation Used in GROUP BY clause
    • Output Columns:
      • campaign_id: Directly copied to output
Column Lineage
%3 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp stat_time_hour 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly stat_time_hour 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f0->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0 237. model.tiktok_ads.tiktok_ads__campaign_report 237. model.tiktok_ads.tiktok_ads__campaign_report date_day 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f0
251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly
  • Input Column: 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp[stat_time_hour]
    • Cleaning The column is cast to TIMESTAMP
    • Output Columns:
      • stat_time_hour: Directly mapped after casting
237. model.tiktok_ads.tiktok_ads__campaign_report
  • Input Column: 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly[stat_time_hour]
    • Cleaning Cast to DATE type
    • Aggregation Used to group data by day
    • Output Columns:
      • date_day: Transformed to date and used as output
Column Lineage
%3 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp cost_per_conversion 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly cost_per_conversion 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f0->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0
251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly
  • Input Column: 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp[cost_per_conversion]
    • Cleaning The column is cast to FLOAT
    • Output Columns:
      • cost_per_conversion: Directly mapped after casting
Column Lineage
%3 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp cpc 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly cpc 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f0->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0
251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly
  • Input Column: 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp[cpc]
    • Cleaning The column is cast to FLOAT
    • Output Columns:
      • cpc: Directly mapped after casting
Column Lineage
%3 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp video_play_actions 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly video_play_actions 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f0->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0
251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly
  • Input Column: 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp[video_play_actions]
    • Cleaning The column is cast to DECIMAL(28, 6)
    • Output Columns:
      • video_play_actions: Directly mapped after casting
Column Lineage
%3 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp conversion_rate 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly conversion_rate 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f0->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0
251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly
  • Input Column: 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp[conversion_rate]
    • Cleaning The column is cast to FLOAT
    • Output Columns:
      • conversion_rate: Directly mapped after casting
Column Lineage
%3 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp video_views_p_75 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly video_views_p_75 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f0->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0 237. model.tiktok_ads.tiktok_ads__campaign_report 237. model.tiktok_ads.tiktok_ads__campaign_report video_views_p_75 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f0
251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly
  • Input Column: 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp[video_views_p_75]
    • Cleaning The column is cast to DECIMAL(28, 6)
    • Output Columns:
      • video_views_p_75: Directly mapped after casting
237. model.tiktok_ads.tiktok_ads__campaign_report
  • Input Column: 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly[video_views_p_75]
    • Aggregation Summed up in the aggregated CTE
    • Output Columns:
      • video_views_p_75: Aggregated sum in output
Column Lineage
%3 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp video_views_p_50 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly video_views_p_50 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f0->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0 237. model.tiktok_ads.tiktok_ads__campaign_report 237. model.tiktok_ads.tiktok_ads__campaign_report video_views_p_50 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f0
251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly
  • Input Column: 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp[video_views_p_50]
    • Cleaning The column is cast to DECIMAL(28, 6)
    • Output Columns:
      • video_views_p_50: Directly mapped after casting
237. model.tiktok_ads.tiktok_ads__campaign_report
  • Input Column: 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly[video_views_p_50]
    • Aggregation Summed up in the aggregated CTE
    • Output Columns:
      • video_views_p_50: Aggregated sum in output
Column Lineage
%3 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp impressions 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly impressions 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f0->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0 237. model.tiktok_ads.tiktok_ads__campaign_report 237. model.tiktok_ads.tiktok_ads__campaign_report daily_cpm daily_ctr impressions 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f2 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f0 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f1
251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly
  • Input Column: 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp[impressions]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as DECIMAL(28, 6)
    • Output Columns:
      • impressions: Directly mapped after casting
237. model.tiktok_ads.tiktok_ads__campaign_report
  • Input Column: 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly[impressions]
    • Aggregation Summed up in the aggregated CTE
    • Other Used in calculating daily_cpm and daily_ctr
    • Output Columns:
      • impressions: Aggregated sum in output
      • daily_cpm: Part of the calculation
      • daily_ctr: Part of the calculation
Column Lineage
%3 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp comments 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly comments 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f0->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0 237. model.tiktok_ads.tiktok_ads__campaign_report 237. model.tiktok_ads.tiktok_ads__campaign_report comments 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f0
251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly
  • Input Column: 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp[comments]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as DECIMAL(28, 6)
    • Output Columns:
      • comments: Directly mapped after casting
237. model.tiktok_ads.tiktok_ads__campaign_report
  • Input Column: 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly[comments]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • comments: Directly mapped after aggregation
Column Lineage
%3 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp conversion 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly conversion 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f0->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0 237. model.tiktok_ads.tiktok_ads__campaign_report 237. model.tiktok_ads.tiktok_ads__campaign_report conversion 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f0
251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly
  • Input Column: 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp[conversion]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as DECIMAL(28, 6)
    • Output Columns:
      • conversion: Directly mapped after casting
237. model.tiktok_ads.tiktok_ads__campaign_report
  • Input Column: 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly[conversion]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • conversion: Directly mapped after aggregation
Column Lineage
%3 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp shares 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly shares 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f0->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0 237. model.tiktok_ads.tiktok_ads__campaign_report 237. model.tiktok_ads.tiktok_ads__campaign_report shares 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f0
251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly
  • Input Column: 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp[shares]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as DECIMAL(28, 6)
    • Output Columns:
      • shares: Directly mapped after casting
237. model.tiktok_ads.tiktok_ads__campaign_report
  • Input Column: 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly[shares]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • shares: Directly mapped after aggregation
Column Lineage
%3 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp clicks 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly clicks 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f0->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0 237. model.tiktok_ads.tiktok_ads__campaign_report 237. model.tiktok_ads.tiktok_ads__campaign_report clicks daily_cpc daily_ctr 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f0 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f1 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f2
251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly
  • Input Column: 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp[clicks]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as DECIMAL(28, 6)
    • Output Columns:
      • clicks: Directly mapped after casting
237. model.tiktok_ads.tiktok_ads__campaign_report
  • Input Column: 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly[clicks]
    • Aggregation The column is summed up in the GROUP BY clause
    • Other Used in calculations for derived metrics (daily_cpc, daily_ctr)
    • Output Columns:
      • clicks: Directly mapped after aggregation
      • daily_cpc: Used in calculation
      • daily_ctr: Used in calculation
Column Lineage
%3 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp video_views_p_25 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly video_views_p_25 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f0->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0 237. model.tiktok_ads.tiktok_ads__campaign_report 237. model.tiktok_ads.tiktok_ads__campaign_report video_views_p_25 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f0
251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly
  • Input Column: 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp[video_views_p_25]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as DECIMAL(28, 6)
    • Output Columns:
      • video_views_p_25: Directly mapped after casting
237. model.tiktok_ads.tiktok_ads__campaign_report
  • Input Column: 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly[video_views_p_25]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • video_views_p_25: Directly mapped after aggregation
Column Lineage
%3 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp reach 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly reach 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f0->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0 237. model.tiktok_ads.tiktok_ads__campaign_report 237. model.tiktok_ads.tiktok_ads__campaign_report reach 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f0
251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly
  • Input Column: 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp[reach]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as DECIMAL(28, 6)
    • Output Columns:
      • reach: Directly mapped after casting
237. model.tiktok_ads.tiktok_ads__campaign_report
  • Input Column: 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly[reach]
    • Aggregation The column is summed up in the GROUP BY clause
    • Output Columns:
      • reach: Directly mapped after aggregation
Column Lineage
%3 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp average_video_play 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly average_video_play 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f0->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0
251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly
  • Input Column: 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp[average_video_play]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as FLOAT
    • Output Columns:
      • average_video_play: Directly mapped after casting
Column Lineage
%3 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp profile_visits 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly profile_visits 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f0->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0 237. model.tiktok_ads.tiktok_ads__campaign_report 237. model.tiktok_ads.tiktok_ads__campaign_report profile_visits 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f0
251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly
  • Input Column: 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp[profile_visits]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as DECIMAL(28, 6)
    • Output Columns:
      • profile_visits: Directly mapped after casting
237. model.tiktok_ads.tiktok_ads__campaign_report
  • Input Column: 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly[profile_visits]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • profile_visits: Directly mapped after aggregation
Column Lineage
%3 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp cpm 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly cpm 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f0->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0
251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly
  • Input Column: 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp[cpm]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as FLOAT
    • Output Columns:
      • cpm: Directly mapped after casting
Column Lineage
%3 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp ctr 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly ctr 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f0->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0
251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly
  • Input Column: 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp[ctr]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as FLOAT
    • Output Columns:
      • ctr: Directly mapped after casting
Column Lineage
%3 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp video_watched_2_s 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly video_watched_2_s 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f0->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0 237. model.tiktok_ads.tiktok_ads__campaign_report 237. model.tiktok_ads.tiktok_ads__campaign_report video_watched_2_s 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f0
251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly
  • Input Column: 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp[video_watched_2_s]
    • Direct This column is directly copied without any transformation
    • Cleaning The column is cast to DECIMAL(28, 6)
    • Output Columns:
      • video_watched_2_s: Directly mapped after casting
237. model.tiktok_ads.tiktok_ads__campaign_report
  • Input Column: 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly[video_watched_2_s]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • video_watched_2_s: Directly mapped after aggregation
Column Lineage
%3 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp follows 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly follows 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f0->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0 237. model.tiktok_ads.tiktok_ads__campaign_report 237. model.tiktok_ads.tiktok_ads__campaign_report follows 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f0
251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly
  • Input Column: 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp[follows]
    • Direct This column is directly copied without any transformation
    • Cleaning The column is cast to DECIMAL(28, 6)
    • Output Columns:
      • follows: Directly mapped after casting
237. model.tiktok_ads.tiktok_ads__campaign_report
  • Input Column: 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly[follows]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • follows: Directly mapped after aggregation
Column Lineage
%3 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp video_watched_6_s 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly video_watched_6_s 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f0->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0 237. model.tiktok_ads.tiktok_ads__campaign_report 237. model.tiktok_ads.tiktok_ads__campaign_report video_watched_6_s 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f0
251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly
  • Input Column: 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp[video_watched_6_s]
    • Direct This column is directly copied without any transformation
    • Cleaning The column is cast to DECIMAL(28, 6)
    • Output Columns:
      • video_watched_6_s: Directly mapped after casting
237. model.tiktok_ads.tiktok_ads__campaign_report
  • Input Column: 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly[video_watched_6_s]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • video_watched_6_s: Directly mapped after aggregation
Column Lineage
%3 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp average_video_play_per_user 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly average_video_play_per_user 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f0->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0
251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly
  • Input Column: 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp[average_video_play_per_user]
    • Direct This column is directly copied without any transformation
    • Cleaning The column is cast to FLOAT
    • Output Columns:
      • average_video_play_per_user: Directly mapped after casting
Column Lineage
%3 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp spend 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly spend 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f0->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0 237. model.tiktok_ads.tiktok_ads__campaign_report 237. model.tiktok_ads.tiktok_ads__campaign_report daily_cpc daily_cpm spend 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f2 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f0 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f1
251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly
  • Input Column: 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp[spend]
    • Direct This column is directly copied without any transformation
    • Cleaning The column is cast to DECIMAL(28, 6)
    • Output Columns:
      • spend: Directly mapped after casting
237. model.tiktok_ads.tiktok_ads__campaign_report
  • Input Column: 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly[spend]
    • Aggregation The column is summed up in the aggregated CTE
    • Other Used in calculations for daily_cpc and daily_cpm
    • Output Columns:
      • spend: Directly mapped after aggregation
      • daily_cpc: Used in calculation
      • daily_cpm: Used in calculation
Column Lineage
%3 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp likes 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly likes 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp:f0->251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0 237. model.tiktok_ads.tiktok_ads__campaign_report 237. model.tiktok_ads.tiktok_ads__campaign_report likes 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly:f0->237. model.tiktok_ads.tiktok_ads__campaign_report:f0
251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly
  • Input Column: 252. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp[likes]
    • Direct This column is directly copied without any transformation
    • Cleaning The column is cast to DECIMAL(28, 6)
    • Output Columns:
      • likes: Directly mapped after casting
237. model.tiktok_ads.tiktok_ads__campaign_report
  • Input Column: 251. model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly[likes]
    • Aggregation The column is summed up in the aggregated CTE
    • Output Columns:
      • likes: Directly mapped after aggregation
253. model.twitter_ads.twitter_ads__account_report

This SQL query combines data from Twitter ads account history and promoted tweet reports. It first filters the account history for the latest versions, then aggregates the promoted tweet report data by date, account, and placement. Finally, it joins this aggregated data with the account information, providing a comprehensive report of ad performance metrics (clicks, impressions, spend, etc.) along with account details.

FilteringIntegrationAggregation
SQL Query
WITH accounts AS (
  SELECT
    *
  FROM TEST.PUBLIC_twitter_ads_source.stg_twitter_ads__account_history
  WHERE
    is_latest_version
), promoted_tweet_report AS (
  SELECT
    *
  FROM TEST.PUBLIC_twitter_ads_source.stg_twitter_ads__promoted_tweet_report
), rollup_report AS (
  SELECT
    source_relation,
    date_day,
    account_id,
    placement,
    SUM(clicks) AS clicks,
    SUM(impressions) AS impressions,
    SUM(spend) AS spend,
    SUM(spend_micro) AS spend_micro,
    SUM(url_clicks) AS url_clicks
  FROM promoted_tweet_report
  GROUP BY
    1,
    2,
    3,
    4
), final AS (
  SELECT
    report.source_relation,
    report.date_day,
    report.placement,
    report.account_id,
    accounts.name AS account_name,
    accounts.is_deleted,
    accounts.timezone,
    accounts.industry_type,
    accounts.approval_status,
    accounts.business_name,
    accounts.business_id,
    accounts.created_timestamp,
    accounts.updated_timestamp,
    accounts.timezone_switched_timestamp,
    SUM(report.clicks) AS clicks,
    SUM(report.impressions) AS impressions,
    SUM(report.spend) AS spend,
    SUM(report.spend_micro) AS spend_micro,
    SUM(report.url_clicks) AS url_clicks
  FROM rollup_report AS report
  LEFT JOIN accounts
    ON report.account_id = accounts.account_id
    AND report.source_relation = accounts.source_relation
  GROUP BY
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10,
    11,
    12,
    13,
    14
)
SELECT
  *
FROM final
%3 253. model.twitter_ads.twitter_ads__account_report 253. model.twitter_ads.twitter_ads__account_report source_relation spend_micro spend clicks date_day impressions url_clicks placement approval_status business_id business_name created_timestamp is_deleted account_id account_name industry_type timezone timezone_switched_timestamp updated_timestamp 259. model.twitter_ads_source.stg_twitter_ads__account_history 259. model.twitter_ads_source.stg_twitter_ads__account_history source_relation approval_status business_id business_name created_timestamp is_deleted account_id industry_type name timezone timezone_switched_timestamp updated_timestamp 259. model.twitter_ads_source.stg_twitter_ads__account_history:f0->253. model.twitter_ads.twitter_ads__account_report:f0 259. model.twitter_ads_source.stg_twitter_ads__account_history:f1->253. model.twitter_ads.twitter_ads__account_report:f8 259. model.twitter_ads_source.stg_twitter_ads__account_history:f2->253. model.twitter_ads.twitter_ads__account_report:f9 259. model.twitter_ads_source.stg_twitter_ads__account_history:f3->253. model.twitter_ads.twitter_ads__account_report:f10 259. model.twitter_ads_source.stg_twitter_ads__account_history:f4->253. model.twitter_ads.twitter_ads__account_report:f11 259. model.twitter_ads_source.stg_twitter_ads__account_history:f5->253. model.twitter_ads.twitter_ads__account_report:f12 259. model.twitter_ads_source.stg_twitter_ads__account_history:f6->253. model.twitter_ads.twitter_ads__account_report:f13 259. model.twitter_ads_source.stg_twitter_ads__account_history:f7->253. model.twitter_ads.twitter_ads__account_report:f15 259. model.twitter_ads_source.stg_twitter_ads__account_history:f8->253. model.twitter_ads.twitter_ads__account_report:f14 259. model.twitter_ads_source.stg_twitter_ads__account_history:f9->253. model.twitter_ads.twitter_ads__account_report:f16 259. model.twitter_ads_source.stg_twitter_ads__account_history:f10->253. model.twitter_ads.twitter_ads__account_report:f17 259. model.twitter_ads_source.stg_twitter_ads__account_history:f11->253. model.twitter_ads.twitter_ads__account_report:f18 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report source_relation account_id spend_micro spend clicks date_day impressions url_clicks placement 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0->253. model.twitter_ads.twitter_ads__account_report:f0 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f1->253. model.twitter_ads.twitter_ads__account_report:f13 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f2->253. model.twitter_ads.twitter_ads__account_report:f1 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f3->253. model.twitter_ads.twitter_ads__account_report:f2 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f4->253. model.twitter_ads.twitter_ads__account_report:f3 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f5->253. model.twitter_ads.twitter_ads__account_report:f4 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f6->253. model.twitter_ads.twitter_ads__account_report:f5 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f7->253. model.twitter_ads.twitter_ads__account_report:f6 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f8->253. model.twitter_ads.twitter_ads__account_report:f7
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
spend_micro numeric The spend (in micros) for the account on that day.
spend numeric The spend for the account on that day.
clicks numeric The clicks for th account on that day. Includes clicks on the URL (shortened or regular links), profile pic, screen name, username, detail, hashtags, and likes.
date_day timestamp without time zone The date of the performance.
impressions numeric The impressions for the account on that day. This is the number of users who see a Promoted Ad either in their home timeline or search results.
url_clicks numeric The url clicks for the account on that day.
placement text Where on Twitter the ad is being displayed. Possible values include 'ALL_ON_TWITTER', 'PUBLISHER_NETWORK', 'TWITTER_PROFILE', 'TWITTER_SEARCH', 'TWITTER_TIMELINE', and 'TAP_*', which are more granular options for `PUBLISHER_NETWORK`.
approval_status text The approval status of the account.
business_id integer The ID of the related business.
business_name integer The name of the related business.
created_timestamp text Time that the respective record (ad, ad group, campaign, post, etc) was created. ISO-8601 timestamp.
is_deleted boolean Whether the record has been deleted or not.
account_id text The ID of the account.
account_name character varying Name of the account.
industry_type integer The industry of the accounts.
timezone text The timezone the account is set to.
timezone_switched_timestamp text The timestamp the account's timezone was last changed.
updated_timestamp text Timestamp of when the record was last updated in Google Ads.
Column Lineage
%3 259. model.twitter_ads_source.stg_twitter_ads__account_history 259. model.twitter_ads_source.stg_twitter_ads__account_history source_relation 253. model.twitter_ads.twitter_ads__account_report 253. model.twitter_ads.twitter_ads__account_report source_relation 259. model.twitter_ads_source.stg_twitter_ads__account_history:f0->253. model.twitter_ads.twitter_ads__account_report:f0 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report source_relation 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0->253. model.twitter_ads.twitter_ads__account_report:f0
253. model.twitter_ads.twitter_ads__account_report
  • Input Column: 259. model.twitter_ads_source.stg_twitter_ads__account_history[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with the rollup_report table
    • Output Columns:
      • source_relation: Directly copied to the output
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[source_relation]
    • Direct The column is directly copied without transformation
    • Integration Used as part of the join condition with accounts table
    • Aggregation Used in GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to output
Column Lineage
%3 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report spend spend_micro 253. model.twitter_ads.twitter_ads__account_report 253. model.twitter_ads.twitter_ads__account_report spend_micro 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f1->253. model.twitter_ads.twitter_ads__account_report:f0 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp billed_charge_local_micro 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp:f0->273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f1 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp:f0->273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0
273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report
  • Input Column: 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp[billed_charge_local_micro]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT in the renamed CTE
    • Featurization Used to calculate the 'spend' column
    • Output Columns:
      • spend_micro: Directly mapped
      • spend: Transformed (divided by 1,000,000 and rounded)
253. model.twitter_ads.twitter_ads__account_report
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[spend_micro]
    • Aggregation Summed up in the rollup_report CTE and final SELECT
    • Output Columns:
      • spend_micro: Aggregated sum in output
Column Lineage
%3 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report spend spend_micro 253. model.twitter_ads.twitter_ads__account_report 253. model.twitter_ads.twitter_ads__account_report spend 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0->253. model.twitter_ads.twitter_ads__account_report:f0 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp billed_charge_local_micro 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp:f0->273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f1 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp:f0->273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0
273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report
  • Input Column: 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp[billed_charge_local_micro]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT in the renamed CTE
    • Featurization Used to calculate the 'spend' column
    • Output Columns:
      • spend_micro: Directly mapped
      • spend: Transformed (divided by 1,000,000 and rounded)
253. model.twitter_ads.twitter_ads__account_report
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[spend]
    • Aggregation Summed up in the rollup_report CTE and final SELECT
    • Output Columns:
      • spend: Aggregated sum in output
Column Lineage
%3 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report clicks 253. model.twitter_ads.twitter_ads__account_report 253. model.twitter_ads.twitter_ads__account_report clicks 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0->253. model.twitter_ads.twitter_ads__account_report:f0 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp clicks 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp:f0->273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0
273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report
  • Input Column: 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp[clicks]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT in the renamed CTE
    • Output Columns:
      • clicks: Directly mapped
253. model.twitter_ads.twitter_ads__account_report
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[clicks]
    • Aggregation Summed up in the rollup_report CTE and final SELECT
    • Output Columns:
      • clicks: Aggregated sum in output
Column Lineage
%3 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report date_day 253. model.twitter_ads.twitter_ads__account_report 253. model.twitter_ads.twitter_ads__account_report date_day 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0->253. model.twitter_ads.twitter_ads__account_report:f0 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp date 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp:f0->273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0
273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report
  • Input Column: 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp[date]
    • Cleaning The column is cast as TIMESTAMP in the renamed CTE
    • Featurization The date is truncated to the day level
    • Output Columns:
      • date_day: Transformed (truncated to day)
253. model.twitter_ads.twitter_ads__account_report
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[date_day]
    • Direct The column is directly copied without transformation
    • Aggregation Used in GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to output
Column Lineage
%3 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report impressions 253. model.twitter_ads.twitter_ads__account_report 253. model.twitter_ads.twitter_ads__account_report impressions 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0->253. model.twitter_ads.twitter_ads__account_report:f0 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp impressions 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp:f0->273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0
273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report
  • Input Column: 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp[impressions]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT in the renamed CTE
    • Output Columns:
      • impressions: Directly mapped
253. model.twitter_ads.twitter_ads__account_report
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[impressions]
    • Aggregation Summed up in the rollup_report CTE and final SELECT
    • Output Columns:
      • impressions: Aggregated sum in output
Column Lineage
%3 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report url_clicks 253. model.twitter_ads.twitter_ads__account_report 253. model.twitter_ads.twitter_ads__account_report url_clicks 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0->253. model.twitter_ads.twitter_ads__account_report:f0 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp url_clicks 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp:f0->273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0
273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report
  • Input Column: 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp[url_clicks]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT in the renamed CTE
    • Output Columns:
      • url_clicks: Directly mapped
253. model.twitter_ads.twitter_ads__account_report
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[url_clicks]
    • Aggregation Summed up in the rollup_report CTE and final SELECT
    • Output Columns:
      • url_clicks: Aggregated sum in output
Column Lineage
%3 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report placement 253. model.twitter_ads.twitter_ads__account_report 253. model.twitter_ads.twitter_ads__account_report placement 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0->253. model.twitter_ads.twitter_ads__account_report:f0 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp placement 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp:f0->273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0
273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report
  • Input Column: 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp[placement]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the renamed CTE
    • Output Columns:
      • placement: Directly mapped
253. model.twitter_ads.twitter_ads__account_report
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[placement]
    • Direct The column is directly copied without transformation
    • Aggregation Used in GROUP BY clause
    • Output Columns:
      • placement: Directly copied to output
Column Lineage
%3 259. model.twitter_ads_source.stg_twitter_ads__account_history 259. model.twitter_ads_source.stg_twitter_ads__account_history approval_status 253. model.twitter_ads.twitter_ads__account_report 253. model.twitter_ads.twitter_ads__account_report approval_status 259. model.twitter_ads_source.stg_twitter_ads__account_history:f0->253. model.twitter_ads.twitter_ads__account_report:f0 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp approval_status 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp:f0->259. model.twitter_ads_source.stg_twitter_ads__account_history:f0
259. model.twitter_ads_source.stg_twitter_ads__account_history
  • Input Column: 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp[approval_status]
    • Cleaning The column is cast to TEXT type
    • Direct The column is directly copied to the output
    • Output Columns:
      • approval_status: Directly mapped after casting
253. model.twitter_ads.twitter_ads__account_report
  • Input Column: 259. model.twitter_ads_source.stg_twitter_ads__account_history[approval_status]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • approval_status: Directly copied to the output
Column Lineage
%3 259. model.twitter_ads_source.stg_twitter_ads__account_history 259. model.twitter_ads_source.stg_twitter_ads__account_history business_id 253. model.twitter_ads.twitter_ads__account_report 253. model.twitter_ads.twitter_ads__account_report business_id 259. model.twitter_ads_source.stg_twitter_ads__account_history:f0->253. model.twitter_ads.twitter_ads__account_report:f0 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp business_id 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp:f0->259. model.twitter_ads_source.stg_twitter_ads__account_history:f0
259. model.twitter_ads_source.stg_twitter_ads__account_history
  • Input Column: 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp[business_id]
    • Cleaning The column is cast to TEXT type
    • Direct The column is directly copied to the output
    • Output Columns:
      • business_id: Directly mapped after casting
253. model.twitter_ads.twitter_ads__account_report
  • Input Column: 259. model.twitter_ads_source.stg_twitter_ads__account_history[business_id]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • business_id: Directly copied to the output
Column Lineage
%3 259. model.twitter_ads_source.stg_twitter_ads__account_history 259. model.twitter_ads_source.stg_twitter_ads__account_history business_name 253. model.twitter_ads.twitter_ads__account_report 253. model.twitter_ads.twitter_ads__account_report business_name 259. model.twitter_ads_source.stg_twitter_ads__account_history:f0->253. model.twitter_ads.twitter_ads__account_report:f0 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp business_name 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp:f0->259. model.twitter_ads_source.stg_twitter_ads__account_history:f0
259. model.twitter_ads_source.stg_twitter_ads__account_history
  • Input Column: 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp[business_name]
    • Cleaning The column is cast to TEXT type
    • Direct The column is directly copied to the output
    • Output Columns:
      • business_name: Directly mapped after casting
253. model.twitter_ads.twitter_ads__account_report
  • Input Column: 259. model.twitter_ads_source.stg_twitter_ads__account_history[business_name]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • business_name: Directly copied to the output
Column Lineage
%3 259. model.twitter_ads_source.stg_twitter_ads__account_history 259. model.twitter_ads_source.stg_twitter_ads__account_history created_timestamp 253. model.twitter_ads.twitter_ads__account_report 253. model.twitter_ads.twitter_ads__account_report created_timestamp 259. model.twitter_ads_source.stg_twitter_ads__account_history:f0->253. model.twitter_ads.twitter_ads__account_report:f0 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp created_at 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp:f0->259. model.twitter_ads_source.stg_twitter_ads__account_history:f0
259. model.twitter_ads_source.stg_twitter_ads__account_history
  • Input Column: 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp[created_at]
    • Cleaning The column is cast to TIMESTAMP type
    • Direct The column is directly copied to the output with a name change
    • Output Columns:
      • created_timestamp: Directly mapped after casting and renaming
253. model.twitter_ads.twitter_ads__account_report
  • Input Column: 259. model.twitter_ads_source.stg_twitter_ads__account_history[created_timestamp]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • created_timestamp: Directly copied to the output
Column Lineage
%3 259. model.twitter_ads_source.stg_twitter_ads__account_history 259. model.twitter_ads_source.stg_twitter_ads__account_history is_deleted 253. model.twitter_ads.twitter_ads__account_report 253. model.twitter_ads.twitter_ads__account_report is_deleted 259. model.twitter_ads_source.stg_twitter_ads__account_history:f0->253. model.twitter_ads.twitter_ads__account_report:f0 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp deleted 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp:f0->259. model.twitter_ads_source.stg_twitter_ads__account_history:f0
259. model.twitter_ads_source.stg_twitter_ads__account_history
  • Input Column: 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp[deleted]
    • Cleaning The column is cast to BOOLEAN type
    • Direct The column is directly copied to the output with a name change
    • Output Columns:
      • is_deleted: Directly mapped after casting and renaming
253. model.twitter_ads.twitter_ads__account_report
  • Input Column: 259. model.twitter_ads_source.stg_twitter_ads__account_history[is_deleted]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • is_deleted: Directly copied to the output
Column Lineage
%3 259. model.twitter_ads_source.stg_twitter_ads__account_history 259. model.twitter_ads_source.stg_twitter_ads__account_history account_id 253. model.twitter_ads.twitter_ads__account_report 253. model.twitter_ads.twitter_ads__account_report account_id 259. model.twitter_ads_source.stg_twitter_ads__account_history:f0->253. model.twitter_ads.twitter_ads__account_report:f0 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report account_id 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0->253. model.twitter_ads.twitter_ads__account_report:f0 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp id 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp:f0->259. model.twitter_ads_source.stg_twitter_ads__account_history:f0 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp account_id 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp:f0->273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0
259. model.twitter_ads_source.stg_twitter_ads__account_history
  • Input Column: 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp[id]
    • Cleaning The column is cast to TEXT type
    • Direct The column is directly copied to the output with a name change
    • Deduplication Used in the ROW_NUMBER() function to identify the latest version
    • Output Columns:
      • account_id: Directly mapped after casting and renaming
273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report
  • Input Column: 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp[account_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the renamed CTE
    • Output Columns:
      • account_id: Directly mapped
253. model.twitter_ads.twitter_ads__account_report
  • Input Column: 259. model.twitter_ads_source.stg_twitter_ads__account_history[account_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as the key to join with the rollup_report table
    • Output Columns:
      • account_id: Directly copied to the output
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[account_id]
    • Direct The column is directly copied without transformation
    • Integration Used as the key to join with accounts table
    • Aggregation Used in GROUP BY clause
    • Output Columns:
      • account_id: Directly copied to output
Column Lineage
%3 259. model.twitter_ads_source.stg_twitter_ads__account_history 259. model.twitter_ads_source.stg_twitter_ads__account_history name 253. model.twitter_ads.twitter_ads__account_report 253. model.twitter_ads.twitter_ads__account_report account_name 259. model.twitter_ads_source.stg_twitter_ads__account_history:f0->253. model.twitter_ads.twitter_ads__account_report:f0 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp name 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp:f0->259. model.twitter_ads_source.stg_twitter_ads__account_history:f0
259. model.twitter_ads_source.stg_twitter_ads__account_history
  • Input Column: 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp[name]
    • Cleaning The column is cast to TEXT type
    • Direct The column is directly copied to the output
    • Output Columns:
      • name: Directly mapped after casting
253. model.twitter_ads.twitter_ads__account_report
  • Input Column: 259. model.twitter_ads_source.stg_twitter_ads__account_history[name]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • account_name: Renamed to account_name in the output
Column Lineage
%3 259. model.twitter_ads_source.stg_twitter_ads__account_history 259. model.twitter_ads_source.stg_twitter_ads__account_history industry_type 253. model.twitter_ads.twitter_ads__account_report 253. model.twitter_ads.twitter_ads__account_report industry_type 259. model.twitter_ads_source.stg_twitter_ads__account_history:f0->253. model.twitter_ads.twitter_ads__account_report:f0 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp industry_type 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp:f0->259. model.twitter_ads_source.stg_twitter_ads__account_history:f0
259. model.twitter_ads_source.stg_twitter_ads__account_history
  • Input Column: 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp[industry_type]
    • Cleaning The column is cast to TEXT type
    • Direct The column is directly copied to the output
    • Output Columns:
      • industry_type: Directly mapped after casting
253. model.twitter_ads.twitter_ads__account_report
  • Input Column: 259. model.twitter_ads_source.stg_twitter_ads__account_history[industry_type]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • industry_type: Directly copied to the output
Column Lineage
%3 259. model.twitter_ads_source.stg_twitter_ads__account_history 259. model.twitter_ads_source.stg_twitter_ads__account_history timezone 253. model.twitter_ads.twitter_ads__account_report 253. model.twitter_ads.twitter_ads__account_report timezone 259. model.twitter_ads_source.stg_twitter_ads__account_history:f0->253. model.twitter_ads.twitter_ads__account_report:f0 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp timezone 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp:f0->259. model.twitter_ads_source.stg_twitter_ads__account_history:f0
259. model.twitter_ads_source.stg_twitter_ads__account_history
  • Input Column: 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp[timezone]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • timezone: It is directly mapped to the output 'timezone' column
253. model.twitter_ads.twitter_ads__account_report
  • Input Column: 259. model.twitter_ads_source.stg_twitter_ads__account_history[timezone]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • timezone: Directly copied to the output
Column Lineage
%3 259. model.twitter_ads_source.stg_twitter_ads__account_history 259. model.twitter_ads_source.stg_twitter_ads__account_history timezone_switched_timestamp 253. model.twitter_ads.twitter_ads__account_report 253. model.twitter_ads.twitter_ads__account_report timezone_switched_timestamp 259. model.twitter_ads_source.stg_twitter_ads__account_history:f0->253. model.twitter_ads.twitter_ads__account_report:f0 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp timezone_switch_at 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp:f0->259. model.twitter_ads_source.stg_twitter_ads__account_history:f0
259. model.twitter_ads_source.stg_twitter_ads__account_history
  • Input Column: 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp[timezone_switch_at]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TIMESTAMP type
    • Output Columns:
      • timezone_switched_timestamp: It is directly mapped to the output 'timezone_switched_timestamp' column
253. model.twitter_ads.twitter_ads__account_report
  • Input Column: 259. model.twitter_ads_source.stg_twitter_ads__account_history[timezone_switched_timestamp]
    • Direct This column is directly copied to the output without transformation
    • Output Columns:
      • timezone_switched_timestamp: Directly copied to the output column with the same name
Column Lineage
%3 259. model.twitter_ads_source.stg_twitter_ads__account_history 259. model.twitter_ads_source.stg_twitter_ads__account_history is_latest_version updated_timestamp 253. model.twitter_ads.twitter_ads__account_report 253. model.twitter_ads.twitter_ads__account_report updated_timestamp 259. model.twitter_ads_source.stg_twitter_ads__account_history:f1->253. model.twitter_ads.twitter_ads__account_report:f0 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp updated_at 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp:f0->259. model.twitter_ads_source.stg_twitter_ads__account_history:f1 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp:f0->259. model.twitter_ads_source.stg_twitter_ads__account_history:f0
259. model.twitter_ads_source.stg_twitter_ads__account_history
  • Input Column: 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp[updated_at]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TIMESTAMP type
    • Deduplication The column is used in the ROW_NUMBER() function to determine the latest version of each account record
    • Output Columns:
      • updated_timestamp: It is directly mapped to the output 'updated_timestamp' column
      • is_latest_version: It is used to determine this boolean flag
253. model.twitter_ads.twitter_ads__account_report
  • Input Column: 259. model.twitter_ads_source.stg_twitter_ads__account_history[updated_timestamp]
    • Direct This column is directly copied to the output without transformation
    • Output Columns:
      • updated_timestamp: Directly copied to the output column with the same name
254. model.twitter_ads.twitter_ads__campaign_report

This SQL query combines data from three sources: campaign reports, campaign history, and account history. It joins these tables to create a comprehensive report that includes campaign performance metrics (clicks, impressions, spend) along with campaign and account details. The query filters for the latest versions of campaigns and accounts, and aggregates the report data by various dimensions such as date, placement, account, and campaign.

FilteringIntegrationAggregation
SQL Query
WITH report AS (
  SELECT
    *
  FROM TEST.PUBLIC_twitter_ads_source.stg_twitter_ads__campaign_report
), campaigns AS (
  SELECT
    *
  FROM TEST.PUBLIC_twitter_ads_source.stg_twitter_ads__campaign_history
  WHERE
    is_latest_version
), accounts AS (
  SELECT
    *
  FROM TEST.PUBLIC_twitter_ads_source.stg_twitter_ads__account_history
  WHERE
    is_latest_version
), final AS (
  SELECT
    report.source_relation,
    report.date_day,
    report.placement,
    report.account_id,
    accounts.name AS account_name,
    report.campaign_id,
    campaigns.campaign_name,
    campaigns.is_deleted,
    campaigns.entity_status AS campaign_status,
    campaigns.currency,
    campaigns.is_servable,
    campaigns.is_standard_delivery,
    campaigns.frequency_cap,
    campaigns.start_timestamp,
    campaigns.end_timestamp,
    campaigns.created_timestamp,
    campaigns.updated_timestamp,
    campaigns.funding_instrument_id,
    campaigns.daily_budget_amount,
    campaigns.total_budget_amount,
    SUM(report.clicks) AS clicks,
    SUM(report.impressions) AS impressions,
    SUM(report.spend) AS spend,
    SUM(report.spend_micro) AS spend_micro,
    SUM(report.url_clicks) AS url_clicks
  FROM report
  LEFT JOIN campaigns
    ON report.campaign_id = campaigns.campaign_id
    AND report.source_relation = campaigns.source_relation
  LEFT JOIN accounts
    ON report.account_id = accounts.account_id
    AND report.source_relation = accounts.source_relation
  GROUP BY
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10,
    11,
    12,
    13,
    14,
    15,
    16,
    17,
    18,
    19,
    20
)
SELECT
  *
FROM final
%3 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report source_relation campaign_id campaign_name clicks date_day impressions spend spend_micro url_clicks placement account_id account_name created_timestamp currency is_deleted end_timestamp campaign_status frequency_cap is_servable is_standard_delivery start_timestamp updated_timestamp funding_instrument_id daily_budget_amount total_budget_amount 259. model.twitter_ads_source.stg_twitter_ads__account_history 259. model.twitter_ads_source.stg_twitter_ads__account_history source_relation account_id name 259. model.twitter_ads_source.stg_twitter_ads__account_history:f0->254. model.twitter_ads.twitter_ads__campaign_report:f0 259. model.twitter_ads_source.stg_twitter_ads__account_history:f1->254. model.twitter_ads.twitter_ads__campaign_report:f10 259. model.twitter_ads_source.stg_twitter_ads__account_history:f2->254. model.twitter_ads.twitter_ads__campaign_report:f11 261. model.twitter_ads_source.stg_twitter_ads__campaign_history 261. model.twitter_ads_source.stg_twitter_ads__campaign_history source_relation created_timestamp currency daily_budget_amount_local_micro is_deleted end_timestamp entity_status frequency_cap campaign_id campaign_name is_servable is_standard_delivery start_timestamp total_budget_amount_local_micro updated_timestamp funding_instrument_id daily_budget_amount total_budget_amount 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->254. model.twitter_ads.twitter_ads__campaign_report:f0 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f1->254. model.twitter_ads.twitter_ads__campaign_report:f12 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f2->254. model.twitter_ads.twitter_ads__campaign_report:f13 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f3->254. model.twitter_ads.twitter_ads__campaign_report:f23 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f4->254. model.twitter_ads.twitter_ads__campaign_report:f14 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f5->254. model.twitter_ads.twitter_ads__campaign_report:f15 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f6->254. model.twitter_ads.twitter_ads__campaign_report:f16 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f7->254. model.twitter_ads.twitter_ads__campaign_report:f17 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f8->254. model.twitter_ads.twitter_ads__campaign_report:f1 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f9->254. model.twitter_ads.twitter_ads__campaign_report:f2 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f10->254. model.twitter_ads.twitter_ads__campaign_report:f18 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f11->254. model.twitter_ads.twitter_ads__campaign_report:f19 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f12->254. model.twitter_ads.twitter_ads__campaign_report:f20 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f13->254. model.twitter_ads.twitter_ads__campaign_report:f24 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f14->254. model.twitter_ads.twitter_ads__campaign_report:f21 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f15->254. model.twitter_ads.twitter_ads__campaign_report:f22 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f16->254. model.twitter_ads.twitter_ads__campaign_report:f23 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f17->254. model.twitter_ads.twitter_ads__campaign_report:f24 263. model.twitter_ads_source.stg_twitter_ads__campaign_report 263. model.twitter_ads_source.stg_twitter_ads__campaign_report source_relation account_id spend_micro spend clicks date_day impressions campaign_id url_clicks placement 263. model.twitter_ads_source.stg_twitter_ads__campaign_report:f0->254. model.twitter_ads.twitter_ads__campaign_report:f0 263. model.twitter_ads_source.stg_twitter_ads__campaign_report:f1->254. model.twitter_ads.twitter_ads__campaign_report:f10 263. model.twitter_ads_source.stg_twitter_ads__campaign_report:f2->254. model.twitter_ads.twitter_ads__campaign_report:f7 263. model.twitter_ads_source.stg_twitter_ads__campaign_report:f3->254. model.twitter_ads.twitter_ads__campaign_report:f6 263. model.twitter_ads_source.stg_twitter_ads__campaign_report:f4->254. model.twitter_ads.twitter_ads__campaign_report:f3 263. model.twitter_ads_source.stg_twitter_ads__campaign_report:f5->254. model.twitter_ads.twitter_ads__campaign_report:f4 263. model.twitter_ads_source.stg_twitter_ads__campaign_report:f6->254. model.twitter_ads.twitter_ads__campaign_report:f5 263. model.twitter_ads_source.stg_twitter_ads__campaign_report:f7->254. model.twitter_ads.twitter_ads__campaign_report:f1 263. model.twitter_ads_source.stg_twitter_ads__campaign_report:f8->254. model.twitter_ads.twitter_ads__campaign_report:f8 263. model.twitter_ads_source.stg_twitter_ads__campaign_report:f9->254. model.twitter_ads.twitter_ads__campaign_report:f9
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
campaign_id text The ID of the campaign.
campaign_name text The name of the campaign.
clicks bigint The number of clicks on that date. Includes clicks on the URL (shortened or regular links), profile pic, screen name, username, detail, hashtags, and likes.
date_day timestamp without time zone The date of the performance.
impressions bigint The number of impressions on that date. This is the number of users who see a Promoted Ad either in their home timeline or search results.
spend numeric The amount of spend on that date.
spend_micro bigint The amount of spend, in micros, on that date.
url_clicks bigint The number of URL clicks on that date.
placement text Where on Twitter the ad is being displayed. Possible values include 'ALL_ON_TWITTER', 'PUBLISHER_NETWORK', 'TWITTER_PROFILE', 'TWITTER_SEARCH', 'TWITTER_TIMELINE', and 'TAP_*', which are more granular options for `PUBLISHER_NETWORK`.
account_id text The ID of the related account.
account_name character varying The name of the related account.
created_timestamp text Time that the respective record (ad, ad group, campaign, post, etc) was created. ISO-8601 timestamp.
currency text The currency all metrics for the account are set to.
is_deleted boolean Whether the record has been deleted or not.
end_timestamp text The time the campaign will end
campaign_status text The status of the campaign.
frequency_cap integer The maximum number of times an ad could be delivered to a user.
is_servable boolean Whether the campaign is in a state to be actively served to users.
is_standard_delivery boolean Whether standard delivery is enabled (vs accelerated delivery).
start_timestamp text The time the campaign will start.
updated_timestamp text Timestamp of when the record was last updated in Google Ads.
funding_instrument_id text Reference to the funding instrument.
daily_budget_amount numeric The daily budget amount to be allocated to the campaign. The currency associated with the specified funding instrument will be used.
total_budget_amount numeric The total budget amount to be allocated to the campaign.
Column Lineage
%3 259. model.twitter_ads_source.stg_twitter_ads__account_history 259. model.twitter_ads_source.stg_twitter_ads__account_history source_relation 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report source_relation 259. model.twitter_ads_source.stg_twitter_ads__account_history:f0->254. model.twitter_ads.twitter_ads__campaign_report:f0 261. model.twitter_ads_source.stg_twitter_ads__campaign_history 261. model.twitter_ads_source.stg_twitter_ads__campaign_history source_relation 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->254. model.twitter_ads.twitter_ads__campaign_report:f0 263. model.twitter_ads_source.stg_twitter_ads__campaign_report 263. model.twitter_ads_source.stg_twitter_ads__campaign_report source_relation 263. model.twitter_ads_source.stg_twitter_ads__campaign_report:f0->254. model.twitter_ads.twitter_ads__campaign_report:f0
254. model.twitter_ads.twitter_ads__campaign_report
  • Input Column: 259. model.twitter_ads_source.stg_twitter_ads__account_history[source_relation]
    • Integration used as a key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[source_relation]
    • Integration used as part of the join condition with report and accounts tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 263. model.twitter_ads_source.stg_twitter_ads__campaign_report[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the JOIN condition with other tables
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
Column Lineage
%3 261. model.twitter_ads_source.stg_twitter_ads__campaign_history 261. model.twitter_ads_source.stg_twitter_ads__campaign_history campaign_id 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report campaign_id 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->254. model.twitter_ads.twitter_ads__campaign_report:f0 263. model.twitter_ads_source.stg_twitter_ads__campaign_report 263. model.twitter_ads_source.stg_twitter_ads__campaign_report campaign_id 263. model.twitter_ads_source.stg_twitter_ads__campaign_report:f0->254. model.twitter_ads.twitter_ads__campaign_report:f0 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp id 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f0->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp campaign_id 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp:f0->263. model.twitter_ads_source.stg_twitter_ads__campaign_report:f0
261. model.twitter_ads_source.stg_twitter_ads__campaign_history
  • Input Column: 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp[id]
    • Direct The column is directly copied without any transformation
    • Deduplication Used in the ROW_NUMBER() function to identify the latest version of each campaign
    • Output Columns:
      • campaign_id: Directly copied to the output and renamed
263. model.twitter_ads_source.stg_twitter_ads__campaign_report
  • Input Column: 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp[campaign_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • campaign_id: Directly mapped after casting
254. model.twitter_ads.twitter_ads__campaign_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[campaign_id]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as a key to join with the report table
    • Output Columns:
      • campaign_id: Directly copied to the output
  • Input Column: 263. model.twitter_ads_source.stg_twitter_ads__campaign_report[campaign_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the JOIN condition with the campaigns table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • campaign_id: Directly copied to the output
Column Lineage
%3 261. model.twitter_ads_source.stg_twitter_ads__campaign_history 261. model.twitter_ads_source.stg_twitter_ads__campaign_history campaign_name 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report campaign_name 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->254. model.twitter_ads.twitter_ads__campaign_report:f0 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp name 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f0->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0
261. model.twitter_ads_source.stg_twitter_ads__campaign_history
  • Input Column: 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp[name]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • campaign_name: Directly copied to the output and renamed
254. model.twitter_ads.twitter_ads__campaign_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[campaign_name]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • campaign_name: Directly copied to the output
Column Lineage
%3 263. model.twitter_ads_source.stg_twitter_ads__campaign_report 263. model.twitter_ads_source.stg_twitter_ads__campaign_report clicks 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report clicks 263. model.twitter_ads_source.stg_twitter_ads__campaign_report:f0->254. model.twitter_ads.twitter_ads__campaign_report:f0 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp clicks 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp:f0->263. model.twitter_ads_source.stg_twitter_ads__campaign_report:f0
263. model.twitter_ads_source.stg_twitter_ads__campaign_report
  • Input Column: 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp[clicks]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT
    • Output Columns:
      • clicks: Directly mapped after casting
254. model.twitter_ads.twitter_ads__campaign_report
  • Input Column: 263. model.twitter_ads_source.stg_twitter_ads__campaign_report[clicks]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • clicks: Summed up in the output
Column Lineage
%3 263. model.twitter_ads_source.stg_twitter_ads__campaign_report 263. model.twitter_ads_source.stg_twitter_ads__campaign_report date_day 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report date_day 263. model.twitter_ads_source.stg_twitter_ads__campaign_report:f0->254. model.twitter_ads.twitter_ads__campaign_report:f0 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp date 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp:f0->263. model.twitter_ads_source.stg_twitter_ads__campaign_report:f0
263. model.twitter_ads_source.stg_twitter_ads__campaign_report
  • Input Column: 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp[date]
    • Cleaning The column is cast as TIMESTAMP and then truncated to day level
    • Featurization The date is truncated to create a day-level feature
    • Output Columns:
      • date_day: Mapped after casting and truncating to day level
254. model.twitter_ads.twitter_ads__campaign_report
  • Input Column: 263. model.twitter_ads_source.stg_twitter_ads__campaign_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 263. model.twitter_ads_source.stg_twitter_ads__campaign_report 263. model.twitter_ads_source.stg_twitter_ads__campaign_report impressions 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report impressions 263. model.twitter_ads_source.stg_twitter_ads__campaign_report:f0->254. model.twitter_ads.twitter_ads__campaign_report:f0 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp impressions 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp:f0->263. model.twitter_ads_source.stg_twitter_ads__campaign_report:f0
263. model.twitter_ads_source.stg_twitter_ads__campaign_report
  • Input Column: 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp[impressions]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT
    • Output Columns:
      • impressions: Directly mapped after casting
254. model.twitter_ads.twitter_ads__campaign_report
  • Input Column: 263. model.twitter_ads_source.stg_twitter_ads__campaign_report[impressions]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • impressions: Summed up in the output
Column Lineage
%3 263. model.twitter_ads_source.stg_twitter_ads__campaign_report 263. model.twitter_ads_source.stg_twitter_ads__campaign_report spend spend_micro 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report spend 263. model.twitter_ads_source.stg_twitter_ads__campaign_report:f0->254. model.twitter_ads.twitter_ads__campaign_report:f0 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp billed_charge_local_micro 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp:f0->263. model.twitter_ads_source.stg_twitter_ads__campaign_report:f1 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp:f0->263. model.twitter_ads_source.stg_twitter_ads__campaign_report:f0
263. model.twitter_ads_source.stg_twitter_ads__campaign_report
  • Input Column: 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp[billed_charge_local_micro]
    • Cleaning The column is cast as INT
    • Featurization The value is divided by 1,000,000 and rounded to 2 decimal places to create a new feature
    • Output Columns:
      • spend_micro: Directly mapped after casting
      • spend: Mapped after transformation (division and rounding)
254. model.twitter_ads.twitter_ads__campaign_report
  • Input Column: 263. model.twitter_ads_source.stg_twitter_ads__campaign_report[spend]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • spend: Summed up in the output
Column Lineage
%3 263. model.twitter_ads_source.stg_twitter_ads__campaign_report 263. model.twitter_ads_source.stg_twitter_ads__campaign_report spend spend_micro 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report spend_micro 263. model.twitter_ads_source.stg_twitter_ads__campaign_report:f1->254. model.twitter_ads.twitter_ads__campaign_report:f0 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp billed_charge_local_micro 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp:f0->263. model.twitter_ads_source.stg_twitter_ads__campaign_report:f1 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp:f0->263. model.twitter_ads_source.stg_twitter_ads__campaign_report:f0
263. model.twitter_ads_source.stg_twitter_ads__campaign_report
  • Input Column: 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp[billed_charge_local_micro]
    • Cleaning The column is cast as INT
    • Featurization The value is divided by 1,000,000 and rounded to 2 decimal places to create a new feature
    • Output Columns:
      • spend_micro: Directly mapped after casting
      • spend: Mapped after transformation (division and rounding)
254. model.twitter_ads.twitter_ads__campaign_report
  • Input Column: 263. model.twitter_ads_source.stg_twitter_ads__campaign_report[spend_micro]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • spend_micro: Summed up in the output
Column Lineage
%3 263. model.twitter_ads_source.stg_twitter_ads__campaign_report 263. model.twitter_ads_source.stg_twitter_ads__campaign_report url_clicks 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report url_clicks 263. model.twitter_ads_source.stg_twitter_ads__campaign_report:f0->254. model.twitter_ads.twitter_ads__campaign_report:f0 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp url_clicks 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp:f0->263. model.twitter_ads_source.stg_twitter_ads__campaign_report:f0
263. model.twitter_ads_source.stg_twitter_ads__campaign_report
  • Input Column: 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp[url_clicks]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT in the 'fields' CTE
    • Output Columns:
      • url_clicks: Directly mapped
254. model.twitter_ads.twitter_ads__campaign_report
  • Input Column: 263. model.twitter_ads_source.stg_twitter_ads__campaign_report[url_clicks]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • url_clicks: Summed up in the output
Column Lineage
%3 263. model.twitter_ads_source.stg_twitter_ads__campaign_report 263. model.twitter_ads_source.stg_twitter_ads__campaign_report placement 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report placement 263. model.twitter_ads_source.stg_twitter_ads__campaign_report:f0->254. model.twitter_ads.twitter_ads__campaign_report:f0 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp placement 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp:f0->263. model.twitter_ads_source.stg_twitter_ads__campaign_report:f0
263. model.twitter_ads_source.stg_twitter_ads__campaign_report
  • Input Column: 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp[placement]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • placement: Directly mapped after casting
254. model.twitter_ads.twitter_ads__campaign_report
  • Input Column: 263. model.twitter_ads_source.stg_twitter_ads__campaign_report[placement]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • placement: Directly copied to the output
Column Lineage
%3 259. model.twitter_ads_source.stg_twitter_ads__account_history 259. model.twitter_ads_source.stg_twitter_ads__account_history account_id 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report account_id 259. model.twitter_ads_source.stg_twitter_ads__account_history:f0->254. model.twitter_ads.twitter_ads__campaign_report:f0 263. model.twitter_ads_source.stg_twitter_ads__campaign_report 263. model.twitter_ads_source.stg_twitter_ads__campaign_report account_id 263. model.twitter_ads_source.stg_twitter_ads__campaign_report:f0->254. model.twitter_ads.twitter_ads__campaign_report:f0 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp id 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp:f0->259. model.twitter_ads_source.stg_twitter_ads__account_history:f0 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp account_id 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp:f0->263. model.twitter_ads_source.stg_twitter_ads__campaign_report:f0
259. model.twitter_ads_source.stg_twitter_ads__account_history
  • Input Column: 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp[id]
    • Cleaning The column is cast to TEXT type
    • Direct The column is directly copied to the output with a name change
    • Deduplication Used in the ROW_NUMBER() function to identify the latest version
    • Output Columns:
      • account_id: Directly mapped after casting and renaming
263. model.twitter_ads_source.stg_twitter_ads__campaign_report
  • Input Column: 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp[account_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • account_id: Directly mapped after casting
254. model.twitter_ads.twitter_ads__campaign_report
  • Input Column: 259. model.twitter_ads_source.stg_twitter_ads__account_history[account_id]
    • Integration used as a key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • account_id: directly copied
  • Input Column: 263. model.twitter_ads_source.stg_twitter_ads__campaign_report[account_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the JOIN condition with the accounts table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • account_id: Directly copied to the output
Column Lineage
%3 259. model.twitter_ads_source.stg_twitter_ads__account_history 259. model.twitter_ads_source.stg_twitter_ads__account_history name 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report account_name 259. model.twitter_ads_source.stg_twitter_ads__account_history:f0->254. model.twitter_ads.twitter_ads__campaign_report:f0 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp name 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp:f0->259. model.twitter_ads_source.stg_twitter_ads__account_history:f0
259. model.twitter_ads_source.stg_twitter_ads__account_history
  • Input Column: 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp[name]
    • Cleaning The column is cast to TEXT type
    • Direct The column is directly copied to the output
    • Output Columns:
      • name: Directly mapped after casting
254. model.twitter_ads.twitter_ads__campaign_report
  • Input Column: 259. model.twitter_ads_source.stg_twitter_ads__account_history[name]
    • Direct directly copied to the output
    • Output Columns:
      • account_name: directly copied and renamed
Column Lineage
%3 261. model.twitter_ads_source.stg_twitter_ads__campaign_history 261. model.twitter_ads_source.stg_twitter_ads__campaign_history created_timestamp 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report created_timestamp 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->254. model.twitter_ads.twitter_ads__campaign_report:f0 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp created_at 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f0->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0
261. model.twitter_ads_source.stg_twitter_ads__campaign_history
  • Input Column: 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp[created_at]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TIMESTAMP type
    • Output Columns:
      • created_timestamp: Directly mapped after casting and renaming
254. model.twitter_ads.twitter_ads__campaign_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[created_timestamp]
    • Direct directly copied to the output
    • Output Columns:
      • created_timestamp: directly copied
Column Lineage
%3 261. model.twitter_ads_source.stg_twitter_ads__campaign_history 261. model.twitter_ads_source.stg_twitter_ads__campaign_history currency 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report currency 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->254. model.twitter_ads.twitter_ads__campaign_report:f0 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp currency 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f0->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0
261. model.twitter_ads_source.stg_twitter_ads__campaign_history
  • Input Column: 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp[currency]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • currency: Directly mapped after casting
254. model.twitter_ads.twitter_ads__campaign_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[currency]
    • Direct directly copied to the output
    • Output Columns:
      • currency: directly copied
Column Lineage
%3 261. model.twitter_ads_source.stg_twitter_ads__campaign_history 261. model.twitter_ads_source.stg_twitter_ads__campaign_history is_deleted 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report is_deleted 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->254. model.twitter_ads.twitter_ads__campaign_report:f0 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp deleted 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f0->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0
261. model.twitter_ads_source.stg_twitter_ads__campaign_history
  • Input Column: 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp[deleted]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as BOOLEAN type
    • Output Columns:
      • is_deleted: Directly mapped after casting and renaming
254. model.twitter_ads.twitter_ads__campaign_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[is_deleted]
    • Direct directly copied to the output
    • Output Columns:
      • is_deleted: directly copied
Column Lineage
%3 261. model.twitter_ads_source.stg_twitter_ads__campaign_history 261. model.twitter_ads_source.stg_twitter_ads__campaign_history end_timestamp 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report end_timestamp 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->254. model.twitter_ads.twitter_ads__campaign_report:f0 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp end_time 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f0->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0
261. model.twitter_ads_source.stg_twitter_ads__campaign_history
  • Input Column: 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp[end_time]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TIMESTAMP type
    • Output Columns:
      • end_timestamp: Directly mapped after casting and renaming
254. model.twitter_ads.twitter_ads__campaign_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[end_timestamp]
    • Direct directly copied to the output
    • Output Columns:
      • end_timestamp: directly copied
Column Lineage
%3 261. model.twitter_ads_source.stg_twitter_ads__campaign_history 261. model.twitter_ads_source.stg_twitter_ads__campaign_history entity_status 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report campaign_status 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->254. model.twitter_ads.twitter_ads__campaign_report:f0 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp entity_status 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f0->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0
261. model.twitter_ads_source.stg_twitter_ads__campaign_history
  • Input Column: 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp[entity_status]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • entity_status: Directly mapped after casting
254. model.twitter_ads.twitter_ads__campaign_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[entity_status]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_status: directly copied and renamed
Column Lineage
%3 261. model.twitter_ads_source.stg_twitter_ads__campaign_history 261. model.twitter_ads_source.stg_twitter_ads__campaign_history frequency_cap 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report frequency_cap 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->254. model.twitter_ads.twitter_ads__campaign_report:f0 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp frequency_cap 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f0->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0
261. model.twitter_ads_source.stg_twitter_ads__campaign_history
  • Input Column: 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp[frequency_cap]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT type
    • Output Columns:
      • frequency_cap: Directly mapped after casting
254. model.twitter_ads.twitter_ads__campaign_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[frequency_cap]
    • Direct directly copied to the output
    • Output Columns:
      • frequency_cap: directly copied
Column Lineage
%3 261. model.twitter_ads_source.stg_twitter_ads__campaign_history 261. model.twitter_ads_source.stg_twitter_ads__campaign_history is_servable 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report is_servable 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->254. model.twitter_ads.twitter_ads__campaign_report:f0 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp servable 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f0->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0
261. model.twitter_ads_source.stg_twitter_ads__campaign_history
  • Input Column: 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp[servable]
    • Cleaning The column is cast to BOOLEAN type
    • Output Columns:
      • is_servable: Copied to the output, renamed, and cast to BOOLEAN
254. model.twitter_ads.twitter_ads__campaign_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[is_servable]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • is_servable: Directly copied to the output
Column Lineage
%3 261. model.twitter_ads_source.stg_twitter_ads__campaign_history 261. model.twitter_ads_source.stg_twitter_ads__campaign_history is_standard_delivery 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report is_standard_delivery 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->254. model.twitter_ads.twitter_ads__campaign_report:f0 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp standard_delivery 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f0->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0
261. model.twitter_ads_source.stg_twitter_ads__campaign_history
  • Input Column: 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp[standard_delivery]
    • Cleaning The column is cast to BOOLEAN type
    • Output Columns:
      • is_standard_delivery: Copied to the output, renamed, and cast to BOOLEAN
254. model.twitter_ads.twitter_ads__campaign_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[is_standard_delivery]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • is_standard_delivery: Directly copied to the output
Column Lineage
%3 261. model.twitter_ads_source.stg_twitter_ads__campaign_history 261. model.twitter_ads_source.stg_twitter_ads__campaign_history start_timestamp 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report start_timestamp 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->254. model.twitter_ads.twitter_ads__campaign_report:f0 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp start_time 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f0->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0
261. model.twitter_ads_source.stg_twitter_ads__campaign_history
  • Input Column: 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp[start_time]
    • Cleaning The column is cast to TIMESTAMP type
    • Output Columns:
      • start_timestamp: Copied to the output, renamed, and cast to TIMESTAMP
254. model.twitter_ads.twitter_ads__campaign_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[start_timestamp]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • start_timestamp: Directly copied to the output
Column Lineage
%3 261. model.twitter_ads_source.stg_twitter_ads__campaign_history 261. model.twitter_ads_source.stg_twitter_ads__campaign_history is_latest_version updated_timestamp 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report updated_timestamp 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f1->254. model.twitter_ads.twitter_ads__campaign_report:f0 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp updated_at 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f0->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f1 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f0->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0
261. model.twitter_ads_source.stg_twitter_ads__campaign_history
  • Input Column: 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp[updated_at]
    • Cleaning The column is cast to TIMESTAMP type
    • Deduplication Used in the ROW_NUMBER() function to identify the latest version of each campaign
    • Output Columns:
      • updated_timestamp: Copied to the output, renamed, and cast to TIMESTAMP
      • is_latest_version: Used to determine if the record is the latest version
254. model.twitter_ads.twitter_ads__campaign_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[updated_timestamp]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • updated_timestamp: Directly copied to the output
Column Lineage
%3 261. model.twitter_ads_source.stg_twitter_ads__campaign_history 261. model.twitter_ads_source.stg_twitter_ads__campaign_history funding_instrument_id 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report funding_instrument_id 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->254. model.twitter_ads.twitter_ads__campaign_report:f0 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp funding_instrument_id 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f0->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0
261. model.twitter_ads_source.stg_twitter_ads__campaign_history
  • Input Column: 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp[funding_instrument_id]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • funding_instrument_id: Directly copied to the output
254. model.twitter_ads.twitter_ads__campaign_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[funding_instrument_id]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • funding_instrument_id: Directly copied to the output
Column Lineage
%3 261. model.twitter_ads_source.stg_twitter_ads__campaign_history 261. model.twitter_ads_source.stg_twitter_ads__campaign_history daily_budget_amount daily_budget_amount_local_micro 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report daily_budget_amount 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f1->254. model.twitter_ads.twitter_ads__campaign_report:f0 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->254. model.twitter_ads.twitter_ads__campaign_report:f0 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp daily_budget_amount_local_micro 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f0->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f1 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f0->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f0->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f1 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f0->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0
261. model.twitter_ads_source.stg_twitter_ads__campaign_history
  • Input Column: 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp[daily_budget_amount_local_micro]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT type
    • Featurization Used to calculate daily_budget_amount
    • Output Columns:
      • daily_budget_amount_local_micro: Directly mapped after casting
      • daily_budget_amount: Calculated by dividing by 1,000,000 and rounding to 2 decimal places
  • Input Column: 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp[daily_budget_amount_local_micro]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT type
    • Featurization Used to calculate daily_budget_amount
    • Output Columns:
      • daily_budget_amount_local_micro: Directly mapped after casting
      • daily_budget_amount: Calculated by dividing by 1,000,000 and rounding to 2 decimal places
254. model.twitter_ads.twitter_ads__campaign_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[daily_budget_amount_local_micro]
    • Cleaning likely transformed from micro to standard units
    • Output Columns:
      • daily_budget_amount: transformed from micro to standard units
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[daily_budget_amount]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • daily_budget_amount: Directly copied to the output
Column Lineage
%3 261. model.twitter_ads_source.stg_twitter_ads__campaign_history 261. model.twitter_ads_source.stg_twitter_ads__campaign_history total_budget_amount total_budget_amount_local_micro 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report total_budget_amount 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f1->254. model.twitter_ads.twitter_ads__campaign_report:f0 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->254. model.twitter_ads.twitter_ads__campaign_report:f0 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp total_budget_amount_local_micro 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f0->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f1 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f0->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f0->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f1 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f0->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0
261. model.twitter_ads_source.stg_twitter_ads__campaign_history
  • Input Column: 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp[total_budget_amount_local_micro]
    • Direct The column is directly copied without any transformation
    • Featurization Used to calculate the total_budget_amount in standard currency units
    • Output Columns:
      • total_budget_amount_local_micro: Directly copied to the output
      • total_budget_amount: Transformed to calculate the budget in standard currency units
  • Input Column: 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp[total_budget_amount_local_micro]
    • Direct The column is directly copied without any transformation
    • Featurization Used to calculate the total_budget_amount in standard currency units
    • Output Columns:
      • total_budget_amount_local_micro: Directly copied to the output
      • total_budget_amount: Transformed to calculate the budget in standard currency units
254. model.twitter_ads.twitter_ads__campaign_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[total_budget_amount_local_micro]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • total_budget_amount: Directly copied to the output
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[total_budget_amount]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join between the report and campaigns tables
    • Output Columns:
      • total_budget_amount: It is directly mapped to the output column of the same name
255. model.twitter_ads.twitter_ads__keyword_report

This SQL query integrates data from multiple Twitter Ads-related tables to create a comprehensive keyword report. It joins the keyword report with line item, campaign, and account information, and then aggregates metrics such as clicks, impressions, spend, and URL clicks. The query filters for the latest versions of line items, campaigns, and accounts, and groups the results by various dimensions including date, account, campaign, line item, and keyword.

FilteringIntegrationAggregation
SQL Query
WITH report AS (
  SELECT
    *
  FROM TEST.PUBLIC_twitter_ads_source.stg_twitter_ads__line_item_keywords_report
), line_items AS (
  SELECT
    *
  FROM TEST.PUBLIC_twitter_ads_source.stg_twitter_ads__line_item_history
  WHERE
    is_latest_version
), campaigns AS (
  SELECT
    *
  FROM TEST.PUBLIC_twitter_ads_source.stg_twitter_ads__campaign_history
  WHERE
    is_latest_version
), accounts AS (
  SELECT
    *
  FROM TEST.PUBLIC_twitter_ads_source.stg_twitter_ads__account_history
  WHERE
    is_latest_version
), final AS (
  SELECT
    report.source_relation,
    report.date_day,
    report.placement,
    report.account_id,
    accounts.name AS account_name,
    line_items.campaign_id,
    campaigns.campaign_name,
    report.line_item_id,
    line_items.name AS line_item_name,
    report.keyword_id,
    report.keyword,
    line_items.currency,
    SUM(report.clicks) AS clicks,
    SUM(report.impressions) AS impressions,
    SUM(report.spend) AS spend,
    SUM(report.spend_micro) AS spend_micro,
    SUM(report.url_clicks) AS url_clicks
  FROM report
  LEFT JOIN line_items
    ON report.line_item_id = line_items.line_item_id
    AND report.source_relation = line_items.source_relation
  LEFT JOIN campaigns
    ON line_items.campaign_id = campaigns.campaign_id
    AND line_items.source_relation = campaigns.source_relation
  LEFT JOIN accounts
    ON report.account_id = accounts.account_id
    AND report.source_relation = accounts.source_relation
  GROUP BY
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10,
    11,
    12
)
SELECT
  *
FROM final
%3 255. model.twitter_ads.twitter_ads__keyword_report 255. model.twitter_ads.twitter_ads__keyword_report source_relation account_id spend_micro spend clicks date_day impressions line_item_id url_clicks keyword keyword_id placement account_name campaign_id campaign_name line_item_name currency 259. model.twitter_ads_source.stg_twitter_ads__account_history 259. model.twitter_ads_source.stg_twitter_ads__account_history source_relation account_id name 259. model.twitter_ads_source.stg_twitter_ads__account_history:f0->255. model.twitter_ads.twitter_ads__keyword_report:f0 259. model.twitter_ads_source.stg_twitter_ads__account_history:f1->255. model.twitter_ads.twitter_ads__keyword_report:f1 259. model.twitter_ads_source.stg_twitter_ads__account_history:f2->255. model.twitter_ads.twitter_ads__keyword_report:f12 261. model.twitter_ads_source.stg_twitter_ads__campaign_history 261. model.twitter_ads_source.stg_twitter_ads__campaign_history source_relation campaign_id campaign_name 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->255. model.twitter_ads.twitter_ads__keyword_report:f0 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f1->255. model.twitter_ads.twitter_ads__keyword_report:f13 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f2->255. model.twitter_ads.twitter_ads__keyword_report:f14 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history source_relation campaign_id currency line_item_id name 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->255. model.twitter_ads.twitter_ads__keyword_report:f0 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f1->255. model.twitter_ads.twitter_ads__keyword_report:f13 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f2->255. model.twitter_ads.twitter_ads__keyword_report:f16 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f3->255. model.twitter_ads.twitter_ads__keyword_report:f7 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f4->255. model.twitter_ads.twitter_ads__keyword_report:f15 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report source_relation keyword_id account_id spend_micro spend clicks date_day impressions line_item_id url_clicks keyword placement 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report:f0->255. model.twitter_ads.twitter_ads__keyword_report:f0 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report:f1->255. model.twitter_ads.twitter_ads__keyword_report:f10 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report:f2->255. model.twitter_ads.twitter_ads__keyword_report:f1 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report:f3->255. model.twitter_ads.twitter_ads__keyword_report:f2 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report:f4->255. model.twitter_ads.twitter_ads__keyword_report:f3 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report:f5->255. model.twitter_ads.twitter_ads__keyword_report:f4 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report:f6->255. model.twitter_ads.twitter_ads__keyword_report:f5 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report:f7->255. model.twitter_ads.twitter_ads__keyword_report:f6 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report:f8->255. model.twitter_ads.twitter_ads__keyword_report:f7 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report:f9->255. model.twitter_ads.twitter_ads__keyword_report:f8 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report:f10->255. model.twitter_ads.twitter_ads__keyword_report:f9 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report:f11->255. model.twitter_ads.twitter_ads__keyword_report:f11
Name Type Comment
source_relation None The source of the record if the unioning functionality is being used. If not this field will be empty.
account_id None The ID of the related account.
spend_micro None The spend for the line item + keyword on that day, in micros and in whichever currency was selected during account creation.
spend None The spend for the line item + keyword on that day in whichever currency was selected during account creation.
clicks None The clicks for the line item + keyword on that day. Includes clicks on the URL (shortened or regular links), profile pic, screen name, username, detail, hashtags, and likes.
date_day None The date of the performance.
impressions None The impressions for the line item + keyword on that day. This is the number of users who see a Promoted Ad either in their home timeline or search results.
line_item_id None The ID of the related line item (ad group).
url_clicks None The url clicks for the line item + keyword on that day.
keyword None The keyword whose performance is being tracked.
keyword_id None Unique key of the table built from the combination of 'account_id', 'line_item_id', 'segment', and 'placement' fields.
placement None Where on Twitter the ad is being displayed. Possible values include 'ALL_ON_TWITTER', 'PUBLISHER_NETWORK', 'TWITTER_PROFILE', 'TWITTER_SEARCH', 'TWITTER_TIMELINE', and 'TAP_*', which are more granular options for `PUBLISHER_NETWORK`.
account_name None Name of the associated account.
campaign_id None The ID of the related campaign.
campaign_name None The name of the related campaign.
line_item_name None The ID of the related line item.
currency None The currency all metrics for the account are set to.
Column Lineage
%3 259. model.twitter_ads_source.stg_twitter_ads__account_history 259. model.twitter_ads_source.stg_twitter_ads__account_history source_relation 255. model.twitter_ads.twitter_ads__keyword_report 255. model.twitter_ads.twitter_ads__keyword_report source_relation 259. model.twitter_ads_source.stg_twitter_ads__account_history:f0->255. model.twitter_ads.twitter_ads__keyword_report:f0 261. model.twitter_ads_source.stg_twitter_ads__campaign_history 261. model.twitter_ads_source.stg_twitter_ads__campaign_history source_relation 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->255. model.twitter_ads.twitter_ads__keyword_report:f0 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history source_relation 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->255. model.twitter_ads.twitter_ads__keyword_report:f0 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report source_relation 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report:f0->255. model.twitter_ads.twitter_ads__keyword_report:f0
255. model.twitter_ads.twitter_ads__keyword_report
  • Input Column: 259. model.twitter_ads_source.stg_twitter_ads__account_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[source_relation]
    • Integration This column is used as a key to join with other tables
    • Output Columns:
      • source_relation: Directly copied to the output
  • Input Column: 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with other tables
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
Column Lineage
%3 259. model.twitter_ads_source.stg_twitter_ads__account_history 259. model.twitter_ads_source.stg_twitter_ads__account_history account_id 255. model.twitter_ads.twitter_ads__keyword_report 255. model.twitter_ads.twitter_ads__keyword_report account_id 259. model.twitter_ads_source.stg_twitter_ads__account_history:f0->255. model.twitter_ads.twitter_ads__keyword_report:f0 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report account_id 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report:f0->255. model.twitter_ads.twitter_ads__keyword_report:f0 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp id 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp:f0->259. model.twitter_ads_source.stg_twitter_ads__account_history:f0
259. model.twitter_ads_source.stg_twitter_ads__account_history
  • Input Column: 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp[id]
    • Cleaning The column is cast to TEXT type
    • Direct The column is directly copied to the output with a name change
    • Deduplication Used in the ROW_NUMBER() function to identify the latest version
    • Output Columns:
      • account_id: Directly mapped after casting and renaming
255. model.twitter_ads.twitter_ads__keyword_report
  • Input Column: 259. model.twitter_ads_source.stg_twitter_ads__account_history[account_id]
    • Integration used as the key to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • account_id: directly copied
  • Input Column: 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report[account_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a join key with the accounts table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • account_id: Directly copied to the output
Column Lineage
%3 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report spend_micro 255. model.twitter_ads.twitter_ads__keyword_report 255. model.twitter_ads.twitter_ads__keyword_report spend_micro 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report:f0->255. model.twitter_ads.twitter_ads__keyword_report:f0
255. model.twitter_ads.twitter_ads__keyword_report
  • Input Column: 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report[spend_micro]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • spend_micro: Aggregated sum in the output
Column Lineage
%3 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report spend 255. model.twitter_ads.twitter_ads__keyword_report 255. model.twitter_ads.twitter_ads__keyword_report spend 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report:f0->255. model.twitter_ads.twitter_ads__keyword_report:f0
255. model.twitter_ads.twitter_ads__keyword_report
  • Input Column: 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report[spend]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • spend: Aggregated sum in the output
Column Lineage
%3 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report clicks 255. model.twitter_ads.twitter_ads__keyword_report 255. model.twitter_ads.twitter_ads__keyword_report clicks 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report:f0->255. model.twitter_ads.twitter_ads__keyword_report:f0
255. model.twitter_ads.twitter_ads__keyword_report
  • Input Column: 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report[clicks]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • clicks: Aggregated sum in the output
Column Lineage
%3 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report date_day 255. model.twitter_ads.twitter_ads__keyword_report 255. model.twitter_ads.twitter_ads__keyword_report date_day 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report:f0->255. model.twitter_ads.twitter_ads__keyword_report:f0
255. model.twitter_ads.twitter_ads__keyword_report
  • Input Column: 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report impressions 255. model.twitter_ads.twitter_ads__keyword_report 255. model.twitter_ads.twitter_ads__keyword_report impressions 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report:f0->255. model.twitter_ads.twitter_ads__keyword_report:f0
255. model.twitter_ads.twitter_ads__keyword_report
  • Input Column: 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report[impressions]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • impressions: Aggregated sum in the output
Column Lineage
%3 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history line_item_id 255. model.twitter_ads.twitter_ads__keyword_report 255. model.twitter_ads.twitter_ads__keyword_report line_item_id 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->255. model.twitter_ads.twitter_ads__keyword_report:f0 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report line_item_id 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report:f0->255. model.twitter_ads.twitter_ads__keyword_report:f0 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp id 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[id]
    • Direct The column is directly copied without any transformation
    • Deduplication The column is used for deduplication in the ROW_NUMBER() window function
    • Output Columns:
      • line_item_id: Mapped to the output column with a renamed field
255. model.twitter_ads.twitter_ads__keyword_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[line_item_id]
    • Integration This column is used as a key to join with the report table
    • Output Columns:
      • line_item_id: Directly copied to the output
  • Input Column: 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report[line_item_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a join key with the line_items table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • line_item_id: Directly copied to the output
Column Lineage
%3 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report url_clicks 255. model.twitter_ads.twitter_ads__keyword_report 255. model.twitter_ads.twitter_ads__keyword_report url_clicks 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report:f0->255. model.twitter_ads.twitter_ads__keyword_report:f0
255. model.twitter_ads.twitter_ads__keyword_report
  • Input Column: 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report[url_clicks]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • url_clicks: Aggregated sum in the output
Column Lineage
%3 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report keyword 255. model.twitter_ads.twitter_ads__keyword_report 255. model.twitter_ads.twitter_ads__keyword_report keyword 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report:f0->255. model.twitter_ads.twitter_ads__keyword_report:f0
255. model.twitter_ads.twitter_ads__keyword_report
  • Input Column: 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report[keyword]
    • Direct The keyword is directly copied to the output without transformation
    • Aggregation The keyword is used in the GROUP BY clause
    • Output Columns:
      • keyword: Directly copied to the output column 'keyword'
Column Lineage
%3 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report keyword_id 255. model.twitter_ads.twitter_ads__keyword_report 255. model.twitter_ads.twitter_ads__keyword_report keyword_id 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report:f0->255. model.twitter_ads.twitter_ads__keyword_report:f0
255. model.twitter_ads.twitter_ads__keyword_report
  • Input Column: 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report[keyword_id]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • keyword_id: Directly copied to the output
Column Lineage
%3 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report placement 255. model.twitter_ads.twitter_ads__keyword_report 255. model.twitter_ads.twitter_ads__keyword_report placement 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report:f0->255. model.twitter_ads.twitter_ads__keyword_report:f0
255. model.twitter_ads.twitter_ads__keyword_report
  • Input Column: 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report[placement]
    • Direct The placement is directly copied to the output without transformation
    • Aggregation The placement is used in the GROUP BY clause
    • Output Columns:
      • placement: Directly copied to the output column 'placement'
Column Lineage
%3 259. model.twitter_ads_source.stg_twitter_ads__account_history 259. model.twitter_ads_source.stg_twitter_ads__account_history name 255. model.twitter_ads.twitter_ads__keyword_report 255. model.twitter_ads.twitter_ads__keyword_report account_name 259. model.twitter_ads_source.stg_twitter_ads__account_history:f0->255. model.twitter_ads.twitter_ads__keyword_report:f0 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp name 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp:f0->259. model.twitter_ads_source.stg_twitter_ads__account_history:f0
259. model.twitter_ads_source.stg_twitter_ads__account_history
  • Input Column: 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp[name]
    • Cleaning The column is cast to TEXT type
    • Direct The column is directly copied to the output
    • Output Columns:
      • name: Directly mapped after casting
255. model.twitter_ads.twitter_ads__keyword_report
  • Input Column: 259. model.twitter_ads_source.stg_twitter_ads__account_history[name]
    • Direct directly copied to the output
    • Output Columns:
      • account_name: directly copied and renamed
Column Lineage
%3 261. model.twitter_ads_source.stg_twitter_ads__campaign_history 261. model.twitter_ads_source.stg_twitter_ads__campaign_history campaign_id 255. model.twitter_ads.twitter_ads__keyword_report 255. model.twitter_ads.twitter_ads__keyword_report campaign_id 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->255. model.twitter_ads.twitter_ads__keyword_report:f0 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history campaign_id 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->255. model.twitter_ads.twitter_ads__keyword_report:f0 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp id 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f0->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp campaign_id 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0
261. model.twitter_ads_source.stg_twitter_ads__campaign_history
  • Input Column: 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp[id]
    • Direct The column is directly copied without any transformation
    • Deduplication Used in the ROW_NUMBER() function to identify the latest version of each campaign
    • Output Columns:
      • campaign_id: Directly copied to the output and renamed
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[campaign_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • campaign_id: Directly mapped
255. model.twitter_ads.twitter_ads__keyword_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[campaign_id]
    • Integration used as a key to join with line_items table
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[campaign_id]
    • Integration This column is used as a key to join with the campaigns table
    • Output Columns:
      • campaign_id: Directly copied to the output
Column Lineage
%3 261. model.twitter_ads_source.stg_twitter_ads__campaign_history 261. model.twitter_ads_source.stg_twitter_ads__campaign_history campaign_name 255. model.twitter_ads.twitter_ads__keyword_report 255. model.twitter_ads.twitter_ads__keyword_report campaign_name 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->255. model.twitter_ads.twitter_ads__keyword_report:f0 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp name 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f0->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0
261. model.twitter_ads_source.stg_twitter_ads__campaign_history
  • Input Column: 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp[name]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • campaign_name: Directly copied to the output and renamed
255. model.twitter_ads.twitter_ads__keyword_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[campaign_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_name: directly copied
Column Lineage
%3 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history name 255. model.twitter_ads.twitter_ads__keyword_report 255. model.twitter_ads.twitter_ads__keyword_report line_item_name 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->255. model.twitter_ads.twitter_ads__keyword_report:f0 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp name 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[name]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • name: Directly mapped to the output column
255. model.twitter_ads.twitter_ads__keyword_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[name]
    • Direct This column is directly copied to the output
    • Output Columns:
      • line_item_name: Directly copied to the output
Column Lineage
%3 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history currency 255. model.twitter_ads.twitter_ads__keyword_report 255. model.twitter_ads.twitter_ads__keyword_report currency 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->255. model.twitter_ads.twitter_ads__keyword_report:f0 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp currency 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[currency]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • currency: Directly mapped to the output column
255. model.twitter_ads.twitter_ads__keyword_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[currency]
    • Direct This column is directly copied to the output
    • Output Columns:
      • currency: Directly copied to the output
256. model.twitter_ads.twitter_ads__line_item_report

This SQL query integrates data from multiple Twitter Ads-related tables (line item report, line items, campaigns, and accounts) to create a comprehensive report. It joins these tables based on common identifiers and source relations, selecting the latest versions of historical data where applicable. The query then aggregates metrics such as clicks, impressions, spend, and URL clicks while including various attributes from the joined tables. The result is a detailed view of Twitter Ads performance at the line item level, including associated campaign and account information.

FilteringIntegrationAggregation
SQL Query
WITH report AS (
  SELECT
    *
  FROM TEST.PUBLIC_twitter_ads_source.stg_twitter_ads__line_item_report
), line_items AS (
  SELECT
    *
  FROM TEST.PUBLIC_twitter_ads_source.stg_twitter_ads__line_item_history
  WHERE
    is_latest_version
), campaigns AS (
  SELECT
    *
  FROM TEST.PUBLIC_twitter_ads_source.stg_twitter_ads__campaign_history
  WHERE
    is_latest_version
), accounts AS (
  SELECT
    *
  FROM TEST.PUBLIC_twitter_ads_source.stg_twitter_ads__account_history
  WHERE
    is_latest_version
), final AS (
  SELECT
    report.source_relation,
    report.date_day,
    report.placement,
    report.account_id,
    accounts.name AS account_name,
    line_items.campaign_id,
    campaigns.campaign_name,
    report.line_item_id,
    line_items.name AS line_item_name,
    line_items.is_deleted,
    line_items.entity_status AS line_item_status,
    campaigns.entity_status AS campaign_status,
    line_items.currency,
    line_items.advertiser_domain,
    line_items.advertiser_user_id,
    line_items.bid_type,
    line_items.bid_unit,
    line_items.charge_by,
    line_items.objective,
    line_items.optimization,
    line_items.product_type,
    line_items.primary_web_event_tag,
    line_items.creative_source,
    line_items.start_timestamp,
    line_items.end_timestamp,
    line_items.created_timestamp,
    line_items.updated_timestamp,
    line_items.target_cpa,
    line_items.total_budget_amount,
    line_items.bid_amount,
    SUM(report.clicks) AS clicks,
    SUM(report.impressions) AS impressions,
    SUM(report.spend) AS spend,
    SUM(report.spend_micro) AS spend_micro,
    SUM(report.url_clicks) AS url_clicks
  FROM report
  LEFT JOIN line_items
    ON report.line_item_id = line_items.line_item_id
    AND report.source_relation = line_items.source_relation
  LEFT JOIN campaigns
    ON line_items.campaign_id = campaigns.campaign_id
    AND line_items.source_relation = campaigns.source_relation
  LEFT JOIN accounts
    ON report.account_id = accounts.account_id
    AND report.source_relation = accounts.source_relation
  GROUP BY
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10,
    11,
    12,
    13,
    14,
    15,
    16,
    17,
    18,
    19,
    20,
    21,
    22,
    23,
    24,
    25,
    26,
    27,
    28,
    29,
    30
)
SELECT
  *
FROM final
%3 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report source_relation campaign_id campaign_name clicks date_day impressions line_item_id line_item_name spend spend_micro url_clicks placement account_id account_name advertiser_domain advertiser_user_id bid_type bid_unit charge_by created_timestamp creative_source currency is_deleted end_timestamp line_item_status campaign_status objective optimization primary_web_event_tag product_type start_timestamp updated_timestamp bid_amount total_budget_amount target_cpa 259. model.twitter_ads_source.stg_twitter_ads__account_history 259. model.twitter_ads_source.stg_twitter_ads__account_history source_relation account_id name updated_timestamp 259. model.twitter_ads_source.stg_twitter_ads__account_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0 259. model.twitter_ads_source.stg_twitter_ads__account_history:f1->256. model.twitter_ads.twitter_ads__line_item_report:f12 259. model.twitter_ads_source.stg_twitter_ads__account_history:f2->256. model.twitter_ads.twitter_ads__line_item_report:f13 259. model.twitter_ads_source.stg_twitter_ads__account_history:f3->256. model.twitter_ads.twitter_ads__line_item_report:f31 261. model.twitter_ads_source.stg_twitter_ads__campaign_history 261. model.twitter_ads_source.stg_twitter_ads__campaign_history source_relation entity_status campaign_id campaign_name 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f1->256. model.twitter_ads.twitter_ads__line_item_report:f25 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f2->256. model.twitter_ads.twitter_ads__line_item_report:f1 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f3->256. model.twitter_ads.twitter_ads__line_item_report:f2 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history source_relation advertiser_domain advertiser_user_id bid_amount_local_micro bid_type bid_unit campaign_id charge_by created_timestamp creative_source currency is_deleted end_timestamp entity_status line_item_id name objective optimization primary_web_event_tag product_type start_timestamp updated_timestamp bid_amount total_budget_amount target_cpa 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f1->256. model.twitter_ads.twitter_ads__line_item_report:f14 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f2->256. model.twitter_ads.twitter_ads__line_item_report:f15 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f3->256. model.twitter_ads.twitter_ads__line_item_report:f32 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f4->256. model.twitter_ads.twitter_ads__line_item_report:f16 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f5->256. model.twitter_ads.twitter_ads__line_item_report:f17 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f6->256. model.twitter_ads.twitter_ads__line_item_report:f1 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f7->256. model.twitter_ads.twitter_ads__line_item_report:f18 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f8->256. model.twitter_ads.twitter_ads__line_item_report:f19 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f9->256. model.twitter_ads.twitter_ads__line_item_report:f20 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f10->256. model.twitter_ads.twitter_ads__line_item_report:f21 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f11->256. model.twitter_ads.twitter_ads__line_item_report:f22 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f12->256. model.twitter_ads.twitter_ads__line_item_report:f23 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f13->256. model.twitter_ads.twitter_ads__line_item_report:f24 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f14->256. model.twitter_ads.twitter_ads__line_item_report:f6 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f15->256. model.twitter_ads.twitter_ads__line_item_report:f7 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f16->256. model.twitter_ads.twitter_ads__line_item_report:f26 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f17->256. model.twitter_ads.twitter_ads__line_item_report:f27 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f18->256. model.twitter_ads.twitter_ads__line_item_report:f28 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f19->256. model.twitter_ads.twitter_ads__line_item_report:f29 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f20->256. model.twitter_ads.twitter_ads__line_item_report:f30 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f21->256. model.twitter_ads.twitter_ads__line_item_report:f31 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f22->256. model.twitter_ads.twitter_ads__line_item_report:f32 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f23->256. model.twitter_ads.twitter_ads__line_item_report:f33 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f24->256. model.twitter_ads.twitter_ads__line_item_report:f34 269. model.twitter_ads_source.stg_twitter_ads__line_item_report 269. model.twitter_ads_source.stg_twitter_ads__line_item_report source_relation account_id spend_micro spend clicks date_day impressions line_item_id url_clicks placement 269. model.twitter_ads_source.stg_twitter_ads__line_item_report:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0 269. model.twitter_ads_source.stg_twitter_ads__line_item_report:f1->256. model.twitter_ads.twitter_ads__line_item_report:f12 269. model.twitter_ads_source.stg_twitter_ads__line_item_report:f2->256. model.twitter_ads.twitter_ads__line_item_report:f9 269. model.twitter_ads_source.stg_twitter_ads__line_item_report:f3->256. model.twitter_ads.twitter_ads__line_item_report:f8 269. model.twitter_ads_source.stg_twitter_ads__line_item_report:f4->256. model.twitter_ads.twitter_ads__line_item_report:f3 269. model.twitter_ads_source.stg_twitter_ads__line_item_report:f5->256. model.twitter_ads.twitter_ads__line_item_report:f4 269. model.twitter_ads_source.stg_twitter_ads__line_item_report:f6->256. model.twitter_ads.twitter_ads__line_item_report:f5 269. model.twitter_ads_source.stg_twitter_ads__line_item_report:f7->256. model.twitter_ads.twitter_ads__line_item_report:f6 269. model.twitter_ads_source.stg_twitter_ads__line_item_report:f8->256. model.twitter_ads.twitter_ads__line_item_report:f10 269. model.twitter_ads_source.stg_twitter_ads__line_item_report:f9->256. model.twitter_ads.twitter_ads__line_item_report:f11
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
campaign_id text The ID of the line item's campaign.
campaign_name text The name of the line item's campaign.
clicks bigint The number of clicks on that date. Includes clicks on the URL (shortened or regular links), profile pic, screen name, username, detail, hashtags, and likes.
date_day timestamp without time zone The date of the performance.
impressions bigint The number of impressions on that date. This is the number of users who see a Promoted Ad either in their home timeline or search results.
line_item_id text The ID of the line item.
line_item_name text The name of the line item.
spend numeric The amount of spend on that date.
spend_micro bigint The amount of spend, in micros, on that date.
url_clicks bigint The number of URL clicks on that date.
placement text Where on Twitter the ad is being displayed. Possible values include 'ALL_ON_TWITTER', 'PUBLISHER_NETWORK', 'TWITTER_PROFILE', 'TWITTER_SEARCH', 'TWITTER_TIMELINE', and 'TAP_*', which are more granular options for `PUBLISHER_NETWORK`.
account_id text The ID of the related account.
account_name character varying The name of the related account.
advertiser_domain text The website domain for this advertiser, without the protocol specification.
advertiser_user_id integer The Twitter user identifier for the handle promoting the ad.
bid_type text The bidding mechanism.
bid_unit text The bid unit for this line item.
charge_by text The unit to charge this line item by.
created_timestamp text Time that the respective record (ad, ad group, campaign, post, etc) was created. ISO-8601 timestamp.
creative_source text The source of the creatives for the line item.
currency text The currency in which metrics will be reported.
is_deleted boolean Whether the record has been deleted or not.
end_timestamp integer The timestamp at which the line item will stop being served.
line_item_status text The status of the line item.
campaign_status text The status of the line item's related campaign.
objective text The campaign objective for this line item.
optimization text The optimization setting to use with this line item.
primary_web_event_tag integer The identifier of the primary web event tag. Allows more accurate tracking of engagements for the campaign pertaining to this line item.
product_type text The type of promoted product that this line item will contain.
start_timestamp integer The timestamp at which the line item will start being served.
updated_timestamp text Timestamp of when the record was last updated in Google Ads.
bid_amount numeric The bid amount to be associated with this line item.
total_budget_amount numeric The total budget amount to be allocated to the campaign.
target_cpa numeric The target cost per acquisition for the line item.
Column Lineage
%3 259. model.twitter_ads_source.stg_twitter_ads__account_history 259. model.twitter_ads_source.stg_twitter_ads__account_history source_relation 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report source_relation 259. model.twitter_ads_source.stg_twitter_ads__account_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0 261. model.twitter_ads_source.stg_twitter_ads__campaign_history 261. model.twitter_ads_source.stg_twitter_ads__campaign_history source_relation 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history source_relation 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0 269. model.twitter_ads_source.stg_twitter_ads__line_item_report 269. model.twitter_ads_source.stg_twitter_ads__line_item_report source_relation 269. model.twitter_ads_source.stg_twitter_ads__line_item_report:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 259. model.twitter_ads_source.stg_twitter_ads__account_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct copied directly to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with other tables
    • Output Columns:
      • source_relation: Directly copied to the output
  • Input Column: 269. model.twitter_ads_source.stg_twitter_ads__line_item_report[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with other tables
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
Column Lineage
%3 261. model.twitter_ads_source.stg_twitter_ads__campaign_history 261. model.twitter_ads_source.stg_twitter_ads__campaign_history campaign_id 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report campaign_id 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history campaign_id 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp id 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f0->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp campaign_id 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0
261. model.twitter_ads_source.stg_twitter_ads__campaign_history
  • Input Column: 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp[id]
    • Direct The column is directly copied without any transformation
    • Deduplication Used in the ROW_NUMBER() function to identify the latest version of each campaign
    • Output Columns:
      • campaign_id: Directly copied to the output and renamed
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[campaign_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • campaign_id: Directly mapped
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[campaign_id]
    • Integration used as a key to join with line_items table
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[campaign_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a join key with the campaigns table
    • Output Columns:
      • campaign_id: Directly copied to the output
Column Lineage
%3 261. model.twitter_ads_source.stg_twitter_ads__campaign_history 261. model.twitter_ads_source.stg_twitter_ads__campaign_history campaign_name 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report campaign_name 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp name 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f0->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0
261. model.twitter_ads_source.stg_twitter_ads__campaign_history
  • Input Column: 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp[name]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • campaign_name: Directly copied to the output and renamed
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[campaign_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_name: directly copied
Column Lineage
%3 269. model.twitter_ads_source.stg_twitter_ads__line_item_report 269. model.twitter_ads_source.stg_twitter_ads__line_item_report clicks 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report clicks 269. model.twitter_ads_source.stg_twitter_ads__line_item_report:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp clicks 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp:f0->269. model.twitter_ads_source.stg_twitter_ads__line_item_report:f0
269. model.twitter_ads_source.stg_twitter_ads__line_item_report
  • Input Column: 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp[clicks]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to INT data type
    • Output Columns:
      • clicks: Directly mapped to the output 'clicks' column
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 269. model.twitter_ads_source.stg_twitter_ads__line_item_report[clicks]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • clicks: Aggregated sum in the output
Column Lineage
%3 269. model.twitter_ads_source.stg_twitter_ads__line_item_report 269. model.twitter_ads_source.stg_twitter_ads__line_item_report date_day 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report date_day 269. model.twitter_ads_source.stg_twitter_ads__line_item_report:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp date 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp:f0->269. model.twitter_ads_source.stg_twitter_ads__line_item_report:f0
269. model.twitter_ads_source.stg_twitter_ads__line_item_report
  • Input Column: 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp[date]
    • Cleaning The column is cast as TIMESTAMP and then truncated to day level
    • Featurization The day-level date is extracted from this column
    • Output Columns:
      • date_day: Mapped after casting and truncating to day level
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 269. model.twitter_ads_source.stg_twitter_ads__line_item_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 269. model.twitter_ads_source.stg_twitter_ads__line_item_report 269. model.twitter_ads_source.stg_twitter_ads__line_item_report impressions 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report impressions 269. model.twitter_ads_source.stg_twitter_ads__line_item_report:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp impressions 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp:f0->269. model.twitter_ads_source.stg_twitter_ads__line_item_report:f0
269. model.twitter_ads_source.stg_twitter_ads__line_item_report
  • Input Column: 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp[impressions]
    • Cleaning The column is cast to INT type
    • Direct The column is directly copied to the output without transformation
    • Output Columns:
      • impressions: Directly copied after casting
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 269. model.twitter_ads_source.stg_twitter_ads__line_item_report[impressions]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • impressions: Aggregated sum in the output
Column Lineage
%3 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history line_item_id 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report line_item_id 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0 269. model.twitter_ads_source.stg_twitter_ads__line_item_report 269. model.twitter_ads_source.stg_twitter_ads__line_item_report line_item_id 269. model.twitter_ads_source.stg_twitter_ads__line_item_report:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp id 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp line_item_id 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp:f0->269. model.twitter_ads_source.stg_twitter_ads__line_item_report:f0
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[id]
    • Direct The column is directly copied without any transformation
    • Deduplication The column is used for deduplication in the ROW_NUMBER() window function
    • Output Columns:
      • line_item_id: Mapped to the output column with a renamed field
269. model.twitter_ads_source.stg_twitter_ads__line_item_report
  • Input Column: 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp[line_item_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • line_item_id: Directly mapped after casting
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[line_item_id]
    • Integration The column is used as the key to join with the report table
    • Output Columns:
      • line_item_id: Directly copied to the output
  • Input Column: 269. model.twitter_ads_source.stg_twitter_ads__line_item_report[line_item_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with the line_items table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • line_item_id: Directly copied to the output
Column Lineage
%3 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history name 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report line_item_name 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp name 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[name]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • name: Directly mapped to the output column
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[name]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the JOIN condition with the report table
    • Output Columns:
      • line_item_name: Renamed and directly copied to the output
Column Lineage
%3 269. model.twitter_ads_source.stg_twitter_ads__line_item_report 269. model.twitter_ads_source.stg_twitter_ads__line_item_report spend spend_micro 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report spend 269. model.twitter_ads_source.stg_twitter_ads__line_item_report:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp billed_charge_local_micro 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp:f0->269. model.twitter_ads_source.stg_twitter_ads__line_item_report:f1 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp:f0->269. model.twitter_ads_source.stg_twitter_ads__line_item_report:f0
269. model.twitter_ads_source.stg_twitter_ads__line_item_report
  • Input Column: 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp[billed_charge_local_micro]
    • Cleaning The column is cast as INT
    • Featurization The spend in regular currency is calculated from this column
    • Output Columns:
      • spend_micro: Directly mapped after casting
      • spend: Calculated by dividing by 1,000,000 and rounding to 2 decimal places
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 269. model.twitter_ads_source.stg_twitter_ads__line_item_report[spend]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • spend: Aggregated sum in the output
Column Lineage
%3 269. model.twitter_ads_source.stg_twitter_ads__line_item_report 269. model.twitter_ads_source.stg_twitter_ads__line_item_report spend spend_micro 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report spend_micro 269. model.twitter_ads_source.stg_twitter_ads__line_item_report:f1->256. model.twitter_ads.twitter_ads__line_item_report:f0 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp billed_charge_local_micro 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp:f0->269. model.twitter_ads_source.stg_twitter_ads__line_item_report:f1 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp:f0->269. model.twitter_ads_source.stg_twitter_ads__line_item_report:f0
269. model.twitter_ads_source.stg_twitter_ads__line_item_report
  • Input Column: 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp[billed_charge_local_micro]
    • Cleaning The column is cast as INT
    • Featurization The spend in regular currency is calculated from this column
    • Output Columns:
      • spend_micro: Directly mapped after casting
      • spend: Calculated by dividing by 1,000,000 and rounding to 2 decimal places
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 269. model.twitter_ads_source.stg_twitter_ads__line_item_report[spend_micro]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • spend_micro: Aggregated sum in the output
Column Lineage
%3 269. model.twitter_ads_source.stg_twitter_ads__line_item_report 269. model.twitter_ads_source.stg_twitter_ads__line_item_report url_clicks 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report url_clicks 269. model.twitter_ads_source.stg_twitter_ads__line_item_report:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp url_clicks 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp:f0->269. model.twitter_ads_source.stg_twitter_ads__line_item_report:f0
269. model.twitter_ads_source.stg_twitter_ads__line_item_report
  • Input Column: 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp[url_clicks]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • url_clicks: Directly mapped to the output column 'url_clicks'
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 269. model.twitter_ads_source.stg_twitter_ads__line_item_report[url_clicks]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • url_clicks: Aggregated sum in the output
Column Lineage
%3 269. model.twitter_ads_source.stg_twitter_ads__line_item_report 269. model.twitter_ads_source.stg_twitter_ads__line_item_report placement 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report placement 269. model.twitter_ads_source.stg_twitter_ads__line_item_report:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp placement 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp:f0->269. model.twitter_ads_source.stg_twitter_ads__line_item_report:f0
269. model.twitter_ads_source.stg_twitter_ads__line_item_report
  • Input Column: 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp[placement]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • placement: Directly mapped after casting
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 269. model.twitter_ads_source.stg_twitter_ads__line_item_report[placement]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • placement: Directly copied to the output
Column Lineage
%3 259. model.twitter_ads_source.stg_twitter_ads__account_history 259. model.twitter_ads_source.stg_twitter_ads__account_history account_id 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report account_id 259. model.twitter_ads_source.stg_twitter_ads__account_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0 269. model.twitter_ads_source.stg_twitter_ads__line_item_report 269. model.twitter_ads_source.stg_twitter_ads__line_item_report account_id 269. model.twitter_ads_source.stg_twitter_ads__line_item_report:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp id 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp:f0->259. model.twitter_ads_source.stg_twitter_ads__account_history:f0 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp account_id 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp:f0->269. model.twitter_ads_source.stg_twitter_ads__line_item_report:f0
259. model.twitter_ads_source.stg_twitter_ads__account_history
  • Input Column: 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp[id]
    • Cleaning The column is cast to TEXT type
    • Direct The column is directly copied to the output with a name change
    • Deduplication Used in the ROW_NUMBER() function to identify the latest version
    • Output Columns:
      • account_id: Directly mapped after casting and renaming
269. model.twitter_ads_source.stg_twitter_ads__line_item_report
  • Input Column: 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp[account_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • account_id: Directly mapped after casting
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 259. model.twitter_ads_source.stg_twitter_ads__account_history[account_id]
    • Integration used as the join key with the report table
    • Direct directly copied to the output
    • Output Columns:
      • account_id: directly copied
  • Input Column: 269. model.twitter_ads_source.stg_twitter_ads__line_item_report[account_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with the accounts table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • account_id: Directly copied to the output
Column Lineage
%3 259. model.twitter_ads_source.stg_twitter_ads__account_history 259. model.twitter_ads_source.stg_twitter_ads__account_history name 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report account_name 259. model.twitter_ads_source.stg_twitter_ads__account_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp name 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp:f0->259. model.twitter_ads_source.stg_twitter_ads__account_history:f0
259. model.twitter_ads_source.stg_twitter_ads__account_history
  • Input Column: 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp[name]
    • Cleaning The column is cast to TEXT type
    • Direct The column is directly copied to the output
    • Output Columns:
      • name: Directly mapped after casting
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 259. model.twitter_ads_source.stg_twitter_ads__account_history[name]
    • Direct directly copied to the output
    • Output Columns:
      • account_name: directly copied and renamed
Column Lineage
%3 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history advertiser_domain 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report advertiser_domain 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp advertiser_domain 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[advertiser_domain]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • advertiser_domain: Directly mapped
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[advertiser_domain]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • advertiser_domain: Directly copied to the output
Column Lineage
%3 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history advertiser_user_id 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report advertiser_user_id 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp advertiser_user_id 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[advertiser_user_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT
    • Output Columns:
      • advertiser_user_id: Directly mapped
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[advertiser_user_id]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • advertiser_user_id: Directly copied to the output
Column Lineage
%3 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history bid_type 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report bid_type 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp bid_type 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[bid_type]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • bid_type: Directly mapped
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[bid_type]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • bid_type: Directly copied to the output
Column Lineage
%3 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history bid_unit 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report bid_unit 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp bid_unit 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[bid_unit]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • bid_unit: Directly mapped
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[bid_unit]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • bid_unit: Directly copied to the output
Column Lineage
%3 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history charge_by 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report charge_by 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp charge_by 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[charge_by]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • charge_by: Directly mapped
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[charge_by]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • charge_by: Directly copied to the output
Column Lineage
%3 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history created_timestamp 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report created_timestamp 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp created_at 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[created_at]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TIMESTAMP
    • Output Columns:
      • created_timestamp: Directly mapped and renamed
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[created_timestamp]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • created_timestamp: Directly copied to the output
Column Lineage
%3 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history creative_source 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report creative_source 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp creative_source 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[creative_source]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • creative_source: Directly mapped
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[creative_source]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the JOIN condition with the report table
    • Output Columns:
      • creative_source: Directly copied to the output
Column Lineage
%3 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history currency 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report currency 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp currency 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[currency]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • currency: Directly mapped to the output column
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[currency]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the JOIN condition with the report table
    • Output Columns:
      • currency: Directly copied to the output
Column Lineage
%3 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history is_deleted 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report is_deleted 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp deleted 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[deleted]
    • Cleaning The column is cleaned by casting to BOOLEAN
    • Output Columns:
      • is_deleted: Mapped to the output column with a renamed field
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[is_deleted]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the JOIN condition with the report table
    • Output Columns:
      • is_deleted: Directly copied to the output
Column Lineage
%3 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history end_timestamp 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report end_timestamp 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp end_time 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[end_time]
    • Cleaning The column is cleaned by casting to TIMESTAMP
    • Output Columns:
      • end_timestamp: Mapped to the output column with a renamed field
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[end_timestamp]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the JOIN condition with the report table
    • Output Columns:
      • end_timestamp: Directly copied to the output
Column Lineage
%3 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history entity_status 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report line_item_status 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp entity_status 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[entity_status]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • entity_status: Directly mapped to the output column
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[entity_status]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the JOIN condition with the report table
    • Output Columns:
      • line_item_status: Renamed and directly copied to the output
Column Lineage
%3 261. model.twitter_ads_source.stg_twitter_ads__campaign_history 261. model.twitter_ads_source.stg_twitter_ads__campaign_history entity_status 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report campaign_status 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp entity_status 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f0->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0
261. model.twitter_ads_source.stg_twitter_ads__campaign_history
  • Input Column: 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp[entity_status]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • entity_status: Directly mapped after casting
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[entity_status]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_status: directly copied
Column Lineage
%3 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history objective 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report objective 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp objective 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[objective]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • objective: Directly mapped to the output column
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[objective]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the JOIN condition with the report table
    • Output Columns:
      • objective: Directly copied to the output
Column Lineage
%3 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history optimization 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report optimization 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp optimization 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[optimization]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • optimization: Directly mapped to the output column
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[optimization]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the JOIN condition with the report table
    • Output Columns:
      • optimization: Directly copied to the output
Column Lineage
%3 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history primary_web_event_tag 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report primary_web_event_tag 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp primary_web_event_tag 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[primary_web_event_tag]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • primary_web_event_tag: Directly mapped to the output column
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[primary_web_event_tag]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the JOIN condition with the report table
    • Output Columns:
      • primary_web_event_tag: Directly copied to the output
Column Lineage
%3 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history product_type 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report product_type 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp product_type 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[product_type]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • product_type: Directly mapped to the output column
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[product_type]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • product_type: Directly copied to the output
Column Lineage
%3 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history start_timestamp 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report start_timestamp 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp start_time 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[start_time]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast to TIMESTAMP data type
    • Output Columns:
      • start_timestamp: The column is directly mapped and renamed
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[start_timestamp]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • start_timestamp: Directly copied to the output
Column Lineage
%3 259. model.twitter_ads_source.stg_twitter_ads__account_history 259. model.twitter_ads_source.stg_twitter_ads__account_history is_latest_version updated_timestamp 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report updated_timestamp 259. model.twitter_ads_source.stg_twitter_ads__account_history:f1->256. model.twitter_ads.twitter_ads__line_item_report:f0 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history is_latest_version updated_timestamp 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f1->256. model.twitter_ads.twitter_ads__line_item_report:f0 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp updated_at 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp:f0->259. model.twitter_ads_source.stg_twitter_ads__account_history:f1 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp:f0->259. model.twitter_ads_source.stg_twitter_ads__account_history:f0 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp updated_at 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f1 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0
259. model.twitter_ads_source.stg_twitter_ads__account_history
  • Input Column: 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp[updated_at]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TIMESTAMP type
    • Deduplication The column is used in the ROW_NUMBER() function to determine the latest version of each account record
    • Output Columns:
      • updated_timestamp: It is directly mapped to the output 'updated_timestamp' column
      • is_latest_version: It is used to determine this boolean flag
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[updated_at]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast to TIMESTAMP data type
    • Deduplication The column is used in the ROW_NUMBER() function to determine the latest version of each line item
    • Output Columns:
      • updated_timestamp: The column is directly mapped and renamed
      • is_latest_version: The column is used to determine if the record is the latest version
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 259. model.twitter_ads_source.stg_twitter_ads__account_history[updated_timestamp]
    • Direct This column is directly selected in the final SELECT statement
    • Output Columns:
      • updated_timestamp: Directly copied to the output
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[updated_timestamp]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • updated_timestamp: Directly copied to the output
Column Lineage
%3 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history bid_amount bid_amount_local_micro 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report bid_amount 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f1->256. model.twitter_ads.twitter_ads__line_item_report:f0 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp bid_amount_local_micro 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f1 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f1 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[bid_amount_local_micro]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT
    • Featurization Used to calculate bid_amount
    • Output Columns:
      • bid_amount_local_micro: Directly mapped
      • bid_amount: Transformed (divided by 1,000,000 and rounded to 2 decimal places)
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[bid_amount_local_micro]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT
    • Featurization Used to calculate bid_amount
    • Output Columns:
      • bid_amount_local_micro: Directly mapped
      • bid_amount: Transformed (divided by 1,000,000 and rounded to 2 decimal places)
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[bid_amount_local_micro]
    • Cleaning The column is likely cleaned or transformed
    • Output Columns:
      • bid_amount: Transformed and mapped to this output column
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[bid_amount]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • bid_amount: Directly copied to the output
Column Lineage
%3 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history total_budget_amount total_budget_amount_local_micro 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report total_budget_amount 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp total_budget_amount_local_micro 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f1 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[total_budget_amount_local_micro]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast to INT data type
    • Featurization The column is used to calculate a new feature 'total_budget_amount'
    • Output Columns:
      • total_budget_amount_local_micro: The column is directly mapped
      • total_budget_amount: The column is transformed by dividing by 1,000,000 and rounding to 2 decimal places
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[total_budget_amount]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • total_budget_amount: Directly copied to the output
Column Lineage
%3 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history target_cpa target_cpa_local_micro 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report target_cpa 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp target_cpa_local_micro 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f1 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[target_cpa_local_micro]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast to INT data type
    • Featurization The column is used to calculate a new feature 'target_cpa'
    • Output Columns:
      • target_cpa_local_micro: The column is directly mapped
      • target_cpa: The column is transformed by dividing by 1,000,000 and rounding to 2 decimal places
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[target_cpa]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • target_cpa: Directly copied to the output
257. model.twitter_ads.twitter_ads__promoted_tweet_report

This SQL query integrates data from multiple Twitter Ads-related tables to create a comprehensive report on promoted tweets. It joins information from accounts, campaigns, line items, promoted tweets, and tweets, filtering for the latest versions where applicable. The query then aggregates metrics such as clicks, impressions, spend, and URL clicks, grouping by various dimensions including date, placement, account, campaign, and tweet details.

FilteringIntegrationAggregation
SQL Query
WITH report AS (
  SELECT
    *
  FROM TEST.PUBLIC_twitter_ads_source.stg_twitter_ads__promoted_tweet_report
), campaigns AS (
  SELECT
    *
  FROM TEST.PUBLIC_twitter_ads_source.stg_twitter_ads__campaign_history
  WHERE
    is_latest_version
), accounts AS (
  SELECT
    *
  FROM TEST.PUBLIC_twitter_ads_source.stg_twitter_ads__account_history
  WHERE
    is_latest_version
), line_items AS (
  SELECT
    *
  FROM TEST.PUBLIC_twitter_ads_source.stg_twitter_ads__line_item_history
  WHERE
    is_latest_version
), promoted_tweets AS (
  SELECT
    *
  FROM TEST.PUBLIC_twitter_ads_source.stg_twitter_ads__promoted_tweet_history
  WHERE
    is_latest_version
), tweets AS (
  SELECT
    *
  FROM TEST.PUBLIC_twitter_ads_source.stg_twitter_ads__tweet
), final AS (
  SELECT
    report.source_relation,
    report.date_day,
    report.placement,
    accounts.account_id,
    accounts.name AS account_name,
    campaigns.campaign_id,
    campaigns.campaign_name,
    line_items.line_item_id,
    line_items.name AS line_item_name,
    promoted_tweets.promoted_tweet_id,
    promoted_tweets.tweet_id,
    tweets.name AS tweet_name,
    tweets.full_text,
    promoted_tweets.is_deleted,
    promoted_tweets.entity_status AS promoted_tweet_status,
    campaigns.entity_status AS campaign_status,
    line_items.entity_status AS line_item_status,
    tweets.language,
    campaigns.currency,
    promoted_tweets.approval_status,
    promoted_tweets.created_timestamp,
    promoted_tweets.updated_timestamp,
    SUM(report.clicks) AS clicks,
    SUM(report.impressions) AS impressions,
    SUM(report.spend) AS spend,
    SUM(report.spend_micro) AS spend_micro,
    SUM(report.url_clicks) AS url_clicks
  FROM report
  LEFT JOIN promoted_tweets
    ON report.promoted_tweet_id = promoted_tweets.promoted_tweet_id
    AND report.source_relation = promoted_tweets.source_relation
  LEFT JOIN tweets
    ON promoted_tweets.tweet_id = tweets.tweet_id
    AND promoted_tweets.source_relation = tweets.source_relation
  LEFT JOIN line_items
    ON promoted_tweets.line_item_id = line_items.line_item_id
    AND promoted_tweets.source_relation = line_items.source_relation
  LEFT JOIN campaigns
    ON line_items.campaign_id = campaigns.campaign_id
    AND line_items.source_relation = campaigns.source_relation
  LEFT JOIN accounts
    ON report.account_id = accounts.account_id
    AND report.source_relation = accounts.source_relation
  GROUP BY
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10,
    11,
    12,
    13,
    14,
    15,
    16,
    17,
    18,
    19,
    20,
    21,
    22
)
SELECT
  *
FROM final
%3 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report source_relation date_day placement account_id account_name campaign_id campaign_name line_item_id line_item_name promoted_tweet_id tweet_id tweet_name full_text currency clicks impressions spend spend_micro url_clicks approval_status created_timestamp is_deleted promoted_tweet_status campaign_status line_item_status updated_timestamp language 259. model.twitter_ads_source.stg_twitter_ads__account_history 259. model.twitter_ads_source.stg_twitter_ads__account_history source_relation account_id name 259. model.twitter_ads_source.stg_twitter_ads__account_history:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 259. model.twitter_ads_source.stg_twitter_ads__account_history:f1->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f3 259. model.twitter_ads_source.stg_twitter_ads__account_history:f2->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f4 261. model.twitter_ads_source.stg_twitter_ads__campaign_history 261. model.twitter_ads_source.stg_twitter_ads__campaign_history source_relation currency entity_status campaign_id campaign_name 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f1->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f13 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f2->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f23 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f3->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f5 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f4->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f6 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history source_relation line_item_id name entity_status currency 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f1->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f7 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f2->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f8 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f3->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f24 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f4->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f13 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history source_relation approval_status created_timestamp is_deleted entity_status promoted_tweet_id tweet_id updated_timestamp 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history:f1->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f19 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history:f2->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f20 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history:f3->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f21 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history:f4->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f22 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history:f5->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f9 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history:f6->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f10 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history:f7->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f25 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report source_relation account_id spend_micro spend clicks date_day impressions promoted_tweet_id url_clicks placement 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f1->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f3 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f2->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f17 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f3->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f16 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f4->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f14 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f5->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f1 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f6->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f15 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f7->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f9 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f8->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f18 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f9->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f2 275. model.twitter_ads_source.stg_twitter_ads__tweet 275. model.twitter_ads_source.stg_twitter_ads__tweet source_relation tweet_id name full_text language 275. model.twitter_ads_source.stg_twitter_ads__tweet:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 275. model.twitter_ads_source.stg_twitter_ads__tweet:f1->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f10 275. model.twitter_ads_source.stg_twitter_ads__tweet:f2->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f11 275. model.twitter_ads_source.stg_twitter_ads__tweet:f3->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f12 275. model.twitter_ads_source.stg_twitter_ads__tweet:f4->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f26
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
date_day timestamp without time zone The date of the performance.
placement text Where on Twitter the ad is being displayed. Possible values include 'ALL_ON_TWITTER', 'PUBLISHER_NETWORK', 'TWITTER_PROFILE', 'TWITTER_SEARCH', 'TWITTER_TIMELINE', and 'TAP_*', which are more granular options for `PUBLISHER_NETWORK`.
account_id text The ID of the related account.
account_name character varying The name of the related account.
campaign_id text The ID of the related campaign.
campaign_name text The name of the related campaign.
line_item_id text The ID of the related line item (ad group).
line_item_name text The ID of the related line item.
promoted_tweet_id text The ID of the promoted tweet that the URL appeared in.
tweet_id bigint The ID of the tweet that the URL appeared in.
tweet_name integer The name, if provided, of the tweet that the URL appeared in.
full_text text The full text of the tweet that the URL appeared in.
currency text The currency all metrics for the account are set to.
clicks bigint The clicks for the promoted tweet + URL on that day. Includes clicks on the URL (shortened or regular links), profile pic, screen name, username, detail, hashtags, and likes.
impressions bigint The impressions for the promoted tweet + URL on that day. This is the number of users who see a Promoted Ad either in their home timeline or search results.
spend numeric The spend for the promoted tweet + URL on that day.
spend_micro bigint The spend, in micros, for the tweet + URL on that day.
url_clicks bigint The URL clicks for the promoted tweet + URL on that day.
approval_status text The approval status of the promoted tweet.
created_timestamp text Time that the respective record (ad, ad group, campaign, post, etc) was created. ISO-8601 timestamp.
is_deleted boolean Whether the record has been deleted or not.
promoted_tweet_status text The status of the promoted tweet.
campaign_status text The status of the tweet's campaign.
line_item_status text The status of the tweet's line item.
updated_timestamp text Timestamp of when the record was last updated in Google Ads.
language text Two-letter language code of the tweet.
Column Lineage
%3 259. model.twitter_ads_source.stg_twitter_ads__account_history 259. model.twitter_ads_source.stg_twitter_ads__account_history source_relation 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report source_relation 259. model.twitter_ads_source.stg_twitter_ads__account_history:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 261. model.twitter_ads_source.stg_twitter_ads__campaign_history 261. model.twitter_ads_source.stg_twitter_ads__campaign_history source_relation 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history source_relation 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history source_relation 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report source_relation 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 275. model.twitter_ads_source.stg_twitter_ads__tweet 275. model.twitter_ads_source.stg_twitter_ads__tweet source_relation 275. model.twitter_ads_source.stg_twitter_ads__tweet:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 259. model.twitter_ads_source.stg_twitter_ads__account_history[source_relation]
    • Integration Used to join with other tables
    • Direct Directly copied to the output
    • Output Columns:
      • source_relation: Directly copied
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[source_relation]
    • Integration used to join with other tables
    • Direct copied directly to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[source_relation]
    • Integration used as a key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history[source_relation]
    • Direct The column is directly copied without transformation
    • Integration Used as part of the join condition with other tables
    • Output Columns:
      • source_relation: Directly copied to the output
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join conditions with other tables
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
  • Input Column: 275. model.twitter_ads_source.stg_twitter_ads__tweet[source_relation]
    • Integration used to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
Column Lineage
%3 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report date_day 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report date_day 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp date 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp:f0->273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0
273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report
  • Input Column: 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp[date]
    • Cleaning The column is cast as TIMESTAMP in the renamed CTE
    • Featurization The date is truncated to the day level
    • Output Columns:
      • date_day: Transformed (truncated to day)
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report placement 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report placement 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp placement 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp:f0->273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0
273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report
  • Input Column: 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp[placement]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the renamed CTE
    • Output Columns:
      • placement: Directly mapped
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[placement]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • placement: Directly copied to the output
Column Lineage
%3 259. model.twitter_ads_source.stg_twitter_ads__account_history 259. model.twitter_ads_source.stg_twitter_ads__account_history account_id 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report account_id 259. model.twitter_ads_source.stg_twitter_ads__account_history:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report account_id 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp id 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp:f0->259. model.twitter_ads_source.stg_twitter_ads__account_history:f0 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp account_id 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp:f0->273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0
259. model.twitter_ads_source.stg_twitter_ads__account_history
  • Input Column: 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp[id]
    • Cleaning The column is cast to TEXT type
    • Direct The column is directly copied to the output with a name change
    • Deduplication Used in the ROW_NUMBER() function to identify the latest version
    • Output Columns:
      • account_id: Directly mapped after casting and renaming
273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report
  • Input Column: 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp[account_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the renamed CTE
    • Output Columns:
      • account_id: Directly mapped
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 259. model.twitter_ads_source.stg_twitter_ads__account_history[account_id]
    • Integration Used to join with the report table
    • Direct Directly copied to the output
    • Output Columns:
      • account_id: Directly copied
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[account_id]
    • Integration Used to join with the accounts table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • account_id: Directly copied to the output
Column Lineage
%3 259. model.twitter_ads_source.stg_twitter_ads__account_history 259. model.twitter_ads_source.stg_twitter_ads__account_history name 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report account_name 259. model.twitter_ads_source.stg_twitter_ads__account_history:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp name 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp:f0->259. model.twitter_ads_source.stg_twitter_ads__account_history:f0
259. model.twitter_ads_source.stg_twitter_ads__account_history
  • Input Column: 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp[name]
    • Cleaning The column is cast to TEXT type
    • Direct The column is directly copied to the output
    • Output Columns:
      • name: Directly mapped after casting
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 259. model.twitter_ads_source.stg_twitter_ads__account_history[name]
    • Direct Directly copied to the output
    • Output Columns:
      • account_name: Directly copied and renamed
Column Lineage
%3 261. model.twitter_ads_source.stg_twitter_ads__campaign_history 261. model.twitter_ads_source.stg_twitter_ads__campaign_history campaign_id 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report campaign_id 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp id 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f0->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0
261. model.twitter_ads_source.stg_twitter_ads__campaign_history
  • Input Column: 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp[id]
    • Direct The column is directly copied without any transformation
    • Deduplication Used in the ROW_NUMBER() function to identify the latest version of each campaign
    • Output Columns:
      • campaign_id: Directly copied to the output and renamed
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[campaign_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with the line_items table
    • Output Columns:
      • campaign_id: Directly copied to the output
Column Lineage
%3 261. model.twitter_ads_source.stg_twitter_ads__campaign_history 261. model.twitter_ads_source.stg_twitter_ads__campaign_history campaign_name 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report campaign_name 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp name 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f0->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0
261. model.twitter_ads_source.stg_twitter_ads__campaign_history
  • Input Column: 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp[name]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • campaign_name: Directly copied to the output and renamed
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[campaign_name]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • campaign_name: Directly copied to the output
Column Lineage
%3 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history line_item_id 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report line_item_id 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp id 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[id]
    • Direct The column is directly copied without any transformation
    • Deduplication The column is used for deduplication in the ROW_NUMBER() window function
    • Output Columns:
      • line_item_id: Mapped to the output column with a renamed field
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[line_item_id]
    • Integration This column is used to join the line_items table with the promoted_tweets table
    • Direct The column is directly copied to the output
    • Output Columns:
      • line_item_id: Directly copied
Column Lineage
%3 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history name 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report line_item_name 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp name 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[name]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • name: Directly mapped to the output column
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[name]
    • Direct The column is directly copied to the output
    • Output Columns:
      • line_item_name: Directly copied
Column Lineage
%3 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history promoted_tweet_id 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report promoted_tweet_id 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report promoted_tweet_id 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp id 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp:f0->271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history:f0 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp promoted_tweet_id 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp:f0->273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0
271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history
  • Input Column: 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp[id]
    • Cleaning The column is cast to TEXT data type
    • Direct The column is directly copied without transformation
    • Deduplication Used in the PARTITION BY clause of the ROW_NUMBER() function
    • Output Columns:
      • promoted_tweet_id: Renamed and directly mapped
273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report
  • Input Column: 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp[promoted_tweet_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the renamed CTE
    • Output Columns:
      • promoted_tweet_id: Directly mapped
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history[promoted_tweet_id]
    • Direct The column is directly copied without transformation
    • Integration Used as a join key with the report table
    • Output Columns:
      • promoted_tweet_id: Directly copied to the output
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[promoted_tweet_id]
    • Integration Used to join with the promoted_tweets table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • promoted_tweet_id: Directly copied to the output
Column Lineage
%3 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history tweet_id 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report tweet_id 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 275. model.twitter_ads_source.stg_twitter_ads__tweet 275. model.twitter_ads_source.stg_twitter_ads__tweet tweet_id 275. model.twitter_ads_source.stg_twitter_ads__tweet:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp tweet_id 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp:f0->271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history:f0 276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp 276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp id 276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp:f0->275. model.twitter_ads_source.stg_twitter_ads__tweet:f0
271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history
  • Input Column: 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp[tweet_id]
    • Cleaning The column is cast to TEXT data type
    • Direct The column is directly copied without transformation
    • Output Columns:
      • tweet_id: Directly mapped
275. model.twitter_ads_source.stg_twitter_ads__tweet
  • Input Column: 276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp[id]
    • Cleaning The column is cast to TEXT type
    • Direct The column is directly copied after casting
    • Output Columns:
      • tweet_id: Directly mapped after casting to TEXT
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history[tweet_id]
    • Direct The column is directly copied without transformation
    • Integration Used as a join key with the tweets table
    • Output Columns:
      • tweet_id: Directly copied to the output
  • Input Column: 275. model.twitter_ads_source.stg_twitter_ads__tweet[tweet_id]
    • Integration used to join with promoted_tweets table
    • Output Columns:
      • tweet_id: directly copied after joining
Column Lineage
%3 275. model.twitter_ads_source.stg_twitter_ads__tweet 275. model.twitter_ads_source.stg_twitter_ads__tweet name 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report tweet_name 275. model.twitter_ads_source.stg_twitter_ads__tweet:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp 276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp name 276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp:f0->275. model.twitter_ads_source.stg_twitter_ads__tweet:f0
275. model.twitter_ads_source.stg_twitter_ads__tweet
  • Input Column: 276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp[name]
    • Cleaning The column is cast to TEXT type and potentially set to NULL.
    • Output Columns:
      • name: It is directly mapped to the 'name' output column after casting.
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 275. model.twitter_ads_source.stg_twitter_ads__tweet[name]
    • Direct directly copied to the output
    • Output Columns:
      • tweet_name: directly copied
Column Lineage
%3 275. model.twitter_ads_source.stg_twitter_ads__tweet 275. model.twitter_ads_source.stg_twitter_ads__tweet full_text 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report full_text 275. model.twitter_ads_source.stg_twitter_ads__tweet:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp 276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp full_text 276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp:f0->275. model.twitter_ads_source.stg_twitter_ads__tweet:f0
275. model.twitter_ads_source.stg_twitter_ads__tweet
  • Input Column: 276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp[full_text]
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • full_text: It is directly mapped to the output 'full_text' column
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 275. model.twitter_ads_source.stg_twitter_ads__tweet[full_text]
    • Direct directly copied to the output
    • Output Columns:
      • full_text: directly copied
Column Lineage
%3 261. model.twitter_ads_source.stg_twitter_ads__campaign_history 261. model.twitter_ads_source.stg_twitter_ads__campaign_history currency 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report currency 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history currency 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp currency 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f0->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp currency 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0
261. model.twitter_ads_source.stg_twitter_ads__campaign_history
  • Input Column: 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp[currency]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • currency: Directly mapped after casting
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[currency]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • currency: Directly mapped to the output column
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[currency]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • currency: Directly copied to the output
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[currency]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with other tables
    • Output Columns:
      • currency: Directly copied to the output
Column Lineage
%3 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report clicks 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report clicks 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp clicks 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp:f0->273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0
273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report
  • Input Column: 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp[clicks]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT in the renamed CTE
    • Output Columns:
      • clicks: Directly mapped
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[clicks]
    • Aggregation Summed up in the final SELECT statement
    • Output Columns:
      • clicks: Aggregated sum in the output
Column Lineage
%3 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report impressions 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report impressions 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp impressions 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp:f0->273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0
273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report
  • Input Column: 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp[impressions]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT in the renamed CTE
    • Output Columns:
      • impressions: Directly mapped
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[impressions]
    • Aggregation Summed up in the final SELECT statement
    • Output Columns:
      • impressions: Aggregated sum in the output
Column Lineage
%3 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report spend spend_micro 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report spend 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp billed_charge_local_micro 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp:f0->273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f1 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp:f0->273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0
273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report
  • Input Column: 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp[billed_charge_local_micro]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT in the renamed CTE
    • Featurization Used to calculate the 'spend' column
    • Output Columns:
      • spend_micro: Directly mapped
      • spend: Transformed (divided by 1,000,000 and rounded)
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[spend]
    • Aggregation Summed up in the final SELECT statement
    • Output Columns:
      • spend: Aggregated sum in the output
Column Lineage
%3 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report spend spend_micro 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report spend_micro 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f1->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp billed_charge_local_micro 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp:f0->273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f1 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp:f0->273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0
273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report
  • Input Column: 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp[billed_charge_local_micro]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT in the renamed CTE
    • Featurization Used to calculate the 'spend' column
    • Output Columns:
      • spend_micro: Directly mapped
      • spend: Transformed (divided by 1,000,000 and rounded)
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[spend_micro]
    • Aggregation Summed up in the final SELECT statement
    • Output Columns:
      • spend_micro: Aggregated sum in the output
Column Lineage
%3 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report url_clicks 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report url_clicks 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp url_clicks 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp:f0->273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0
273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report
  • Input Column: 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp[url_clicks]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT in the renamed CTE
    • Output Columns:
      • url_clicks: Directly mapped
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[url_clicks]
    • Aggregation Summed up in the final SELECT statement
    • Output Columns:
      • url_clicks: Aggregated sum in the output
Column Lineage
%3 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history approval_status 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report approval_status 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp approval_status 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp:f0->271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history:f0
271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history
  • Input Column: 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp[approval_status]
    • Cleaning The column is cast to TEXT data type
    • Direct The column is directly copied without transformation
    • Output Columns:
      • approval_status: Directly mapped
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history[approval_status]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • approval_status: Directly copied to the output
Column Lineage
%3 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history created_timestamp 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report created_timestamp 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp created_at 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp:f0->271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history:f0
271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history
  • Input Column: 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp[created_at]
    • Cleaning The column is cast to TIMESTAMP data type
    • Direct The column is directly copied without transformation
    • Output Columns:
      • created_timestamp: Renamed and directly mapped
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history[created_timestamp]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • created_timestamp: Directly copied to the output
Column Lineage
%3 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history is_deleted 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report is_deleted 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp deleted 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp:f0->271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history:f0
271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history
  • Input Column: 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp[deleted]
    • Cleaning The column is cast to BOOLEAN data type
    • Direct The column is directly copied without transformation
    • Output Columns:
      • is_deleted: Renamed and directly mapped
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history[is_deleted]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • is_deleted: Directly copied to the output
Column Lineage
%3 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history entity_status 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report promoted_tweet_status 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp entity_status 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp:f0->271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history:f0
271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history
  • Input Column: 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp[entity_status]
    • Cleaning The column is cast to TEXT data type
    • Direct The column is directly copied without transformation
    • Output Columns:
      • entity_status: Directly mapped
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history[entity_status]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • promoted_tweet_status: Renamed and directly copied to the output
Column Lineage
%3 261. model.twitter_ads_source.stg_twitter_ads__campaign_history 261. model.twitter_ads_source.stg_twitter_ads__campaign_history entity_status 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report campaign_status 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp entity_status 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f0->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0
261. model.twitter_ads_source.stg_twitter_ads__campaign_history
  • Input Column: 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp[entity_status]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • entity_status: Directly mapped after casting
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[entity_status]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • campaign_status: Directly copied to the output
Column Lineage
%3 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history entity_status 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report line_item_status 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp entity_status 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[entity_status]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • entity_status: Directly mapped to the output column
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[entity_status]
    • Direct The column is directly copied to the output
    • Output Columns:
      • line_item_status: Directly copied
Column Lineage
%3 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history updated_timestamp 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report updated_timestamp 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp updated_at 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp:f0->271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history:f0
271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history
  • Input Column: 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp[updated_at]
    • Cleaning The column is cast to TIMESTAMP data type
    • Direct The column is directly copied without transformation
    • Deduplication Used in the ORDER BY clause of the ROW_NUMBER() function
    • Output Columns:
      • updated_timestamp: Renamed and directly mapped
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history[updated_timestamp]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • updated_timestamp: Directly copied to the output
Column Lineage
%3 275. model.twitter_ads_source.stg_twitter_ads__tweet 275. model.twitter_ads_source.stg_twitter_ads__tweet language 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report language 275. model.twitter_ads_source.stg_twitter_ads__tweet:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp 276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp lang 276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp:f0->275. model.twitter_ads_source.stg_twitter_ads__tweet:f0
275. model.twitter_ads_source.stg_twitter_ads__tweet
  • Input Column: 276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp[lang]
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • language: It is mapped to the output 'language' column
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 275. model.twitter_ads_source.stg_twitter_ads__tweet[language]
    • Direct directly copied to the output
    • Output Columns:
      • language: directly copied
258. model.twitter_ads.twitter_ads__url_report

This SQL query integrates data from multiple Twitter Ads-related tables to create a comprehensive URL report. It joins information from promoted tweets, campaigns, accounts, line items, and tweets, focusing on URL-related metrics. The query filters for the latest versions of historical data and non-null expanded URLs. It then aggregates metrics like clicks, impressions, spend, and URL clicks, grouping by various dimensions such as account, campaign, tweet, and URL attributes.

FilteringIntegrationAggregation
SQL Query
WITH report AS (
  SELECT
    *
  FROM TEST.PUBLIC_twitter_ads_source.stg_twitter_ads__promoted_tweet_report
), campaigns AS (
  SELECT
    *
  FROM TEST.PUBLIC_twitter_ads_source.stg_twitter_ads__campaign_history
  WHERE
    is_latest_version
), accounts AS (
  SELECT
    *
  FROM TEST.PUBLIC_twitter_ads_source.stg_twitter_ads__account_history
  WHERE
    is_latest_version
), line_items AS (
  SELECT
    *
  FROM TEST.PUBLIC_twitter_ads_source.stg_twitter_ads__line_item_history
  WHERE
    is_latest_version
), promoted_tweets AS (
  SELECT
    *
  FROM TEST.PUBLIC_twitter_ads_source.stg_twitter_ads__promoted_tweet_history
  WHERE
    is_latest_version
), tweets AS (
  SELECT
    *
  FROM TEST.PUBLIC_twitter_ads_source.stg_twitter_ads__tweet
), tweet_url AS (
  SELECT
    *
  FROM TEST.PUBLIC_twitter_ads_source.stg_twitter_ads__tweet_url
  WHERE
    index = 0
), final AS (
  SELECT
    report.source_relation,
    report.date_day,
    report.placement,
    accounts.account_id,
    accounts.name AS account_name,
    campaigns.campaign_id,
    campaigns.campaign_name,
    line_items.line_item_id,
    line_items.name AS line_item_name,
    promoted_tweets.promoted_tweet_id,
    promoted_tweets.tweet_id,
    tweets.name AS tweet_name,
    tweets.full_text AS tweet_full_text,
    tweet_url.base_url,
    tweet_url.url_host,
    tweet_url.url_path,
    tweet_url.utm_source,
    tweet_url.utm_medium,
    tweet_url.utm_campaign,
    tweet_url.utm_content,
    tweet_url.utm_term,
    tweet_url.expanded_url,
    tweet_url.display_url,
    campaigns.currency,
    SUM(report.clicks) AS clicks,
    SUM(report.impressions) AS impressions,
    SUM(report.spend) AS spend,
    SUM(report.spend_micro) AS spend_micro,
    SUM(report.url_clicks) AS url_clicks
  FROM report
  LEFT JOIN promoted_tweets
    ON report.promoted_tweet_id = promoted_tweets.promoted_tweet_id
    AND report.source_relation = promoted_tweets.source_relation
  LEFT JOIN tweet_url
    ON promoted_tweets.tweet_id = tweet_url.tweet_id
    AND promoted_tweets.source_relation = tweet_url.source_relation
  LEFT JOIN tweets
    ON promoted_tweets.tweet_id = tweets.tweet_id
    AND promoted_tweets.source_relation = tweets.source_relation
  LEFT JOIN line_items
    ON promoted_tweets.line_item_id = line_items.line_item_id
    AND promoted_tweets.source_relation = line_items.source_relation
  LEFT JOIN campaigns
    ON line_items.campaign_id = campaigns.campaign_id
    AND line_items.source_relation = campaigns.source_relation
  LEFT JOIN accounts
    ON report.account_id = accounts.account_id
    AND report.source_relation = accounts.source_relation
  WHERE
    NOT tweet_url.expanded_url IS NULL
  GROUP BY
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10,
    11,
    12,
    13,
    14,
    15,
    16,
    17,
    18,
    19,
    20,
    21,
    22,
    23,
    24
)
SELECT
  *
FROM final
%3 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report source_relation date_day placement account_id account_name campaign_id campaign_name line_item_id line_item_name promoted_tweet_id tweet_id tweet_name tweet_full_text base_url url_host url_path utm_source utm_medium utm_campaign utm_content utm_term display_url expanded_url currency clicks impressions spend spend_micro url_clicks 259. model.twitter_ads_source.stg_twitter_ads__account_history 259. model.twitter_ads_source.stg_twitter_ads__account_history source_relation account_id name 259. model.twitter_ads_source.stg_twitter_ads__account_history:f0->258. model.twitter_ads.twitter_ads__url_report:f0 259. model.twitter_ads_source.stg_twitter_ads__account_history:f1->258. model.twitter_ads.twitter_ads__url_report:f3 259. model.twitter_ads_source.stg_twitter_ads__account_history:f2->258. model.twitter_ads.twitter_ads__url_report:f4 261. model.twitter_ads_source.stg_twitter_ads__campaign_history 261. model.twitter_ads_source.stg_twitter_ads__campaign_history source_relation currency campaign_id campaign_name 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->258. model.twitter_ads.twitter_ads__url_report:f0 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f1->258. model.twitter_ads.twitter_ads__url_report:f23 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f2->258. model.twitter_ads.twitter_ads__url_report:f5 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f3->258. model.twitter_ads.twitter_ads__url_report:f6 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history source_relation line_item_id name currency 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->258. model.twitter_ads.twitter_ads__url_report:f0 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f1->258. model.twitter_ads.twitter_ads__url_report:f7 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f2->258. model.twitter_ads.twitter_ads__url_report:f8 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f3->258. model.twitter_ads.twitter_ads__url_report:f23 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history source_relation promoted_tweet_id tweet_id 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history:f0->258. model.twitter_ads.twitter_ads__url_report:f0 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history:f1->258. model.twitter_ads.twitter_ads__url_report:f9 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history:f2->258. model.twitter_ads.twitter_ads__url_report:f10 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report source_relation account_id spend_micro spend clicks date_day impressions promoted_tweet_id url_clicks placement 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0->258. model.twitter_ads.twitter_ads__url_report:f0 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f1->258. model.twitter_ads.twitter_ads__url_report:f3 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f2->258. model.twitter_ads.twitter_ads__url_report:f27 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f3->258. model.twitter_ads.twitter_ads__url_report:f26 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f4->258. model.twitter_ads.twitter_ads__url_report:f24 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f5->258. model.twitter_ads.twitter_ads__url_report:f1 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f6->258. model.twitter_ads.twitter_ads__url_report:f25 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f7->258. model.twitter_ads.twitter_ads__url_report:f9 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f8->258. model.twitter_ads.twitter_ads__url_report:f28 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f9->258. model.twitter_ads.twitter_ads__url_report:f2 275. model.twitter_ads_source.stg_twitter_ads__tweet 275. model.twitter_ads_source.stg_twitter_ads__tweet source_relation tweet_id name full_text 275. model.twitter_ads_source.stg_twitter_ads__tweet:f0->258. model.twitter_ads.twitter_ads__url_report:f0 275. model.twitter_ads_source.stg_twitter_ads__tweet:f1->258. model.twitter_ads.twitter_ads__url_report:f10 275. model.twitter_ads_source.stg_twitter_ads__tweet:f2->258. model.twitter_ads.twitter_ads__url_report:f11 275. model.twitter_ads_source.stg_twitter_ads__tweet:f3->258. model.twitter_ads.twitter_ads__url_report:f12 277. model.twitter_ads_source.stg_twitter_ads__tweet_url 277. model.twitter_ads_source.stg_twitter_ads__tweet_url source_relation display_url expanded_url base_url url_host url_path utm_source utm_medium utm_campaign utm_content utm_term 277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f0->258. model.twitter_ads.twitter_ads__url_report:f0 277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f1->258. model.twitter_ads.twitter_ads__url_report:f21 277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f2->258. model.twitter_ads.twitter_ads__url_report:f22 277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f3->258. model.twitter_ads.twitter_ads__url_report:f13 277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f4->258. model.twitter_ads.twitter_ads__url_report:f14 277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f5->258. model.twitter_ads.twitter_ads__url_report:f15 277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f6->258. model.twitter_ads.twitter_ads__url_report:f16 277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f7->258. model.twitter_ads.twitter_ads__url_report:f17 277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f8->258. model.twitter_ads.twitter_ads__url_report:f18 277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f9->258. model.twitter_ads.twitter_ads__url_report:f19 277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f10->258. model.twitter_ads.twitter_ads__url_report:f20
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
date_day timestamp without time zone The date of the performance.
placement text Where on Twitter the ad is being displayed. Possible values include 'ALL_ON_TWITTER', 'PUBLISHER_NETWORK', 'TWITTER_PROFILE', 'TWITTER_SEARCH', 'TWITTER_TIMELINE', and 'TAP_*', which are more granular options for `PUBLISHER_NETWORK`.
account_id text The ID of the related account.
account_name character varying The name of the related account.
campaign_id text The ID of the related campaign.
campaign_name text The name of the related campaign.
line_item_id text The ID of the related line item (ad group).
line_item_name text The ID of the related line item.
promoted_tweet_id text The ID of the promoted tweet that the URL appeared in.
tweet_id bigint The ID of the tweet that the URL appeared in.
tweet_name integer The name, if provided, of the tweet that the URL appeared in.
tweet_full_text text The full text of the tweet that the URL appeared in.
base_url text The base URL of the ad, extracted from the `expanded_url`.
url_host text The URL host of the ad, extracted from the `expanded_url`.
url_path text The URL path of the ad, extracted from the `expanded_url`.
utm_source text The utm_source parameter of the ad, extracted from the `expanded_url`.
utm_medium text The utm_medium parameter of the ad, extracted from the `expanded_url`.
utm_campaign text The utm_campaign parameter of the ad, extracted from the `expanded_url`.
utm_content text The utm_content parameter of the ad, extracted from the `expanded_url`.
utm_term text The utm_term parameter of the ad, extracted from the `expanded_url`.
display_url text The URL as it will be displayed.
expanded_url text The fully expanded URL.
currency text The currency all metrics for the account are set to.
clicks bigint The clicks for the promoted tweet + URL on that day. Includes clicks on the URL (shortened or regular links), profile pic, screen name, username, detail, hashtags, and likes.
impressions bigint The impressions for the promoted tweet + URL on that day. This is the number of users who see a Promoted Ad either in their home timeline or search results.
spend numeric The spend for the promoted tweet + URL on that day.
spend_micro bigint The spend, in micros, for the tweet + URL on that day.
url_clicks bigint The URL clicks for the promoted tweet + URL on that day.
Column Lineage
%3 259. model.twitter_ads_source.stg_twitter_ads__account_history 259. model.twitter_ads_source.stg_twitter_ads__account_history source_relation 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report source_relation 259. model.twitter_ads_source.stg_twitter_ads__account_history:f0->258. model.twitter_ads.twitter_ads__url_report:f0 261. model.twitter_ads_source.stg_twitter_ads__campaign_history 261. model.twitter_ads_source.stg_twitter_ads__campaign_history source_relation 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->258. model.twitter_ads.twitter_ads__url_report:f0 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history source_relation 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->258. model.twitter_ads.twitter_ads__url_report:f0 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history source_relation 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history:f0->258. model.twitter_ads.twitter_ads__url_report:f0 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report source_relation 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0->258. model.twitter_ads.twitter_ads__url_report:f0 275. model.twitter_ads_source.stg_twitter_ads__tweet 275. model.twitter_ads_source.stg_twitter_ads__tweet source_relation 275. model.twitter_ads_source.stg_twitter_ads__tweet:f0->258. model.twitter_ads.twitter_ads__url_report:f0 277. model.twitter_ads_source.stg_twitter_ads__tweet_url 277. model.twitter_ads_source.stg_twitter_ads__tweet_url source_relation 277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f0->258. model.twitter_ads.twitter_ads__url_report:f0
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 259. model.twitter_ads_source.stg_twitter_ads__account_history[source_relation]
    • Integration used to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history[source_relation]
    • Integration used to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join conditions with other tables
    • Output Columns:
      • source_relation: Directly copied to the output
  • Input Column: 275. model.twitter_ads_source.stg_twitter_ads__tweet[source_relation]
    • Integration used to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
  • Input Column: 277. model.twitter_ads_source.stg_twitter_ads__tweet_url[source_relation]
    • Integration used to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
Column Lineage
%3 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report date_day 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report date_day 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0->258. model.twitter_ads.twitter_ads__url_report:f0 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp date 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp:f0->273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0
273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report
  • Input Column: 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp[date]
    • Cleaning The column is cast as TIMESTAMP in the renamed CTE
    • Featurization The date is truncated to the day level
    • Output Columns:
      • date_day: Transformed (truncated to day)
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Part of the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report placement 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report placement 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0->258. model.twitter_ads.twitter_ads__url_report:f0 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp placement 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp:f0->273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0
273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report
  • Input Column: 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp[placement]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the renamed CTE
    • Output Columns:
      • placement: Directly mapped
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[placement]
    • Direct The column is directly copied without any transformation
    • Aggregation Part of the GROUP BY clause
    • Output Columns:
      • placement: Directly copied to the output
Column Lineage
%3 259. model.twitter_ads_source.stg_twitter_ads__account_history 259. model.twitter_ads_source.stg_twitter_ads__account_history account_id 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report account_id 259. model.twitter_ads_source.stg_twitter_ads__account_history:f0->258. model.twitter_ads.twitter_ads__url_report:f0 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report account_id 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0->258. model.twitter_ads.twitter_ads__url_report:f0 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp id 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp:f0->259. model.twitter_ads_source.stg_twitter_ads__account_history:f0 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp account_id 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp:f0->273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0
259. model.twitter_ads_source.stg_twitter_ads__account_history
  • Input Column: 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp[id]
    • Cleaning The column is cast to TEXT type
    • Direct The column is directly copied to the output with a name change
    • Deduplication Used in the ROW_NUMBER() function to identify the latest version
    • Output Columns:
      • account_id: Directly mapped after casting and renaming
273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report
  • Input Column: 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp[account_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the renamed CTE
    • Output Columns:
      • account_id: Directly mapped
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 259. model.twitter_ads_source.stg_twitter_ads__account_history[account_id]
    • Integration used to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • account_id: directly copied
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[account_id]
    • Integration Used to join with the accounts table
    • Aggregation Part of the GROUP BY clause
    • Output Columns:
      • account_id: Directly copied to the output
Column Lineage
%3 259. model.twitter_ads_source.stg_twitter_ads__account_history 259. model.twitter_ads_source.stg_twitter_ads__account_history name 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report account_name 259. model.twitter_ads_source.stg_twitter_ads__account_history:f0->258. model.twitter_ads.twitter_ads__url_report:f0 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp name 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp:f0->259. model.twitter_ads_source.stg_twitter_ads__account_history:f0
259. model.twitter_ads_source.stg_twitter_ads__account_history
  • Input Column: 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp[name]
    • Cleaning The column is cast to TEXT type
    • Direct The column is directly copied to the output
    • Output Columns:
      • name: Directly mapped after casting
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 259. model.twitter_ads_source.stg_twitter_ads__account_history[name]
    • Direct directly copied to the output
    • Output Columns:
      • account_name: directly copied
Column Lineage
%3 261. model.twitter_ads_source.stg_twitter_ads__campaign_history 261. model.twitter_ads_source.stg_twitter_ads__campaign_history campaign_id 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report campaign_id 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->258. model.twitter_ads.twitter_ads__url_report:f0 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp id 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f0->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0
261. model.twitter_ads_source.stg_twitter_ads__campaign_history
  • Input Column: 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp[id]
    • Direct The column is directly copied without any transformation
    • Deduplication Used in the ROW_NUMBER() function to identify the latest version of each campaign
    • Output Columns:
      • campaign_id: Directly copied to the output and renamed
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[campaign_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with the line_items table
    • Output Columns:
      • campaign_id: Directly copied to the output
Column Lineage
%3 261. model.twitter_ads_source.stg_twitter_ads__campaign_history 261. model.twitter_ads_source.stg_twitter_ads__campaign_history campaign_name 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report campaign_name 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->258. model.twitter_ads.twitter_ads__url_report:f0 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp name 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f0->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0
261. model.twitter_ads_source.stg_twitter_ads__campaign_history
  • Input Column: 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp[name]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • campaign_name: Directly copied to the output and renamed
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[campaign_name]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • campaign_name: Directly copied to the output
Column Lineage
%3 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history line_item_id 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report line_item_id 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->258. model.twitter_ads.twitter_ads__url_report:f0 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp id 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[id]
    • Direct The column is directly copied without any transformation
    • Deduplication The column is used for deduplication in the ROW_NUMBER() window function
    • Output Columns:
      • line_item_id: Mapped to the output column with a renamed field
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[line_item_id]
    • Integration This column is used as a key to join with the promoted_tweets table
    • Direct The column is directly copied to the output
    • Output Columns:
      • line_item_id: Directly copied
Column Lineage
%3 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history name 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report line_item_name 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->258. model.twitter_ads.twitter_ads__url_report:f0 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp name 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[name]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • name: Directly mapped to the output column
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[name]
    • Direct The column is directly copied to the output
    • Output Columns:
      • line_item_name: Directly copied
Column Lineage
%3 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history promoted_tweet_id 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report promoted_tweet_id 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history:f0->258. model.twitter_ads.twitter_ads__url_report:f0 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report promoted_tweet_id 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0->258. model.twitter_ads.twitter_ads__url_report:f0 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp id 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp:f0->271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history:f0 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp promoted_tweet_id 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp:f0->273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0
271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history
  • Input Column: 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp[id]
    • Cleaning The column is cast to TEXT data type
    • Direct The column is directly copied without transformation
    • Deduplication Used in the PARTITION BY clause of the ROW_NUMBER() function
    • Output Columns:
      • promoted_tweet_id: Renamed and directly mapped
273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report
  • Input Column: 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp[promoted_tweet_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the renamed CTE
    • Output Columns:
      • promoted_tweet_id: Directly mapped
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history[promoted_tweet_id]
    • Integration used to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • promoted_tweet_id: directly copied
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[promoted_tweet_id]
    • Integration Used to join with the promoted_tweets table
    • Aggregation Part of the GROUP BY clause
    • Output Columns:
      • promoted_tweet_id: Directly copied to the output
Column Lineage
%3 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history tweet_id 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report tweet_id 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history:f0->258. model.twitter_ads.twitter_ads__url_report:f0 275. model.twitter_ads_source.stg_twitter_ads__tweet 275. model.twitter_ads_source.stg_twitter_ads__tweet tweet_id 275. model.twitter_ads_source.stg_twitter_ads__tweet:f0->258. model.twitter_ads.twitter_ads__url_report:f0 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp tweet_id 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp:f0->271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history:f0 276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp 276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp id 276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp:f0->275. model.twitter_ads_source.stg_twitter_ads__tweet:f0
271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history
  • Input Column: 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp[tweet_id]
    • Cleaning The column is cast to TEXT data type
    • Direct The column is directly copied without transformation
    • Output Columns:
      • tweet_id: Directly mapped
275. model.twitter_ads_source.stg_twitter_ads__tweet
  • Input Column: 276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp[id]
    • Cleaning The column is cast to TEXT type
    • Direct The column is directly copied after casting
    • Output Columns:
      • tweet_id: Directly mapped after casting to TEXT
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history[tweet_id]
    • Integration used to join with the tweets and tweet_url tables
    • Direct directly copied to the output
    • Output Columns:
      • tweet_id: directly copied
  • Input Column: 275. model.twitter_ads_source.stg_twitter_ads__tweet[tweet_id]
    • Integration used to join with other tables
    • Output Columns:
      • tweet_id: directly copied
Column Lineage
%3 275. model.twitter_ads_source.stg_twitter_ads__tweet 275. model.twitter_ads_source.stg_twitter_ads__tweet name 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report tweet_name 275. model.twitter_ads_source.stg_twitter_ads__tweet:f0->258. model.twitter_ads.twitter_ads__url_report:f0 276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp 276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp name 276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp:f0->275. model.twitter_ads_source.stg_twitter_ads__tweet:f0
275. model.twitter_ads_source.stg_twitter_ads__tweet
  • Input Column: 276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp[name]
    • Cleaning The column is cast to TEXT type and potentially set to NULL.
    • Output Columns:
      • name: It is directly mapped to the 'name' output column after casting.
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 275. model.twitter_ads_source.stg_twitter_ads__tweet[name]
    • Direct directly copied to the output
    • Output Columns:
      • tweet_name: directly copied
Column Lineage
%3 275. model.twitter_ads_source.stg_twitter_ads__tweet 275. model.twitter_ads_source.stg_twitter_ads__tweet full_text 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report tweet_full_text 275. model.twitter_ads_source.stg_twitter_ads__tweet:f0->258. model.twitter_ads.twitter_ads__url_report:f0 276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp 276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp full_text 276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp:f0->275. model.twitter_ads_source.stg_twitter_ads__tweet:f0
275. model.twitter_ads_source.stg_twitter_ads__tweet
  • Input Column: 276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp[full_text]
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • full_text: It is directly mapped to the output 'full_text' column
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 275. model.twitter_ads_source.stg_twitter_ads__tweet[full_text]
    • Direct directly copied to the output
    • Output Columns:
      • tweet_full_text: directly copied
Column Lineage
%3 277. model.twitter_ads_source.stg_twitter_ads__tweet_url 277. model.twitter_ads_source.stg_twitter_ads__tweet_url base_url expanded_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report base_url 277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f0->258. model.twitter_ads.twitter_ads__url_report:f0 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp expanded_url 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f1 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f0 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f2 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f3 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f7 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f6 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f4 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f5 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f8
277. model.twitter_ads_source.stg_twitter_ads__tweet_url
  • Input Column: 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp[expanded_url]
    • Direct The column is directly copied without any transformation
    • Featurization Multiple features are extracted from this column
    • Output Columns:
      • expanded_url: Directly copied to the output
      • base_url: Extracted by splitting on '?'
      • url_host: Extracted by complex string manipulation and splitting
      • url_path: Extracted by complex string manipulation and splitting
      • utm_source: Extracted by splitting on 'utm_source=' and '&'
      • utm_medium: Extracted by splitting on 'utm_medium=' and '&'
      • utm_campaign: Extracted by splitting on 'utm_campaign=' and '&'
      • utm_content: Extracted by splitting on 'utm_content=' and '&'
      • utm_term: Extracted by splitting on 'utm_term=' and '&'
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 277. model.twitter_ads_source.stg_twitter_ads__tweet_url[base_url]
    • Direct directly copied to the output
    • Output Columns:
      • base_url: directly copied
Column Lineage
%3 277. model.twitter_ads_source.stg_twitter_ads__tweet_url 277. model.twitter_ads_source.stg_twitter_ads__tweet_url base_url expanded_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report url_host 277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f2->258. model.twitter_ads.twitter_ads__url_report:f0 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp expanded_url 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f1 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f0 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f2 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f3 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f7 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f6 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f4 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f5 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f8
277. model.twitter_ads_source.stg_twitter_ads__tweet_url
  • Input Column: 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp[expanded_url]
    • Direct The column is directly copied without any transformation
    • Featurization Multiple features are extracted from this column
    • Output Columns:
      • expanded_url: Directly copied to the output
      • base_url: Extracted by splitting on '?'
      • url_host: Extracted by complex string manipulation and splitting
      • url_path: Extracted by complex string manipulation and splitting
      • utm_source: Extracted by splitting on 'utm_source=' and '&'
      • utm_medium: Extracted by splitting on 'utm_medium=' and '&'
      • utm_campaign: Extracted by splitting on 'utm_campaign=' and '&'
      • utm_content: Extracted by splitting on 'utm_content=' and '&'
      • utm_term: Extracted by splitting on 'utm_term=' and '&'
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 277. model.twitter_ads_source.stg_twitter_ads__tweet_url[url_host]
    • Direct directly copied to the output
    • Output Columns:
      • url_host: directly copied
Column Lineage
%3 277. model.twitter_ads_source.stg_twitter_ads__tweet_url 277. model.twitter_ads_source.stg_twitter_ads__tweet_url base_url expanded_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report url_path 277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f3->258. model.twitter_ads.twitter_ads__url_report:f0 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp expanded_url 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f1 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f0 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f2 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f3 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f7 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f6 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f4 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f5 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f8
277. model.twitter_ads_source.stg_twitter_ads__tweet_url
  • Input Column: 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp[expanded_url]
    • Direct The column is directly copied without any transformation
    • Featurization Multiple features are extracted from this column
    • Output Columns:
      • expanded_url: Directly copied to the output
      • base_url: Extracted by splitting on '?'
      • url_host: Extracted by complex string manipulation and splitting
      • url_path: Extracted by complex string manipulation and splitting
      • utm_source: Extracted by splitting on 'utm_source=' and '&'
      • utm_medium: Extracted by splitting on 'utm_medium=' and '&'
      • utm_campaign: Extracted by splitting on 'utm_campaign=' and '&'
      • utm_content: Extracted by splitting on 'utm_content=' and '&'
      • utm_term: Extracted by splitting on 'utm_term=' and '&'
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 277. model.twitter_ads_source.stg_twitter_ads__tweet_url[url_path]
    • Direct directly copied to the output
    • Output Columns:
      • url_path: directly copied
Column Lineage
%3 277. model.twitter_ads_source.stg_twitter_ads__tweet_url 277. model.twitter_ads_source.stg_twitter_ads__tweet_url base_url expanded_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report utm_source 277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f7->258. model.twitter_ads.twitter_ads__url_report:f0 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp expanded_url 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f1 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f0 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f2 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f3 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f7 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f6 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f4 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f5 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f8
277. model.twitter_ads_source.stg_twitter_ads__tweet_url
  • Input Column: 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp[expanded_url]
    • Direct The column is directly copied without any transformation
    • Featurization Multiple features are extracted from this column
    • Output Columns:
      • expanded_url: Directly copied to the output
      • base_url: Extracted by splitting on '?'
      • url_host: Extracted by complex string manipulation and splitting
      • url_path: Extracted by complex string manipulation and splitting
      • utm_source: Extracted by splitting on 'utm_source=' and '&'
      • utm_medium: Extracted by splitting on 'utm_medium=' and '&'
      • utm_campaign: Extracted by splitting on 'utm_campaign=' and '&'
      • utm_content: Extracted by splitting on 'utm_content=' and '&'
      • utm_term: Extracted by splitting on 'utm_term=' and '&'
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 277. model.twitter_ads_source.stg_twitter_ads__tweet_url[utm_source]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • utm_source: Directly copied to the output column of the same name
Column Lineage
%3 277. model.twitter_ads_source.stg_twitter_ads__tweet_url 277. model.twitter_ads_source.stg_twitter_ads__tweet_url base_url expanded_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report utm_medium 277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f6->258. model.twitter_ads.twitter_ads__url_report:f0 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp expanded_url 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f1 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f0 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f2 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f3 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f7 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f6 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f4 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f5 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f8
277. model.twitter_ads_source.stg_twitter_ads__tweet_url
  • Input Column: 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp[expanded_url]
    • Direct The column is directly copied without any transformation
    • Featurization Multiple features are extracted from this column
    • Output Columns:
      • expanded_url: Directly copied to the output
      • base_url: Extracted by splitting on '?'
      • url_host: Extracted by complex string manipulation and splitting
      • url_path: Extracted by complex string manipulation and splitting
      • utm_source: Extracted by splitting on 'utm_source=' and '&'
      • utm_medium: Extracted by splitting on 'utm_medium=' and '&'
      • utm_campaign: Extracted by splitting on 'utm_campaign=' and '&'
      • utm_content: Extracted by splitting on 'utm_content=' and '&'
      • utm_term: Extracted by splitting on 'utm_term=' and '&'
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 277. model.twitter_ads_source.stg_twitter_ads__tweet_url[utm_medium]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • utm_medium: Directly copied to the output column of the same name
Column Lineage
%3 277. model.twitter_ads_source.stg_twitter_ads__tweet_url 277. model.twitter_ads_source.stg_twitter_ads__tweet_url base_url expanded_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report utm_campaign 277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f4->258. model.twitter_ads.twitter_ads__url_report:f0 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp expanded_url 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f1 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f0 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f2 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f3 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f7 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f6 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f4 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f5 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f8
277. model.twitter_ads_source.stg_twitter_ads__tweet_url
  • Input Column: 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp[expanded_url]
    • Direct The column is directly copied without any transformation
    • Featurization Multiple features are extracted from this column
    • Output Columns:
      • expanded_url: Directly copied to the output
      • base_url: Extracted by splitting on '?'
      • url_host: Extracted by complex string manipulation and splitting
      • url_path: Extracted by complex string manipulation and splitting
      • utm_source: Extracted by splitting on 'utm_source=' and '&'
      • utm_medium: Extracted by splitting on 'utm_medium=' and '&'
      • utm_campaign: Extracted by splitting on 'utm_campaign=' and '&'
      • utm_content: Extracted by splitting on 'utm_content=' and '&'
      • utm_term: Extracted by splitting on 'utm_term=' and '&'
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 277. model.twitter_ads_source.stg_twitter_ads__tweet_url[utm_campaign]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • utm_campaign: Directly copied to the output column of the same name
Column Lineage
%3 277. model.twitter_ads_source.stg_twitter_ads__tweet_url 277. model.twitter_ads_source.stg_twitter_ads__tweet_url base_url expanded_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report utm_content 277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f5->258. model.twitter_ads.twitter_ads__url_report:f0 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp expanded_url 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f1 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f0 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f2 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f3 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f7 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f6 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f4 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f5 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f8
277. model.twitter_ads_source.stg_twitter_ads__tweet_url
  • Input Column: 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp[expanded_url]
    • Direct The column is directly copied without any transformation
    • Featurization Multiple features are extracted from this column
    • Output Columns:
      • expanded_url: Directly copied to the output
      • base_url: Extracted by splitting on '?'
      • url_host: Extracted by complex string manipulation and splitting
      • url_path: Extracted by complex string manipulation and splitting
      • utm_source: Extracted by splitting on 'utm_source=' and '&'
      • utm_medium: Extracted by splitting on 'utm_medium=' and '&'
      • utm_campaign: Extracted by splitting on 'utm_campaign=' and '&'
      • utm_content: Extracted by splitting on 'utm_content=' and '&'
      • utm_term: Extracted by splitting on 'utm_term=' and '&'
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 277. model.twitter_ads_source.stg_twitter_ads__tweet_url[utm_content]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • utm_content: Directly copied to the output column of the same name
Column Lineage
%3 277. model.twitter_ads_source.stg_twitter_ads__tweet_url 277. model.twitter_ads_source.stg_twitter_ads__tweet_url base_url expanded_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report utm_term 277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f8->258. model.twitter_ads.twitter_ads__url_report:f0 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp expanded_url 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f1 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f0 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f2 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f3 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f7 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f6 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f4 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f5 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f8
277. model.twitter_ads_source.stg_twitter_ads__tweet_url
  • Input Column: 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp[expanded_url]
    • Direct The column is directly copied without any transformation
    • Featurization Multiple features are extracted from this column
    • Output Columns:
      • expanded_url: Directly copied to the output
      • base_url: Extracted by splitting on '?'
      • url_host: Extracted by complex string manipulation and splitting
      • url_path: Extracted by complex string manipulation and splitting
      • utm_source: Extracted by splitting on 'utm_source=' and '&'
      • utm_medium: Extracted by splitting on 'utm_medium=' and '&'
      • utm_campaign: Extracted by splitting on 'utm_campaign=' and '&'
      • utm_content: Extracted by splitting on 'utm_content=' and '&'
      • utm_term: Extracted by splitting on 'utm_term=' and '&'
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 277. model.twitter_ads_source.stg_twitter_ads__tweet_url[utm_term]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • utm_term: Directly copied to the output column of the same name
Column Lineage
%3 277. model.twitter_ads_source.stg_twitter_ads__tweet_url 277. model.twitter_ads_source.stg_twitter_ads__tweet_url display_url 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report display_url 277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f0->258. model.twitter_ads.twitter_ads__url_report:f0 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp display_url 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f0
277. model.twitter_ads_source.stg_twitter_ads__tweet_url
  • Input Column: 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp[display_url]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • display_url: Directly copied to the output
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 277. model.twitter_ads_source.stg_twitter_ads__tweet_url[display_url]
    • Direct directly copied to the output
    • Output Columns:
      • display_url: directly copied
Column Lineage
%3 277. model.twitter_ads_source.stg_twitter_ads__tweet_url 277. model.twitter_ads_source.stg_twitter_ads__tweet_url base_url expanded_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report expanded_url 277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f1->258. model.twitter_ads.twitter_ads__url_report:f0 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp expanded_url 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f1 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f0 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f2 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f3 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f7 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f6 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f4 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f5 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f8
277. model.twitter_ads_source.stg_twitter_ads__tweet_url
  • Input Column: 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp[expanded_url]
    • Direct The column is directly copied without any transformation
    • Featurization Multiple features are extracted from this column
    • Output Columns:
      • expanded_url: Directly copied to the output
      • base_url: Extracted by splitting on '?'
      • url_host: Extracted by complex string manipulation and splitting
      • url_path: Extracted by complex string manipulation and splitting
      • utm_source: Extracted by splitting on 'utm_source=' and '&'
      • utm_medium: Extracted by splitting on 'utm_medium=' and '&'
      • utm_campaign: Extracted by splitting on 'utm_campaign=' and '&'
      • utm_content: Extracted by splitting on 'utm_content=' and '&'
      • utm_term: Extracted by splitting on 'utm_term=' and '&'
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 277. model.twitter_ads_source.stg_twitter_ads__tweet_url[expanded_url]
    • Filtering used in WHERE clause to filter non-null values
    • Direct directly copied to the output
    • Output Columns:
      • expanded_url: directly copied
Column Lineage
%3 261. model.twitter_ads_source.stg_twitter_ads__campaign_history 261. model.twitter_ads_source.stg_twitter_ads__campaign_history currency 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report currency 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->258. model.twitter_ads.twitter_ads__url_report:f0 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history currency 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->258. model.twitter_ads.twitter_ads__url_report:f0 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp currency 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f0->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp currency 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0
261. model.twitter_ads_source.stg_twitter_ads__campaign_history
  • Input Column: 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp[currency]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • currency: Directly mapped after casting
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[currency]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • currency: Directly mapped to the output column
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[currency]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • currency: Directly copied to the output
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[currency]
    • Direct The currency column is directly copied to the output
    • Output Columns:
      • currency: Directly copied
Column Lineage
%3 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report clicks 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report clicks 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0->258. model.twitter_ads.twitter_ads__url_report:f0 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp clicks 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp:f0->273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0
273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report
  • Input Column: 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp[clicks]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT in the renamed CTE
    • Output Columns:
      • clicks: Directly mapped
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[clicks]
    • Aggregation Summed up in the final SELECT statement
    • Output Columns:
      • clicks: Aggregated sum in the output
Column Lineage
%3 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report impressions 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report impressions 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0->258. model.twitter_ads.twitter_ads__url_report:f0 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp impressions 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp:f0->273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0
273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report
  • Input Column: 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp[impressions]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT in the renamed CTE
    • Output Columns:
      • impressions: Directly mapped
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[impressions]
    • Aggregation Summed up in the final SELECT statement
    • Output Columns:
      • impressions: Aggregated sum in the output
Column Lineage
%3 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report spend spend_micro 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report spend 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0->258. model.twitter_ads.twitter_ads__url_report:f0 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp billed_charge_local_micro 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp:f0->273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f1 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp:f0->273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0
273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report
  • Input Column: 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp[billed_charge_local_micro]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT in the renamed CTE
    • Featurization Used to calculate the 'spend' column
    • Output Columns:
      • spend_micro: Directly mapped
      • spend: Transformed (divided by 1,000,000 and rounded)
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[spend]
    • Aggregation Summed up in the final SELECT statement
    • Output Columns:
      • spend: Aggregated sum in the output
Column Lineage
%3 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report spend spend_micro 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report spend_micro 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f1->258. model.twitter_ads.twitter_ads__url_report:f0 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp billed_charge_local_micro 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp:f0->273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f1 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp:f0->273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0
273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report
  • Input Column: 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp[billed_charge_local_micro]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT in the renamed CTE
    • Featurization Used to calculate the 'spend' column
    • Output Columns:
      • spend_micro: Directly mapped
      • spend: Transformed (divided by 1,000,000 and rounded)
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[spend_micro]
    • Aggregation Summed up in the final SELECT statement
    • Output Columns:
      • spend_micro: Aggregated sum in the output
Column Lineage
%3 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report url_clicks 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report url_clicks 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0->258. model.twitter_ads.twitter_ads__url_report:f0 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp url_clicks 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp:f0->273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0
273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report
  • Input Column: 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp[url_clicks]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT in the renamed CTE
    • Output Columns:
      • url_clicks: Directly mapped
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[url_clicks]
    • Aggregation Summed up in the final SELECT statement
    • Output Columns:
      • url_clicks: Aggregated sum in the output
259. model.twitter_ads_source.stg_twitter_ads__account_history

This SQL query performs a series of transformations on data from a Twitter Ads account history table. It casts various fields to specific data types, renames some columns, and adds a flag to identify the latest version of each account record. The query also includes a 'source_relation' field, though it's set to an empty string in this case.

CleaningDeduplicationOther
SQL Query
WITH source AS (
  SELECT
    *
  FROM TEST.PUBLIC_twitter_ads_source.stg_twitter_ads__account_history_tmp
), fields AS (
  SELECT
    CAST(NULL AS TEXT) AS approval_status,
    CAST(NULL AS TEXT) AS business_id,
    CAST(NULL AS TEXT) AS business_name,
    CAST(NULL AS TIMESTAMP) AS created_at,
    CAST(NULL AS BOOLEAN) AS deleted,
    CAST(NULL AS TEXT) AS id,
    CAST(NULL AS TEXT) AS industry_type,
    CAST(NULL AS TEXT) AS name,
    CAST(NULL AS TEXT) AS salt,
    CAST(NULL AS TEXT) AS timezone,
    CAST(NULL AS TIMESTAMP) AS timezone_switch_at,
    CAST(NULL AS TIMESTAMP) AS updated_at,
    CAST('' AS TEXT) AS source_relation
  FROM source
), final AS (
  SELECT
    source_relation,
    approval_status,
    business_id,
    business_name,
    created_at AS created_timestamp,
    deleted AS is_deleted,
    id AS account_id,
    industry_type,
    name,
    salt,
    timezone,
    timezone_switch_at AS timezone_switched_timestamp,
    updated_at AS updated_timestamp,
    ROW_NUMBER() OVER (PARTITION BY source_relation, id ORDER BY updated_at DESC) = 1 AS is_latest_version
  FROM fields
)
SELECT
  *
FROM final
%3 259. model.twitter_ads_source.stg_twitter_ads__account_history 259. model.twitter_ads_source.stg_twitter_ads__account_history source_relation approval_status business_id business_name created_timestamp is_deleted account_id industry_type name timezone timezone_switched_timestamp updated_timestamp is_latest_version salt 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp approval_status business_id business_name created_at deleted id industry_type name salt timezone timezone_switch_at updated_at 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp:f0->259. model.twitter_ads_source.stg_twitter_ads__account_history:f1 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp:f1->259. model.twitter_ads_source.stg_twitter_ads__account_history:f2 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp:f2->259. model.twitter_ads_source.stg_twitter_ads__account_history:f3 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp:f3->259. model.twitter_ads_source.stg_twitter_ads__account_history:f4 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp:f4->259. model.twitter_ads_source.stg_twitter_ads__account_history:f5 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp:f5->259. model.twitter_ads_source.stg_twitter_ads__account_history:f6 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp:f6->259. model.twitter_ads_source.stg_twitter_ads__account_history:f7 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp:f7->259. model.twitter_ads_source.stg_twitter_ads__account_history:f8 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp:f8->259. model.twitter_ads_source.stg_twitter_ads__account_history:f13 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp:f9->259. model.twitter_ads_source.stg_twitter_ads__account_history:f9 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp:f10->259. model.twitter_ads_source.stg_twitter_ads__account_history:f10 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp:f11->259. model.twitter_ads_source.stg_twitter_ads__account_history:f11 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp:f11->259. model.twitter_ads_source.stg_twitter_ads__account_history:f12
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
approval_status text The approval status of the account.
business_id integer The ID of the related business.
business_name integer The name of the related business.
created_timestamp text The timestamp the account was created.
is_deleted boolean Whether the record has been deleted or not.
account_id text The ID of the account.
industry_type integer The industry of the accounts.
name character varying The name of the account.
timezone text The timezone the account is set to.
timezone_switched_timestamp text The timestamp the account's timezone was last changed.
updated_timestamp text The timestamp the account was last updated.
is_latest_version boolean Whether the record is the most latest version for the account
salt integer The random encryption key used to hash data.
Column Lineage
%3 259. model.twitter_ads_source.stg_twitter_ads__account_history 259. model.twitter_ads_source.stg_twitter_ads__account_history source_relation 253. model.twitter_ads.twitter_ads__account_report 253. model.twitter_ads.twitter_ads__account_report source_relation 259. model.twitter_ads_source.stg_twitter_ads__account_history:f0->253. model.twitter_ads.twitter_ads__account_report:f0 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report source_relation 259. model.twitter_ads_source.stg_twitter_ads__account_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report source_relation 259. model.twitter_ads_source.stg_twitter_ads__account_history:f0->254. model.twitter_ads.twitter_ads__campaign_report:f0 255. model.twitter_ads.twitter_ads__keyword_report 255. model.twitter_ads.twitter_ads__keyword_report source_relation 259. model.twitter_ads_source.stg_twitter_ads__account_history:f0->255. model.twitter_ads.twitter_ads__keyword_report:f0 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report source_relation 259. model.twitter_ads_source.stg_twitter_ads__account_history:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report source_relation 259. model.twitter_ads_source.stg_twitter_ads__account_history:f0->258. model.twitter_ads.twitter_ads__url_report:f0
253. model.twitter_ads.twitter_ads__account_report
  • Input Column: 259. model.twitter_ads_source.stg_twitter_ads__account_history[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with the rollup_report table
    • Output Columns:
      • source_relation: Directly copied to the output
254. model.twitter_ads.twitter_ads__campaign_report
  • Input Column: 259. model.twitter_ads_source.stg_twitter_ads__account_history[source_relation]
    • Integration used as a key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
255. model.twitter_ads.twitter_ads__keyword_report
  • Input Column: 259. model.twitter_ads_source.stg_twitter_ads__account_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 259. model.twitter_ads_source.stg_twitter_ads__account_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 259. model.twitter_ads_source.stg_twitter_ads__account_history[source_relation]
    • Integration Used to join with other tables
    • Direct Directly copied to the output
    • Output Columns:
      • source_relation: Directly copied
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 259. model.twitter_ads_source.stg_twitter_ads__account_history[source_relation]
    • Integration used to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
Column Lineage
%3 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp approval_status 259. model.twitter_ads_source.stg_twitter_ads__account_history 259. model.twitter_ads_source.stg_twitter_ads__account_history approval_status 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp:f0->259. model.twitter_ads_source.stg_twitter_ads__account_history:f0 253. model.twitter_ads.twitter_ads__account_report 253. model.twitter_ads.twitter_ads__account_report approval_status 259. model.twitter_ads_source.stg_twitter_ads__account_history:f0->253. model.twitter_ads.twitter_ads__account_report:f0
259. model.twitter_ads_source.stg_twitter_ads__account_history
  • Input Column: 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp[approval_status]
    • Cleaning The column is cast to TEXT type
    • Direct The column is directly copied to the output
    • Output Columns:
      • approval_status: Directly mapped after casting
253. model.twitter_ads.twitter_ads__account_report
  • Input Column: 259. model.twitter_ads_source.stg_twitter_ads__account_history[approval_status]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • approval_status: Directly copied to the output
Column Lineage
%3 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp business_id 259. model.twitter_ads_source.stg_twitter_ads__account_history 259. model.twitter_ads_source.stg_twitter_ads__account_history business_id 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp:f0->259. model.twitter_ads_source.stg_twitter_ads__account_history:f0 253. model.twitter_ads.twitter_ads__account_report 253. model.twitter_ads.twitter_ads__account_report business_id 259. model.twitter_ads_source.stg_twitter_ads__account_history:f0->253. model.twitter_ads.twitter_ads__account_report:f0
259. model.twitter_ads_source.stg_twitter_ads__account_history
  • Input Column: 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp[business_id]
    • Cleaning The column is cast to TEXT type
    • Direct The column is directly copied to the output
    • Output Columns:
      • business_id: Directly mapped after casting
253. model.twitter_ads.twitter_ads__account_report
  • Input Column: 259. model.twitter_ads_source.stg_twitter_ads__account_history[business_id]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • business_id: Directly copied to the output
Column Lineage
%3 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp business_name 259. model.twitter_ads_source.stg_twitter_ads__account_history 259. model.twitter_ads_source.stg_twitter_ads__account_history business_name 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp:f0->259. model.twitter_ads_source.stg_twitter_ads__account_history:f0 253. model.twitter_ads.twitter_ads__account_report 253. model.twitter_ads.twitter_ads__account_report business_name 259. model.twitter_ads_source.stg_twitter_ads__account_history:f0->253. model.twitter_ads.twitter_ads__account_report:f0
259. model.twitter_ads_source.stg_twitter_ads__account_history
  • Input Column: 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp[business_name]
    • Cleaning The column is cast to TEXT type
    • Direct The column is directly copied to the output
    • Output Columns:
      • business_name: Directly mapped after casting
253. model.twitter_ads.twitter_ads__account_report
  • Input Column: 259. model.twitter_ads_source.stg_twitter_ads__account_history[business_name]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • business_name: Directly copied to the output
Column Lineage
%3 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp created_at 259. model.twitter_ads_source.stg_twitter_ads__account_history 259. model.twitter_ads_source.stg_twitter_ads__account_history created_timestamp 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp:f0->259. model.twitter_ads_source.stg_twitter_ads__account_history:f0 253. model.twitter_ads.twitter_ads__account_report 253. model.twitter_ads.twitter_ads__account_report created_timestamp 259. model.twitter_ads_source.stg_twitter_ads__account_history:f0->253. model.twitter_ads.twitter_ads__account_report:f0
259. model.twitter_ads_source.stg_twitter_ads__account_history
  • Input Column: 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp[created_at]
    • Cleaning The column is cast to TIMESTAMP type
    • Direct The column is directly copied to the output with a name change
    • Output Columns:
      • created_timestamp: Directly mapped after casting and renaming
253. model.twitter_ads.twitter_ads__account_report
  • Input Column: 259. model.twitter_ads_source.stg_twitter_ads__account_history[created_timestamp]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • created_timestamp: Directly copied to the output
Column Lineage
%3 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp deleted 259. model.twitter_ads_source.stg_twitter_ads__account_history 259. model.twitter_ads_source.stg_twitter_ads__account_history is_deleted 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp:f0->259. model.twitter_ads_source.stg_twitter_ads__account_history:f0 253. model.twitter_ads.twitter_ads__account_report 253. model.twitter_ads.twitter_ads__account_report is_deleted 259. model.twitter_ads_source.stg_twitter_ads__account_history:f0->253. model.twitter_ads.twitter_ads__account_report:f0
259. model.twitter_ads_source.stg_twitter_ads__account_history
  • Input Column: 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp[deleted]
    • Cleaning The column is cast to BOOLEAN type
    • Direct The column is directly copied to the output with a name change
    • Output Columns:
      • is_deleted: Directly mapped after casting and renaming
253. model.twitter_ads.twitter_ads__account_report
  • Input Column: 259. model.twitter_ads_source.stg_twitter_ads__account_history[is_deleted]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • is_deleted: Directly copied to the output
Column Lineage
%3 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp id 259. model.twitter_ads_source.stg_twitter_ads__account_history 259. model.twitter_ads_source.stg_twitter_ads__account_history account_id 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp:f0->259. model.twitter_ads_source.stg_twitter_ads__account_history:f0 253. model.twitter_ads.twitter_ads__account_report 253. model.twitter_ads.twitter_ads__account_report account_id 259. model.twitter_ads_source.stg_twitter_ads__account_history:f0->253. model.twitter_ads.twitter_ads__account_report:f0 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report account_id 259. model.twitter_ads_source.stg_twitter_ads__account_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report account_id 259. model.twitter_ads_source.stg_twitter_ads__account_history:f0->254. model.twitter_ads.twitter_ads__campaign_report:f0 255. model.twitter_ads.twitter_ads__keyword_report 255. model.twitter_ads.twitter_ads__keyword_report account_id 259. model.twitter_ads_source.stg_twitter_ads__account_history:f0->255. model.twitter_ads.twitter_ads__keyword_report:f0 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report account_id 259. model.twitter_ads_source.stg_twitter_ads__account_history:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report account_id 259. model.twitter_ads_source.stg_twitter_ads__account_history:f0->258. model.twitter_ads.twitter_ads__url_report:f0
259. model.twitter_ads_source.stg_twitter_ads__account_history
  • Input Column: 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp[id]
    • Cleaning The column is cast to TEXT type
    • Direct The column is directly copied to the output with a name change
    • Deduplication Used in the ROW_NUMBER() function to identify the latest version
    • Output Columns:
      • account_id: Directly mapped after casting and renaming
253. model.twitter_ads.twitter_ads__account_report
  • Input Column: 259. model.twitter_ads_source.stg_twitter_ads__account_history[account_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as the key to join with the rollup_report table
    • Output Columns:
      • account_id: Directly copied to the output
254. model.twitter_ads.twitter_ads__campaign_report
  • Input Column: 259. model.twitter_ads_source.stg_twitter_ads__account_history[account_id]
    • Integration used as a key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • account_id: directly copied
255. model.twitter_ads.twitter_ads__keyword_report
  • Input Column: 259. model.twitter_ads_source.stg_twitter_ads__account_history[account_id]
    • Integration used as the key to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • account_id: directly copied
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 259. model.twitter_ads_source.stg_twitter_ads__account_history[account_id]
    • Integration used as the join key with the report table
    • Direct directly copied to the output
    • Output Columns:
      • account_id: directly copied
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 259. model.twitter_ads_source.stg_twitter_ads__account_history[account_id]
    • Integration Used to join with the report table
    • Direct Directly copied to the output
    • Output Columns:
      • account_id: Directly copied
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 259. model.twitter_ads_source.stg_twitter_ads__account_history[account_id]
    • Integration used to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • account_id: directly copied
Column Lineage
%3 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp industry_type 259. model.twitter_ads_source.stg_twitter_ads__account_history 259. model.twitter_ads_source.stg_twitter_ads__account_history industry_type 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp:f0->259. model.twitter_ads_source.stg_twitter_ads__account_history:f0 253. model.twitter_ads.twitter_ads__account_report 253. model.twitter_ads.twitter_ads__account_report industry_type 259. model.twitter_ads_source.stg_twitter_ads__account_history:f0->253. model.twitter_ads.twitter_ads__account_report:f0
259. model.twitter_ads_source.stg_twitter_ads__account_history
  • Input Column: 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp[industry_type]
    • Cleaning The column is cast to TEXT type
    • Direct The column is directly copied to the output
    • Output Columns:
      • industry_type: Directly mapped after casting
253. model.twitter_ads.twitter_ads__account_report
  • Input Column: 259. model.twitter_ads_source.stg_twitter_ads__account_history[industry_type]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • industry_type: Directly copied to the output
Column Lineage
%3 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp name 259. model.twitter_ads_source.stg_twitter_ads__account_history 259. model.twitter_ads_source.stg_twitter_ads__account_history name 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp:f0->259. model.twitter_ads_source.stg_twitter_ads__account_history:f0 253. model.twitter_ads.twitter_ads__account_report 253. model.twitter_ads.twitter_ads__account_report account_name 259. model.twitter_ads_source.stg_twitter_ads__account_history:f0->253. model.twitter_ads.twitter_ads__account_report:f0 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report account_name 259. model.twitter_ads_source.stg_twitter_ads__account_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report account_name 259. model.twitter_ads_source.stg_twitter_ads__account_history:f0->254. model.twitter_ads.twitter_ads__campaign_report:f0 255. model.twitter_ads.twitter_ads__keyword_report 255. model.twitter_ads.twitter_ads__keyword_report account_name 259. model.twitter_ads_source.stg_twitter_ads__account_history:f0->255. model.twitter_ads.twitter_ads__keyword_report:f0 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report account_name 259. model.twitter_ads_source.stg_twitter_ads__account_history:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report account_name 259. model.twitter_ads_source.stg_twitter_ads__account_history:f0->258. model.twitter_ads.twitter_ads__url_report:f0
259. model.twitter_ads_source.stg_twitter_ads__account_history
  • Input Column: 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp[name]
    • Cleaning The column is cast to TEXT type
    • Direct The column is directly copied to the output
    • Output Columns:
      • name: Directly mapped after casting
253. model.twitter_ads.twitter_ads__account_report
  • Input Column: 259. model.twitter_ads_source.stg_twitter_ads__account_history[name]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • account_name: Renamed to account_name in the output
254. model.twitter_ads.twitter_ads__campaign_report
  • Input Column: 259. model.twitter_ads_source.stg_twitter_ads__account_history[name]
    • Direct directly copied to the output
    • Output Columns:
      • account_name: directly copied and renamed
255. model.twitter_ads.twitter_ads__keyword_report
  • Input Column: 259. model.twitter_ads_source.stg_twitter_ads__account_history[name]
    • Direct directly copied to the output
    • Output Columns:
      • account_name: directly copied and renamed
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 259. model.twitter_ads_source.stg_twitter_ads__account_history[name]
    • Direct directly copied to the output
    • Output Columns:
      • account_name: directly copied and renamed
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 259. model.twitter_ads_source.stg_twitter_ads__account_history[name]
    • Direct Directly copied to the output
    • Output Columns:
      • account_name: Directly copied and renamed
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 259. model.twitter_ads_source.stg_twitter_ads__account_history[name]
    • Direct directly copied to the output
    • Output Columns:
      • account_name: directly copied
Column Lineage
%3 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp timezone 259. model.twitter_ads_source.stg_twitter_ads__account_history 259. model.twitter_ads_source.stg_twitter_ads__account_history timezone 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp:f0->259. model.twitter_ads_source.stg_twitter_ads__account_history:f0 253. model.twitter_ads.twitter_ads__account_report 253. model.twitter_ads.twitter_ads__account_report timezone 259. model.twitter_ads_source.stg_twitter_ads__account_history:f0->253. model.twitter_ads.twitter_ads__account_report:f0
259. model.twitter_ads_source.stg_twitter_ads__account_history
  • Input Column: 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp[timezone]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • timezone: It is directly mapped to the output 'timezone' column
253. model.twitter_ads.twitter_ads__account_report
  • Input Column: 259. model.twitter_ads_source.stg_twitter_ads__account_history[timezone]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • timezone: Directly copied to the output
Column Lineage
%3 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp timezone_switch_at 259. model.twitter_ads_source.stg_twitter_ads__account_history 259. model.twitter_ads_source.stg_twitter_ads__account_history timezone_switched_timestamp 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp:f0->259. model.twitter_ads_source.stg_twitter_ads__account_history:f0 253. model.twitter_ads.twitter_ads__account_report 253. model.twitter_ads.twitter_ads__account_report timezone_switched_timestamp 259. model.twitter_ads_source.stg_twitter_ads__account_history:f0->253. model.twitter_ads.twitter_ads__account_report:f0
259. model.twitter_ads_source.stg_twitter_ads__account_history
  • Input Column: 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp[timezone_switch_at]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TIMESTAMP type
    • Output Columns:
      • timezone_switched_timestamp: It is directly mapped to the output 'timezone_switched_timestamp' column
253. model.twitter_ads.twitter_ads__account_report
  • Input Column: 259. model.twitter_ads_source.stg_twitter_ads__account_history[timezone_switched_timestamp]
    • Direct This column is directly copied to the output without transformation
    • Output Columns:
      • timezone_switched_timestamp: Directly copied to the output column with the same name
Column Lineage
%3 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp updated_at 259. model.twitter_ads_source.stg_twitter_ads__account_history 259. model.twitter_ads_source.stg_twitter_ads__account_history is_latest_version updated_timestamp 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp:f0->259. model.twitter_ads_source.stg_twitter_ads__account_history:f1 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp:f0->259. model.twitter_ads_source.stg_twitter_ads__account_history:f0 253. model.twitter_ads.twitter_ads__account_report 253. model.twitter_ads.twitter_ads__account_report updated_timestamp 259. model.twitter_ads_source.stg_twitter_ads__account_history:f1->253. model.twitter_ads.twitter_ads__account_report:f0 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report updated_timestamp 259. model.twitter_ads_source.stg_twitter_ads__account_history:f1->256. model.twitter_ads.twitter_ads__line_item_report:f0
259. model.twitter_ads_source.stg_twitter_ads__account_history
  • Input Column: 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp[updated_at]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TIMESTAMP type
    • Deduplication The column is used in the ROW_NUMBER() function to determine the latest version of each account record
    • Output Columns:
      • updated_timestamp: It is directly mapped to the output 'updated_timestamp' column
      • is_latest_version: It is used to determine this boolean flag
253. model.twitter_ads.twitter_ads__account_report
  • Input Column: 259. model.twitter_ads_source.stg_twitter_ads__account_history[updated_timestamp]
    • Direct This column is directly copied to the output without transformation
    • Output Columns:
      • updated_timestamp: Directly copied to the output column with the same name
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 259. model.twitter_ads_source.stg_twitter_ads__account_history[updated_timestamp]
    • Direct This column is directly selected in the final SELECT statement
    • Output Columns:
      • updated_timestamp: Directly copied to the output
Column Lineage
%3 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp updated_at 259. model.twitter_ads_source.stg_twitter_ads__account_history 259. model.twitter_ads_source.stg_twitter_ads__account_history is_latest_version updated_timestamp 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp:f0->259. model.twitter_ads_source.stg_twitter_ads__account_history:f1 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp:f0->259. model.twitter_ads_source.stg_twitter_ads__account_history:f0
259. model.twitter_ads_source.stg_twitter_ads__account_history
  • Input Column: 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp[updated_at]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TIMESTAMP type
    • Deduplication The column is used in the ROW_NUMBER() function to determine the latest version of each account record
    • Output Columns:
      • updated_timestamp: It is directly mapped to the output 'updated_timestamp' column
      • is_latest_version: It is used to determine this boolean flag
Column Lineage
%3 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp salt 259. model.twitter_ads_source.stg_twitter_ads__account_history 259. model.twitter_ads_source.stg_twitter_ads__account_history salt 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp:f0->259. model.twitter_ads_source.stg_twitter_ads__account_history:f0
259. model.twitter_ads_source.stg_twitter_ads__account_history
  • Input Column: 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp[salt]
    • Cleaning The column is cast to TEXT type
    • Direct The column is directly copied to the output
    • Output Columns:
      • salt: Directly mapped after casting
260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of type TEXT. The query doesn't select any actual data; it's likely used as a template or placeholder in a dbt (data build tool) model.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp _fivetran_synced approval_status business_id business_name created_at deleted id industry_type name salt timezone timezone_switch_at updated_at 367. source.twitter_ads_source.twitter_ads.account_history 367. source.twitter_ads_source.twitter_ads.account_history
Name Type Comment
_fivetran_synced text None
approval_status text None
business_id integer None
business_name integer None
created_at text None
deleted boolean None
id text None
industry_type integer None
name character varying None
salt integer None
timezone text None
timezone_switch_at text None
updated_at text None
Column Lineage
%3 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp approval_status 259. model.twitter_ads_source.stg_twitter_ads__account_history 259. model.twitter_ads_source.stg_twitter_ads__account_history approval_status 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp:f0->259. model.twitter_ads_source.stg_twitter_ads__account_history:f0 253. model.twitter_ads.twitter_ads__account_report 253. model.twitter_ads.twitter_ads__account_report approval_status 259. model.twitter_ads_source.stg_twitter_ads__account_history:f0->253. model.twitter_ads.twitter_ads__account_report:f0
259. model.twitter_ads_source.stg_twitter_ads__account_history
  • Input Column: 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp[approval_status]
    • Cleaning The column is cast to TEXT type
    • Direct The column is directly copied to the output
    • Output Columns:
      • approval_status: Directly mapped after casting
253. model.twitter_ads.twitter_ads__account_report
  • Input Column: 259. model.twitter_ads_source.stg_twitter_ads__account_history[approval_status]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • approval_status: Directly copied to the output
Column Lineage
%3 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp business_id 259. model.twitter_ads_source.stg_twitter_ads__account_history 259. model.twitter_ads_source.stg_twitter_ads__account_history business_id 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp:f0->259. model.twitter_ads_source.stg_twitter_ads__account_history:f0 253. model.twitter_ads.twitter_ads__account_report 253. model.twitter_ads.twitter_ads__account_report business_id 259. model.twitter_ads_source.stg_twitter_ads__account_history:f0->253. model.twitter_ads.twitter_ads__account_report:f0
259. model.twitter_ads_source.stg_twitter_ads__account_history
  • Input Column: 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp[business_id]
    • Cleaning The column is cast to TEXT type
    • Direct The column is directly copied to the output
    • Output Columns:
      • business_id: Directly mapped after casting
253. model.twitter_ads.twitter_ads__account_report
  • Input Column: 259. model.twitter_ads_source.stg_twitter_ads__account_history[business_id]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • business_id: Directly copied to the output
Column Lineage
%3 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp business_name 259. model.twitter_ads_source.stg_twitter_ads__account_history 259. model.twitter_ads_source.stg_twitter_ads__account_history business_name 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp:f0->259. model.twitter_ads_source.stg_twitter_ads__account_history:f0 253. model.twitter_ads.twitter_ads__account_report 253. model.twitter_ads.twitter_ads__account_report business_name 259. model.twitter_ads_source.stg_twitter_ads__account_history:f0->253. model.twitter_ads.twitter_ads__account_report:f0
259. model.twitter_ads_source.stg_twitter_ads__account_history
  • Input Column: 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp[business_name]
    • Cleaning The column is cast to TEXT type
    • Direct The column is directly copied to the output
    • Output Columns:
      • business_name: Directly mapped after casting
253. model.twitter_ads.twitter_ads__account_report
  • Input Column: 259. model.twitter_ads_source.stg_twitter_ads__account_history[business_name]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • business_name: Directly copied to the output
Column Lineage
%3 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp created_at 259. model.twitter_ads_source.stg_twitter_ads__account_history 259. model.twitter_ads_source.stg_twitter_ads__account_history created_timestamp 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp:f0->259. model.twitter_ads_source.stg_twitter_ads__account_history:f0 253. model.twitter_ads.twitter_ads__account_report 253. model.twitter_ads.twitter_ads__account_report created_timestamp 259. model.twitter_ads_source.stg_twitter_ads__account_history:f0->253. model.twitter_ads.twitter_ads__account_report:f0
259. model.twitter_ads_source.stg_twitter_ads__account_history
  • Input Column: 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp[created_at]
    • Cleaning The column is cast to TIMESTAMP type
    • Direct The column is directly copied to the output with a name change
    • Output Columns:
      • created_timestamp: Directly mapped after casting and renaming
253. model.twitter_ads.twitter_ads__account_report
  • Input Column: 259. model.twitter_ads_source.stg_twitter_ads__account_history[created_timestamp]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • created_timestamp: Directly copied to the output
Column Lineage
%3 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp deleted 259. model.twitter_ads_source.stg_twitter_ads__account_history 259. model.twitter_ads_source.stg_twitter_ads__account_history is_deleted 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp:f0->259. model.twitter_ads_source.stg_twitter_ads__account_history:f0 253. model.twitter_ads.twitter_ads__account_report 253. model.twitter_ads.twitter_ads__account_report is_deleted 259. model.twitter_ads_source.stg_twitter_ads__account_history:f0->253. model.twitter_ads.twitter_ads__account_report:f0
259. model.twitter_ads_source.stg_twitter_ads__account_history
  • Input Column: 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp[deleted]
    • Cleaning The column is cast to BOOLEAN type
    • Direct The column is directly copied to the output with a name change
    • Output Columns:
      • is_deleted: Directly mapped after casting and renaming
253. model.twitter_ads.twitter_ads__account_report
  • Input Column: 259. model.twitter_ads_source.stg_twitter_ads__account_history[is_deleted]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • is_deleted: Directly copied to the output
Column Lineage
%3 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp id 259. model.twitter_ads_source.stg_twitter_ads__account_history 259. model.twitter_ads_source.stg_twitter_ads__account_history account_id 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp:f0->259. model.twitter_ads_source.stg_twitter_ads__account_history:f0 253. model.twitter_ads.twitter_ads__account_report 253. model.twitter_ads.twitter_ads__account_report account_id 259. model.twitter_ads_source.stg_twitter_ads__account_history:f0->253. model.twitter_ads.twitter_ads__account_report:f0 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report account_id 259. model.twitter_ads_source.stg_twitter_ads__account_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report account_id 259. model.twitter_ads_source.stg_twitter_ads__account_history:f0->254. model.twitter_ads.twitter_ads__campaign_report:f0 255. model.twitter_ads.twitter_ads__keyword_report 255. model.twitter_ads.twitter_ads__keyword_report account_id 259. model.twitter_ads_source.stg_twitter_ads__account_history:f0->255. model.twitter_ads.twitter_ads__keyword_report:f0 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report account_id 259. model.twitter_ads_source.stg_twitter_ads__account_history:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report account_id 259. model.twitter_ads_source.stg_twitter_ads__account_history:f0->258. model.twitter_ads.twitter_ads__url_report:f0
259. model.twitter_ads_source.stg_twitter_ads__account_history
  • Input Column: 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp[id]
    • Cleaning The column is cast to TEXT type
    • Direct The column is directly copied to the output with a name change
    • Deduplication Used in the ROW_NUMBER() function to identify the latest version
    • Output Columns:
      • account_id: Directly mapped after casting and renaming
253. model.twitter_ads.twitter_ads__account_report
  • Input Column: 259. model.twitter_ads_source.stg_twitter_ads__account_history[account_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as the key to join with the rollup_report table
    • Output Columns:
      • account_id: Directly copied to the output
254. model.twitter_ads.twitter_ads__campaign_report
  • Input Column: 259. model.twitter_ads_source.stg_twitter_ads__account_history[account_id]
    • Integration used as a key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • account_id: directly copied
255. model.twitter_ads.twitter_ads__keyword_report
  • Input Column: 259. model.twitter_ads_source.stg_twitter_ads__account_history[account_id]
    • Integration used as the key to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • account_id: directly copied
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 259. model.twitter_ads_source.stg_twitter_ads__account_history[account_id]
    • Integration used as the join key with the report table
    • Direct directly copied to the output
    • Output Columns:
      • account_id: directly copied
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 259. model.twitter_ads_source.stg_twitter_ads__account_history[account_id]
    • Integration Used to join with the report table
    • Direct Directly copied to the output
    • Output Columns:
      • account_id: Directly copied
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 259. model.twitter_ads_source.stg_twitter_ads__account_history[account_id]
    • Integration used to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • account_id: directly copied
Column Lineage
%3 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp industry_type 259. model.twitter_ads_source.stg_twitter_ads__account_history 259. model.twitter_ads_source.stg_twitter_ads__account_history industry_type 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp:f0->259. model.twitter_ads_source.stg_twitter_ads__account_history:f0 253. model.twitter_ads.twitter_ads__account_report 253. model.twitter_ads.twitter_ads__account_report industry_type 259. model.twitter_ads_source.stg_twitter_ads__account_history:f0->253. model.twitter_ads.twitter_ads__account_report:f0
259. model.twitter_ads_source.stg_twitter_ads__account_history
  • Input Column: 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp[industry_type]
    • Cleaning The column is cast to TEXT type
    • Direct The column is directly copied to the output
    • Output Columns:
      • industry_type: Directly mapped after casting
253. model.twitter_ads.twitter_ads__account_report
  • Input Column: 259. model.twitter_ads_source.stg_twitter_ads__account_history[industry_type]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • industry_type: Directly copied to the output
Column Lineage
%3 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp name 259. model.twitter_ads_source.stg_twitter_ads__account_history 259. model.twitter_ads_source.stg_twitter_ads__account_history name 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp:f0->259. model.twitter_ads_source.stg_twitter_ads__account_history:f0 253. model.twitter_ads.twitter_ads__account_report 253. model.twitter_ads.twitter_ads__account_report account_name 259. model.twitter_ads_source.stg_twitter_ads__account_history:f0->253. model.twitter_ads.twitter_ads__account_report:f0 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report account_name 259. model.twitter_ads_source.stg_twitter_ads__account_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report account_name 259. model.twitter_ads_source.stg_twitter_ads__account_history:f0->254. model.twitter_ads.twitter_ads__campaign_report:f0 255. model.twitter_ads.twitter_ads__keyword_report 255. model.twitter_ads.twitter_ads__keyword_report account_name 259. model.twitter_ads_source.stg_twitter_ads__account_history:f0->255. model.twitter_ads.twitter_ads__keyword_report:f0 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report account_name 259. model.twitter_ads_source.stg_twitter_ads__account_history:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report account_name 259. model.twitter_ads_source.stg_twitter_ads__account_history:f0->258. model.twitter_ads.twitter_ads__url_report:f0
259. model.twitter_ads_source.stg_twitter_ads__account_history
  • Input Column: 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp[name]
    • Cleaning The column is cast to TEXT type
    • Direct The column is directly copied to the output
    • Output Columns:
      • name: Directly mapped after casting
253. model.twitter_ads.twitter_ads__account_report
  • Input Column: 259. model.twitter_ads_source.stg_twitter_ads__account_history[name]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • account_name: Renamed to account_name in the output
254. model.twitter_ads.twitter_ads__campaign_report
  • Input Column: 259. model.twitter_ads_source.stg_twitter_ads__account_history[name]
    • Direct directly copied to the output
    • Output Columns:
      • account_name: directly copied and renamed
255. model.twitter_ads.twitter_ads__keyword_report
  • Input Column: 259. model.twitter_ads_source.stg_twitter_ads__account_history[name]
    • Direct directly copied to the output
    • Output Columns:
      • account_name: directly copied and renamed
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 259. model.twitter_ads_source.stg_twitter_ads__account_history[name]
    • Direct directly copied to the output
    • Output Columns:
      • account_name: directly copied and renamed
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 259. model.twitter_ads_source.stg_twitter_ads__account_history[name]
    • Direct Directly copied to the output
    • Output Columns:
      • account_name: Directly copied and renamed
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 259. model.twitter_ads_source.stg_twitter_ads__account_history[name]
    • Direct directly copied to the output
    • Output Columns:
      • account_name: directly copied
Column Lineage
%3 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp salt 259. model.twitter_ads_source.stg_twitter_ads__account_history 259. model.twitter_ads_source.stg_twitter_ads__account_history salt 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp:f0->259. model.twitter_ads_source.stg_twitter_ads__account_history:f0
259. model.twitter_ads_source.stg_twitter_ads__account_history
  • Input Column: 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp[salt]
    • Cleaning The column is cast to TEXT type
    • Direct The column is directly copied to the output
    • Output Columns:
      • salt: Directly mapped after casting
Column Lineage
%3 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp timezone 259. model.twitter_ads_source.stg_twitter_ads__account_history 259. model.twitter_ads_source.stg_twitter_ads__account_history timezone 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp:f0->259. model.twitter_ads_source.stg_twitter_ads__account_history:f0 253. model.twitter_ads.twitter_ads__account_report 253. model.twitter_ads.twitter_ads__account_report timezone 259. model.twitter_ads_source.stg_twitter_ads__account_history:f0->253. model.twitter_ads.twitter_ads__account_report:f0
259. model.twitter_ads_source.stg_twitter_ads__account_history
  • Input Column: 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp[timezone]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • timezone: It is directly mapped to the output 'timezone' column
253. model.twitter_ads.twitter_ads__account_report
  • Input Column: 259. model.twitter_ads_source.stg_twitter_ads__account_history[timezone]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • timezone: Directly copied to the output
Column Lineage
%3 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp timezone_switch_at 259. model.twitter_ads_source.stg_twitter_ads__account_history 259. model.twitter_ads_source.stg_twitter_ads__account_history timezone_switched_timestamp 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp:f0->259. model.twitter_ads_source.stg_twitter_ads__account_history:f0 253. model.twitter_ads.twitter_ads__account_report 253. model.twitter_ads.twitter_ads__account_report timezone_switched_timestamp 259. model.twitter_ads_source.stg_twitter_ads__account_history:f0->253. model.twitter_ads.twitter_ads__account_report:f0
259. model.twitter_ads_source.stg_twitter_ads__account_history
  • Input Column: 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp[timezone_switch_at]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TIMESTAMP type
    • Output Columns:
      • timezone_switched_timestamp: It is directly mapped to the output 'timezone_switched_timestamp' column
253. model.twitter_ads.twitter_ads__account_report
  • Input Column: 259. model.twitter_ads_source.stg_twitter_ads__account_history[timezone_switched_timestamp]
    • Direct This column is directly copied to the output without transformation
    • Output Columns:
      • timezone_switched_timestamp: Directly copied to the output column with the same name
Column Lineage
%3 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp updated_at 259. model.twitter_ads_source.stg_twitter_ads__account_history 259. model.twitter_ads_source.stg_twitter_ads__account_history is_latest_version updated_timestamp 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp:f0->259. model.twitter_ads_source.stg_twitter_ads__account_history:f1 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp:f0->259. model.twitter_ads_source.stg_twitter_ads__account_history:f0 253. model.twitter_ads.twitter_ads__account_report 253. model.twitter_ads.twitter_ads__account_report updated_timestamp 259. model.twitter_ads_source.stg_twitter_ads__account_history:f1->253. model.twitter_ads.twitter_ads__account_report:f0 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report updated_timestamp 259. model.twitter_ads_source.stg_twitter_ads__account_history:f1->256. model.twitter_ads.twitter_ads__line_item_report:f0
259. model.twitter_ads_source.stg_twitter_ads__account_history
  • Input Column: 260. model.twitter_ads_source.stg_twitter_ads__account_history_tmp[updated_at]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TIMESTAMP type
    • Deduplication The column is used in the ROW_NUMBER() function to determine the latest version of each account record
    • Output Columns:
      • updated_timestamp: It is directly mapped to the output 'updated_timestamp' column
      • is_latest_version: It is used to determine this boolean flag
253. model.twitter_ads.twitter_ads__account_report
  • Input Column: 259. model.twitter_ads_source.stg_twitter_ads__account_history[updated_timestamp]
    • Direct This column is directly copied to the output without transformation
    • Output Columns:
      • updated_timestamp: Directly copied to the output column with the same name
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 259. model.twitter_ads_source.stg_twitter_ads__account_history[updated_timestamp]
    • Direct This column is directly selected in the final SELECT statement
    • Output Columns:
      • updated_timestamp: Directly copied to the output
261. model.twitter_ads_source.stg_twitter_ads__campaign_history

This SQL query processes data from a Twitter Ads campaign history staging table. It casts and renames fields, calculates budget amounts in standard currency units, adds a flag for the latest version of each campaign, and selects all resulting columns. The query performs data type conversions, column renaming, and adds derived columns for analysis purposes.

CleaningFeaturizationDeduplication
SQL Query
WITH source AS (
  SELECT
    *
  FROM TEST.PUBLIC_twitter_ads_source.stg_twitter_ads__campaign_history_tmp
), fields AS (
  SELECT
    CAST(NULL AS TEXT) AS account_id,
    CAST(NULL AS TIMESTAMP) AS created_at,
    CAST(NULL AS TEXT) AS currency,
    CAST(NULL AS INT) AS daily_budget_amount_local_micro,
    CAST(NULL AS BOOLEAN) AS deleted,
    CAST(NULL AS INT) AS duration_in_days,
    CAST(NULL AS TIMESTAMP) AS end_time,
    CAST(NULL AS TEXT) AS entity_status,
    CAST(NULL AS INT) AS frequency_cap,
    CAST(NULL AS TEXT) AS funding_instrument_id,
    CAST(NULL AS TEXT) AS id,
    CAST(NULL AS TEXT) AS name,
    CAST(NULL AS BOOLEAN) AS servable,
    CAST(NULL AS BOOLEAN) AS standard_delivery,
    CAST(NULL AS TIMESTAMP) AS start_time,
    CAST(NULL AS INT) AS total_budget_amount_local_micro,
    CAST(NULL AS TIMESTAMP) AS updated_at,
    CAST('' AS TEXT) AS source_relation
  FROM source
), final AS (
  SELECT
    source_relation,
    account_id,
    created_at AS created_timestamp,
    currency,
    daily_budget_amount_local_micro,
    deleted AS is_deleted,
    duration_in_days,
    end_time AS end_timestamp,
    entity_status,
    frequency_cap,
    funding_instrument_id,
    id AS campaign_id,
    name AS campaign_name,
    servable AS is_servable,
    standard_delivery AS is_standard_delivery,
    start_time AS start_timestamp,
    total_budget_amount_local_micro,
    updated_at AS updated_timestamp,
    ROUND(daily_budget_amount_local_micro / 1000000.0, 2) AS daily_budget_amount,
    ROUND(total_budget_amount_local_micro / 1000000.0, 2) AS total_budget_amount,
    ROW_NUMBER() OVER (PARTITION BY source_relation, id ORDER BY updated_at DESC) = 1 AS is_latest_version
  FROM fields
)
SELECT
  *
FROM final
%3 261. model.twitter_ads_source.stg_twitter_ads__campaign_history 261. model.twitter_ads_source.stg_twitter_ads__campaign_history source_relation account_id created_timestamp currency daily_budget_amount_local_micro is_deleted duration_in_days end_timestamp entity_status frequency_cap campaign_id campaign_name is_servable is_standard_delivery start_timestamp total_budget_amount_local_micro updated_timestamp is_latest_version funding_instrument_id daily_budget_amount total_budget_amount 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp account_id created_at currency daily_budget_amount_local_micro deleted duration_in_days end_time entity_status frequency_cap funding_instrument_id id name servable standard_delivery start_time total_budget_amount_local_micro updated_at 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f0->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f1 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f1->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f2 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f2->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f3 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f3->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f4 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f3->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f19 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f4->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f5 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f5->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f6 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f6->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f7 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f7->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f8 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f8->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f9 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f9->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f18 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f10->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f10 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f11->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f11 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f12->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f12 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f13->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f13 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f14->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f14 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f15->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f15 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f15->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f20 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f16->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f16 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f16->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f17
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
account_id text The ID of the related account.
created_timestamp text The timestamp the account was created.
currency text The currency all metrics for the account are set to.
daily_budget_amount_local_micro integer The daily budget amount to be allocated to the campaign, in micros. The currency associated with the specified funding instrument will be used.
is_deleted boolean Whether the record has been deleted or not.
duration_in_days integer The time period within which the frequency_cap is achieved.
end_timestamp text The time the campaign will end
entity_status text The status of the campaign.
frequency_cap integer The maximum number of times an ad could be delivered to a user.
campaign_id text The ID of the campaign.
campaign_name text The name of the campaign.
is_servable boolean Whether the campaign is in a state to be actively served to users.
is_standard_delivery boolean Whether standard delivery is enabled (vs accelerated delivery).
start_timestamp text The time the campaign will start.
total_budget_amount_local_micro integer The total budget amount to be allocated to the campaign, in micros.
updated_timestamp text The timestamp the account was last updated.
is_latest_version boolean Whether the record is the most latest version for the campaign
funding_instrument_id text Reference to the funding instrument.
daily_budget_amount numeric The daily budget amount to be allocated to the campaign. The currency associated with the specified funding instrument will be used.
total_budget_amount numeric The total budget amount to be allocated to the campaign.
Column Lineage
%3 261. model.twitter_ads_source.stg_twitter_ads__campaign_history 261. model.twitter_ads_source.stg_twitter_ads__campaign_history source_relation 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report source_relation 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report source_relation 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->254. model.twitter_ads.twitter_ads__campaign_report:f0 255. model.twitter_ads.twitter_ads__keyword_report 255. model.twitter_ads.twitter_ads__keyword_report source_relation 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->255. model.twitter_ads.twitter_ads__keyword_report:f0 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report source_relation 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report source_relation 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->258. model.twitter_ads.twitter_ads__url_report:f0
254. model.twitter_ads.twitter_ads__campaign_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[source_relation]
    • Integration used as part of the join condition with report and accounts tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
255. model.twitter_ads.twitter_ads__keyword_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct copied directly to the output
    • Output Columns:
      • source_relation: directly copied
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[source_relation]
    • Integration used to join with other tables
    • Direct copied directly to the output
    • Output Columns:
      • source_relation: directly copied
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
Column Lineage
%3 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp account_id 261. model.twitter_ads_source.stg_twitter_ads__campaign_history 261. model.twitter_ads_source.stg_twitter_ads__campaign_history account_id 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f0->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0
261. model.twitter_ads_source.stg_twitter_ads__campaign_history
  • Input Column: 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp[account_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • account_id: Directly mapped after casting
Column Lineage
%3 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp created_at 261. model.twitter_ads_source.stg_twitter_ads__campaign_history 261. model.twitter_ads_source.stg_twitter_ads__campaign_history created_timestamp 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f0->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report created_timestamp 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->254. model.twitter_ads.twitter_ads__campaign_report:f0
261. model.twitter_ads_source.stg_twitter_ads__campaign_history
  • Input Column: 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp[created_at]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TIMESTAMP type
    • Output Columns:
      • created_timestamp: Directly mapped after casting and renaming
254. model.twitter_ads.twitter_ads__campaign_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[created_timestamp]
    • Direct directly copied to the output
    • Output Columns:
      • created_timestamp: directly copied
Column Lineage
%3 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp currency 261. model.twitter_ads_source.stg_twitter_ads__campaign_history 261. model.twitter_ads_source.stg_twitter_ads__campaign_history currency 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f0->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report currency 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->254. model.twitter_ads.twitter_ads__campaign_report:f0 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report currency 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report currency 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->258. model.twitter_ads.twitter_ads__url_report:f0
261. model.twitter_ads_source.stg_twitter_ads__campaign_history
  • Input Column: 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp[currency]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • currency: Directly mapped after casting
254. model.twitter_ads.twitter_ads__campaign_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[currency]
    • Direct directly copied to the output
    • Output Columns:
      • currency: directly copied
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[currency]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • currency: Directly copied to the output
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[currency]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • currency: Directly copied to the output
Column Lineage
%3 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp daily_budget_amount_local_micro 261. model.twitter_ads_source.stg_twitter_ads__campaign_history 261. model.twitter_ads_source.stg_twitter_ads__campaign_history daily_budget_amount daily_budget_amount_local_micro 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f0->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f1 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f0->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report daily_budget_amount 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f1->254. model.twitter_ads.twitter_ads__campaign_report:f0
261. model.twitter_ads_source.stg_twitter_ads__campaign_history
  • Input Column: 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp[daily_budget_amount_local_micro]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT type
    • Featurization Used to calculate daily_budget_amount
    • Output Columns:
      • daily_budget_amount_local_micro: Directly mapped after casting
      • daily_budget_amount: Calculated by dividing by 1,000,000 and rounding to 2 decimal places
254. model.twitter_ads.twitter_ads__campaign_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[daily_budget_amount_local_micro]
    • Cleaning likely transformed from micro to standard units
    • Output Columns:
      • daily_budget_amount: transformed from micro to standard units
Column Lineage
%3 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp deleted 261. model.twitter_ads_source.stg_twitter_ads__campaign_history 261. model.twitter_ads_source.stg_twitter_ads__campaign_history is_deleted 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f0->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report is_deleted 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->254. model.twitter_ads.twitter_ads__campaign_report:f0
261. model.twitter_ads_source.stg_twitter_ads__campaign_history
  • Input Column: 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp[deleted]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as BOOLEAN type
    • Output Columns:
      • is_deleted: Directly mapped after casting and renaming
254. model.twitter_ads.twitter_ads__campaign_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[is_deleted]
    • Direct directly copied to the output
    • Output Columns:
      • is_deleted: directly copied
Column Lineage
%3 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp duration_in_days 261. model.twitter_ads_source.stg_twitter_ads__campaign_history 261. model.twitter_ads_source.stg_twitter_ads__campaign_history duration_in_days 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f0->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0
261. model.twitter_ads_source.stg_twitter_ads__campaign_history
  • Input Column: 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp[duration_in_days]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT type
    • Output Columns:
      • duration_in_days: Directly mapped after casting
Column Lineage
%3 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp end_time 261. model.twitter_ads_source.stg_twitter_ads__campaign_history 261. model.twitter_ads_source.stg_twitter_ads__campaign_history end_timestamp 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f0->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report end_timestamp 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->254. model.twitter_ads.twitter_ads__campaign_report:f0
261. model.twitter_ads_source.stg_twitter_ads__campaign_history
  • Input Column: 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp[end_time]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TIMESTAMP type
    • Output Columns:
      • end_timestamp: Directly mapped after casting and renaming
254. model.twitter_ads.twitter_ads__campaign_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[end_timestamp]
    • Direct directly copied to the output
    • Output Columns:
      • end_timestamp: directly copied
Column Lineage
%3 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp entity_status 261. model.twitter_ads_source.stg_twitter_ads__campaign_history 261. model.twitter_ads_source.stg_twitter_ads__campaign_history entity_status 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f0->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report campaign_status 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report campaign_status 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->254. model.twitter_ads.twitter_ads__campaign_report:f0 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report campaign_status 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0
261. model.twitter_ads_source.stg_twitter_ads__campaign_history
  • Input Column: 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp[entity_status]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • entity_status: Directly mapped after casting
254. model.twitter_ads.twitter_ads__campaign_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[entity_status]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_status: directly copied and renamed
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[entity_status]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_status: directly copied
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[entity_status]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • campaign_status: Directly copied to the output
Column Lineage
%3 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp frequency_cap 261. model.twitter_ads_source.stg_twitter_ads__campaign_history 261. model.twitter_ads_source.stg_twitter_ads__campaign_history frequency_cap 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f0->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report frequency_cap 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->254. model.twitter_ads.twitter_ads__campaign_report:f0
261. model.twitter_ads_source.stg_twitter_ads__campaign_history
  • Input Column: 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp[frequency_cap]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT type
    • Output Columns:
      • frequency_cap: Directly mapped after casting
254. model.twitter_ads.twitter_ads__campaign_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[frequency_cap]
    • Direct directly copied to the output
    • Output Columns:
      • frequency_cap: directly copied
Column Lineage
%3 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp id 261. model.twitter_ads_source.stg_twitter_ads__campaign_history 261. model.twitter_ads_source.stg_twitter_ads__campaign_history campaign_id 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f0->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report campaign_id 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report campaign_id 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->254. model.twitter_ads.twitter_ads__campaign_report:f0 255. model.twitter_ads.twitter_ads__keyword_report 255. model.twitter_ads.twitter_ads__keyword_report campaign_id 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->255. model.twitter_ads.twitter_ads__keyword_report:f0 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report campaign_id 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report campaign_id 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->258. model.twitter_ads.twitter_ads__url_report:f0
261. model.twitter_ads_source.stg_twitter_ads__campaign_history
  • Input Column: 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp[id]
    • Direct The column is directly copied without any transformation
    • Deduplication Used in the ROW_NUMBER() function to identify the latest version of each campaign
    • Output Columns:
      • campaign_id: Directly copied to the output and renamed
254. model.twitter_ads.twitter_ads__campaign_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[campaign_id]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as a key to join with the report table
    • Output Columns:
      • campaign_id: Directly copied to the output
255. model.twitter_ads.twitter_ads__keyword_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[campaign_id]
    • Integration used as a key to join with line_items table
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[campaign_id]
    • Integration used as a key to join with line_items table
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[campaign_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with the line_items table
    • Output Columns:
      • campaign_id: Directly copied to the output
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[campaign_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with the line_items table
    • Output Columns:
      • campaign_id: Directly copied to the output
Column Lineage
%3 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp name 261. model.twitter_ads_source.stg_twitter_ads__campaign_history 261. model.twitter_ads_source.stg_twitter_ads__campaign_history campaign_name 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f0->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report campaign_name 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report campaign_name 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->254. model.twitter_ads.twitter_ads__campaign_report:f0 255. model.twitter_ads.twitter_ads__keyword_report 255. model.twitter_ads.twitter_ads__keyword_report campaign_name 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->255. model.twitter_ads.twitter_ads__keyword_report:f0 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report campaign_name 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report campaign_name 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->258. model.twitter_ads.twitter_ads__url_report:f0
261. model.twitter_ads_source.stg_twitter_ads__campaign_history
  • Input Column: 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp[name]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • campaign_name: Directly copied to the output and renamed
254. model.twitter_ads.twitter_ads__campaign_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[campaign_name]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • campaign_name: Directly copied to the output
255. model.twitter_ads.twitter_ads__keyword_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[campaign_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_name: directly copied
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[campaign_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_name: directly copied
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[campaign_name]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • campaign_name: Directly copied to the output
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[campaign_name]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • campaign_name: Directly copied to the output
Column Lineage
%3 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp servable 261. model.twitter_ads_source.stg_twitter_ads__campaign_history 261. model.twitter_ads_source.stg_twitter_ads__campaign_history is_servable 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f0->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report is_servable 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->254. model.twitter_ads.twitter_ads__campaign_report:f0
261. model.twitter_ads_source.stg_twitter_ads__campaign_history
  • Input Column: 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp[servable]
    • Cleaning The column is cast to BOOLEAN type
    • Output Columns:
      • is_servable: Copied to the output, renamed, and cast to BOOLEAN
254. model.twitter_ads.twitter_ads__campaign_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[is_servable]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • is_servable: Directly copied to the output
Column Lineage
%3 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp standard_delivery 261. model.twitter_ads_source.stg_twitter_ads__campaign_history 261. model.twitter_ads_source.stg_twitter_ads__campaign_history is_standard_delivery 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f0->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report is_standard_delivery 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->254. model.twitter_ads.twitter_ads__campaign_report:f0
261. model.twitter_ads_source.stg_twitter_ads__campaign_history
  • Input Column: 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp[standard_delivery]
    • Cleaning The column is cast to BOOLEAN type
    • Output Columns:
      • is_standard_delivery: Copied to the output, renamed, and cast to BOOLEAN
254. model.twitter_ads.twitter_ads__campaign_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[is_standard_delivery]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • is_standard_delivery: Directly copied to the output
Column Lineage
%3 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp start_time 261. model.twitter_ads_source.stg_twitter_ads__campaign_history 261. model.twitter_ads_source.stg_twitter_ads__campaign_history start_timestamp 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f0->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report start_timestamp 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->254. model.twitter_ads.twitter_ads__campaign_report:f0
261. model.twitter_ads_source.stg_twitter_ads__campaign_history
  • Input Column: 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp[start_time]
    • Cleaning The column is cast to TIMESTAMP type
    • Output Columns:
      • start_timestamp: Copied to the output, renamed, and cast to TIMESTAMP
254. model.twitter_ads.twitter_ads__campaign_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[start_timestamp]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • start_timestamp: Directly copied to the output
Column Lineage
%3 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp total_budget_amount_local_micro 261. model.twitter_ads_source.stg_twitter_ads__campaign_history 261. model.twitter_ads_source.stg_twitter_ads__campaign_history total_budget_amount total_budget_amount_local_micro 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f0->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f1 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f0->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report total_budget_amount 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f1->254. model.twitter_ads.twitter_ads__campaign_report:f0
261. model.twitter_ads_source.stg_twitter_ads__campaign_history
  • Input Column: 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp[total_budget_amount_local_micro]
    • Direct The column is directly copied without any transformation
    • Featurization Used to calculate the total_budget_amount in standard currency units
    • Output Columns:
      • total_budget_amount_local_micro: Directly copied to the output
      • total_budget_amount: Transformed to calculate the budget in standard currency units
254. model.twitter_ads.twitter_ads__campaign_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[total_budget_amount_local_micro]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • total_budget_amount: Directly copied to the output
Column Lineage
%3 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp updated_at 261. model.twitter_ads_source.stg_twitter_ads__campaign_history 261. model.twitter_ads_source.stg_twitter_ads__campaign_history is_latest_version updated_timestamp 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f0->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f1 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f0->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report updated_timestamp 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f1->254. model.twitter_ads.twitter_ads__campaign_report:f0
261. model.twitter_ads_source.stg_twitter_ads__campaign_history
  • Input Column: 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp[updated_at]
    • Cleaning The column is cast to TIMESTAMP type
    • Deduplication Used in the ROW_NUMBER() function to identify the latest version of each campaign
    • Output Columns:
      • updated_timestamp: Copied to the output, renamed, and cast to TIMESTAMP
      • is_latest_version: Used to determine if the record is the latest version
254. model.twitter_ads.twitter_ads__campaign_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[updated_timestamp]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • updated_timestamp: Directly copied to the output
Column Lineage
%3 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp updated_at 261. model.twitter_ads_source.stg_twitter_ads__campaign_history 261. model.twitter_ads_source.stg_twitter_ads__campaign_history is_latest_version updated_timestamp 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f0->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f1 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f0->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0
261. model.twitter_ads_source.stg_twitter_ads__campaign_history
  • Input Column: 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp[updated_at]
    • Cleaning The column is cast to TIMESTAMP type
    • Deduplication Used in the ROW_NUMBER() function to identify the latest version of each campaign
    • Output Columns:
      • updated_timestamp: Copied to the output, renamed, and cast to TIMESTAMP
      • is_latest_version: Used to determine if the record is the latest version
Column Lineage
%3 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp funding_instrument_id 261. model.twitter_ads_source.stg_twitter_ads__campaign_history 261. model.twitter_ads_source.stg_twitter_ads__campaign_history funding_instrument_id 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f0->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report funding_instrument_id 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->254. model.twitter_ads.twitter_ads__campaign_report:f0
261. model.twitter_ads_source.stg_twitter_ads__campaign_history
  • Input Column: 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp[funding_instrument_id]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • funding_instrument_id: Directly copied to the output
254. model.twitter_ads.twitter_ads__campaign_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[funding_instrument_id]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • funding_instrument_id: Directly copied to the output
Column Lineage
%3 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp daily_budget_amount_local_micro 261. model.twitter_ads_source.stg_twitter_ads__campaign_history 261. model.twitter_ads_source.stg_twitter_ads__campaign_history daily_budget_amount daily_budget_amount_local_micro 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f0->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f1 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f0->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report daily_budget_amount 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->254. model.twitter_ads.twitter_ads__campaign_report:f0
261. model.twitter_ads_source.stg_twitter_ads__campaign_history
  • Input Column: 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp[daily_budget_amount_local_micro]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT type
    • Featurization Used to calculate daily_budget_amount
    • Output Columns:
      • daily_budget_amount_local_micro: Directly mapped after casting
      • daily_budget_amount: Calculated by dividing by 1,000,000 and rounding to 2 decimal places
254. model.twitter_ads.twitter_ads__campaign_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[daily_budget_amount]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • daily_budget_amount: Directly copied to the output
Column Lineage
%3 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp total_budget_amount_local_micro 261. model.twitter_ads_source.stg_twitter_ads__campaign_history 261. model.twitter_ads_source.stg_twitter_ads__campaign_history total_budget_amount total_budget_amount_local_micro 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f0->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f1 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f0->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report total_budget_amount 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->254. model.twitter_ads.twitter_ads__campaign_report:f0
261. model.twitter_ads_source.stg_twitter_ads__campaign_history
  • Input Column: 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp[total_budget_amount_local_micro]
    • Direct The column is directly copied without any transformation
    • Featurization Used to calculate the total_budget_amount in standard currency units
    • Output Columns:
      • total_budget_amount_local_micro: Directly copied to the output
      • total_budget_amount: Transformed to calculate the budget in standard currency units
254. model.twitter_ads.twitter_ads__campaign_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[total_budget_amount]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join between the report and campaigns tables
    • Output Columns:
      • total_budget_amount: It is directly mapped to the output column of the same name
262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of TEXT data type. It's likely used as a placeholder or template for a staging table in a dbt (data build tool) project, specifically for Twitter Ads campaign history data.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp _fivetran_synced account_id created_at currency daily_budget_amount_local_micro deleted duration_in_days end_time entity_status frequency_cap funding_instrument_id id name servable standard_delivery start_time total_budget_amount_local_micro updated_at 368. source.twitter_ads_source.twitter_ads.campaign_history 368. source.twitter_ads_source.twitter_ads.campaign_history
Name Type Comment
_fivetran_synced text None
account_id text None
created_at text None
currency text None
daily_budget_amount_local_micro integer None
deleted boolean None
duration_in_days integer None
end_time text None
entity_status text None
frequency_cap integer None
funding_instrument_id text None
id text None
name text None
servable boolean None
standard_delivery boolean None
start_time text None
total_budget_amount_local_micro integer None
updated_at text None
Column Lineage
%3 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp account_id 261. model.twitter_ads_source.stg_twitter_ads__campaign_history 261. model.twitter_ads_source.stg_twitter_ads__campaign_history account_id 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f0->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0
261. model.twitter_ads_source.stg_twitter_ads__campaign_history
  • Input Column: 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp[account_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • account_id: Directly mapped after casting
Column Lineage
%3 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp created_at 261. model.twitter_ads_source.stg_twitter_ads__campaign_history 261. model.twitter_ads_source.stg_twitter_ads__campaign_history created_timestamp 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f0->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report created_timestamp 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->254. model.twitter_ads.twitter_ads__campaign_report:f0
261. model.twitter_ads_source.stg_twitter_ads__campaign_history
  • Input Column: 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp[created_at]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TIMESTAMP type
    • Output Columns:
      • created_timestamp: Directly mapped after casting and renaming
254. model.twitter_ads.twitter_ads__campaign_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[created_timestamp]
    • Direct directly copied to the output
    • Output Columns:
      • created_timestamp: directly copied
Column Lineage
%3 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp currency 261. model.twitter_ads_source.stg_twitter_ads__campaign_history 261. model.twitter_ads_source.stg_twitter_ads__campaign_history currency 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f0->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report currency 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->254. model.twitter_ads.twitter_ads__campaign_report:f0 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report currency 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report currency 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->258. model.twitter_ads.twitter_ads__url_report:f0
261. model.twitter_ads_source.stg_twitter_ads__campaign_history
  • Input Column: 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp[currency]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • currency: Directly mapped after casting
254. model.twitter_ads.twitter_ads__campaign_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[currency]
    • Direct directly copied to the output
    • Output Columns:
      • currency: directly copied
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[currency]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • currency: Directly copied to the output
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[currency]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • currency: Directly copied to the output
Column Lineage
%3 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp daily_budget_amount_local_micro 261. model.twitter_ads_source.stg_twitter_ads__campaign_history 261. model.twitter_ads_source.stg_twitter_ads__campaign_history daily_budget_amount daily_budget_amount_local_micro 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f0->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f1 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f0->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report daily_budget_amount 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f1->254. model.twitter_ads.twitter_ads__campaign_report:f0 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->254. model.twitter_ads.twitter_ads__campaign_report:f0
261. model.twitter_ads_source.stg_twitter_ads__campaign_history
  • Input Column: 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp[daily_budget_amount_local_micro]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT type
    • Featurization Used to calculate daily_budget_amount
    • Output Columns:
      • daily_budget_amount_local_micro: Directly mapped after casting
      • daily_budget_amount: Calculated by dividing by 1,000,000 and rounding to 2 decimal places
254. model.twitter_ads.twitter_ads__campaign_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[daily_budget_amount_local_micro]
    • Cleaning likely transformed from micro to standard units
    • Output Columns:
      • daily_budget_amount: transformed from micro to standard units
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[daily_budget_amount]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • daily_budget_amount: Directly copied to the output
Column Lineage
%3 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp deleted 261. model.twitter_ads_source.stg_twitter_ads__campaign_history 261. model.twitter_ads_source.stg_twitter_ads__campaign_history is_deleted 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f0->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report is_deleted 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->254. model.twitter_ads.twitter_ads__campaign_report:f0
261. model.twitter_ads_source.stg_twitter_ads__campaign_history
  • Input Column: 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp[deleted]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as BOOLEAN type
    • Output Columns:
      • is_deleted: Directly mapped after casting and renaming
254. model.twitter_ads.twitter_ads__campaign_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[is_deleted]
    • Direct directly copied to the output
    • Output Columns:
      • is_deleted: directly copied
Column Lineage
%3 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp duration_in_days 261. model.twitter_ads_source.stg_twitter_ads__campaign_history 261. model.twitter_ads_source.stg_twitter_ads__campaign_history duration_in_days 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f0->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0
261. model.twitter_ads_source.stg_twitter_ads__campaign_history
  • Input Column: 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp[duration_in_days]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT type
    • Output Columns:
      • duration_in_days: Directly mapped after casting
Column Lineage
%3 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp end_time 261. model.twitter_ads_source.stg_twitter_ads__campaign_history 261. model.twitter_ads_source.stg_twitter_ads__campaign_history end_timestamp 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f0->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report end_timestamp 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->254. model.twitter_ads.twitter_ads__campaign_report:f0
261. model.twitter_ads_source.stg_twitter_ads__campaign_history
  • Input Column: 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp[end_time]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TIMESTAMP type
    • Output Columns:
      • end_timestamp: Directly mapped after casting and renaming
254. model.twitter_ads.twitter_ads__campaign_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[end_timestamp]
    • Direct directly copied to the output
    • Output Columns:
      • end_timestamp: directly copied
Column Lineage
%3 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp entity_status 261. model.twitter_ads_source.stg_twitter_ads__campaign_history 261. model.twitter_ads_source.stg_twitter_ads__campaign_history entity_status 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f0->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report campaign_status 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report campaign_status 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->254. model.twitter_ads.twitter_ads__campaign_report:f0 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report campaign_status 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0
261. model.twitter_ads_source.stg_twitter_ads__campaign_history
  • Input Column: 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp[entity_status]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT type
    • Output Columns:
      • entity_status: Directly mapped after casting
254. model.twitter_ads.twitter_ads__campaign_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[entity_status]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_status: directly copied and renamed
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[entity_status]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_status: directly copied
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[entity_status]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • campaign_status: Directly copied to the output
Column Lineage
%3 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp frequency_cap 261. model.twitter_ads_source.stg_twitter_ads__campaign_history 261. model.twitter_ads_source.stg_twitter_ads__campaign_history frequency_cap 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f0->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report frequency_cap 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->254. model.twitter_ads.twitter_ads__campaign_report:f0
261. model.twitter_ads_source.stg_twitter_ads__campaign_history
  • Input Column: 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp[frequency_cap]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT type
    • Output Columns:
      • frequency_cap: Directly mapped after casting
254. model.twitter_ads.twitter_ads__campaign_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[frequency_cap]
    • Direct directly copied to the output
    • Output Columns:
      • frequency_cap: directly copied
Column Lineage
%3 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp funding_instrument_id 261. model.twitter_ads_source.stg_twitter_ads__campaign_history 261. model.twitter_ads_source.stg_twitter_ads__campaign_history funding_instrument_id 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f0->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report funding_instrument_id 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->254. model.twitter_ads.twitter_ads__campaign_report:f0
261. model.twitter_ads_source.stg_twitter_ads__campaign_history
  • Input Column: 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp[funding_instrument_id]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • funding_instrument_id: Directly copied to the output
254. model.twitter_ads.twitter_ads__campaign_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[funding_instrument_id]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • funding_instrument_id: Directly copied to the output
Column Lineage
%3 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp id 261. model.twitter_ads_source.stg_twitter_ads__campaign_history 261. model.twitter_ads_source.stg_twitter_ads__campaign_history campaign_id 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f0->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report campaign_id 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report campaign_id 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->254. model.twitter_ads.twitter_ads__campaign_report:f0 255. model.twitter_ads.twitter_ads__keyword_report 255. model.twitter_ads.twitter_ads__keyword_report campaign_id 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->255. model.twitter_ads.twitter_ads__keyword_report:f0 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report campaign_id 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report campaign_id 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->258. model.twitter_ads.twitter_ads__url_report:f0
261. model.twitter_ads_source.stg_twitter_ads__campaign_history
  • Input Column: 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp[id]
    • Direct The column is directly copied without any transformation
    • Deduplication Used in the ROW_NUMBER() function to identify the latest version of each campaign
    • Output Columns:
      • campaign_id: Directly copied to the output and renamed
254. model.twitter_ads.twitter_ads__campaign_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[campaign_id]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as a key to join with the report table
    • Output Columns:
      • campaign_id: Directly copied to the output
255. model.twitter_ads.twitter_ads__keyword_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[campaign_id]
    • Integration used as a key to join with line_items table
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[campaign_id]
    • Integration used as a key to join with line_items table
    • Direct directly copied to the output
    • Output Columns:
      • campaign_id: directly copied
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[campaign_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with the line_items table
    • Output Columns:
      • campaign_id: Directly copied to the output
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[campaign_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a key to join with the line_items table
    • Output Columns:
      • campaign_id: Directly copied to the output
Column Lineage
%3 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp name 261. model.twitter_ads_source.stg_twitter_ads__campaign_history 261. model.twitter_ads_source.stg_twitter_ads__campaign_history campaign_name 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f0->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report campaign_name 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report campaign_name 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->254. model.twitter_ads.twitter_ads__campaign_report:f0 255. model.twitter_ads.twitter_ads__keyword_report 255. model.twitter_ads.twitter_ads__keyword_report campaign_name 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->255. model.twitter_ads.twitter_ads__keyword_report:f0 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report campaign_name 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report campaign_name 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->258. model.twitter_ads.twitter_ads__url_report:f0
261. model.twitter_ads_source.stg_twitter_ads__campaign_history
  • Input Column: 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp[name]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • campaign_name: Directly copied to the output and renamed
254. model.twitter_ads.twitter_ads__campaign_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[campaign_name]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • campaign_name: Directly copied to the output
255. model.twitter_ads.twitter_ads__keyword_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[campaign_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_name: directly copied
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[campaign_name]
    • Direct directly copied to the output
    • Output Columns:
      • campaign_name: directly copied
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[campaign_name]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • campaign_name: Directly copied to the output
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[campaign_name]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • campaign_name: Directly copied to the output
Column Lineage
%3 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp servable 261. model.twitter_ads_source.stg_twitter_ads__campaign_history 261. model.twitter_ads_source.stg_twitter_ads__campaign_history is_servable 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f0->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report is_servable 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->254. model.twitter_ads.twitter_ads__campaign_report:f0
261. model.twitter_ads_source.stg_twitter_ads__campaign_history
  • Input Column: 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp[servable]
    • Cleaning The column is cast to BOOLEAN type
    • Output Columns:
      • is_servable: Copied to the output, renamed, and cast to BOOLEAN
254. model.twitter_ads.twitter_ads__campaign_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[is_servable]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • is_servable: Directly copied to the output
Column Lineage
%3 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp standard_delivery 261. model.twitter_ads_source.stg_twitter_ads__campaign_history 261. model.twitter_ads_source.stg_twitter_ads__campaign_history is_standard_delivery 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f0->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report is_standard_delivery 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->254. model.twitter_ads.twitter_ads__campaign_report:f0
261. model.twitter_ads_source.stg_twitter_ads__campaign_history
  • Input Column: 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp[standard_delivery]
    • Cleaning The column is cast to BOOLEAN type
    • Output Columns:
      • is_standard_delivery: Copied to the output, renamed, and cast to BOOLEAN
254. model.twitter_ads.twitter_ads__campaign_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[is_standard_delivery]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • is_standard_delivery: Directly copied to the output
Column Lineage
%3 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp start_time 261. model.twitter_ads_source.stg_twitter_ads__campaign_history 261. model.twitter_ads_source.stg_twitter_ads__campaign_history start_timestamp 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f0->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report start_timestamp 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->254. model.twitter_ads.twitter_ads__campaign_report:f0
261. model.twitter_ads_source.stg_twitter_ads__campaign_history
  • Input Column: 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp[start_time]
    • Cleaning The column is cast to TIMESTAMP type
    • Output Columns:
      • start_timestamp: Copied to the output, renamed, and cast to TIMESTAMP
254. model.twitter_ads.twitter_ads__campaign_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[start_timestamp]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • start_timestamp: Directly copied to the output
Column Lineage
%3 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp total_budget_amount_local_micro 261. model.twitter_ads_source.stg_twitter_ads__campaign_history 261. model.twitter_ads_source.stg_twitter_ads__campaign_history total_budget_amount total_budget_amount_local_micro 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f0->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f1 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f0->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report total_budget_amount 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f1->254. model.twitter_ads.twitter_ads__campaign_report:f0 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0->254. model.twitter_ads.twitter_ads__campaign_report:f0
261. model.twitter_ads_source.stg_twitter_ads__campaign_history
  • Input Column: 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp[total_budget_amount_local_micro]
    • Direct The column is directly copied without any transformation
    • Featurization Used to calculate the total_budget_amount in standard currency units
    • Output Columns:
      • total_budget_amount_local_micro: Directly copied to the output
      • total_budget_amount: Transformed to calculate the budget in standard currency units
254. model.twitter_ads.twitter_ads__campaign_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[total_budget_amount_local_micro]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • total_budget_amount: Directly copied to the output
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[total_budget_amount]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join between the report and campaigns tables
    • Output Columns:
      • total_budget_amount: It is directly mapped to the output column of the same name
Column Lineage
%3 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp updated_at 261. model.twitter_ads_source.stg_twitter_ads__campaign_history 261. model.twitter_ads_source.stg_twitter_ads__campaign_history is_latest_version updated_timestamp 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f0->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f1 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp:f0->261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f0 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report updated_timestamp 261. model.twitter_ads_source.stg_twitter_ads__campaign_history:f1->254. model.twitter_ads.twitter_ads__campaign_report:f0
261. model.twitter_ads_source.stg_twitter_ads__campaign_history
  • Input Column: 262. model.twitter_ads_source.stg_twitter_ads__campaign_history_tmp[updated_at]
    • Cleaning The column is cast to TIMESTAMP type
    • Deduplication Used in the ROW_NUMBER() function to identify the latest version of each campaign
    • Output Columns:
      • updated_timestamp: Copied to the output, renamed, and cast to TIMESTAMP
      • is_latest_version: Used to determine if the record is the latest version
254. model.twitter_ads.twitter_ads__campaign_report
  • Input Column: 261. model.twitter_ads_source.stg_twitter_ads__campaign_history[updated_timestamp]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • updated_timestamp: Directly copied to the output
263. model.twitter_ads_source.stg_twitter_ads__campaign_report

This SQL query stages data from a temporary table for Twitter ads campaign reports. It casts columns to specific data types, renames some columns, and performs minor transformations such as truncating the date to day level and converting the spend from micro units to standard currency units. The query doesn't filter or aggregate data, but prepares it for further analysis.

CleaningFeaturization
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_twitter_ads_source.stg_twitter_ads__campaign_report_tmp
), fields AS (
  SELECT
    CAST(NULL AS TEXT) AS account_id,
    CAST(NULL AS INT) AS billed_charge_local_micro,
    CAST(NULL AS TEXT) AS campaign_id,
    CAST(NULL AS INT) AS clicks,
    CAST(NULL AS TIMESTAMP) AS date,
    CAST(NULL AS INT) AS impressions,
    CAST(NULL AS TEXT) AS placement,
    CAST(NULL AS INT) AS url_clicks,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    DATE_TRUNC('DAY', date) AS date_day,
    account_id,
    campaign_id,
    placement,
    clicks,
    impressions,
    billed_charge_local_micro AS spend_micro,
    ROUND(billed_charge_local_micro / 1000000.0, 2) AS spend,
    url_clicks
  FROM fields
)
SELECT
  *
FROM final
%3 263. model.twitter_ads_source.stg_twitter_ads__campaign_report 263. model.twitter_ads_source.stg_twitter_ads__campaign_report source_relation account_id spend_micro spend clicks date_day impressions campaign_id url_clicks placement 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp account_id campaign_id date placement billed_charge_local_micro clicks impressions url_clicks 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp:f0->263. model.twitter_ads_source.stg_twitter_ads__campaign_report:f1 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp:f1->263. model.twitter_ads_source.stg_twitter_ads__campaign_report:f7 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp:f2->263. model.twitter_ads_source.stg_twitter_ads__campaign_report:f5 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp:f3->263. model.twitter_ads_source.stg_twitter_ads__campaign_report:f9 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp:f4->263. model.twitter_ads_source.stg_twitter_ads__campaign_report:f2 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp:f4->263. model.twitter_ads_source.stg_twitter_ads__campaign_report:f3 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp:f5->263. model.twitter_ads_source.stg_twitter_ads__campaign_report:f4 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp:f6->263. model.twitter_ads_source.stg_twitter_ads__campaign_report:f6 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp:f7->263. model.twitter_ads_source.stg_twitter_ads__campaign_report:f8
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
account_id text The ID of the related account.
spend_micro integer The spend for the campaign on that day, in micros and in whichever currency was selected during account creation.
spend numeric The spend for the campaign on that day in whichever currency was selected during account creation.
clicks integer The clicks for the campaign on that day. Includes clicks on the URL (shortened or regular links), profile pic, screen name, username, detail, hashtags, and likes.
date_day timestamp without time zone The date of the performance.
impressions integer The impressions for the campaign on that day. This is the number of users who see a Promoted Ad either in their home timeline or search results.
campaign_id text The ID of the campaign.
url_clicks integer The url clicks for the campaign on that day.
placement text Where on Twitter the ad is being displayed. Possible values include 'ALL_ON_TWITTER', 'PUBLISHER_NETWORK', 'TWITTER_PROFILE', 'TWITTER_SEARCH', 'TWITTER_TIMELINE', and 'TAP_*', which are more granular options for `PUBLISHER_NETWORK`.
Column Lineage
%3 263. model.twitter_ads_source.stg_twitter_ads__campaign_report 263. model.twitter_ads_source.stg_twitter_ads__campaign_report source_relation 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report source_relation 263. model.twitter_ads_source.stg_twitter_ads__campaign_report:f0->254. model.twitter_ads.twitter_ads__campaign_report:f0
254. model.twitter_ads.twitter_ads__campaign_report
  • Input Column: 263. model.twitter_ads_source.stg_twitter_ads__campaign_report[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the JOIN condition with other tables
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
Column Lineage
%3 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp account_id 263. model.twitter_ads_source.stg_twitter_ads__campaign_report 263. model.twitter_ads_source.stg_twitter_ads__campaign_report account_id 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp:f0->263. model.twitter_ads_source.stg_twitter_ads__campaign_report:f0 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report account_id 263. model.twitter_ads_source.stg_twitter_ads__campaign_report:f0->254. model.twitter_ads.twitter_ads__campaign_report:f0
263. model.twitter_ads_source.stg_twitter_ads__campaign_report
  • Input Column: 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp[account_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • account_id: Directly mapped after casting
254. model.twitter_ads.twitter_ads__campaign_report
  • Input Column: 263. model.twitter_ads_source.stg_twitter_ads__campaign_report[account_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the JOIN condition with the accounts table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • account_id: Directly copied to the output
Column Lineage
%3 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp billed_charge_local_micro 263. model.twitter_ads_source.stg_twitter_ads__campaign_report 263. model.twitter_ads_source.stg_twitter_ads__campaign_report spend spend_micro 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp:f0->263. model.twitter_ads_source.stg_twitter_ads__campaign_report:f1 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp:f0->263. model.twitter_ads_source.stg_twitter_ads__campaign_report:f0 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report spend_micro 263. model.twitter_ads_source.stg_twitter_ads__campaign_report:f1->254. model.twitter_ads.twitter_ads__campaign_report:f0
263. model.twitter_ads_source.stg_twitter_ads__campaign_report
  • Input Column: 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp[billed_charge_local_micro]
    • Cleaning The column is cast as INT
    • Featurization The value is divided by 1,000,000 and rounded to 2 decimal places to create a new feature
    • Output Columns:
      • spend_micro: Directly mapped after casting
      • spend: Mapped after transformation (division and rounding)
254. model.twitter_ads.twitter_ads__campaign_report
  • Input Column: 263. model.twitter_ads_source.stg_twitter_ads__campaign_report[spend_micro]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • spend_micro: Summed up in the output
Column Lineage
%3 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp billed_charge_local_micro 263. model.twitter_ads_source.stg_twitter_ads__campaign_report 263. model.twitter_ads_source.stg_twitter_ads__campaign_report spend spend_micro 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp:f0->263. model.twitter_ads_source.stg_twitter_ads__campaign_report:f1 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp:f0->263. model.twitter_ads_source.stg_twitter_ads__campaign_report:f0 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report spend 263. model.twitter_ads_source.stg_twitter_ads__campaign_report:f0->254. model.twitter_ads.twitter_ads__campaign_report:f0
263. model.twitter_ads_source.stg_twitter_ads__campaign_report
  • Input Column: 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp[billed_charge_local_micro]
    • Cleaning The column is cast as INT
    • Featurization The value is divided by 1,000,000 and rounded to 2 decimal places to create a new feature
    • Output Columns:
      • spend_micro: Directly mapped after casting
      • spend: Mapped after transformation (division and rounding)
254. model.twitter_ads.twitter_ads__campaign_report
  • Input Column: 263. model.twitter_ads_source.stg_twitter_ads__campaign_report[spend]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • spend: Summed up in the output
Column Lineage
%3 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp clicks 263. model.twitter_ads_source.stg_twitter_ads__campaign_report 263. model.twitter_ads_source.stg_twitter_ads__campaign_report clicks 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp:f0->263. model.twitter_ads_source.stg_twitter_ads__campaign_report:f0 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report clicks 263. model.twitter_ads_source.stg_twitter_ads__campaign_report:f0->254. model.twitter_ads.twitter_ads__campaign_report:f0
263. model.twitter_ads_source.stg_twitter_ads__campaign_report
  • Input Column: 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp[clicks]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT
    • Output Columns:
      • clicks: Directly mapped after casting
254. model.twitter_ads.twitter_ads__campaign_report
  • Input Column: 263. model.twitter_ads_source.stg_twitter_ads__campaign_report[clicks]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • clicks: Summed up in the output
Column Lineage
%3 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp date 263. model.twitter_ads_source.stg_twitter_ads__campaign_report 263. model.twitter_ads_source.stg_twitter_ads__campaign_report date_day 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp:f0->263. model.twitter_ads_source.stg_twitter_ads__campaign_report:f0 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report date_day 263. model.twitter_ads_source.stg_twitter_ads__campaign_report:f0->254. model.twitter_ads.twitter_ads__campaign_report:f0
263. model.twitter_ads_source.stg_twitter_ads__campaign_report
  • Input Column: 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp[date]
    • Cleaning The column is cast as TIMESTAMP and then truncated to day level
    • Featurization The date is truncated to create a day-level feature
    • Output Columns:
      • date_day: Mapped after casting and truncating to day level
254. model.twitter_ads.twitter_ads__campaign_report
  • Input Column: 263. model.twitter_ads_source.stg_twitter_ads__campaign_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp impressions 263. model.twitter_ads_source.stg_twitter_ads__campaign_report 263. model.twitter_ads_source.stg_twitter_ads__campaign_report impressions 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp:f0->263. model.twitter_ads_source.stg_twitter_ads__campaign_report:f0 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report impressions 263. model.twitter_ads_source.stg_twitter_ads__campaign_report:f0->254. model.twitter_ads.twitter_ads__campaign_report:f0
263. model.twitter_ads_source.stg_twitter_ads__campaign_report
  • Input Column: 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp[impressions]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT
    • Output Columns:
      • impressions: Directly mapped after casting
254. model.twitter_ads.twitter_ads__campaign_report
  • Input Column: 263. model.twitter_ads_source.stg_twitter_ads__campaign_report[impressions]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • impressions: Summed up in the output
Column Lineage
%3 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp campaign_id 263. model.twitter_ads_source.stg_twitter_ads__campaign_report 263. model.twitter_ads_source.stg_twitter_ads__campaign_report campaign_id 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp:f0->263. model.twitter_ads_source.stg_twitter_ads__campaign_report:f0 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report campaign_id 263. model.twitter_ads_source.stg_twitter_ads__campaign_report:f0->254. model.twitter_ads.twitter_ads__campaign_report:f0
263. model.twitter_ads_source.stg_twitter_ads__campaign_report
  • Input Column: 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp[campaign_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • campaign_id: Directly mapped after casting
254. model.twitter_ads.twitter_ads__campaign_report
  • Input Column: 263. model.twitter_ads_source.stg_twitter_ads__campaign_report[campaign_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the JOIN condition with the campaigns table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • campaign_id: Directly copied to the output
Column Lineage
%3 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp url_clicks 263. model.twitter_ads_source.stg_twitter_ads__campaign_report 263. model.twitter_ads_source.stg_twitter_ads__campaign_report url_clicks 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp:f0->263. model.twitter_ads_source.stg_twitter_ads__campaign_report:f0 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report url_clicks 263. model.twitter_ads_source.stg_twitter_ads__campaign_report:f0->254. model.twitter_ads.twitter_ads__campaign_report:f0
263. model.twitter_ads_source.stg_twitter_ads__campaign_report
  • Input Column: 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp[url_clicks]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT in the 'fields' CTE
    • Output Columns:
      • url_clicks: Directly mapped
254. model.twitter_ads.twitter_ads__campaign_report
  • Input Column: 263. model.twitter_ads_source.stg_twitter_ads__campaign_report[url_clicks]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • url_clicks: Summed up in the output
Column Lineage
%3 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp placement 263. model.twitter_ads_source.stg_twitter_ads__campaign_report 263. model.twitter_ads_source.stg_twitter_ads__campaign_report placement 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp:f0->263. model.twitter_ads_source.stg_twitter_ads__campaign_report:f0 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report placement 263. model.twitter_ads_source.stg_twitter_ads__campaign_report:f0->254. model.twitter_ads.twitter_ads__campaign_report:f0
263. model.twitter_ads_source.stg_twitter_ads__campaign_report
  • Input Column: 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp[placement]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • placement: Directly mapped after casting
254. model.twitter_ads.twitter_ads__campaign_report
  • Input Column: 263. model.twitter_ads_source.stg_twitter_ads__campaign_report[placement]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • placement: Directly copied to the output
264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of type TEXT. It's likely used as a placeholder or template for a staging table in a dbt (data build tool) project, specifically for Twitter ads campaign reporting.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp account_id campaign_id date placement _fivetran_synced app_clicks billed_charge_local_micro billed_engagements card_engagements carousel_swipes clicks conversion_custom_metric conversion_custom_order_quantity conversion_custom_order_quantity_engagement conversion_custom_order_quantity_view conversion_custom_post_engagement conversion_custom_post_view conversion_custom_sale_amount conversion_custom_sale_amount_engagement conversion_custom_sale_amount_view conversion_downloads_metric conversion_downloads_order_quantity conversion_downloads_order_quantity_engagement conversion_downloads_order_quantity_view conversion_downloads_post_engagement conversion_downloads_post_view conversion_downloads_sale_amount conversion_downloads_sale_amount_engagement conversion_downloads_sale_amount_view conversion_purchases_assisted conversion_purchases_metric conversion_purchases_order_quantity conversion_purchases_order_quantity_engagement conversion_purchases_order_quantity_view conversion_purchases_post_engagement conversion_purchases_post_view conversion_purchases_sale_amount conversion_purchases_sale_amount_engagement conversion_purchases_sale_amount_view conversion_sign_ups_assisted conversion_sign_ups_metric conversion_sign_ups_order_quantity conversion_sign_ups_order_quantity_engagement conversion_sign_ups_order_quantity_view conversion_sign_ups_post_engagement conversion_sign_ups_post_view conversion_sign_ups_sale_amount conversion_sign_ups_sale_amount_engagement conversion_sign_ups_sale_amount_view conversion_site_visits_metric conversion_site_visits_order_quantity conversion_site_visits_order_quantity_engagement conversion_site_visits_order_quantity_view conversion_site_visits_post_engagement conversion_site_visits_post_view conversion_site_visits_sale_amount conversion_site_visits_sale_amount_engagement conversion_site_visits_sale_amount_view engagements follows impressions likes media_engagements media_views mobile_conversion_achievements_unlocked_assisted mobile_conversion_achievements_unlocked_order_quantity mobile_conversion_achievements_unlocked_post_engagement mobile_conversion_achievements_unlocked_post_view mobile_conversion_achievements_unlocked_sale_amount mobile_conversion_add_to_carts_assisted mobile_conversion_add_to_carts_order_quantity mobile_conversion_add_to_carts_post_engagement mobile_conversion_add_to_carts_post_view mobile_conversion_add_to_carts_sale_amount mobile_conversion_add_to_wishlists_assisted mobile_conversion_add_to_wishlists_order_quantity mobile_conversion_add_to_wishlists_post_engagement mobile_conversion_add_to_wishlists_post_view mobile_conversion_add_to_wishlists_sale_amount mobile_conversion_checkouts_initiated_assisted mobile_conversion_checkouts_initiated_order_quantity mobile_conversion_checkouts_initiated_post_engagement mobile_conversion_checkouts_initiated_post_view mobile_conversion_checkouts_initiated_sale_amount mobile_conversion_content_views_assisted mobile_conversion_content_views_order_quantity mobile_conversion_content_views_post_engagement mobile_conversion_content_views_post_view mobile_conversion_content_views_sale_amount mobile_conversion_downloads_order_quantity mobile_conversion_downloads_post_engagement mobile_conversion_downloads_post_view mobile_conversion_downloads_sale_amount mobile_conversion_installs_assisted mobile_conversion_installs_order_quantity mobile_conversion_installs_post_engagement mobile_conversion_installs_post_view mobile_conversion_installs_sale_amount mobile_conversion_invites_assisted mobile_conversion_invites_order_quantity mobile_conversion_invites_post_engagement mobile_conversion_invites_post_view mobile_conversion_invites_sale_amount mobile_conversion_key_page_views_post_engagement mobile_conversion_key_page_views_post_view mobile_conversion_levels_achieved_assisted mobile_conversion_levels_achieved_order_quantity mobile_conversion_levels_achieved_post_engagement mobile_conversion_levels_achieved_post_view mobile_conversion_levels_achieved_sale_amount mobile_conversion_lifetime_value_achievements_unlocked_metric mobile_conversion_lifetime_value_achievements_unlocked_order_qu mobile_conversion_lifetime_value_achievements_unlocked_sale_amo mobile_conversion_lifetime_value_add_to_carts_metric mobile_conversion_lifetime_value_add_to_carts_order_quantity mobile_conversion_lifetime_value_add_to_carts_sale_amount mobile_conversion_lifetime_value_add_to_wishlists_metric mobile_conversion_lifetime_value_add_to_wishlists_order_quantit mobile_conversion_lifetime_value_add_to_wishlists_sale_amount mobile_conversion_lifetime_value_checkouts_initiated_metric mobile_conversion_lifetime_value_checkouts_initiated_order_quan mobile_conversion_lifetime_value_checkouts_initiated_sale_amoun mobile_conversion_lifetime_value_content_views_metric mobile_conversion_lifetime_value_content_views_order_quantity mobile_conversion_lifetime_value_content_views_sale_amount mobile_conversion_lifetime_value_invites_metric mobile_conversion_lifetime_value_invites_order_quantity mobile_conversion_lifetime_value_invites_sale_amount mobile_conversion_lifetime_value_levels_achieved_metric mobile_conversion_lifetime_value_levels_achieved_order_quantity mobile_conversion_lifetime_value_levels_achieved_sale_amount mobile_conversion_lifetime_value_logins_metric mobile_conversion_lifetime_value_logins_order_quantity mobile_conversion_lifetime_value_logins_sale_amount mobile_conversion_lifetime_value_payment_info_additions_metric mobile_conversion_lifetime_value_payment_info_additions_order_q mobile_conversion_lifetime_value_payment_info_additions_sale_am mobile_conversion_lifetime_value_purchases_metric mobile_conversion_lifetime_value_purchases_order_quantity mobile_conversion_lifetime_value_purchases_sale_amount mobile_conversion_lifetime_value_rates_metric mobile_conversion_lifetime_value_rates_order_quantity mobile_conversion_lifetime_value_rates_sale_amount mobile_conversion_lifetime_value_reservations_metric mobile_conversion_lifetime_value_reservations_order_quantity mobile_conversion_lifetime_value_reservations_sale_amount mobile_conversion_lifetime_value_searches_metric mobile_conversion_lifetime_value_searches_order_quantity mobile_conversion_lifetime_value_searches_sale_amount mobile_conversion_lifetime_value_shares_metric mobile_conversion_lifetime_value_shares_order_quantity mobile_conversion_lifetime_value_shares_sale_amount mobile_conversion_lifetime_value_sign_ups_metric mobile_conversion_lifetime_value_sign_ups_order_quantity mobile_conversion_lifetime_value_sign_ups_sale_amount mobile_conversion_lifetime_value_spent_credits_metric mobile_conversion_lifetime_value_spent_credits_order_quantity mobile_conversion_lifetime_value_spent_credits_sale_amount mobile_conversion_lifetime_value_tutorials_completed_metric mobile_conversion_lifetime_value_tutorials_completed_order_quan mobile_conversion_lifetime_value_tutorials_completed_sale_amoun mobile_conversion_lifetime_value_updates_metric mobile_conversion_lifetime_value_updates_order_quantity mobile_conversion_lifetime_value_updates_sale_amount mobile_conversion_logins_assisted mobile_conversion_logins_order_quantity mobile_conversion_logins_post_engagement mobile_conversion_logins_post_view mobile_conversion_logins_sale_amount mobile_conversion_payment_info_additions_assisted mobile_conversion_payment_info_additions_order_quantity mobile_conversion_payment_info_additions_post_engagement mobile_conversion_payment_info_additions_post_view mobile_conversion_payment_info_additions_sale_amount mobile_conversion_purchases_assisted mobile_conversion_purchases_order_quantity mobile_conversion_purchases_post_engagement mobile_conversion_purchases_post_view mobile_conversion_purchases_sale_amount mobile_conversion_rates_assisted mobile_conversion_rates_order_quantity mobile_conversion_rates_post_engagement mobile_conversion_rates_post_view mobile_conversion_rates_sale_amount mobile_conversion_re_engages_assisted mobile_conversion_re_engages_order_quantity mobile_conversion_re_engages_post_engagement mobile_conversion_re_engages_post_view mobile_conversion_re_engages_sale_amount mobile_conversion_reservations_assisted mobile_conversion_reservations_order_quantity mobile_conversion_reservations_post_engagement mobile_conversion_reservations_post_view mobile_conversion_reservations_sale_amount mobile_conversion_searches_assisted mobile_conversion_searches_order_quantity mobile_conversion_searches_post_engagement mobile_conversion_searches_post_view mobile_conversion_searches_sale_amount mobile_conversion_shares_assisted mobile_conversion_shares_order_quantity mobile_conversion_shares_post_engagement mobile_conversion_shares_post_view mobile_conversion_shares_sale_amount mobile_conversion_sign_ups_assisted mobile_conversion_sign_ups_order_quantity mobile_conversion_sign_ups_post_engagement mobile_conversion_sign_ups_post_view mobile_conversion_sign_ups_sale_amount mobile_conversion_site_visits_order_quantity mobile_conversion_site_visits_post_engagement mobile_conversion_site_visits_post_view mobile_conversion_site_visits_sale_amount mobile_conversion_spent_credits_assisted mobile_conversion_spent_credits_order_quantity mobile_conversion_spent_credits_post_engagement mobile_conversion_spent_credits_post_view mobile_conversion_spent_credits_sale_amount mobile_conversion_tutorials_completed_assisted mobile_conversion_tutorials_completed_order_quantity mobile_conversion_tutorials_completed_post_engagement mobile_conversion_tutorials_completed_post_view mobile_conversion_tutorials_completed_sale_amount mobile_conversion_updates_assisted mobile_conversion_updates_order_quantity mobile_conversion_updates_post_engagement mobile_conversion_updates_post_view mobile_conversion_updates_sale_amount poll_card_vote qualified_impressions replies retweets tweets_send unfollows url_clicks video_3_s_100_pct_views video_6_s_views video_content_starts video_cta_clicks video_mrc_views video_total_views video_views_100 video_views_25 video_views_50 video_views_75 mobile_conversion_installs_skan_post_engagement mobile_conversion_installs_skan_post_view mobile_conversion_purchases_skan_post_engagement mobile_conversion_purchases_skan_post_view video_15_s_views auto_created_conversion_landing_page_view auto_created_conversion_session 369. source.twitter_ads_source.twitter_ads.campaign_report 369. source.twitter_ads_source.twitter_ads.campaign_report
Name Type Comment
account_id text None
campaign_id text None
date timestamp without time zone None
placement text None
_fivetran_synced text None
app_clicks integer None
billed_charge_local_micro integer None
billed_engagements integer None
card_engagements integer None
carousel_swipes integer None
clicks integer None
conversion_custom_metric integer None
conversion_custom_order_quantity integer None
conversion_custom_order_quantity_engagement integer None
conversion_custom_order_quantity_view integer None
conversion_custom_post_engagement integer None
conversion_custom_post_view integer None
conversion_custom_sale_amount integer None
conversion_custom_sale_amount_engagement integer None
conversion_custom_sale_amount_view integer None
conversion_downloads_metric integer None
conversion_downloads_order_quantity integer None
conversion_downloads_order_quantity_engagement integer None
conversion_downloads_order_quantity_view integer None
conversion_downloads_post_engagement integer None
conversion_downloads_post_view integer None
conversion_downloads_sale_amount integer None
conversion_downloads_sale_amount_engagement integer None
conversion_downloads_sale_amount_view integer None
conversion_purchases_assisted integer None
conversion_purchases_metric integer None
conversion_purchases_order_quantity integer None
conversion_purchases_order_quantity_engagement integer None
conversion_purchases_order_quantity_view integer None
conversion_purchases_post_engagement integer None
conversion_purchases_post_view integer None
conversion_purchases_sale_amount integer None
conversion_purchases_sale_amount_engagement integer None
conversion_purchases_sale_amount_view integer None
conversion_sign_ups_assisted integer None
conversion_sign_ups_metric integer None
conversion_sign_ups_order_quantity integer None
conversion_sign_ups_order_quantity_engagement integer None
conversion_sign_ups_order_quantity_view integer None
conversion_sign_ups_post_engagement integer None
conversion_sign_ups_post_view integer None
conversion_sign_ups_sale_amount integer None
conversion_sign_ups_sale_amount_engagement integer None
conversion_sign_ups_sale_amount_view integer None
conversion_site_visits_metric integer None
conversion_site_visits_order_quantity integer None
conversion_site_visits_order_quantity_engagement integer None
conversion_site_visits_order_quantity_view integer None
conversion_site_visits_post_engagement integer None
conversion_site_visits_post_view integer None
conversion_site_visits_sale_amount integer None
conversion_site_visits_sale_amount_engagement integer None
conversion_site_visits_sale_amount_view integer None
engagements integer None
follows integer None
impressions integer None
likes integer None
media_engagements integer None
media_views integer None
mobile_conversion_achievements_unlocked_assisted integer None
mobile_conversion_achievements_unlocked_order_quantity integer None
mobile_conversion_achievements_unlocked_post_engagement integer None
mobile_conversion_achievements_unlocked_post_view integer None
mobile_conversion_achievements_unlocked_sale_amount integer None
mobile_conversion_add_to_carts_assisted integer None
mobile_conversion_add_to_carts_order_quantity integer None
mobile_conversion_add_to_carts_post_engagement integer None
mobile_conversion_add_to_carts_post_view integer None
mobile_conversion_add_to_carts_sale_amount integer None
mobile_conversion_add_to_wishlists_assisted integer None
mobile_conversion_add_to_wishlists_order_quantity integer None
mobile_conversion_add_to_wishlists_post_engagement integer None
mobile_conversion_add_to_wishlists_post_view integer None
mobile_conversion_add_to_wishlists_sale_amount integer None
mobile_conversion_checkouts_initiated_assisted integer None
mobile_conversion_checkouts_initiated_order_quantity integer None
mobile_conversion_checkouts_initiated_post_engagement integer None
mobile_conversion_checkouts_initiated_post_view integer None
mobile_conversion_checkouts_initiated_sale_amount integer None
mobile_conversion_content_views_assisted integer None
mobile_conversion_content_views_order_quantity integer None
mobile_conversion_content_views_post_engagement integer None
mobile_conversion_content_views_post_view integer None
mobile_conversion_content_views_sale_amount integer None
mobile_conversion_downloads_order_quantity integer None
mobile_conversion_downloads_post_engagement integer None
mobile_conversion_downloads_post_view integer None
mobile_conversion_downloads_sale_amount integer None
mobile_conversion_installs_assisted integer None
mobile_conversion_installs_order_quantity integer None
mobile_conversion_installs_post_engagement integer None
mobile_conversion_installs_post_view integer None
mobile_conversion_installs_sale_amount integer None
mobile_conversion_invites_assisted integer None
mobile_conversion_invites_order_quantity integer None
mobile_conversion_invites_post_engagement integer None
mobile_conversion_invites_post_view integer None
mobile_conversion_invites_sale_amount integer None
mobile_conversion_key_page_views_post_engagement integer None
mobile_conversion_key_page_views_post_view integer None
mobile_conversion_levels_achieved_assisted integer None
mobile_conversion_levels_achieved_order_quantity integer None
mobile_conversion_levels_achieved_post_engagement integer None
mobile_conversion_levels_achieved_post_view integer None
mobile_conversion_levels_achieved_sale_amount integer None
mobile_conversion_lifetime_value_achievements_unlocked_metric integer None
mobile_conversion_lifetime_value_achievements_unlocked_order_qu integer None
mobile_conversion_lifetime_value_achievements_unlocked_sale_amo integer None
mobile_conversion_lifetime_value_add_to_carts_metric integer None
mobile_conversion_lifetime_value_add_to_carts_order_quantity integer None
mobile_conversion_lifetime_value_add_to_carts_sale_amount integer None
mobile_conversion_lifetime_value_add_to_wishlists_metric integer None
mobile_conversion_lifetime_value_add_to_wishlists_order_quantit integer None
mobile_conversion_lifetime_value_add_to_wishlists_sale_amount integer None
mobile_conversion_lifetime_value_checkouts_initiated_metric integer None
mobile_conversion_lifetime_value_checkouts_initiated_order_quan integer None
mobile_conversion_lifetime_value_checkouts_initiated_sale_amoun integer None
mobile_conversion_lifetime_value_content_views_metric integer None
mobile_conversion_lifetime_value_content_views_order_quantity integer None
mobile_conversion_lifetime_value_content_views_sale_amount integer None
mobile_conversion_lifetime_value_invites_metric integer None
mobile_conversion_lifetime_value_invites_order_quantity integer None
mobile_conversion_lifetime_value_invites_sale_amount integer None
mobile_conversion_lifetime_value_levels_achieved_metric integer None
mobile_conversion_lifetime_value_levels_achieved_order_quantity integer None
mobile_conversion_lifetime_value_levels_achieved_sale_amount integer None
mobile_conversion_lifetime_value_logins_metric integer None
mobile_conversion_lifetime_value_logins_order_quantity integer None
mobile_conversion_lifetime_value_logins_sale_amount integer None
mobile_conversion_lifetime_value_payment_info_additions_metric integer None
mobile_conversion_lifetime_value_payment_info_additions_order_q integer None
mobile_conversion_lifetime_value_payment_info_additions_sale_am integer None
mobile_conversion_lifetime_value_purchases_metric integer None
mobile_conversion_lifetime_value_purchases_order_quantity integer None
mobile_conversion_lifetime_value_purchases_sale_amount integer None
mobile_conversion_lifetime_value_rates_metric integer None
mobile_conversion_lifetime_value_rates_order_quantity integer None
mobile_conversion_lifetime_value_rates_sale_amount integer None
mobile_conversion_lifetime_value_reservations_metric integer None
mobile_conversion_lifetime_value_reservations_order_quantity integer None
mobile_conversion_lifetime_value_reservations_sale_amount integer None
mobile_conversion_lifetime_value_searches_metric integer None
mobile_conversion_lifetime_value_searches_order_quantity integer None
mobile_conversion_lifetime_value_searches_sale_amount integer None
mobile_conversion_lifetime_value_shares_metric integer None
mobile_conversion_lifetime_value_shares_order_quantity integer None
mobile_conversion_lifetime_value_shares_sale_amount integer None
mobile_conversion_lifetime_value_sign_ups_metric integer None
mobile_conversion_lifetime_value_sign_ups_order_quantity integer None
mobile_conversion_lifetime_value_sign_ups_sale_amount integer None
mobile_conversion_lifetime_value_spent_credits_metric integer None
mobile_conversion_lifetime_value_spent_credits_order_quantity integer None
mobile_conversion_lifetime_value_spent_credits_sale_amount integer None
mobile_conversion_lifetime_value_tutorials_completed_metric integer None
mobile_conversion_lifetime_value_tutorials_completed_order_quan integer None
mobile_conversion_lifetime_value_tutorials_completed_sale_amoun integer None
mobile_conversion_lifetime_value_updates_metric integer None
mobile_conversion_lifetime_value_updates_order_quantity integer None
mobile_conversion_lifetime_value_updates_sale_amount integer None
mobile_conversion_logins_assisted integer None
mobile_conversion_logins_order_quantity integer None
mobile_conversion_logins_post_engagement integer None
mobile_conversion_logins_post_view integer None
mobile_conversion_logins_sale_amount integer None
mobile_conversion_payment_info_additions_assisted integer None
mobile_conversion_payment_info_additions_order_quantity integer None
mobile_conversion_payment_info_additions_post_engagement integer None
mobile_conversion_payment_info_additions_post_view integer None
mobile_conversion_payment_info_additions_sale_amount integer None
mobile_conversion_purchases_assisted integer None
mobile_conversion_purchases_order_quantity integer None
mobile_conversion_purchases_post_engagement integer None
mobile_conversion_purchases_post_view integer None
mobile_conversion_purchases_sale_amount integer None
mobile_conversion_rates_assisted integer None
mobile_conversion_rates_order_quantity integer None
mobile_conversion_rates_post_engagement integer None
mobile_conversion_rates_post_view integer None
mobile_conversion_rates_sale_amount integer None
mobile_conversion_re_engages_assisted integer None
mobile_conversion_re_engages_order_quantity integer None
mobile_conversion_re_engages_post_engagement integer None
mobile_conversion_re_engages_post_view integer None
mobile_conversion_re_engages_sale_amount integer None
mobile_conversion_reservations_assisted integer None
mobile_conversion_reservations_order_quantity integer None
mobile_conversion_reservations_post_engagement integer None
mobile_conversion_reservations_post_view integer None
mobile_conversion_reservations_sale_amount integer None
mobile_conversion_searches_assisted integer None
mobile_conversion_searches_order_quantity integer None
mobile_conversion_searches_post_engagement integer None
mobile_conversion_searches_post_view integer None
mobile_conversion_searches_sale_amount integer None
mobile_conversion_shares_assisted integer None
mobile_conversion_shares_order_quantity integer None
mobile_conversion_shares_post_engagement integer None
mobile_conversion_shares_post_view integer None
mobile_conversion_shares_sale_amount integer None
mobile_conversion_sign_ups_assisted integer None
mobile_conversion_sign_ups_order_quantity integer None
mobile_conversion_sign_ups_post_engagement integer None
mobile_conversion_sign_ups_post_view integer None
mobile_conversion_sign_ups_sale_amount integer None
mobile_conversion_site_visits_order_quantity integer None
mobile_conversion_site_visits_post_engagement integer None
mobile_conversion_site_visits_post_view integer None
mobile_conversion_site_visits_sale_amount integer None
mobile_conversion_spent_credits_assisted integer None
mobile_conversion_spent_credits_order_quantity integer None
mobile_conversion_spent_credits_post_engagement integer None
mobile_conversion_spent_credits_post_view integer None
mobile_conversion_spent_credits_sale_amount integer None
mobile_conversion_tutorials_completed_assisted integer None
mobile_conversion_tutorials_completed_order_quantity integer None
mobile_conversion_tutorials_completed_post_engagement integer None
mobile_conversion_tutorials_completed_post_view integer None
mobile_conversion_tutorials_completed_sale_amount integer None
mobile_conversion_updates_assisted integer None
mobile_conversion_updates_order_quantity integer None
mobile_conversion_updates_post_engagement integer None
mobile_conversion_updates_post_view integer None
mobile_conversion_updates_sale_amount integer None
poll_card_vote integer None
qualified_impressions integer None
replies integer None
retweets integer None
tweets_send integer None
unfollows integer None
url_clicks integer None
video_3_s_100_pct_views integer None
video_6_s_views integer None
video_content_starts integer None
video_cta_clicks integer None
video_mrc_views integer None
video_total_views integer None
video_views_100 integer None
video_views_25 integer None
video_views_50 integer None
video_views_75 integer None
mobile_conversion_installs_skan_post_engagement integer None
mobile_conversion_installs_skan_post_view integer None
mobile_conversion_purchases_skan_post_engagement integer None
mobile_conversion_purchases_skan_post_view integer None
video_15_s_views integer None
auto_created_conversion_landing_page_view integer None
auto_created_conversion_session integer None
Column Lineage
%3 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp account_id 263. model.twitter_ads_source.stg_twitter_ads__campaign_report 263. model.twitter_ads_source.stg_twitter_ads__campaign_report account_id 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp:f0->263. model.twitter_ads_source.stg_twitter_ads__campaign_report:f0 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report account_id 263. model.twitter_ads_source.stg_twitter_ads__campaign_report:f0->254. model.twitter_ads.twitter_ads__campaign_report:f0
263. model.twitter_ads_source.stg_twitter_ads__campaign_report
  • Input Column: 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp[account_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • account_id: Directly mapped after casting
254. model.twitter_ads.twitter_ads__campaign_report
  • Input Column: 263. model.twitter_ads_source.stg_twitter_ads__campaign_report[account_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the JOIN condition with the accounts table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • account_id: Directly copied to the output
Column Lineage
%3 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp campaign_id 263. model.twitter_ads_source.stg_twitter_ads__campaign_report 263. model.twitter_ads_source.stg_twitter_ads__campaign_report campaign_id 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp:f0->263. model.twitter_ads_source.stg_twitter_ads__campaign_report:f0 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report campaign_id 263. model.twitter_ads_source.stg_twitter_ads__campaign_report:f0->254. model.twitter_ads.twitter_ads__campaign_report:f0
263. model.twitter_ads_source.stg_twitter_ads__campaign_report
  • Input Column: 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp[campaign_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • campaign_id: Directly mapped after casting
254. model.twitter_ads.twitter_ads__campaign_report
  • Input Column: 263. model.twitter_ads_source.stg_twitter_ads__campaign_report[campaign_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the JOIN condition with the campaigns table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • campaign_id: Directly copied to the output
Column Lineage
%3 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp date 263. model.twitter_ads_source.stg_twitter_ads__campaign_report 263. model.twitter_ads_source.stg_twitter_ads__campaign_report date_day 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp:f0->263. model.twitter_ads_source.stg_twitter_ads__campaign_report:f0 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report date_day 263. model.twitter_ads_source.stg_twitter_ads__campaign_report:f0->254. model.twitter_ads.twitter_ads__campaign_report:f0
263. model.twitter_ads_source.stg_twitter_ads__campaign_report
  • Input Column: 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp[date]
    • Cleaning The column is cast as TIMESTAMP and then truncated to day level
    • Featurization The date is truncated to create a day-level feature
    • Output Columns:
      • date_day: Mapped after casting and truncating to day level
254. model.twitter_ads.twitter_ads__campaign_report
  • Input Column: 263. model.twitter_ads_source.stg_twitter_ads__campaign_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp placement 263. model.twitter_ads_source.stg_twitter_ads__campaign_report 263. model.twitter_ads_source.stg_twitter_ads__campaign_report placement 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp:f0->263. model.twitter_ads_source.stg_twitter_ads__campaign_report:f0 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report placement 263. model.twitter_ads_source.stg_twitter_ads__campaign_report:f0->254. model.twitter_ads.twitter_ads__campaign_report:f0
263. model.twitter_ads_source.stg_twitter_ads__campaign_report
  • Input Column: 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp[placement]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • placement: Directly mapped after casting
254. model.twitter_ads.twitter_ads__campaign_report
  • Input Column: 263. model.twitter_ads_source.stg_twitter_ads__campaign_report[placement]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • placement: Directly copied to the output
Column Lineage
%3 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp billed_charge_local_micro 263. model.twitter_ads_source.stg_twitter_ads__campaign_report 263. model.twitter_ads_source.stg_twitter_ads__campaign_report spend spend_micro 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp:f0->263. model.twitter_ads_source.stg_twitter_ads__campaign_report:f1 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp:f0->263. model.twitter_ads_source.stg_twitter_ads__campaign_report:f0 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report spend spend_micro 263. model.twitter_ads_source.stg_twitter_ads__campaign_report:f1->254. model.twitter_ads.twitter_ads__campaign_report:f1 263. model.twitter_ads_source.stg_twitter_ads__campaign_report:f0->254. model.twitter_ads.twitter_ads__campaign_report:f0
263. model.twitter_ads_source.stg_twitter_ads__campaign_report
  • Input Column: 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp[billed_charge_local_micro]
    • Cleaning The column is cast as INT
    • Featurization The value is divided by 1,000,000 and rounded to 2 decimal places to create a new feature
    • Output Columns:
      • spend_micro: Directly mapped after casting
      • spend: Mapped after transformation (division and rounding)
254. model.twitter_ads.twitter_ads__campaign_report
  • Input Column: 263. model.twitter_ads_source.stg_twitter_ads__campaign_report[spend_micro]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • spend_micro: Summed up in the output
  • Input Column: 263. model.twitter_ads_source.stg_twitter_ads__campaign_report[spend]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • spend: Summed up in the output
Column Lineage
%3 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp clicks 263. model.twitter_ads_source.stg_twitter_ads__campaign_report 263. model.twitter_ads_source.stg_twitter_ads__campaign_report clicks 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp:f0->263. model.twitter_ads_source.stg_twitter_ads__campaign_report:f0 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report clicks 263. model.twitter_ads_source.stg_twitter_ads__campaign_report:f0->254. model.twitter_ads.twitter_ads__campaign_report:f0
263. model.twitter_ads_source.stg_twitter_ads__campaign_report
  • Input Column: 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp[clicks]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT
    • Output Columns:
      • clicks: Directly mapped after casting
254. model.twitter_ads.twitter_ads__campaign_report
  • Input Column: 263. model.twitter_ads_source.stg_twitter_ads__campaign_report[clicks]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • clicks: Summed up in the output
Column Lineage
%3 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp impressions 263. model.twitter_ads_source.stg_twitter_ads__campaign_report 263. model.twitter_ads_source.stg_twitter_ads__campaign_report impressions 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp:f0->263. model.twitter_ads_source.stg_twitter_ads__campaign_report:f0 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report impressions 263. model.twitter_ads_source.stg_twitter_ads__campaign_report:f0->254. model.twitter_ads.twitter_ads__campaign_report:f0
263. model.twitter_ads_source.stg_twitter_ads__campaign_report
  • Input Column: 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp[impressions]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT
    • Output Columns:
      • impressions: Directly mapped after casting
254. model.twitter_ads.twitter_ads__campaign_report
  • Input Column: 263. model.twitter_ads_source.stg_twitter_ads__campaign_report[impressions]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • impressions: Summed up in the output
Column Lineage
%3 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp url_clicks 263. model.twitter_ads_source.stg_twitter_ads__campaign_report 263. model.twitter_ads_source.stg_twitter_ads__campaign_report url_clicks 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp:f0->263. model.twitter_ads_source.stg_twitter_ads__campaign_report:f0 254. model.twitter_ads.twitter_ads__campaign_report 254. model.twitter_ads.twitter_ads__campaign_report url_clicks 263. model.twitter_ads_source.stg_twitter_ads__campaign_report:f0->254. model.twitter_ads.twitter_ads__campaign_report:f0
263. model.twitter_ads_source.stg_twitter_ads__campaign_report
  • Input Column: 264. model.twitter_ads_source.stg_twitter_ads__campaign_report_tmp[url_clicks]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT in the 'fields' CTE
    • Output Columns:
      • url_clicks: Directly mapped
254. model.twitter_ads.twitter_ads__campaign_report
  • Input Column: 263. model.twitter_ads_source.stg_twitter_ads__campaign_report[url_clicks]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • url_clicks: Summed up in the output
265. model.twitter_ads_source.stg_twitter_ads__line_item_history

This SQL query stages data from a Twitter Ads source table, casting various fields to specific data types, renaming some columns, and performing light transformations. It also adds a flag to identify the latest version of each line item and calculates monetary amounts from micro units. The query prepares the data for further analysis or integration into a larger data model.

CleaningDeduplicationFeaturization
SQL Query
WITH source AS (
  SELECT
    *
  FROM TEST.PUBLIC_twitter_ads_source.stg_twitter_ads__line_item_history_tmp
), fields AS (
  SELECT
    CAST(NULL AS TEXT) AS advertiser_domain,
    CAST(NULL AS INT) AS advertiser_user_id,
    CAST(NULL AS BOOLEAN) AS automatically_select_bid,
    CAST(NULL AS INT) AS bid_amount_local_micro,
    CAST(NULL AS TEXT) AS bid_type,
    CAST(NULL AS TEXT) AS bid_unit,
    CAST(NULL AS TEXT) AS campaign_id,
    CAST(NULL AS TEXT) AS charge_by,
    CAST(NULL AS TIMESTAMP) AS created_at,
    CAST(NULL AS TEXT) AS creative_source,
    CAST(NULL AS TEXT) AS currency,
    CAST(NULL AS BOOLEAN) AS deleted,
    CAST(NULL AS TIMESTAMP) AS end_time,
    CAST(NULL AS TEXT) AS entity_status,
    CAST(NULL AS TEXT) AS id,
    CAST(NULL AS TEXT) AS name,
    CAST(NULL AS TEXT) AS objective,
    CAST(NULL AS TEXT) AS optimization,
    CAST(NULL AS TEXT) AS primary_web_event_tag,
    CAST(NULL AS TEXT) AS product_type,
    CAST(NULL AS TIMESTAMP) AS start_time,
    CAST(NULL AS INT) AS target_cpa_local_micro,
    CAST(NULL AS INT) AS total_budget_amount_local_micro,
    CAST(NULL AS TIMESTAMP) AS updated_at,
    CAST('' AS TEXT) AS source_relation
  FROM source
), final AS (
  SELECT
    source_relation,
    advertiser_domain,
    advertiser_user_id,
    automatically_select_bid,
    bid_amount_local_micro,
    bid_type,
    bid_unit,
    campaign_id,
    charge_by,
    created_at AS created_timestamp,
    creative_source,
    currency,
    deleted AS is_deleted,
    end_time AS end_timestamp,
    entity_status,
    id AS line_item_id,
    name,
    objective,
    optimization,
    primary_web_event_tag,
    product_type,
    start_time AS start_timestamp,
    target_cpa_local_micro,
    total_budget_amount_local_micro,
    updated_at AS updated_timestamp,
    ROUND(bid_amount_local_micro / 1000000.0, 2) AS bid_amount,
    ROUND(total_budget_amount_local_micro / 1000000.0, 2) AS total_budget_amount,
    ROUND(target_cpa_local_micro / 1000000.0, 2) AS target_cpa,
    ROW_NUMBER() OVER (PARTITION BY source_relation, id ORDER BY updated_at DESC) = 1 AS is_latest_version
  FROM fields
)
SELECT
  *
FROM final
%3 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history source_relation advertiser_domain advertiser_user_id automatically_select_bid bid_amount_local_micro bid_type bid_unit campaign_id charge_by created_timestamp creative_source currency is_deleted end_timestamp entity_status line_item_id name objective optimization primary_web_event_tag product_type start_timestamp target_cpa_local_micro total_budget_amount_local_micro updated_timestamp is_latest_version bid_amount total_budget_amount target_cpa 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp advertiser_domain advertiser_user_id automatically_select_bid bid_amount_local_micro bid_type bid_unit campaign_id charge_by created_at creative_source currency deleted end_time entity_status id name objective optimization primary_web_event_tag product_type start_time target_cpa_local_micro total_budget_amount_local_micro updated_at 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f1 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f1->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f2 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f2->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f3 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f3->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f4 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f3->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f26 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f4->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f5 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f5->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f6 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f6->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f7 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f7->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f8 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f8->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f9 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f9->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f10 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f10->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f11 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f11->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f12 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f12->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f13 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f13->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f14 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f14->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f15 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f15->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f16 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f16->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f17 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f17->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f18 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f18->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f19 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f19->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f20 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f20->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f21 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f21->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f22 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f21->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f28 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f22->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f23 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f22->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f27 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f23->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f24 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f23->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f25
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
advertiser_domain text The website domain for this advertiser, without the protocol specification.
advertiser_user_id integer The Twitter user identifier for the handle promoting the ad.
automatically_select_bid boolean Whether automatically optimize bidding is enabled based on daily budget and campaign flight dates.
bid_amount_local_micro integer The bid amount to be associated with this line item, in micros.
bid_type text The bidding mechanism.
bid_unit text The bid unit for this line item.
campaign_id text The ID of the related campaign.
charge_by text The unit to charge this line item by.
created_timestamp text The timestamp the account was created.
creative_source text The source of the creatives for the line item.
currency text The currency in which metrics will be reported.
is_deleted boolean Whether the record has been deleted or not.
end_timestamp integer The timestamp at which the line item will stop being served.
entity_status text The status of the line item.
line_item_id text The ID of the line item.
name text The name of the line item.
objective text The campaign objective for this line item.
optimization text The optimization setting to use with this line item.
primary_web_event_tag integer The identifier of the primary web event tag. Allows more accurate tracking of engagements for the campaign pertaining to this line item.
product_type text The type of promoted product that this line item will contain.
start_timestamp integer The timestamp at which the line item will start being served.
target_cpa_local_micro integer The target cost per acquisition for the line item, in micros.
total_budget_amount_local_micro integer The total budget amount to be allocated to the line item, in micros.
updated_timestamp text The timestamp the account was last updated.
is_latest_version boolean Whether the record is the most latest version for the line item.
bid_amount numeric The bid amount to be associated with this line item.
total_budget_amount numeric The total budget amount to be allocated to the campaign.
target_cpa numeric The target cost per acquisition for the line item.
Column Lineage
%3 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history source_relation 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report source_relation 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0 255. model.twitter_ads.twitter_ads__keyword_report 255. model.twitter_ads.twitter_ads__keyword_report source_relation 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->255. model.twitter_ads.twitter_ads__keyword_report:f0 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report source_relation 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report source_relation 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->258. model.twitter_ads.twitter_ads__url_report:f0
255. model.twitter_ads.twitter_ads__keyword_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[source_relation]
    • Integration This column is used as a key to join with other tables
    • Output Columns:
      • source_relation: Directly copied to the output
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with other tables
    • Output Columns:
      • source_relation: Directly copied to the output
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[source_relation]
    • Integration used as a key to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[source_relation]
    • Integration used as part of the join condition with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
Column Lineage
%3 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp advertiser_domain 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history advertiser_domain 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report advertiser_domain 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[advertiser_domain]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • advertiser_domain: Directly mapped
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[advertiser_domain]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • advertiser_domain: Directly copied to the output
Column Lineage
%3 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp advertiser_user_id 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history advertiser_user_id 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report advertiser_user_id 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[advertiser_user_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT
    • Output Columns:
      • advertiser_user_id: Directly mapped
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[advertiser_user_id]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • advertiser_user_id: Directly copied to the output
Column Lineage
%3 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp automatically_select_bid 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history automatically_select_bid 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[automatically_select_bid]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as BOOLEAN
    • Output Columns:
      • automatically_select_bid: Directly mapped
Column Lineage
%3 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp bid_amount_local_micro 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history bid_amount bid_amount_local_micro 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f1 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report bid_amount 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f1->256. model.twitter_ads.twitter_ads__line_item_report:f0
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[bid_amount_local_micro]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT
    • Featurization Used to calculate bid_amount
    • Output Columns:
      • bid_amount_local_micro: Directly mapped
      • bid_amount: Transformed (divided by 1,000,000 and rounded to 2 decimal places)
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[bid_amount_local_micro]
    • Cleaning The column is likely cleaned or transformed
    • Output Columns:
      • bid_amount: Transformed and mapped to this output column
Column Lineage
%3 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp bid_type 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history bid_type 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report bid_type 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[bid_type]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • bid_type: Directly mapped
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[bid_type]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • bid_type: Directly copied to the output
Column Lineage
%3 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp bid_unit 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history bid_unit 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report bid_unit 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[bid_unit]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • bid_unit: Directly mapped
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[bid_unit]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • bid_unit: Directly copied to the output
Column Lineage
%3 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp campaign_id 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history campaign_id 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report campaign_id 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0 255. model.twitter_ads.twitter_ads__keyword_report 255. model.twitter_ads.twitter_ads__keyword_report campaign_id 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->255. model.twitter_ads.twitter_ads__keyword_report:f0
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[campaign_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • campaign_id: Directly mapped
255. model.twitter_ads.twitter_ads__keyword_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[campaign_id]
    • Integration This column is used as a key to join with the campaigns table
    • Output Columns:
      • campaign_id: Directly copied to the output
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[campaign_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a join key with the campaigns table
    • Output Columns:
      • campaign_id: Directly copied to the output
Column Lineage
%3 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp charge_by 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history charge_by 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report charge_by 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[charge_by]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • charge_by: Directly mapped
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[charge_by]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • charge_by: Directly copied to the output
Column Lineage
%3 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp created_at 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history created_timestamp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report created_timestamp 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[created_at]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TIMESTAMP
    • Output Columns:
      • created_timestamp: Directly mapped and renamed
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[created_timestamp]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • created_timestamp: Directly copied to the output
Column Lineage
%3 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp creative_source 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history creative_source 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report creative_source 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[creative_source]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • creative_source: Directly mapped
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[creative_source]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the JOIN condition with the report table
    • Output Columns:
      • creative_source: Directly copied to the output
Column Lineage
%3 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp currency 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history currency 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report currency 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0 255. model.twitter_ads.twitter_ads__keyword_report 255. model.twitter_ads.twitter_ads__keyword_report currency 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->255. model.twitter_ads.twitter_ads__keyword_report:f0 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report currency 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report currency 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->258. model.twitter_ads.twitter_ads__url_report:f0
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[currency]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • currency: Directly mapped to the output column
255. model.twitter_ads.twitter_ads__keyword_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[currency]
    • Direct This column is directly copied to the output
    • Output Columns:
      • currency: Directly copied to the output
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[currency]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the JOIN condition with the report table
    • Output Columns:
      • currency: Directly copied to the output
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[currency]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with other tables
    • Output Columns:
      • currency: Directly copied to the output
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[currency]
    • Direct The currency column is directly copied to the output
    • Output Columns:
      • currency: Directly copied
Column Lineage
%3 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp deleted 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history is_deleted 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report is_deleted 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[deleted]
    • Cleaning The column is cleaned by casting to BOOLEAN
    • Output Columns:
      • is_deleted: Mapped to the output column with a renamed field
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[is_deleted]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the JOIN condition with the report table
    • Output Columns:
      • is_deleted: Directly copied to the output
Column Lineage
%3 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp end_time 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history end_timestamp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report end_timestamp 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[end_time]
    • Cleaning The column is cleaned by casting to TIMESTAMP
    • Output Columns:
      • end_timestamp: Mapped to the output column with a renamed field
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[end_timestamp]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the JOIN condition with the report table
    • Output Columns:
      • end_timestamp: Directly copied to the output
Column Lineage
%3 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp entity_status 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history entity_status 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report line_item_status 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report line_item_status 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[entity_status]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • entity_status: Directly mapped to the output column
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[entity_status]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the JOIN condition with the report table
    • Output Columns:
      • line_item_status: Renamed and directly copied to the output
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[entity_status]
    • Direct The column is directly copied to the output
    • Output Columns:
      • line_item_status: Directly copied
Column Lineage
%3 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp id 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history line_item_id 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report line_item_id 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0 255. model.twitter_ads.twitter_ads__keyword_report 255. model.twitter_ads.twitter_ads__keyword_report line_item_id 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->255. model.twitter_ads.twitter_ads__keyword_report:f0 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report line_item_id 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report line_item_id 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->258. model.twitter_ads.twitter_ads__url_report:f0
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[id]
    • Direct The column is directly copied without any transformation
    • Deduplication The column is used for deduplication in the ROW_NUMBER() window function
    • Output Columns:
      • line_item_id: Mapped to the output column with a renamed field
255. model.twitter_ads.twitter_ads__keyword_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[line_item_id]
    • Integration This column is used as a key to join with the report table
    • Output Columns:
      • line_item_id: Directly copied to the output
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[line_item_id]
    • Integration The column is used as the key to join with the report table
    • Output Columns:
      • line_item_id: Directly copied to the output
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[line_item_id]
    • Integration This column is used to join the line_items table with the promoted_tweets table
    • Direct The column is directly copied to the output
    • Output Columns:
      • line_item_id: Directly copied
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[line_item_id]
    • Integration This column is used as a key to join with the promoted_tweets table
    • Direct The column is directly copied to the output
    • Output Columns:
      • line_item_id: Directly copied
Column Lineage
%3 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp name 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history name 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report line_item_name 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0 255. model.twitter_ads.twitter_ads__keyword_report 255. model.twitter_ads.twitter_ads__keyword_report line_item_name 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->255. model.twitter_ads.twitter_ads__keyword_report:f0 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report line_item_name 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report line_item_name 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->258. model.twitter_ads.twitter_ads__url_report:f0
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[name]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • name: Directly mapped to the output column
255. model.twitter_ads.twitter_ads__keyword_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[name]
    • Direct This column is directly copied to the output
    • Output Columns:
      • line_item_name: Directly copied to the output
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[name]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the JOIN condition with the report table
    • Output Columns:
      • line_item_name: Renamed and directly copied to the output
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[name]
    • Direct The column is directly copied to the output
    • Output Columns:
      • line_item_name: Directly copied
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[name]
    • Direct The column is directly copied to the output
    • Output Columns:
      • line_item_name: Directly copied
Column Lineage
%3 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp objective 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history objective 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report objective 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[objective]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • objective: Directly mapped to the output column
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[objective]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the JOIN condition with the report table
    • Output Columns:
      • objective: Directly copied to the output
Column Lineage
%3 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp optimization 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history optimization 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report optimization 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[optimization]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • optimization: Directly mapped to the output column
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[optimization]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the JOIN condition with the report table
    • Output Columns:
      • optimization: Directly copied to the output
Column Lineage
%3 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp primary_web_event_tag 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history primary_web_event_tag 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report primary_web_event_tag 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[primary_web_event_tag]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • primary_web_event_tag: Directly mapped to the output column
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[primary_web_event_tag]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the JOIN condition with the report table
    • Output Columns:
      • primary_web_event_tag: Directly copied to the output
Column Lineage
%3 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp product_type 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history product_type 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report product_type 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[product_type]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • product_type: Directly mapped to the output column
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[product_type]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • product_type: Directly copied to the output
Column Lineage
%3 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp start_time 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history start_timestamp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report start_timestamp 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[start_time]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast to TIMESTAMP data type
    • Output Columns:
      • start_timestamp: The column is directly mapped and renamed
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[start_timestamp]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • start_timestamp: Directly copied to the output
Column Lineage
%3 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp target_cpa_local_micro 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history target_cpa target_cpa_local_micro 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f1 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[target_cpa_local_micro]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast to INT data type
    • Featurization The column is used to calculate a new feature 'target_cpa'
    • Output Columns:
      • target_cpa_local_micro: The column is directly mapped
      • target_cpa: The column is transformed by dividing by 1,000,000 and rounding to 2 decimal places
Column Lineage
%3 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp total_budget_amount_local_micro 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history total_budget_amount total_budget_amount_local_micro 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f1 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[total_budget_amount_local_micro]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast to INT data type
    • Featurization The column is used to calculate a new feature 'total_budget_amount'
    • Output Columns:
      • total_budget_amount_local_micro: The column is directly mapped
      • total_budget_amount: The column is transformed by dividing by 1,000,000 and rounding to 2 decimal places
Column Lineage
%3 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp updated_at 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history is_latest_version updated_timestamp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f1 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report updated_timestamp 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f1->256. model.twitter_ads.twitter_ads__line_item_report:f0
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[updated_at]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast to TIMESTAMP data type
    • Deduplication The column is used in the ROW_NUMBER() function to determine the latest version of each line item
    • Output Columns:
      • updated_timestamp: The column is directly mapped and renamed
      • is_latest_version: The column is used to determine if the record is the latest version
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[updated_timestamp]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • updated_timestamp: Directly copied to the output
Column Lineage
%3 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp updated_at 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history is_latest_version updated_timestamp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f1 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[updated_at]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast to TIMESTAMP data type
    • Deduplication The column is used in the ROW_NUMBER() function to determine the latest version of each line item
    • Output Columns:
      • updated_timestamp: The column is directly mapped and renamed
      • is_latest_version: The column is used to determine if the record is the latest version
Column Lineage
%3 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp bid_amount_local_micro 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history bid_amount bid_amount_local_micro 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f1 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report bid_amount 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[bid_amount_local_micro]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT
    • Featurization Used to calculate bid_amount
    • Output Columns:
      • bid_amount_local_micro: Directly mapped
      • bid_amount: Transformed (divided by 1,000,000 and rounded to 2 decimal places)
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[bid_amount]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • bid_amount: Directly copied to the output
Column Lineage
%3 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp total_budget_amount_local_micro 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history total_budget_amount total_budget_amount_local_micro 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f1 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report total_budget_amount 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[total_budget_amount_local_micro]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast to INT data type
    • Featurization The column is used to calculate a new feature 'total_budget_amount'
    • Output Columns:
      • total_budget_amount_local_micro: The column is directly mapped
      • total_budget_amount: The column is transformed by dividing by 1,000,000 and rounding to 2 decimal places
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[total_budget_amount]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • total_budget_amount: Directly copied to the output
Column Lineage
%3 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp target_cpa_local_micro 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history target_cpa target_cpa_local_micro 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f1 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report target_cpa 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[target_cpa_local_micro]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast to INT data type
    • Featurization The column is used to calculate a new feature 'target_cpa'
    • Output Columns:
      • target_cpa_local_micro: The column is directly mapped
      • target_cpa: The column is transformed by dividing by 1,000,000 and rounding to 2 decimal places
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[target_cpa]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • target_cpa: Directly copied to the output
266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of type TEXT, initialized to NULL. The LIMIT 0 clause ensures no rows are returned. This is likely used as a template or placeholder for a staging table in a dbt (data build tool) project.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp advertiser_domain advertiser_user_id automatically_select_bid bid_amount_local_micro bid_type bid_unit campaign_id charge_by created_at creative_source currency deleted end_time entity_status id name objective optimization primary_web_event_tag product_type start_time target_cpa_local_micro total_budget_amount_local_micro updated_at 370. source.twitter_ads_source.twitter_ads.line_item_history 370. source.twitter_ads_source.twitter_ads.line_item_history
Name Type Comment
advertiser_domain text None
advertiser_user_id integer None
automatically_select_bid boolean None
bid_amount_local_micro integer None
bid_type text None
bid_unit text None
campaign_id text None
charge_by text None
created_at text None
creative_source text None
currency text None
deleted boolean None
end_time integer None
entity_status text None
id text None
name text None
objective text None
optimization text None
primary_web_event_tag integer None
product_type text None
start_time integer None
target_cpa_local_micro integer None
total_budget_amount_local_micro integer None
updated_at text None
Column Lineage
%3 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp advertiser_domain 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history advertiser_domain 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report advertiser_domain 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[advertiser_domain]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • advertiser_domain: Directly mapped
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[advertiser_domain]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • advertiser_domain: Directly copied to the output
Column Lineage
%3 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp advertiser_user_id 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history advertiser_user_id 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report advertiser_user_id 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[advertiser_user_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT
    • Output Columns:
      • advertiser_user_id: Directly mapped
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[advertiser_user_id]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • advertiser_user_id: Directly copied to the output
Column Lineage
%3 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp automatically_select_bid 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history automatically_select_bid 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[automatically_select_bid]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as BOOLEAN
    • Output Columns:
      • automatically_select_bid: Directly mapped
Column Lineage
%3 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp bid_amount_local_micro 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history bid_amount bid_amount_local_micro 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f1 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report bid_amount 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f1->256. model.twitter_ads.twitter_ads__line_item_report:f0 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[bid_amount_local_micro]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT
    • Featurization Used to calculate bid_amount
    • Output Columns:
      • bid_amount_local_micro: Directly mapped
      • bid_amount: Transformed (divided by 1,000,000 and rounded to 2 decimal places)
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[bid_amount_local_micro]
    • Cleaning The column is likely cleaned or transformed
    • Output Columns:
      • bid_amount: Transformed and mapped to this output column
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[bid_amount]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • bid_amount: Directly copied to the output
Column Lineage
%3 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp bid_type 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history bid_type 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report bid_type 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[bid_type]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • bid_type: Directly mapped
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[bid_type]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • bid_type: Directly copied to the output
Column Lineage
%3 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp bid_unit 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history bid_unit 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report bid_unit 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[bid_unit]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • bid_unit: Directly mapped
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[bid_unit]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • bid_unit: Directly copied to the output
Column Lineage
%3 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp campaign_id 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history campaign_id 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report campaign_id 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0 255. model.twitter_ads.twitter_ads__keyword_report 255. model.twitter_ads.twitter_ads__keyword_report campaign_id 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->255. model.twitter_ads.twitter_ads__keyword_report:f0
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[campaign_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • campaign_id: Directly mapped
255. model.twitter_ads.twitter_ads__keyword_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[campaign_id]
    • Integration This column is used as a key to join with the campaigns table
    • Output Columns:
      • campaign_id: Directly copied to the output
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[campaign_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a join key with the campaigns table
    • Output Columns:
      • campaign_id: Directly copied to the output
Column Lineage
%3 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp charge_by 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history charge_by 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report charge_by 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[charge_by]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • charge_by: Directly mapped
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[charge_by]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • charge_by: Directly copied to the output
Column Lineage
%3 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp created_at 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history created_timestamp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report created_timestamp 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[created_at]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TIMESTAMP
    • Output Columns:
      • created_timestamp: Directly mapped and renamed
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[created_timestamp]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • created_timestamp: Directly copied to the output
Column Lineage
%3 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp creative_source 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history creative_source 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report creative_source 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[creative_source]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • creative_source: Directly mapped
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[creative_source]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the JOIN condition with the report table
    • Output Columns:
      • creative_source: Directly copied to the output
Column Lineage
%3 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp currency 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history currency 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report currency 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0 255. model.twitter_ads.twitter_ads__keyword_report 255. model.twitter_ads.twitter_ads__keyword_report currency 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->255. model.twitter_ads.twitter_ads__keyword_report:f0 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report currency 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report currency 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->258. model.twitter_ads.twitter_ads__url_report:f0
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[currency]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • currency: Directly mapped to the output column
255. model.twitter_ads.twitter_ads__keyword_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[currency]
    • Direct This column is directly copied to the output
    • Output Columns:
      • currency: Directly copied to the output
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[currency]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the JOIN condition with the report table
    • Output Columns:
      • currency: Directly copied to the output
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[currency]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the join condition with other tables
    • Output Columns:
      • currency: Directly copied to the output
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[currency]
    • Direct The currency column is directly copied to the output
    • Output Columns:
      • currency: Directly copied
Column Lineage
%3 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp deleted 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history is_deleted 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report is_deleted 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[deleted]
    • Cleaning The column is cleaned by casting to BOOLEAN
    • Output Columns:
      • is_deleted: Mapped to the output column with a renamed field
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[is_deleted]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the JOIN condition with the report table
    • Output Columns:
      • is_deleted: Directly copied to the output
Column Lineage
%3 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp end_time 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history end_timestamp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report end_timestamp 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[end_time]
    • Cleaning The column is cleaned by casting to TIMESTAMP
    • Output Columns:
      • end_timestamp: Mapped to the output column with a renamed field
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[end_timestamp]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the JOIN condition with the report table
    • Output Columns:
      • end_timestamp: Directly copied to the output
Column Lineage
%3 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp entity_status 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history entity_status 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report line_item_status 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report line_item_status 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[entity_status]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • entity_status: Directly mapped to the output column
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[entity_status]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the JOIN condition with the report table
    • Output Columns:
      • line_item_status: Renamed and directly copied to the output
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[entity_status]
    • Direct The column is directly copied to the output
    • Output Columns:
      • line_item_status: Directly copied
Column Lineage
%3 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp id 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history line_item_id 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report line_item_id 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0 255. model.twitter_ads.twitter_ads__keyword_report 255. model.twitter_ads.twitter_ads__keyword_report line_item_id 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->255. model.twitter_ads.twitter_ads__keyword_report:f0 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report line_item_id 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report line_item_id 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->258. model.twitter_ads.twitter_ads__url_report:f0
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[id]
    • Direct The column is directly copied without any transformation
    • Deduplication The column is used for deduplication in the ROW_NUMBER() window function
    • Output Columns:
      • line_item_id: Mapped to the output column with a renamed field
255. model.twitter_ads.twitter_ads__keyword_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[line_item_id]
    • Integration This column is used as a key to join with the report table
    • Output Columns:
      • line_item_id: Directly copied to the output
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[line_item_id]
    • Integration The column is used as the key to join with the report table
    • Output Columns:
      • line_item_id: Directly copied to the output
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[line_item_id]
    • Integration This column is used to join the line_items table with the promoted_tweets table
    • Direct The column is directly copied to the output
    • Output Columns:
      • line_item_id: Directly copied
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[line_item_id]
    • Integration This column is used as a key to join with the promoted_tweets table
    • Direct The column is directly copied to the output
    • Output Columns:
      • line_item_id: Directly copied
Column Lineage
%3 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp name 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history name 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report line_item_name 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0 255. model.twitter_ads.twitter_ads__keyword_report 255. model.twitter_ads.twitter_ads__keyword_report line_item_name 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->255. model.twitter_ads.twitter_ads__keyword_report:f0 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report line_item_name 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report line_item_name 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->258. model.twitter_ads.twitter_ads__url_report:f0
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[name]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • name: Directly mapped to the output column
255. model.twitter_ads.twitter_ads__keyword_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[name]
    • Direct This column is directly copied to the output
    • Output Columns:
      • line_item_name: Directly copied to the output
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[name]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the JOIN condition with the report table
    • Output Columns:
      • line_item_name: Renamed and directly copied to the output
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[name]
    • Direct The column is directly copied to the output
    • Output Columns:
      • line_item_name: Directly copied
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[name]
    • Direct The column is directly copied to the output
    • Output Columns:
      • line_item_name: Directly copied
Column Lineage
%3 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp objective 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history objective 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report objective 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[objective]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • objective: Directly mapped to the output column
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[objective]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the JOIN condition with the report table
    • Output Columns:
      • objective: Directly copied to the output
Column Lineage
%3 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp optimization 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history optimization 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report optimization 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[optimization]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • optimization: Directly mapped to the output column
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[optimization]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the JOIN condition with the report table
    • Output Columns:
      • optimization: Directly copied to the output
Column Lineage
%3 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp primary_web_event_tag 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history primary_web_event_tag 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report primary_web_event_tag 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[primary_web_event_tag]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • primary_web_event_tag: Directly mapped to the output column
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[primary_web_event_tag]
    • Direct The column is directly copied without any transformation
    • Integration The column is used as part of the JOIN condition with the report table
    • Output Columns:
      • primary_web_event_tag: Directly copied to the output
Column Lineage
%3 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp product_type 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history product_type 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report product_type 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[product_type]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • product_type: Directly mapped to the output column
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[product_type]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • product_type: Directly copied to the output
Column Lineage
%3 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp start_time 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history start_timestamp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report start_timestamp 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[start_time]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast to TIMESTAMP data type
    • Output Columns:
      • start_timestamp: The column is directly mapped and renamed
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[start_timestamp]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • start_timestamp: Directly copied to the output
Column Lineage
%3 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp target_cpa_local_micro 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history target_cpa target_cpa_local_micro 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f1 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report target_cpa 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[target_cpa_local_micro]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast to INT data type
    • Featurization The column is used to calculate a new feature 'target_cpa'
    • Output Columns:
      • target_cpa_local_micro: The column is directly mapped
      • target_cpa: The column is transformed by dividing by 1,000,000 and rounding to 2 decimal places
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[target_cpa]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • target_cpa: Directly copied to the output
Column Lineage
%3 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp total_budget_amount_local_micro 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history total_budget_amount total_budget_amount_local_micro 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f1 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report total_budget_amount 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[total_budget_amount_local_micro]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast to INT data type
    • Featurization The column is used to calculate a new feature 'total_budget_amount'
    • Output Columns:
      • total_budget_amount_local_micro: The column is directly mapped
      • total_budget_amount: The column is transformed by dividing by 1,000,000 and rounding to 2 decimal places
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[total_budget_amount]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • total_budget_amount: Directly copied to the output
Column Lineage
%3 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp updated_at 265. model.twitter_ads_source.stg_twitter_ads__line_item_history 265. model.twitter_ads_source.stg_twitter_ads__line_item_history is_latest_version updated_timestamp 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f1 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp:f0->265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f0 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report updated_timestamp 265. model.twitter_ads_source.stg_twitter_ads__line_item_history:f1->256. model.twitter_ads.twitter_ads__line_item_report:f0
265. model.twitter_ads_source.stg_twitter_ads__line_item_history
  • Input Column: 266. model.twitter_ads_source.stg_twitter_ads__line_item_history_tmp[updated_at]
    • Direct The column is directly copied without transformation
    • Cleaning The column is cast to TIMESTAMP data type
    • Deduplication The column is used in the ROW_NUMBER() function to determine the latest version of each line item
    • Output Columns:
      • updated_timestamp: The column is directly mapped and renamed
      • is_latest_version: The column is used to determine if the record is the latest version
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 265. model.twitter_ads_source.stg_twitter_ads__line_item_history[updated_timestamp]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • updated_timestamp: Directly copied to the output
267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report

This SQL query transforms and structures data from a Twitter Ads line item keywords report. It casts fields to specific data types, creates a date_day column by truncating the date to day level, generates a unique keyword_id using MD5 hashing of multiple fields, and calculates spend from billed_charge_local_micro. The query also renames some columns and selects specific fields for the final output.

CleaningFeaturizationOther
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_twitter_ads_source.stg_twitter_ads__line_item_keywords_report_tmp
), fields AS (
  SELECT
    CAST(NULL AS TEXT) AS account_id,
    CAST(NULL AS INT) AS billed_charge_local_micro,
    CAST(NULL AS INT) AS clicks,
    CAST(NULL AS TIMESTAMP) AS date,
    CAST(NULL AS INT) AS impressions,
    CAST(NULL AS TEXT) AS line_item_id,
    CAST(NULL AS TEXT) AS placement,
    CAST(NULL AS TEXT) AS segment,
    CAST(NULL AS INT) AS url_clicks,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    DATE_TRUNC('DAY', date) AS date_day,
    MD5(
      CAST(COALESCE(CAST(account_id AS TEXT), '_dbt_utils_surrogate_key_null_') || '-' || COALESCE(CAST(line_item_id AS TEXT), '_dbt_utils_surrogate_key_null_') || '-' || COALESCE(CAST(segment AS TEXT), '_dbt_utils_surrogate_key_null_') || '-' || COALESCE(CAST(placement AS TEXT), '_dbt_utils_surrogate_key_null_') AS TEXT)
    ) AS keyword_id,
    account_id,
    line_item_id,
    segment AS keyword,
    placement,
    clicks,
    impressions,
    billed_charge_local_micro AS spend_micro,
    ROUND(billed_charge_local_micro / 1000000.0, 2) AS spend,
    url_clicks
  FROM fields
)
SELECT
  *
FROM final
%3 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report source_relation keyword_id account_id spend_micro spend clicks date_day impressions line_item_id url_clicks keyword placement 268. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report_tmp 268. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report_tmp
Name Type Comment
source_relation None The source of the record if the unioning functionality is being used. If not this field will be empty.
keyword_id None Unique key of the table built from the combination of 'account_id', 'line_item_id','segment', and 'placement' fields.
account_id None The ID of the related account.
spend_micro None The spend for the line item + keyword on that day, in micros and in whichever currency was selected during account creation.
spend None The spend for the line item + keyword on that day in whichever currency was selected during account creation.
clicks None The clicks for the line item + keyword on that day. Includes clicks on the URL (shortened or regular links), profile pic, screen name, username, detail, hashtags, and likes.
date_day None The date of the performance.
impressions None The impressions for the line item + keyword on that day. This is the number of users who see a Promoted Ad either in their home timeline or search results.
line_item_id None The ID of the line item.
url_clicks None The url clicks for the line item + keyword on that day.
keyword None The keyword whose performance is being tracked.
placement None Where on Twitter the ad is being displayed. Possible values include 'ALL_ON_TWITTER', 'PUBLISHER_NETWORK', 'TWITTER_PROFILE', 'TWITTER_SEARCH', 'TWITTER_TIMELINE', and 'TAP_*', which are more granular options for `PUBLISHER_NETWORK`.
Column Lineage
%3 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report source_relation 255. model.twitter_ads.twitter_ads__keyword_report 255. model.twitter_ads.twitter_ads__keyword_report source_relation 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report:f0->255. model.twitter_ads.twitter_ads__keyword_report:f0
255. model.twitter_ads.twitter_ads__keyword_report
  • Input Column: 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with other tables
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
Column Lineage
%3 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report keyword_id 255. model.twitter_ads.twitter_ads__keyword_report 255. model.twitter_ads.twitter_ads__keyword_report keyword_id 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report:f0->255. model.twitter_ads.twitter_ads__keyword_report:f0
255. model.twitter_ads.twitter_ads__keyword_report
  • Input Column: 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report[keyword_id]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • keyword_id: Directly copied to the output
Column Lineage
%3 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report account_id 255. model.twitter_ads.twitter_ads__keyword_report 255. model.twitter_ads.twitter_ads__keyword_report account_id 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report:f0->255. model.twitter_ads.twitter_ads__keyword_report:f0
255. model.twitter_ads.twitter_ads__keyword_report
  • Input Column: 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report[account_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a join key with the accounts table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • account_id: Directly copied to the output
Column Lineage
%3 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report spend_micro 255. model.twitter_ads.twitter_ads__keyword_report 255. model.twitter_ads.twitter_ads__keyword_report spend_micro 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report:f0->255. model.twitter_ads.twitter_ads__keyword_report:f0
255. model.twitter_ads.twitter_ads__keyword_report
  • Input Column: 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report[spend_micro]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • spend_micro: Aggregated sum in the output
Column Lineage
%3 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report spend 255. model.twitter_ads.twitter_ads__keyword_report 255. model.twitter_ads.twitter_ads__keyword_report spend 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report:f0->255. model.twitter_ads.twitter_ads__keyword_report:f0
255. model.twitter_ads.twitter_ads__keyword_report
  • Input Column: 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report[spend]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • spend: Aggregated sum in the output
Column Lineage
%3 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report clicks 255. model.twitter_ads.twitter_ads__keyword_report 255. model.twitter_ads.twitter_ads__keyword_report clicks 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report:f0->255. model.twitter_ads.twitter_ads__keyword_report:f0
255. model.twitter_ads.twitter_ads__keyword_report
  • Input Column: 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report[clicks]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • clicks: Aggregated sum in the output
Column Lineage
%3 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report date_day 255. model.twitter_ads.twitter_ads__keyword_report 255. model.twitter_ads.twitter_ads__keyword_report date_day 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report:f0->255. model.twitter_ads.twitter_ads__keyword_report:f0
255. model.twitter_ads.twitter_ads__keyword_report
  • Input Column: 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report impressions 255. model.twitter_ads.twitter_ads__keyword_report 255. model.twitter_ads.twitter_ads__keyword_report impressions 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report:f0->255. model.twitter_ads.twitter_ads__keyword_report:f0
255. model.twitter_ads.twitter_ads__keyword_report
  • Input Column: 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report[impressions]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • impressions: Aggregated sum in the output
Column Lineage
%3 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report line_item_id 255. model.twitter_ads.twitter_ads__keyword_report 255. model.twitter_ads.twitter_ads__keyword_report line_item_id 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report:f0->255. model.twitter_ads.twitter_ads__keyword_report:f0
255. model.twitter_ads.twitter_ads__keyword_report
  • Input Column: 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report[line_item_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as a join key with the line_items table
    • Aggregation Included in the GROUP BY clause
    • Output Columns:
      • line_item_id: Directly copied to the output
Column Lineage
%3 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report url_clicks 255. model.twitter_ads.twitter_ads__keyword_report 255. model.twitter_ads.twitter_ads__keyword_report url_clicks 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report:f0->255. model.twitter_ads.twitter_ads__keyword_report:f0
255. model.twitter_ads.twitter_ads__keyword_report
  • Input Column: 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report[url_clicks]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • url_clicks: Aggregated sum in the output
Column Lineage
%3 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report keyword 255. model.twitter_ads.twitter_ads__keyword_report 255. model.twitter_ads.twitter_ads__keyword_report keyword 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report:f0->255. model.twitter_ads.twitter_ads__keyword_report:f0
255. model.twitter_ads.twitter_ads__keyword_report
  • Input Column: 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report[keyword]
    • Direct The keyword is directly copied to the output without transformation
    • Aggregation The keyword is used in the GROUP BY clause
    • Output Columns:
      • keyword: Directly copied to the output column 'keyword'
Column Lineage
%3 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report placement 255. model.twitter_ads.twitter_ads__keyword_report 255. model.twitter_ads.twitter_ads__keyword_report placement 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report:f0->255. model.twitter_ads.twitter_ads__keyword_report:f0
255. model.twitter_ads.twitter_ads__keyword_report
  • Input Column: 267. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report[placement]
    • Direct The placement is directly copied to the output without transformation
    • Aggregation The placement is used in the GROUP BY clause
    • Output Columns:
      • placement: Directly copied to the output column 'placement'
268. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of type TEXT, which is set to NULL. The LIMIT 0 clause ensures no rows are returned. This query appears to be a placeholder or template for a staging table in a dbt (data build tool) project, specifically for Twitter ads line item keywords report data.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 268. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report_tmp 268. model.twitter_ads_source.stg_twitter_ads__line_item_keywords_report_tmp 371. source.twitter_ads_source.twitter_ads.line_item_keywords_report 371. source.twitter_ads_source.twitter_ads.line_item_keywords_report
Name Type Comment
269. model.twitter_ads_source.stg_twitter_ads__line_item_report

This SQL query transforms data from a temporary staging table for Twitter Ads line item reports. It casts columns to specific data types, renames some columns, and performs minor calculations. The query also adds a source_relation column and truncates the date to day-level granularity. No filtering, deduplication, or aggregation is performed.

CleaningFeaturization
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_twitter_ads_source.stg_twitter_ads__line_item_report_tmp
), fields AS (
  SELECT
    CAST(NULL AS TEXT) AS account_id,
    CAST(NULL AS INT) AS billed_charge_local_micro,
    CAST(NULL AS INT) AS clicks,
    CAST(NULL AS TIMESTAMP) AS date,
    CAST(NULL AS INT) AS impressions,
    CAST(NULL AS TEXT) AS line_item_id,
    CAST(NULL AS TEXT) AS placement,
    CAST(NULL AS INT) AS url_clicks,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    DATE_TRUNC('DAY', date) AS date_day,
    account_id,
    line_item_id,
    placement,
    clicks,
    impressions,
    billed_charge_local_micro AS spend_micro,
    ROUND(billed_charge_local_micro / 1000000.0, 2) AS spend,
    url_clicks
  FROM fields
)
SELECT
  *
FROM final
%3 269. model.twitter_ads_source.stg_twitter_ads__line_item_report 269. model.twitter_ads_source.stg_twitter_ads__line_item_report source_relation account_id spend_micro spend clicks date_day impressions line_item_id url_clicks placement 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp account_id date line_item_id placement billed_charge_local_micro clicks impressions url_clicks 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp:f0->269. model.twitter_ads_source.stg_twitter_ads__line_item_report:f1 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp:f1->269. model.twitter_ads_source.stg_twitter_ads__line_item_report:f5 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp:f2->269. model.twitter_ads_source.stg_twitter_ads__line_item_report:f7 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp:f3->269. model.twitter_ads_source.stg_twitter_ads__line_item_report:f9 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp:f4->269. model.twitter_ads_source.stg_twitter_ads__line_item_report:f2 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp:f4->269. model.twitter_ads_source.stg_twitter_ads__line_item_report:f3 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp:f5->269. model.twitter_ads_source.stg_twitter_ads__line_item_report:f4 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp:f6->269. model.twitter_ads_source.stg_twitter_ads__line_item_report:f6 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp:f7->269. model.twitter_ads_source.stg_twitter_ads__line_item_report:f8
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
account_id text The ID of the related account.
spend_micro integer The spend for the line item on that day, in micros and in whichever currency was selected during account creation.
spend numeric The spend for the line item on that day in whichever currency was selected during account creation.
clicks integer The clicks for the line item on that day. Includes clicks on the URL (shortened or regular links), profile pic, screen name, username, detail, hashtags, and likes.
date_day timestamp without time zone The date of the performance.
impressions integer The impressions for the line item on that day. This is the number of users who see a Promoted Ad either in their home timeline or search results.
line_item_id text The ID of the line item.
url_clicks integer The url clicks for the line item on that day.
placement text Where on Twitter the ad is being displayed. Possible values include 'ALL_ON_TWITTER', 'PUBLISHER_NETWORK', 'TWITTER_PROFILE', 'TWITTER_SEARCH', 'TWITTER_TIMELINE', and 'TAP_*', which are more granular options for `PUBLISHER_NETWORK`.
Column Lineage
%3 269. model.twitter_ads_source.stg_twitter_ads__line_item_report 269. model.twitter_ads_source.stg_twitter_ads__line_item_report source_relation 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report source_relation 269. model.twitter_ads_source.stg_twitter_ads__line_item_report:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 269. model.twitter_ads_source.stg_twitter_ads__line_item_report[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with other tables
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
Column Lineage
%3 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp account_id 269. model.twitter_ads_source.stg_twitter_ads__line_item_report 269. model.twitter_ads_source.stg_twitter_ads__line_item_report account_id 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp:f0->269. model.twitter_ads_source.stg_twitter_ads__line_item_report:f0 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report account_id 269. model.twitter_ads_source.stg_twitter_ads__line_item_report:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0
269. model.twitter_ads_source.stg_twitter_ads__line_item_report
  • Input Column: 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp[account_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • account_id: Directly mapped after casting
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 269. model.twitter_ads_source.stg_twitter_ads__line_item_report[account_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with the accounts table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • account_id: Directly copied to the output
Column Lineage
%3 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp billed_charge_local_micro 269. model.twitter_ads_source.stg_twitter_ads__line_item_report 269. model.twitter_ads_source.stg_twitter_ads__line_item_report spend spend_micro 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp:f0->269. model.twitter_ads_source.stg_twitter_ads__line_item_report:f1 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp:f0->269. model.twitter_ads_source.stg_twitter_ads__line_item_report:f0 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report spend_micro 269. model.twitter_ads_source.stg_twitter_ads__line_item_report:f1->256. model.twitter_ads.twitter_ads__line_item_report:f0
269. model.twitter_ads_source.stg_twitter_ads__line_item_report
  • Input Column: 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp[billed_charge_local_micro]
    • Cleaning The column is cast as INT
    • Featurization The spend in regular currency is calculated from this column
    • Output Columns:
      • spend_micro: Directly mapped after casting
      • spend: Calculated by dividing by 1,000,000 and rounding to 2 decimal places
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 269. model.twitter_ads_source.stg_twitter_ads__line_item_report[spend_micro]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • spend_micro: Aggregated sum in the output
Column Lineage
%3 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp billed_charge_local_micro 269. model.twitter_ads_source.stg_twitter_ads__line_item_report 269. model.twitter_ads_source.stg_twitter_ads__line_item_report spend spend_micro 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp:f0->269. model.twitter_ads_source.stg_twitter_ads__line_item_report:f1 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp:f0->269. model.twitter_ads_source.stg_twitter_ads__line_item_report:f0 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report spend 269. model.twitter_ads_source.stg_twitter_ads__line_item_report:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0
269. model.twitter_ads_source.stg_twitter_ads__line_item_report
  • Input Column: 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp[billed_charge_local_micro]
    • Cleaning The column is cast as INT
    • Featurization The spend in regular currency is calculated from this column
    • Output Columns:
      • spend_micro: Directly mapped after casting
      • spend: Calculated by dividing by 1,000,000 and rounding to 2 decimal places
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 269. model.twitter_ads_source.stg_twitter_ads__line_item_report[spend]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • spend: Aggregated sum in the output
Column Lineage
%3 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp clicks 269. model.twitter_ads_source.stg_twitter_ads__line_item_report 269. model.twitter_ads_source.stg_twitter_ads__line_item_report clicks 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp:f0->269. model.twitter_ads_source.stg_twitter_ads__line_item_report:f0 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report clicks 269. model.twitter_ads_source.stg_twitter_ads__line_item_report:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0
269. model.twitter_ads_source.stg_twitter_ads__line_item_report
  • Input Column: 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp[clicks]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to INT data type
    • Output Columns:
      • clicks: Directly mapped to the output 'clicks' column
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 269. model.twitter_ads_source.stg_twitter_ads__line_item_report[clicks]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • clicks: Aggregated sum in the output
Column Lineage
%3 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp date 269. model.twitter_ads_source.stg_twitter_ads__line_item_report 269. model.twitter_ads_source.stg_twitter_ads__line_item_report date_day 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp:f0->269. model.twitter_ads_source.stg_twitter_ads__line_item_report:f0 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report date_day 269. model.twitter_ads_source.stg_twitter_ads__line_item_report:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0
269. model.twitter_ads_source.stg_twitter_ads__line_item_report
  • Input Column: 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp[date]
    • Cleaning The column is cast as TIMESTAMP and then truncated to day level
    • Featurization The day-level date is extracted from this column
    • Output Columns:
      • date_day: Mapped after casting and truncating to day level
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 269. model.twitter_ads_source.stg_twitter_ads__line_item_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp impressions 269. model.twitter_ads_source.stg_twitter_ads__line_item_report 269. model.twitter_ads_source.stg_twitter_ads__line_item_report impressions 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp:f0->269. model.twitter_ads_source.stg_twitter_ads__line_item_report:f0 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report impressions 269. model.twitter_ads_source.stg_twitter_ads__line_item_report:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0
269. model.twitter_ads_source.stg_twitter_ads__line_item_report
  • Input Column: 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp[impressions]
    • Cleaning The column is cast to INT type
    • Direct The column is directly copied to the output without transformation
    • Output Columns:
      • impressions: Directly copied after casting
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 269. model.twitter_ads_source.stg_twitter_ads__line_item_report[impressions]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • impressions: Aggregated sum in the output
Column Lineage
%3 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp line_item_id 269. model.twitter_ads_source.stg_twitter_ads__line_item_report 269. model.twitter_ads_source.stg_twitter_ads__line_item_report line_item_id 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp:f0->269. model.twitter_ads_source.stg_twitter_ads__line_item_report:f0 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report line_item_id 269. model.twitter_ads_source.stg_twitter_ads__line_item_report:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0
269. model.twitter_ads_source.stg_twitter_ads__line_item_report
  • Input Column: 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp[line_item_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • line_item_id: Directly mapped after casting
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 269. model.twitter_ads_source.stg_twitter_ads__line_item_report[line_item_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with the line_items table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • line_item_id: Directly copied to the output
Column Lineage
%3 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp url_clicks 269. model.twitter_ads_source.stg_twitter_ads__line_item_report 269. model.twitter_ads_source.stg_twitter_ads__line_item_report url_clicks 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp:f0->269. model.twitter_ads_source.stg_twitter_ads__line_item_report:f0 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report url_clicks 269. model.twitter_ads_source.stg_twitter_ads__line_item_report:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0
269. model.twitter_ads_source.stg_twitter_ads__line_item_report
  • Input Column: 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp[url_clicks]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • url_clicks: Directly mapped to the output column 'url_clicks'
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 269. model.twitter_ads_source.stg_twitter_ads__line_item_report[url_clicks]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • url_clicks: Aggregated sum in the output
Column Lineage
%3 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp placement 269. model.twitter_ads_source.stg_twitter_ads__line_item_report 269. model.twitter_ads_source.stg_twitter_ads__line_item_report placement 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp:f0->269. model.twitter_ads_source.stg_twitter_ads__line_item_report:f0 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report placement 269. model.twitter_ads_source.stg_twitter_ads__line_item_report:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0
269. model.twitter_ads_source.stg_twitter_ads__line_item_report
  • Input Column: 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp[placement]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • placement: Directly mapped after casting
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 269. model.twitter_ads_source.stg_twitter_ads__line_item_report[placement]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • placement: Directly copied to the output
270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of type TEXT, which is set to NULL. The LIMIT 0 clause ensures no rows are returned. This appears to be a template or placeholder query, possibly used for schema definition or testing purposes in a dbt (data build tool) project.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp account_id date line_item_id placement _fivetran_synced app_clicks billed_charge_local_micro billed_engagements card_engagements carousel_swipes clicks conversion_custom_metric conversion_custom_order_quantity conversion_custom_order_quantity_engagement conversion_custom_order_quantity_view conversion_custom_post_engagement conversion_custom_post_view conversion_custom_sale_amount conversion_custom_sale_amount_engagement conversion_custom_sale_amount_view conversion_downloads_metric conversion_downloads_order_quantity conversion_downloads_order_quantity_engagement conversion_downloads_order_quantity_view conversion_downloads_post_engagement conversion_downloads_post_view conversion_downloads_sale_amount conversion_downloads_sale_amount_engagement conversion_downloads_sale_amount_view conversion_purchases_assisted conversion_purchases_metric conversion_purchases_order_quantity conversion_purchases_order_quantity_engagement conversion_purchases_order_quantity_view conversion_purchases_post_engagement conversion_purchases_post_view conversion_purchases_sale_amount conversion_purchases_sale_amount_engagement conversion_purchases_sale_amount_view conversion_sign_ups_assisted conversion_sign_ups_metric conversion_sign_ups_order_quantity conversion_sign_ups_order_quantity_engagement conversion_sign_ups_order_quantity_view conversion_sign_ups_post_engagement conversion_sign_ups_post_view conversion_sign_ups_sale_amount conversion_sign_ups_sale_amount_engagement conversion_sign_ups_sale_amount_view conversion_site_visits_metric conversion_site_visits_order_quantity conversion_site_visits_order_quantity_engagement conversion_site_visits_order_quantity_view conversion_site_visits_post_engagement conversion_site_visits_post_view conversion_site_visits_sale_amount conversion_site_visits_sale_amount_engagement conversion_site_visits_sale_amount_view engagements follows impressions likes media_engagements media_views mobile_conversion_achievements_unlocked_assisted mobile_conversion_achievements_unlocked_order_quantity mobile_conversion_achievements_unlocked_post_engagement mobile_conversion_achievements_unlocked_post_view mobile_conversion_achievements_unlocked_sale_amount mobile_conversion_add_to_carts_assisted mobile_conversion_add_to_carts_order_quantity mobile_conversion_add_to_carts_post_engagement mobile_conversion_add_to_carts_post_view mobile_conversion_add_to_carts_sale_amount mobile_conversion_add_to_wishlists_assisted mobile_conversion_add_to_wishlists_order_quantity mobile_conversion_add_to_wishlists_post_engagement mobile_conversion_add_to_wishlists_post_view mobile_conversion_add_to_wishlists_sale_amount mobile_conversion_checkouts_initiated_assisted mobile_conversion_checkouts_initiated_order_quantity mobile_conversion_checkouts_initiated_post_engagement mobile_conversion_checkouts_initiated_post_view mobile_conversion_checkouts_initiated_sale_amount mobile_conversion_content_views_assisted mobile_conversion_content_views_order_quantity mobile_conversion_content_views_post_engagement mobile_conversion_content_views_post_view mobile_conversion_content_views_sale_amount mobile_conversion_downloads_order_quantity mobile_conversion_downloads_post_engagement mobile_conversion_downloads_post_view mobile_conversion_downloads_sale_amount mobile_conversion_installs_assisted mobile_conversion_installs_order_quantity mobile_conversion_installs_post_engagement mobile_conversion_installs_post_view mobile_conversion_installs_sale_amount mobile_conversion_invites_assisted mobile_conversion_invites_order_quantity mobile_conversion_invites_post_engagement mobile_conversion_invites_post_view mobile_conversion_invites_sale_amount mobile_conversion_key_page_views_post_engagement mobile_conversion_key_page_views_post_view mobile_conversion_levels_achieved_assisted mobile_conversion_levels_achieved_order_quantity mobile_conversion_levels_achieved_post_engagement mobile_conversion_levels_achieved_post_view mobile_conversion_levels_achieved_sale_amount mobile_conversion_lifetime_value_achievements_unlocked_metric mobile_conversion_lifetime_value_achievements_unlocked_order_qu mobile_conversion_lifetime_value_achievements_unlocked_sale_amo mobile_conversion_lifetime_value_add_to_carts_metric mobile_conversion_lifetime_value_add_to_carts_order_quantity mobile_conversion_lifetime_value_add_to_carts_sale_amount mobile_conversion_lifetime_value_add_to_wishlists_metric mobile_conversion_lifetime_value_add_to_wishlists_order_quantit mobile_conversion_lifetime_value_add_to_wishlists_sale_amount mobile_conversion_lifetime_value_checkouts_initiated_metric mobile_conversion_lifetime_value_checkouts_initiated_order_quan mobile_conversion_lifetime_value_checkouts_initiated_sale_amoun mobile_conversion_lifetime_value_content_views_metric mobile_conversion_lifetime_value_content_views_order_quantity mobile_conversion_lifetime_value_content_views_sale_amount mobile_conversion_lifetime_value_invites_metric mobile_conversion_lifetime_value_invites_order_quantity mobile_conversion_lifetime_value_invites_sale_amount mobile_conversion_lifetime_value_levels_achieved_metric mobile_conversion_lifetime_value_levels_achieved_order_quantity mobile_conversion_lifetime_value_levels_achieved_sale_amount mobile_conversion_lifetime_value_logins_metric mobile_conversion_lifetime_value_logins_order_quantity mobile_conversion_lifetime_value_logins_sale_amount mobile_conversion_lifetime_value_payment_info_additions_metric mobile_conversion_lifetime_value_payment_info_additions_order_q mobile_conversion_lifetime_value_payment_info_additions_sale_am mobile_conversion_lifetime_value_purchases_metric mobile_conversion_lifetime_value_purchases_order_quantity mobile_conversion_lifetime_value_purchases_sale_amount mobile_conversion_lifetime_value_rates_metric mobile_conversion_lifetime_value_rates_order_quantity mobile_conversion_lifetime_value_rates_sale_amount mobile_conversion_lifetime_value_reservations_metric mobile_conversion_lifetime_value_reservations_order_quantity mobile_conversion_lifetime_value_reservations_sale_amount mobile_conversion_lifetime_value_searches_metric mobile_conversion_lifetime_value_searches_order_quantity mobile_conversion_lifetime_value_searches_sale_amount mobile_conversion_lifetime_value_shares_metric mobile_conversion_lifetime_value_shares_order_quantity mobile_conversion_lifetime_value_shares_sale_amount mobile_conversion_lifetime_value_sign_ups_metric mobile_conversion_lifetime_value_sign_ups_order_quantity mobile_conversion_lifetime_value_sign_ups_sale_amount mobile_conversion_lifetime_value_spent_credits_metric mobile_conversion_lifetime_value_spent_credits_order_quantity mobile_conversion_lifetime_value_spent_credits_sale_amount mobile_conversion_lifetime_value_tutorials_completed_metric mobile_conversion_lifetime_value_tutorials_completed_order_quan mobile_conversion_lifetime_value_tutorials_completed_sale_amoun mobile_conversion_lifetime_value_updates_metric mobile_conversion_lifetime_value_updates_order_quantity mobile_conversion_lifetime_value_updates_sale_amount mobile_conversion_logins_assisted mobile_conversion_logins_order_quantity mobile_conversion_logins_post_engagement mobile_conversion_logins_post_view mobile_conversion_logins_sale_amount mobile_conversion_payment_info_additions_assisted mobile_conversion_payment_info_additions_order_quantity mobile_conversion_payment_info_additions_post_engagement mobile_conversion_payment_info_additions_post_view mobile_conversion_payment_info_additions_sale_amount mobile_conversion_purchases_assisted mobile_conversion_purchases_order_quantity mobile_conversion_purchases_post_engagement mobile_conversion_purchases_post_view mobile_conversion_purchases_sale_amount mobile_conversion_rates_assisted mobile_conversion_rates_order_quantity mobile_conversion_rates_post_engagement mobile_conversion_rates_post_view mobile_conversion_rates_sale_amount mobile_conversion_re_engages_assisted mobile_conversion_re_engages_order_quantity mobile_conversion_re_engages_post_engagement mobile_conversion_re_engages_post_view mobile_conversion_re_engages_sale_amount mobile_conversion_reservations_assisted mobile_conversion_reservations_order_quantity mobile_conversion_reservations_post_engagement mobile_conversion_reservations_post_view mobile_conversion_reservations_sale_amount mobile_conversion_searches_assisted mobile_conversion_searches_order_quantity mobile_conversion_searches_post_engagement mobile_conversion_searches_post_view mobile_conversion_searches_sale_amount mobile_conversion_shares_assisted mobile_conversion_shares_order_quantity mobile_conversion_shares_post_engagement mobile_conversion_shares_post_view mobile_conversion_shares_sale_amount mobile_conversion_sign_ups_assisted mobile_conversion_sign_ups_order_quantity mobile_conversion_sign_ups_post_engagement mobile_conversion_sign_ups_post_view mobile_conversion_sign_ups_sale_amount mobile_conversion_site_visits_order_quantity mobile_conversion_site_visits_post_engagement mobile_conversion_site_visits_post_view mobile_conversion_site_visits_sale_amount mobile_conversion_spent_credits_assisted mobile_conversion_spent_credits_order_quantity mobile_conversion_spent_credits_post_engagement mobile_conversion_spent_credits_post_view mobile_conversion_spent_credits_sale_amount mobile_conversion_tutorials_completed_assisted mobile_conversion_tutorials_completed_order_quantity mobile_conversion_tutorials_completed_post_engagement mobile_conversion_tutorials_completed_post_view mobile_conversion_tutorials_completed_sale_amount mobile_conversion_updates_assisted mobile_conversion_updates_order_quantity mobile_conversion_updates_post_engagement mobile_conversion_updates_post_view mobile_conversion_updates_sale_amount poll_card_vote qualified_impressions replies retweets tweets_send unfollows url_clicks video_3_s_100_pct_views video_6_s_views video_content_starts video_cta_clicks video_mrc_views video_total_views video_views_100 video_views_25 video_views_50 video_views_75 mobile_conversion_installs_skan_post_engagement mobile_conversion_installs_skan_post_view mobile_conversion_purchases_skan_post_engagement mobile_conversion_purchases_skan_post_view video_15_s_views auto_created_conversion_landing_page_view auto_created_conversion_session 372. source.twitter_ads_source.twitter_ads.line_item_report 372. source.twitter_ads_source.twitter_ads.line_item_report
Name Type Comment
account_id text None
date timestamp without time zone None
line_item_id text None
placement text None
_fivetran_synced text None
app_clicks integer None
billed_charge_local_micro integer None
billed_engagements integer None
card_engagements integer None
carousel_swipes integer None
clicks integer None
conversion_custom_metric integer None
conversion_custom_order_quantity integer None
conversion_custom_order_quantity_engagement integer None
conversion_custom_order_quantity_view integer None
conversion_custom_post_engagement integer None
conversion_custom_post_view integer None
conversion_custom_sale_amount integer None
conversion_custom_sale_amount_engagement integer None
conversion_custom_sale_amount_view integer None
conversion_downloads_metric integer None
conversion_downloads_order_quantity integer None
conversion_downloads_order_quantity_engagement integer None
conversion_downloads_order_quantity_view integer None
conversion_downloads_post_engagement integer None
conversion_downloads_post_view integer None
conversion_downloads_sale_amount integer None
conversion_downloads_sale_amount_engagement integer None
conversion_downloads_sale_amount_view integer None
conversion_purchases_assisted integer None
conversion_purchases_metric integer None
conversion_purchases_order_quantity integer None
conversion_purchases_order_quantity_engagement integer None
conversion_purchases_order_quantity_view integer None
conversion_purchases_post_engagement integer None
conversion_purchases_post_view integer None
conversion_purchases_sale_amount integer None
conversion_purchases_sale_amount_engagement integer None
conversion_purchases_sale_amount_view integer None
conversion_sign_ups_assisted integer None
conversion_sign_ups_metric integer None
conversion_sign_ups_order_quantity integer None
conversion_sign_ups_order_quantity_engagement integer None
conversion_sign_ups_order_quantity_view integer None
conversion_sign_ups_post_engagement integer None
conversion_sign_ups_post_view integer None
conversion_sign_ups_sale_amount integer None
conversion_sign_ups_sale_amount_engagement integer None
conversion_sign_ups_sale_amount_view integer None
conversion_site_visits_metric integer None
conversion_site_visits_order_quantity integer None
conversion_site_visits_order_quantity_engagement integer None
conversion_site_visits_order_quantity_view integer None
conversion_site_visits_post_engagement integer None
conversion_site_visits_post_view integer None
conversion_site_visits_sale_amount integer None
conversion_site_visits_sale_amount_engagement integer None
conversion_site_visits_sale_amount_view integer None
engagements integer None
follows integer None
impressions integer None
likes integer None
media_engagements integer None
media_views integer None
mobile_conversion_achievements_unlocked_assisted integer None
mobile_conversion_achievements_unlocked_order_quantity integer None
mobile_conversion_achievements_unlocked_post_engagement integer None
mobile_conversion_achievements_unlocked_post_view integer None
mobile_conversion_achievements_unlocked_sale_amount integer None
mobile_conversion_add_to_carts_assisted integer None
mobile_conversion_add_to_carts_order_quantity integer None
mobile_conversion_add_to_carts_post_engagement integer None
mobile_conversion_add_to_carts_post_view integer None
mobile_conversion_add_to_carts_sale_amount integer None
mobile_conversion_add_to_wishlists_assisted integer None
mobile_conversion_add_to_wishlists_order_quantity integer None
mobile_conversion_add_to_wishlists_post_engagement integer None
mobile_conversion_add_to_wishlists_post_view integer None
mobile_conversion_add_to_wishlists_sale_amount integer None
mobile_conversion_checkouts_initiated_assisted integer None
mobile_conversion_checkouts_initiated_order_quantity integer None
mobile_conversion_checkouts_initiated_post_engagement integer None
mobile_conversion_checkouts_initiated_post_view integer None
mobile_conversion_checkouts_initiated_sale_amount integer None
mobile_conversion_content_views_assisted integer None
mobile_conversion_content_views_order_quantity integer None
mobile_conversion_content_views_post_engagement integer None
mobile_conversion_content_views_post_view integer None
mobile_conversion_content_views_sale_amount integer None
mobile_conversion_downloads_order_quantity integer None
mobile_conversion_downloads_post_engagement integer None
mobile_conversion_downloads_post_view integer None
mobile_conversion_downloads_sale_amount integer None
mobile_conversion_installs_assisted integer None
mobile_conversion_installs_order_quantity integer None
mobile_conversion_installs_post_engagement integer None
mobile_conversion_installs_post_view integer None
mobile_conversion_installs_sale_amount integer None
mobile_conversion_invites_assisted integer None
mobile_conversion_invites_order_quantity integer None
mobile_conversion_invites_post_engagement integer None
mobile_conversion_invites_post_view integer None
mobile_conversion_invites_sale_amount integer None
mobile_conversion_key_page_views_post_engagement integer None
mobile_conversion_key_page_views_post_view integer None
mobile_conversion_levels_achieved_assisted integer None
mobile_conversion_levels_achieved_order_quantity integer None
mobile_conversion_levels_achieved_post_engagement integer None
mobile_conversion_levels_achieved_post_view integer None
mobile_conversion_levels_achieved_sale_amount integer None
mobile_conversion_lifetime_value_achievements_unlocked_metric integer None
mobile_conversion_lifetime_value_achievements_unlocked_order_qu integer None
mobile_conversion_lifetime_value_achievements_unlocked_sale_amo integer None
mobile_conversion_lifetime_value_add_to_carts_metric integer None
mobile_conversion_lifetime_value_add_to_carts_order_quantity integer None
mobile_conversion_lifetime_value_add_to_carts_sale_amount integer None
mobile_conversion_lifetime_value_add_to_wishlists_metric integer None
mobile_conversion_lifetime_value_add_to_wishlists_order_quantit integer None
mobile_conversion_lifetime_value_add_to_wishlists_sale_amount integer None
mobile_conversion_lifetime_value_checkouts_initiated_metric integer None
mobile_conversion_lifetime_value_checkouts_initiated_order_quan integer None
mobile_conversion_lifetime_value_checkouts_initiated_sale_amoun integer None
mobile_conversion_lifetime_value_content_views_metric integer None
mobile_conversion_lifetime_value_content_views_order_quantity integer None
mobile_conversion_lifetime_value_content_views_sale_amount integer None
mobile_conversion_lifetime_value_invites_metric integer None
mobile_conversion_lifetime_value_invites_order_quantity integer None
mobile_conversion_lifetime_value_invites_sale_amount integer None
mobile_conversion_lifetime_value_levels_achieved_metric integer None
mobile_conversion_lifetime_value_levels_achieved_order_quantity integer None
mobile_conversion_lifetime_value_levels_achieved_sale_amount integer None
mobile_conversion_lifetime_value_logins_metric integer None
mobile_conversion_lifetime_value_logins_order_quantity integer None
mobile_conversion_lifetime_value_logins_sale_amount integer None
mobile_conversion_lifetime_value_payment_info_additions_metric integer None
mobile_conversion_lifetime_value_payment_info_additions_order_q integer None
mobile_conversion_lifetime_value_payment_info_additions_sale_am integer None
mobile_conversion_lifetime_value_purchases_metric integer None
mobile_conversion_lifetime_value_purchases_order_quantity integer None
mobile_conversion_lifetime_value_purchases_sale_amount integer None
mobile_conversion_lifetime_value_rates_metric integer None
mobile_conversion_lifetime_value_rates_order_quantity integer None
mobile_conversion_lifetime_value_rates_sale_amount integer None
mobile_conversion_lifetime_value_reservations_metric integer None
mobile_conversion_lifetime_value_reservations_order_quantity integer None
mobile_conversion_lifetime_value_reservations_sale_amount integer None
mobile_conversion_lifetime_value_searches_metric integer None
mobile_conversion_lifetime_value_searches_order_quantity integer None
mobile_conversion_lifetime_value_searches_sale_amount integer None
mobile_conversion_lifetime_value_shares_metric integer None
mobile_conversion_lifetime_value_shares_order_quantity integer None
mobile_conversion_lifetime_value_shares_sale_amount integer None
mobile_conversion_lifetime_value_sign_ups_metric integer None
mobile_conversion_lifetime_value_sign_ups_order_quantity integer None
mobile_conversion_lifetime_value_sign_ups_sale_amount integer None
mobile_conversion_lifetime_value_spent_credits_metric integer None
mobile_conversion_lifetime_value_spent_credits_order_quantity integer None
mobile_conversion_lifetime_value_spent_credits_sale_amount integer None
mobile_conversion_lifetime_value_tutorials_completed_metric integer None
mobile_conversion_lifetime_value_tutorials_completed_order_quan integer None
mobile_conversion_lifetime_value_tutorials_completed_sale_amoun integer None
mobile_conversion_lifetime_value_updates_metric integer None
mobile_conversion_lifetime_value_updates_order_quantity integer None
mobile_conversion_lifetime_value_updates_sale_amount integer None
mobile_conversion_logins_assisted integer None
mobile_conversion_logins_order_quantity integer None
mobile_conversion_logins_post_engagement integer None
mobile_conversion_logins_post_view integer None
mobile_conversion_logins_sale_amount integer None
mobile_conversion_payment_info_additions_assisted integer None
mobile_conversion_payment_info_additions_order_quantity integer None
mobile_conversion_payment_info_additions_post_engagement integer None
mobile_conversion_payment_info_additions_post_view integer None
mobile_conversion_payment_info_additions_sale_amount integer None
mobile_conversion_purchases_assisted integer None
mobile_conversion_purchases_order_quantity integer None
mobile_conversion_purchases_post_engagement integer None
mobile_conversion_purchases_post_view integer None
mobile_conversion_purchases_sale_amount integer None
mobile_conversion_rates_assisted integer None
mobile_conversion_rates_order_quantity integer None
mobile_conversion_rates_post_engagement integer None
mobile_conversion_rates_post_view integer None
mobile_conversion_rates_sale_amount integer None
mobile_conversion_re_engages_assisted integer None
mobile_conversion_re_engages_order_quantity integer None
mobile_conversion_re_engages_post_engagement integer None
mobile_conversion_re_engages_post_view integer None
mobile_conversion_re_engages_sale_amount integer None
mobile_conversion_reservations_assisted integer None
mobile_conversion_reservations_order_quantity integer None
mobile_conversion_reservations_post_engagement integer None
mobile_conversion_reservations_post_view integer None
mobile_conversion_reservations_sale_amount integer None
mobile_conversion_searches_assisted integer None
mobile_conversion_searches_order_quantity integer None
mobile_conversion_searches_post_engagement integer None
mobile_conversion_searches_post_view integer None
mobile_conversion_searches_sale_amount integer None
mobile_conversion_shares_assisted integer None
mobile_conversion_shares_order_quantity integer None
mobile_conversion_shares_post_engagement integer None
mobile_conversion_shares_post_view integer None
mobile_conversion_shares_sale_amount integer None
mobile_conversion_sign_ups_assisted integer None
mobile_conversion_sign_ups_order_quantity integer None
mobile_conversion_sign_ups_post_engagement integer None
mobile_conversion_sign_ups_post_view integer None
mobile_conversion_sign_ups_sale_amount integer None
mobile_conversion_site_visits_order_quantity integer None
mobile_conversion_site_visits_post_engagement integer None
mobile_conversion_site_visits_post_view integer None
mobile_conversion_site_visits_sale_amount integer None
mobile_conversion_spent_credits_assisted integer None
mobile_conversion_spent_credits_order_quantity integer None
mobile_conversion_spent_credits_post_engagement integer None
mobile_conversion_spent_credits_post_view integer None
mobile_conversion_spent_credits_sale_amount integer None
mobile_conversion_tutorials_completed_assisted integer None
mobile_conversion_tutorials_completed_order_quantity integer None
mobile_conversion_tutorials_completed_post_engagement integer None
mobile_conversion_tutorials_completed_post_view integer None
mobile_conversion_tutorials_completed_sale_amount integer None
mobile_conversion_updates_assisted integer None
mobile_conversion_updates_order_quantity integer None
mobile_conversion_updates_post_engagement integer None
mobile_conversion_updates_post_view integer None
mobile_conversion_updates_sale_amount integer None
poll_card_vote integer None
qualified_impressions integer None
replies integer None
retweets integer None
tweets_send integer None
unfollows integer None
url_clicks integer None
video_3_s_100_pct_views integer None
video_6_s_views integer None
video_content_starts integer None
video_cta_clicks integer None
video_mrc_views integer None
video_total_views integer None
video_views_100 integer None
video_views_25 integer None
video_views_50 integer None
video_views_75 integer None
mobile_conversion_installs_skan_post_engagement integer None
mobile_conversion_installs_skan_post_view integer None
mobile_conversion_purchases_skan_post_engagement integer None
mobile_conversion_purchases_skan_post_view integer None
video_15_s_views integer None
auto_created_conversion_landing_page_view integer None
auto_created_conversion_session integer None
Column Lineage
%3 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp account_id 269. model.twitter_ads_source.stg_twitter_ads__line_item_report 269. model.twitter_ads_source.stg_twitter_ads__line_item_report account_id 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp:f0->269. model.twitter_ads_source.stg_twitter_ads__line_item_report:f0 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report account_id 269. model.twitter_ads_source.stg_twitter_ads__line_item_report:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0
269. model.twitter_ads_source.stg_twitter_ads__line_item_report
  • Input Column: 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp[account_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • account_id: Directly mapped after casting
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 269. model.twitter_ads_source.stg_twitter_ads__line_item_report[account_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with the accounts table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • account_id: Directly copied to the output
Column Lineage
%3 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp date 269. model.twitter_ads_source.stg_twitter_ads__line_item_report 269. model.twitter_ads_source.stg_twitter_ads__line_item_report date_day 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp:f0->269. model.twitter_ads_source.stg_twitter_ads__line_item_report:f0 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report date_day 269. model.twitter_ads_source.stg_twitter_ads__line_item_report:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0
269. model.twitter_ads_source.stg_twitter_ads__line_item_report
  • Input Column: 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp[date]
    • Cleaning The column is cast as TIMESTAMP and then truncated to day level
    • Featurization The day-level date is extracted from this column
    • Output Columns:
      • date_day: Mapped after casting and truncating to day level
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 269. model.twitter_ads_source.stg_twitter_ads__line_item_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp line_item_id 269. model.twitter_ads_source.stg_twitter_ads__line_item_report 269. model.twitter_ads_source.stg_twitter_ads__line_item_report line_item_id 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp:f0->269. model.twitter_ads_source.stg_twitter_ads__line_item_report:f0 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report line_item_id 269. model.twitter_ads_source.stg_twitter_ads__line_item_report:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0
269. model.twitter_ads_source.stg_twitter_ads__line_item_report
  • Input Column: 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp[line_item_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • line_item_id: Directly mapped after casting
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 269. model.twitter_ads_source.stg_twitter_ads__line_item_report[line_item_id]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join condition with the line_items table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • line_item_id: Directly copied to the output
Column Lineage
%3 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp placement 269. model.twitter_ads_source.stg_twitter_ads__line_item_report 269. model.twitter_ads_source.stg_twitter_ads__line_item_report placement 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp:f0->269. model.twitter_ads_source.stg_twitter_ads__line_item_report:f0 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report placement 269. model.twitter_ads_source.stg_twitter_ads__line_item_report:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0
269. model.twitter_ads_source.stg_twitter_ads__line_item_report
  • Input Column: 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp[placement]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT
    • Output Columns:
      • placement: Directly mapped after casting
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 269. model.twitter_ads_source.stg_twitter_ads__line_item_report[placement]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • placement: Directly copied to the output
Column Lineage
%3 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp billed_charge_local_micro 269. model.twitter_ads_source.stg_twitter_ads__line_item_report 269. model.twitter_ads_source.stg_twitter_ads__line_item_report spend spend_micro 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp:f0->269. model.twitter_ads_source.stg_twitter_ads__line_item_report:f1 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp:f0->269. model.twitter_ads_source.stg_twitter_ads__line_item_report:f0 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report spend spend_micro 269. model.twitter_ads_source.stg_twitter_ads__line_item_report:f1->256. model.twitter_ads.twitter_ads__line_item_report:f1 269. model.twitter_ads_source.stg_twitter_ads__line_item_report:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0
269. model.twitter_ads_source.stg_twitter_ads__line_item_report
  • Input Column: 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp[billed_charge_local_micro]
    • Cleaning The column is cast as INT
    • Featurization The spend in regular currency is calculated from this column
    • Output Columns:
      • spend_micro: Directly mapped after casting
      • spend: Calculated by dividing by 1,000,000 and rounding to 2 decimal places
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 269. model.twitter_ads_source.stg_twitter_ads__line_item_report[spend_micro]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • spend_micro: Aggregated sum in the output
  • Input Column: 269. model.twitter_ads_source.stg_twitter_ads__line_item_report[spend]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • spend: Aggregated sum in the output
Column Lineage
%3 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp clicks 269. model.twitter_ads_source.stg_twitter_ads__line_item_report 269. model.twitter_ads_source.stg_twitter_ads__line_item_report clicks 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp:f0->269. model.twitter_ads_source.stg_twitter_ads__line_item_report:f0 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report clicks 269. model.twitter_ads_source.stg_twitter_ads__line_item_report:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0
269. model.twitter_ads_source.stg_twitter_ads__line_item_report
  • Input Column: 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp[clicks]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast to INT data type
    • Output Columns:
      • clicks: Directly mapped to the output 'clicks' column
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 269. model.twitter_ads_source.stg_twitter_ads__line_item_report[clicks]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • clicks: Aggregated sum in the output
Column Lineage
%3 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp impressions 269. model.twitter_ads_source.stg_twitter_ads__line_item_report 269. model.twitter_ads_source.stg_twitter_ads__line_item_report impressions 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp:f0->269. model.twitter_ads_source.stg_twitter_ads__line_item_report:f0 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report impressions 269. model.twitter_ads_source.stg_twitter_ads__line_item_report:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0
269. model.twitter_ads_source.stg_twitter_ads__line_item_report
  • Input Column: 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp[impressions]
    • Cleaning The column is cast to INT type
    • Direct The column is directly copied to the output without transformation
    • Output Columns:
      • impressions: Directly copied after casting
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 269. model.twitter_ads_source.stg_twitter_ads__line_item_report[impressions]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • impressions: Aggregated sum in the output
Column Lineage
%3 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp url_clicks 269. model.twitter_ads_source.stg_twitter_ads__line_item_report 269. model.twitter_ads_source.stg_twitter_ads__line_item_report url_clicks 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp:f0->269. model.twitter_ads_source.stg_twitter_ads__line_item_report:f0 256. model.twitter_ads.twitter_ads__line_item_report 256. model.twitter_ads.twitter_ads__line_item_report url_clicks 269. model.twitter_ads_source.stg_twitter_ads__line_item_report:f0->256. model.twitter_ads.twitter_ads__line_item_report:f0
269. model.twitter_ads_source.stg_twitter_ads__line_item_report
  • Input Column: 270. model.twitter_ads_source.stg_twitter_ads__line_item_report_tmp[url_clicks]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • url_clicks: Directly mapped to the output column 'url_clicks'
256. model.twitter_ads.twitter_ads__line_item_report
  • Input Column: 269. model.twitter_ads_source.stg_twitter_ads__line_item_report[url_clicks]
    • Aggregation The column is summed up in the final SELECT statement
    • Output Columns:
      • url_clicks: Aggregated sum in the output
271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history

This SQL query performs several transformations on data from a Twitter Ads source table. It casts several fields to specific data types, renames some columns, and adds a flag to identify the latest version of each promoted tweet. The query also includes a source relation field, though it's set to an empty string in this case.

CleaningDeduplicationFeaturization
SQL Query
WITH source AS (
  SELECT
    *
  FROM TEST.PUBLIC_twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp
), fields AS (
  SELECT
    CAST(NULL AS TEXT) AS approval_status,
    CAST(NULL AS TIMESTAMP) AS created_at,
    CAST(NULL AS BOOLEAN) AS deleted,
    CAST(NULL AS TEXT) AS entity_status,
    CAST(NULL AS TEXT) AS id,
    CAST(NULL AS TEXT) AS line_item_id,
    CAST(NULL AS TEXT) AS tweet_id,
    CAST(NULL AS TIMESTAMP) AS updated_at,
    CAST('' AS TEXT) AS source_relation
  FROM source
), final AS (
  SELECT
    source_relation,
    approval_status,
    created_at AS created_timestamp,
    deleted AS is_deleted,
    entity_status,
    id AS promoted_tweet_id,
    line_item_id,
    tweet_id,
    updated_at AS updated_timestamp,
    ROW_NUMBER() OVER (PARTITION BY source_relation, id ORDER BY updated_at DESC) = 1 AS is_latest_version
  FROM fields
)
SELECT
  *
FROM final
%3 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history source_relation approval_status created_timestamp is_deleted entity_status promoted_tweet_id line_item_id tweet_id updated_timestamp is_latest_version 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp approval_status created_at deleted entity_status id line_item_id tweet_id updated_at 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp:f0->271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history:f1 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp:f1->271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history:f2 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp:f2->271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history:f3 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp:f3->271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history:f4 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp:f4->271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history:f5 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp:f5->271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history:f6 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp:f6->271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history:f7 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp:f7->271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history:f8
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
approval_status text The approval status of the promoted tweet.
created_timestamp text The timestamp the account was created.
is_deleted boolean Whether the record has been deleted or not.
entity_status text The status of the promoted tweet.
promoted_tweet_id text The ID of the promoted tweet.
line_item_id text The ID of the related line item.
tweet_id bigint The ID of the related tweet.
updated_timestamp text The timestamp the account was last updated.
is_latest_version boolean Whether the record is the most latest version for the promoted tweet.
Column Lineage
%3 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history source_relation 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report source_relation 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report source_relation 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history:f0->258. model.twitter_ads.twitter_ads__url_report:f0
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history[source_relation]
    • Direct The column is directly copied without transformation
    • Integration Used as part of the join condition with other tables
    • Output Columns:
      • source_relation: Directly copied to the output
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history[source_relation]
    • Integration used to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
Column Lineage
%3 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp approval_status 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history approval_status 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp:f0->271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history:f0 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report approval_status 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0
271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history
  • Input Column: 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp[approval_status]
    • Cleaning The column is cast to TEXT data type
    • Direct The column is directly copied without transformation
    • Output Columns:
      • approval_status: Directly mapped
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history[approval_status]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • approval_status: Directly copied to the output
Column Lineage
%3 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp created_at 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history created_timestamp 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp:f0->271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history:f0 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report created_timestamp 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0
271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history
  • Input Column: 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp[created_at]
    • Cleaning The column is cast to TIMESTAMP data type
    • Direct The column is directly copied without transformation
    • Output Columns:
      • created_timestamp: Renamed and directly mapped
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history[created_timestamp]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • created_timestamp: Directly copied to the output
Column Lineage
%3 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp deleted 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history is_deleted 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp:f0->271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history:f0 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report is_deleted 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0
271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history
  • Input Column: 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp[deleted]
    • Cleaning The column is cast to BOOLEAN data type
    • Direct The column is directly copied without transformation
    • Output Columns:
      • is_deleted: Renamed and directly mapped
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history[is_deleted]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • is_deleted: Directly copied to the output
Column Lineage
%3 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp entity_status 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history entity_status 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp:f0->271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history:f0 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report promoted_tweet_status 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0
271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history
  • Input Column: 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp[entity_status]
    • Cleaning The column is cast to TEXT data type
    • Direct The column is directly copied without transformation
    • Output Columns:
      • entity_status: Directly mapped
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history[entity_status]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • promoted_tweet_status: Renamed and directly copied to the output
Column Lineage
%3 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp id 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history promoted_tweet_id 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp:f0->271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history:f0 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report promoted_tweet_id 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report promoted_tweet_id 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history:f0->258. model.twitter_ads.twitter_ads__url_report:f0
271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history
  • Input Column: 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp[id]
    • Cleaning The column is cast to TEXT data type
    • Direct The column is directly copied without transformation
    • Deduplication Used in the PARTITION BY clause of the ROW_NUMBER() function
    • Output Columns:
      • promoted_tweet_id: Renamed and directly mapped
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history[promoted_tweet_id]
    • Direct The column is directly copied without transformation
    • Integration Used as a join key with the report table
    • Output Columns:
      • promoted_tweet_id: Directly copied to the output
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history[promoted_tweet_id]
    • Integration used to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • promoted_tweet_id: directly copied
Column Lineage
%3 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp line_item_id 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history line_item_id 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp:f0->271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history:f0
271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history
  • Input Column: 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp[line_item_id]
    • Cleaning The column is cast to TEXT data type
    • Direct The column is directly copied without transformation
    • Output Columns:
      • line_item_id: Directly mapped
Column Lineage
%3 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp tweet_id 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history tweet_id 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp:f0->271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history:f0 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report tweet_id 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report tweet_id 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history:f0->258. model.twitter_ads.twitter_ads__url_report:f0
271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history
  • Input Column: 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp[tweet_id]
    • Cleaning The column is cast to TEXT data type
    • Direct The column is directly copied without transformation
    • Output Columns:
      • tweet_id: Directly mapped
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history[tweet_id]
    • Direct The column is directly copied without transformation
    • Integration Used as a join key with the tweets table
    • Output Columns:
      • tweet_id: Directly copied to the output
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history[tweet_id]
    • Integration used to join with the tweets and tweet_url tables
    • Direct directly copied to the output
    • Output Columns:
      • tweet_id: directly copied
Column Lineage
%3 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp updated_at 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history updated_timestamp 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp:f0->271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history:f0 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report updated_timestamp 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0
271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history
  • Input Column: 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp[updated_at]
    • Cleaning The column is cast to TIMESTAMP data type
    • Direct The column is directly copied without transformation
    • Deduplication Used in the ORDER BY clause of the ROW_NUMBER() function
    • Output Columns:
      • updated_timestamp: Renamed and directly mapped
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history[updated_timestamp]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • updated_timestamp: Directly copied to the output
272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of type TEXT. It's likely used as a template or placeholder for future data operations or to create a temporary table structure.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp _fivetran_synced approval_status created_at deleted entity_status id line_item_id tweet_id updated_at 373. source.twitter_ads_source.twitter_ads.promoted_tweet_history 373. source.twitter_ads_source.twitter_ads.promoted_tweet_history
Name Type Comment
_fivetran_synced text None
approval_status text None
created_at text None
deleted boolean None
entity_status text None
id text None
line_item_id text None
tweet_id bigint None
updated_at text None
Column Lineage
%3 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp approval_status 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history approval_status 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp:f0->271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history:f0 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report approval_status 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0
271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history
  • Input Column: 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp[approval_status]
    • Cleaning The column is cast to TEXT data type
    • Direct The column is directly copied without transformation
    • Output Columns:
      • approval_status: Directly mapped
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history[approval_status]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • approval_status: Directly copied to the output
Column Lineage
%3 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp created_at 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history created_timestamp 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp:f0->271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history:f0 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report created_timestamp 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0
271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history
  • Input Column: 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp[created_at]
    • Cleaning The column is cast to TIMESTAMP data type
    • Direct The column is directly copied without transformation
    • Output Columns:
      • created_timestamp: Renamed and directly mapped
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history[created_timestamp]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • created_timestamp: Directly copied to the output
Column Lineage
%3 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp deleted 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history is_deleted 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp:f0->271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history:f0 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report is_deleted 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0
271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history
  • Input Column: 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp[deleted]
    • Cleaning The column is cast to BOOLEAN data type
    • Direct The column is directly copied without transformation
    • Output Columns:
      • is_deleted: Renamed and directly mapped
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history[is_deleted]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • is_deleted: Directly copied to the output
Column Lineage
%3 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp entity_status 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history entity_status 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp:f0->271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history:f0 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report promoted_tweet_status 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0
271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history
  • Input Column: 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp[entity_status]
    • Cleaning The column is cast to TEXT data type
    • Direct The column is directly copied without transformation
    • Output Columns:
      • entity_status: Directly mapped
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history[entity_status]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • promoted_tweet_status: Renamed and directly copied to the output
Column Lineage
%3 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp id 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history promoted_tweet_id 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp:f0->271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history:f0 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report promoted_tweet_id 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report promoted_tweet_id 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history:f0->258. model.twitter_ads.twitter_ads__url_report:f0
271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history
  • Input Column: 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp[id]
    • Cleaning The column is cast to TEXT data type
    • Direct The column is directly copied without transformation
    • Deduplication Used in the PARTITION BY clause of the ROW_NUMBER() function
    • Output Columns:
      • promoted_tweet_id: Renamed and directly mapped
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history[promoted_tweet_id]
    • Direct The column is directly copied without transformation
    • Integration Used as a join key with the report table
    • Output Columns:
      • promoted_tweet_id: Directly copied to the output
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history[promoted_tweet_id]
    • Integration used to join with the report table
    • Direct directly copied to the output
    • Output Columns:
      • promoted_tweet_id: directly copied
Column Lineage
%3 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp line_item_id 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history line_item_id 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp:f0->271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history:f0
271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history
  • Input Column: 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp[line_item_id]
    • Cleaning The column is cast to TEXT data type
    • Direct The column is directly copied without transformation
    • Output Columns:
      • line_item_id: Directly mapped
Column Lineage
%3 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp tweet_id 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history tweet_id 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp:f0->271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history:f0 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report tweet_id 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report tweet_id 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history:f0->258. model.twitter_ads.twitter_ads__url_report:f0
271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history
  • Input Column: 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp[tweet_id]
    • Cleaning The column is cast to TEXT data type
    • Direct The column is directly copied without transformation
    • Output Columns:
      • tweet_id: Directly mapped
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history[tweet_id]
    • Direct The column is directly copied without transformation
    • Integration Used as a join key with the tweets table
    • Output Columns:
      • tweet_id: Directly copied to the output
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history[tweet_id]
    • Integration used to join with the tweets and tweet_url tables
    • Direct directly copied to the output
    • Output Columns:
      • tweet_id: directly copied
Column Lineage
%3 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp updated_at 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history updated_timestamp 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp:f0->271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history:f0 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report updated_timestamp 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0
271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history
  • Input Column: 272. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history_tmp[updated_at]
    • Cleaning The column is cast to TIMESTAMP data type
    • Direct The column is directly copied without transformation
    • Deduplication Used in the ORDER BY clause of the ROW_NUMBER() function
    • Output Columns:
      • updated_timestamp: Renamed and directly mapped
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 271. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_history[updated_timestamp]
    • Direct The column is directly copied without transformation
    • Output Columns:
      • updated_timestamp: Directly copied to the output
273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report

This SQL query processes data from a Twitter ads promoted tweet report. It first casts columns to specific data types, renames them, and then performs calculations on the spend data. The query truncates the date to the day level and converts the spend from micro-units to standard currency units. It doesn't filter or aggregate the data, but rather prepares it for further analysis.

CleaningFeaturization
SQL Query
WITH source AS (
  SELECT
    *
  FROM TEST.PUBLIC_twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp
), renamed AS (
  SELECT
    CAST(NULL AS TEXT) AS account_id,
    CAST(NULL AS INT) AS billed_charge_local_micro,
    CAST(NULL AS INT) AS clicks,
    CAST(NULL AS TIMESTAMP) AS date,
    CAST(NULL AS INT) AS impressions,
    CAST(NULL AS TEXT) AS placement,
    CAST(NULL AS TEXT) AS promoted_tweet_id,
    CAST(NULL AS INT) AS url_clicks,
    CAST('' AS TEXT) AS source_relation
  FROM source
), spend_calc AS (
  SELECT
    source_relation,
    DATE_TRUNC('DAY', date) AS date_day,
    account_id,
    promoted_tweet_id,
    placement,
    clicks AS clicks,
    impressions AS impressions,
    billed_charge_local_micro AS spend_micro,
    ROUND(billed_charge_local_micro / 1000000.0, 2) AS spend,
    url_clicks AS url_clicks
  FROM renamed
)
SELECT
  *
FROM spend_calc
%3 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report source_relation account_id spend_micro spend clicks date_day impressions promoted_tweet_id url_clicks placement 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp account_id billed_charge_local_micro clicks date impressions promoted_tweet_id url_clicks placement 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp:f0->273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f1 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp:f1->273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f2 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp:f1->273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f3 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp:f2->273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f4 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp:f3->273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f5 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp:f4->273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f6 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp:f5->273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f7 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp:f6->273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f8 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp:f7->273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f9
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
account_id text The ID of the related account.
spend_micro integer The spend (in micros) for the promoted tweet on that day.
spend numeric The spend for the promoted tweet on that day.
clicks integer The clicks for the promoted tweet on that day. Includes clicks on the URL (shortened or regular links), profile pic, screen name, username, detail, hashtags, and likes.
date_day timestamp without time zone The date of the performance.
impressions integer The impressions for the promoted tweet on that day. This is the number of users who see a Promoted Ad either in their home timeline or search results.
promoted_tweet_id text The ID of the related promoted tweet.
url_clicks integer The url clicks for the promoted tweet on that day.
placement text Where on Twitter the ad is being displayed. Possible values include 'ALL_ON_TWITTER', 'PUBLISHER_NETWORK', 'TWITTER_PROFILE', 'TWITTER_SEARCH', 'TWITTER_TIMELINE', and 'TAP_*', which are more granular options for `PUBLISHER_NETWORK`.
Column Lineage
%3 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report source_relation 253. model.twitter_ads.twitter_ads__account_report 253. model.twitter_ads.twitter_ads__account_report source_relation 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0->253. model.twitter_ads.twitter_ads__account_report:f0 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report source_relation 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report source_relation 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0->258. model.twitter_ads.twitter_ads__url_report:f0
253. model.twitter_ads.twitter_ads__account_report
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[source_relation]
    • Direct The column is directly copied without transformation
    • Integration Used as part of the join condition with accounts table
    • Aggregation Used in GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to output
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join conditions with other tables
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • source_relation: Directly copied to the output
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[source_relation]
    • Direct The column is directly copied without any transformation
    • Integration Used as part of the join conditions with other tables
    • Output Columns:
      • source_relation: Directly copied to the output
Column Lineage
%3 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp account_id 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report account_id 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp:f0->273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0 253. model.twitter_ads.twitter_ads__account_report 253. model.twitter_ads.twitter_ads__account_report account_id 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0->253. model.twitter_ads.twitter_ads__account_report:f0 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report account_id 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report account_id 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0->258. model.twitter_ads.twitter_ads__url_report:f0
273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report
  • Input Column: 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp[account_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the renamed CTE
    • Output Columns:
      • account_id: Directly mapped
253. model.twitter_ads.twitter_ads__account_report
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[account_id]
    • Direct The column is directly copied without transformation
    • Integration Used as the key to join with accounts table
    • Aggregation Used in GROUP BY clause
    • Output Columns:
      • account_id: Directly copied to output
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[account_id]
    • Integration Used to join with the accounts table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • account_id: Directly copied to the output
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[account_id]
    • Integration Used to join with the accounts table
    • Aggregation Part of the GROUP BY clause
    • Output Columns:
      • account_id: Directly copied to the output
Column Lineage
%3 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp billed_charge_local_micro 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report spend spend_micro 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp:f0->273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f1 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp:f0->273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0 253. model.twitter_ads.twitter_ads__account_report 253. model.twitter_ads.twitter_ads__account_report spend_micro 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f1->253. model.twitter_ads.twitter_ads__account_report:f0 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report spend_micro 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f1->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report spend_micro 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f1->258. model.twitter_ads.twitter_ads__url_report:f0
273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report
  • Input Column: 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp[billed_charge_local_micro]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT in the renamed CTE
    • Featurization Used to calculate the 'spend' column
    • Output Columns:
      • spend_micro: Directly mapped
      • spend: Transformed (divided by 1,000,000 and rounded)
253. model.twitter_ads.twitter_ads__account_report
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[spend_micro]
    • Aggregation Summed up in the rollup_report CTE and final SELECT
    • Output Columns:
      • spend_micro: Aggregated sum in output
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[spend_micro]
    • Aggregation Summed up in the final SELECT statement
    • Output Columns:
      • spend_micro: Aggregated sum in the output
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[spend_micro]
    • Aggregation Summed up in the final SELECT statement
    • Output Columns:
      • spend_micro: Aggregated sum in the output
Column Lineage
%3 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp billed_charge_local_micro 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report spend spend_micro 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp:f0->273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f1 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp:f0->273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0 253. model.twitter_ads.twitter_ads__account_report 253. model.twitter_ads.twitter_ads__account_report spend 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0->253. model.twitter_ads.twitter_ads__account_report:f0 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report spend 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report spend 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0->258. model.twitter_ads.twitter_ads__url_report:f0
273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report
  • Input Column: 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp[billed_charge_local_micro]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT in the renamed CTE
    • Featurization Used to calculate the 'spend' column
    • Output Columns:
      • spend_micro: Directly mapped
      • spend: Transformed (divided by 1,000,000 and rounded)
253. model.twitter_ads.twitter_ads__account_report
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[spend]
    • Aggregation Summed up in the rollup_report CTE and final SELECT
    • Output Columns:
      • spend: Aggregated sum in output
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[spend]
    • Aggregation Summed up in the final SELECT statement
    • Output Columns:
      • spend: Aggregated sum in the output
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[spend]
    • Aggregation Summed up in the final SELECT statement
    • Output Columns:
      • spend: Aggregated sum in the output
Column Lineage
%3 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp clicks 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report clicks 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp:f0->273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0 253. model.twitter_ads.twitter_ads__account_report 253. model.twitter_ads.twitter_ads__account_report clicks 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0->253. model.twitter_ads.twitter_ads__account_report:f0 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report clicks 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report clicks 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0->258. model.twitter_ads.twitter_ads__url_report:f0
273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report
  • Input Column: 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp[clicks]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT in the renamed CTE
    • Output Columns:
      • clicks: Directly mapped
253. model.twitter_ads.twitter_ads__account_report
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[clicks]
    • Aggregation Summed up in the rollup_report CTE and final SELECT
    • Output Columns:
      • clicks: Aggregated sum in output
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[clicks]
    • Aggregation Summed up in the final SELECT statement
    • Output Columns:
      • clicks: Aggregated sum in the output
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[clicks]
    • Aggregation Summed up in the final SELECT statement
    • Output Columns:
      • clicks: Aggregated sum in the output
Column Lineage
%3 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp date 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report date_day 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp:f0->273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0 253. model.twitter_ads.twitter_ads__account_report 253. model.twitter_ads.twitter_ads__account_report date_day 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0->253. model.twitter_ads.twitter_ads__account_report:f0 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report date_day 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report date_day 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0->258. model.twitter_ads.twitter_ads__url_report:f0
273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report
  • Input Column: 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp[date]
    • Cleaning The column is cast as TIMESTAMP in the renamed CTE
    • Featurization The date is truncated to the day level
    • Output Columns:
      • date_day: Transformed (truncated to day)
253. model.twitter_ads.twitter_ads__account_report
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[date_day]
    • Direct The column is directly copied without transformation
    • Aggregation Used in GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to output
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Part of the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp impressions 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report impressions 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp:f0->273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0 253. model.twitter_ads.twitter_ads__account_report 253. model.twitter_ads.twitter_ads__account_report impressions 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0->253. model.twitter_ads.twitter_ads__account_report:f0 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report impressions 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report impressions 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0->258. model.twitter_ads.twitter_ads__url_report:f0
273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report
  • Input Column: 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp[impressions]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT in the renamed CTE
    • Output Columns:
      • impressions: Directly mapped
253. model.twitter_ads.twitter_ads__account_report
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[impressions]
    • Aggregation Summed up in the rollup_report CTE and final SELECT
    • Output Columns:
      • impressions: Aggregated sum in output
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[impressions]
    • Aggregation Summed up in the final SELECT statement
    • Output Columns:
      • impressions: Aggregated sum in the output
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[impressions]
    • Aggregation Summed up in the final SELECT statement
    • Output Columns:
      • impressions: Aggregated sum in the output
Column Lineage
%3 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp promoted_tweet_id 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report promoted_tweet_id 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp:f0->273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report promoted_tweet_id 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report promoted_tweet_id 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0->258. model.twitter_ads.twitter_ads__url_report:f0
273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report
  • Input Column: 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp[promoted_tweet_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the renamed CTE
    • Output Columns:
      • promoted_tweet_id: Directly mapped
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[promoted_tweet_id]
    • Integration Used to join with the promoted_tweets table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • promoted_tweet_id: Directly copied to the output
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[promoted_tweet_id]
    • Integration Used to join with the promoted_tweets table
    • Aggregation Part of the GROUP BY clause
    • Output Columns:
      • promoted_tweet_id: Directly copied to the output
Column Lineage
%3 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp url_clicks 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report url_clicks 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp:f0->273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0 253. model.twitter_ads.twitter_ads__account_report 253. model.twitter_ads.twitter_ads__account_report url_clicks 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0->253. model.twitter_ads.twitter_ads__account_report:f0 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report url_clicks 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report url_clicks 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0->258. model.twitter_ads.twitter_ads__url_report:f0
273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report
  • Input Column: 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp[url_clicks]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT in the renamed CTE
    • Output Columns:
      • url_clicks: Directly mapped
253. model.twitter_ads.twitter_ads__account_report
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[url_clicks]
    • Aggregation Summed up in the rollup_report CTE and final SELECT
    • Output Columns:
      • url_clicks: Aggregated sum in output
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[url_clicks]
    • Aggregation Summed up in the final SELECT statement
    • Output Columns:
      • url_clicks: Aggregated sum in the output
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[url_clicks]
    • Aggregation Summed up in the final SELECT statement
    • Output Columns:
      • url_clicks: Aggregated sum in the output
Column Lineage
%3 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp placement 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report placement 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp:f0->273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0 253. model.twitter_ads.twitter_ads__account_report 253. model.twitter_ads.twitter_ads__account_report placement 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0->253. model.twitter_ads.twitter_ads__account_report:f0 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report placement 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report placement 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0->258. model.twitter_ads.twitter_ads__url_report:f0
273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report
  • Input Column: 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp[placement]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the renamed CTE
    • Output Columns:
      • placement: Directly mapped
253. model.twitter_ads.twitter_ads__account_report
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[placement]
    • Direct The column is directly copied without transformation
    • Aggregation Used in GROUP BY clause
    • Output Columns:
      • placement: Directly copied to output
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[placement]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • placement: Directly copied to the output
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[placement]
    • Direct The column is directly copied without any transformation
    • Aggregation Part of the GROUP BY clause
    • Output Columns:
      • placement: Directly copied to the output
274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of type TEXT. It's likely used as a placeholder or template for a staging table in a dbt (data build tool) project, specifically for Twitter ads promoted tweet reports.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp _fivetran_synced account_id billed_charge_local_micro clicks date impressions promoted_tweet_id url_clicks placement 374. source.twitter_ads_source.twitter_ads.promoted_tweet_report 374. source.twitter_ads_source.twitter_ads.promoted_tweet_report
Name Type Comment
_fivetran_synced text None
account_id text None
billed_charge_local_micro integer None
clicks integer None
date timestamp without time zone None
impressions integer None
promoted_tweet_id text None
url_clicks integer None
placement text None
Column Lineage
%3 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp account_id 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report account_id 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp:f0->273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0 253. model.twitter_ads.twitter_ads__account_report 253. model.twitter_ads.twitter_ads__account_report account_id 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0->253. model.twitter_ads.twitter_ads__account_report:f0 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report account_id 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report account_id 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0->258. model.twitter_ads.twitter_ads__url_report:f0
273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report
  • Input Column: 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp[account_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the renamed CTE
    • Output Columns:
      • account_id: Directly mapped
253. model.twitter_ads.twitter_ads__account_report
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[account_id]
    • Direct The column is directly copied without transformation
    • Integration Used as the key to join with accounts table
    • Aggregation Used in GROUP BY clause
    • Output Columns:
      • account_id: Directly copied to output
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[account_id]
    • Integration Used to join with the accounts table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • account_id: Directly copied to the output
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[account_id]
    • Integration Used to join with the accounts table
    • Aggregation Part of the GROUP BY clause
    • Output Columns:
      • account_id: Directly copied to the output
Column Lineage
%3 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp billed_charge_local_micro 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report spend spend_micro 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp:f0->273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f1 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp:f0->273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0 253. model.twitter_ads.twitter_ads__account_report 253. model.twitter_ads.twitter_ads__account_report spend spend_micro 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f1->253. model.twitter_ads.twitter_ads__account_report:f1 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0->253. model.twitter_ads.twitter_ads__account_report:f0 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report spend spend_micro 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f1->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f1 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report spend spend_micro 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f1->258. model.twitter_ads.twitter_ads__url_report:f1 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0->258. model.twitter_ads.twitter_ads__url_report:f0
273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report
  • Input Column: 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp[billed_charge_local_micro]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT in the renamed CTE
    • Featurization Used to calculate the 'spend' column
    • Output Columns:
      • spend_micro: Directly mapped
      • spend: Transformed (divided by 1,000,000 and rounded)
253. model.twitter_ads.twitter_ads__account_report
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[spend_micro]
    • Aggregation Summed up in the rollup_report CTE and final SELECT
    • Output Columns:
      • spend_micro: Aggregated sum in output
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[spend]
    • Aggregation Summed up in the rollup_report CTE and final SELECT
    • Output Columns:
      • spend: Aggregated sum in output
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[spend_micro]
    • Aggregation Summed up in the final SELECT statement
    • Output Columns:
      • spend_micro: Aggregated sum in the output
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[spend]
    • Aggregation Summed up in the final SELECT statement
    • Output Columns:
      • spend: Aggregated sum in the output
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[spend_micro]
    • Aggregation Summed up in the final SELECT statement
    • Output Columns:
      • spend_micro: Aggregated sum in the output
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[spend]
    • Aggregation Summed up in the final SELECT statement
    • Output Columns:
      • spend: Aggregated sum in the output
Column Lineage
%3 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp clicks 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report clicks 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp:f0->273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0 253. model.twitter_ads.twitter_ads__account_report 253. model.twitter_ads.twitter_ads__account_report clicks 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0->253. model.twitter_ads.twitter_ads__account_report:f0 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report clicks 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report clicks 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0->258. model.twitter_ads.twitter_ads__url_report:f0
273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report
  • Input Column: 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp[clicks]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT in the renamed CTE
    • Output Columns:
      • clicks: Directly mapped
253. model.twitter_ads.twitter_ads__account_report
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[clicks]
    • Aggregation Summed up in the rollup_report CTE and final SELECT
    • Output Columns:
      • clicks: Aggregated sum in output
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[clicks]
    • Aggregation Summed up in the final SELECT statement
    • Output Columns:
      • clicks: Aggregated sum in the output
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[clicks]
    • Aggregation Summed up in the final SELECT statement
    • Output Columns:
      • clicks: Aggregated sum in the output
Column Lineage
%3 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp date 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report date_day 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp:f0->273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0 253. model.twitter_ads.twitter_ads__account_report 253. model.twitter_ads.twitter_ads__account_report date_day 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0->253. model.twitter_ads.twitter_ads__account_report:f0 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report date_day 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report date_day 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0->258. model.twitter_ads.twitter_ads__url_report:f0
273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report
  • Input Column: 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp[date]
    • Cleaning The column is cast as TIMESTAMP in the renamed CTE
    • Featurization The date is truncated to the day level
    • Output Columns:
      • date_day: Transformed (truncated to day)
253. model.twitter_ads.twitter_ads__account_report
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[date_day]
    • Direct The column is directly copied without transformation
    • Aggregation Used in GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to output
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[date_day]
    • Direct The column is directly copied without any transformation
    • Aggregation Part of the GROUP BY clause
    • Output Columns:
      • date_day: Directly copied to the output
Column Lineage
%3 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp impressions 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report impressions 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp:f0->273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0 253. model.twitter_ads.twitter_ads__account_report 253. model.twitter_ads.twitter_ads__account_report impressions 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0->253. model.twitter_ads.twitter_ads__account_report:f0 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report impressions 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report impressions 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0->258. model.twitter_ads.twitter_ads__url_report:f0
273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report
  • Input Column: 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp[impressions]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT in the renamed CTE
    • Output Columns:
      • impressions: Directly mapped
253. model.twitter_ads.twitter_ads__account_report
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[impressions]
    • Aggregation Summed up in the rollup_report CTE and final SELECT
    • Output Columns:
      • impressions: Aggregated sum in output
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[impressions]
    • Aggregation Summed up in the final SELECT statement
    • Output Columns:
      • impressions: Aggregated sum in the output
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[impressions]
    • Aggregation Summed up in the final SELECT statement
    • Output Columns:
      • impressions: Aggregated sum in the output
Column Lineage
%3 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp promoted_tweet_id 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report promoted_tweet_id 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp:f0->273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report promoted_tweet_id 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report promoted_tweet_id 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0->258. model.twitter_ads.twitter_ads__url_report:f0
273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report
  • Input Column: 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp[promoted_tweet_id]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the renamed CTE
    • Output Columns:
      • promoted_tweet_id: Directly mapped
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[promoted_tweet_id]
    • Integration Used to join with the promoted_tweets table
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • promoted_tweet_id: Directly copied to the output
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[promoted_tweet_id]
    • Integration Used to join with the promoted_tweets table
    • Aggregation Part of the GROUP BY clause
    • Output Columns:
      • promoted_tweet_id: Directly copied to the output
Column Lineage
%3 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp url_clicks 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report url_clicks 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp:f0->273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0 253. model.twitter_ads.twitter_ads__account_report 253. model.twitter_ads.twitter_ads__account_report url_clicks 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0->253. model.twitter_ads.twitter_ads__account_report:f0 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report url_clicks 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report url_clicks 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0->258. model.twitter_ads.twitter_ads__url_report:f0
273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report
  • Input Column: 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp[url_clicks]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as INT in the renamed CTE
    • Output Columns:
      • url_clicks: Directly mapped
253. model.twitter_ads.twitter_ads__account_report
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[url_clicks]
    • Aggregation Summed up in the rollup_report CTE and final SELECT
    • Output Columns:
      • url_clicks: Aggregated sum in output
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[url_clicks]
    • Aggregation Summed up in the final SELECT statement
    • Output Columns:
      • url_clicks: Aggregated sum in the output
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[url_clicks]
    • Aggregation Summed up in the final SELECT statement
    • Output Columns:
      • url_clicks: Aggregated sum in the output
Column Lineage
%3 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp placement 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report placement 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp:f0->273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0 253. model.twitter_ads.twitter_ads__account_report 253. model.twitter_ads.twitter_ads__account_report placement 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0->253. model.twitter_ads.twitter_ads__account_report:f0 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report placement 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report placement 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report:f0->258. model.twitter_ads.twitter_ads__url_report:f0
273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report
  • Input Column: 274. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report_tmp[placement]
    • Direct The column is directly copied without any transformation
    • Cleaning The column is cast as TEXT in the renamed CTE
    • Output Columns:
      • placement: Directly mapped
253. model.twitter_ads.twitter_ads__account_report
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[placement]
    • Direct The column is directly copied without transformation
    • Aggregation Used in GROUP BY clause
    • Output Columns:
      • placement: Directly copied to output
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[placement]
    • Direct The column is directly copied without any transformation
    • Aggregation Used in the GROUP BY clause
    • Output Columns:
      • placement: Directly copied to the output
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 273. model.twitter_ads_source.stg_twitter_ads__promoted_tweet_report[placement]
    • Direct The column is directly copied without any transformation
    • Aggregation Part of the GROUP BY clause
    • Output Columns:
      • placement: Directly copied to the output
275. model.twitter_ads_source.stg_twitter_ads__tweet

This SQL query performs a basic data transformation on the 'stg_twitter_ads__tweet_tmp' table. It casts several columns to TEXT type with NULL or empty string values, renames some columns, and selects a subset of columns for the final output. The query doesn't filter, aggregate, or integrate data from multiple sources.

CleaningOther
SQL Query
WITH base AS (
  SELECT
    *
  FROM TEST.PUBLIC_twitter_ads_source.stg_twitter_ads__tweet_tmp
), fields AS (
  SELECT
    CAST(NULL AS TEXT) AS account_id,
    CAST(NULL AS TEXT) AS full_text,
    CAST(NULL AS TEXT) AS id,
    CAST(NULL AS TEXT) AS lang,
    CAST(NULL AS TEXT) AS name,
    CAST('' AS TEXT) AS source_relation
  FROM base
), final AS (
  SELECT
    source_relation,
    account_id,
    id AS tweet_id,
    name,
    full_text,
    lang AS language
  FROM fields
)
SELECT
  *
FROM final
%3 275. model.twitter_ads_source.stg_twitter_ads__tweet 275. model.twitter_ads_source.stg_twitter_ads__tweet source_relation account_id tweet_id name full_text language 276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp 276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp id account_id full_text lang name 276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp:f0->275. model.twitter_ads_source.stg_twitter_ads__tweet:f2 276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp:f1->275. model.twitter_ads_source.stg_twitter_ads__tweet:f1 276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp:f2->275. model.twitter_ads_source.stg_twitter_ads__tweet:f4 276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp:f3->275. model.twitter_ads_source.stg_twitter_ads__tweet:f5 276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp:f4->275. model.twitter_ads_source.stg_twitter_ads__tweet:f3
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
account_id text The ID of the related account.
tweet_id integer Unique identifier of the tweet.
name integer If provided, the non-public title of the tweet.
full_text text Full text of the tweet's content.
language text Two-letter language code of the tweet.
Column Lineage
%3 275. model.twitter_ads_source.stg_twitter_ads__tweet 275. model.twitter_ads_source.stg_twitter_ads__tweet source_relation 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report source_relation 275. model.twitter_ads_source.stg_twitter_ads__tweet:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report source_relation 275. model.twitter_ads_source.stg_twitter_ads__tweet:f0->258. model.twitter_ads.twitter_ads__url_report:f0
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 275. model.twitter_ads_source.stg_twitter_ads__tweet[source_relation]
    • Integration used to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 275. model.twitter_ads_source.stg_twitter_ads__tweet[source_relation]
    • Integration used to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
Column Lineage
%3 276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp 276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp account_id 275. model.twitter_ads_source.stg_twitter_ads__tweet 275. model.twitter_ads_source.stg_twitter_ads__tweet account_id 276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp:f0->275. model.twitter_ads_source.stg_twitter_ads__tweet:f0
275. model.twitter_ads_source.stg_twitter_ads__tweet
  • Input Column: 276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp[account_id]
    • Cleaning The column is cast to TEXT type and set to NULL
    • Output Columns:
      • account_id: Mapped after casting to TEXT and set to NULL
Column Lineage
%3 276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp 276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp id 275. model.twitter_ads_source.stg_twitter_ads__tweet 275. model.twitter_ads_source.stg_twitter_ads__tweet tweet_id 276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp:f0->275. model.twitter_ads_source.stg_twitter_ads__tweet:f0 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report tweet_id 275. model.twitter_ads_source.stg_twitter_ads__tweet:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report tweet_id 275. model.twitter_ads_source.stg_twitter_ads__tweet:f0->258. model.twitter_ads.twitter_ads__url_report:f0
275. model.twitter_ads_source.stg_twitter_ads__tweet
  • Input Column: 276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp[id]
    • Cleaning The column is cast to TEXT type
    • Direct The column is directly copied after casting
    • Output Columns:
      • tweet_id: Directly mapped after casting to TEXT
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 275. model.twitter_ads_source.stg_twitter_ads__tweet[tweet_id]
    • Integration used to join with promoted_tweets table
    • Output Columns:
      • tweet_id: directly copied after joining
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 275. model.twitter_ads_source.stg_twitter_ads__tweet[tweet_id]
    • Integration used to join with other tables
    • Output Columns:
      • tweet_id: directly copied
Column Lineage
%3 276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp 276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp name 275. model.twitter_ads_source.stg_twitter_ads__tweet 275. model.twitter_ads_source.stg_twitter_ads__tweet name 276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp:f0->275. model.twitter_ads_source.stg_twitter_ads__tweet:f0 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report tweet_name 275. model.twitter_ads_source.stg_twitter_ads__tweet:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report tweet_name 275. model.twitter_ads_source.stg_twitter_ads__tweet:f0->258. model.twitter_ads.twitter_ads__url_report:f0
275. model.twitter_ads_source.stg_twitter_ads__tweet
  • Input Column: 276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp[name]
    • Cleaning The column is cast to TEXT type and potentially set to NULL.
    • Output Columns:
      • name: It is directly mapped to the 'name' output column after casting.
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 275. model.twitter_ads_source.stg_twitter_ads__tweet[name]
    • Direct directly copied to the output
    • Output Columns:
      • tweet_name: directly copied
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 275. model.twitter_ads_source.stg_twitter_ads__tweet[name]
    • Direct directly copied to the output
    • Output Columns:
      • tweet_name: directly copied
Column Lineage
%3 276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp 276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp full_text 275. model.twitter_ads_source.stg_twitter_ads__tweet 275. model.twitter_ads_source.stg_twitter_ads__tweet full_text 276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp:f0->275. model.twitter_ads_source.stg_twitter_ads__tweet:f0 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report full_text 275. model.twitter_ads_source.stg_twitter_ads__tweet:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report tweet_full_text 275. model.twitter_ads_source.stg_twitter_ads__tweet:f0->258. model.twitter_ads.twitter_ads__url_report:f0
275. model.twitter_ads_source.stg_twitter_ads__tweet
  • Input Column: 276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp[full_text]
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • full_text: It is directly mapped to the output 'full_text' column
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 275. model.twitter_ads_source.stg_twitter_ads__tweet[full_text]
    • Direct directly copied to the output
    • Output Columns:
      • full_text: directly copied
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 275. model.twitter_ads_source.stg_twitter_ads__tweet[full_text]
    • Direct directly copied to the output
    • Output Columns:
      • tweet_full_text: directly copied
Column Lineage
%3 276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp 276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp lang 275. model.twitter_ads_source.stg_twitter_ads__tweet 275. model.twitter_ads_source.stg_twitter_ads__tweet language 276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp:f0->275. model.twitter_ads_source.stg_twitter_ads__tweet:f0 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report language 275. model.twitter_ads_source.stg_twitter_ads__tweet:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0
275. model.twitter_ads_source.stg_twitter_ads__tweet
  • Input Column: 276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp[lang]
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • language: It is mapped to the output 'language' column
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 275. model.twitter_ads_source.stg_twitter_ads__tweet[language]
    • Direct directly copied to the output
    • Output Columns:
      • language: directly copied
276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of type TEXT, which is set to NULL. The LIMIT 0 clause ensures no rows are returned. This type of query is often used as a placeholder or to define a schema structure without actually populating data.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp 276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp id _fivetran_synced account_id card_uri coordinates_coordinates coordinates_type created_at favorite_count favorited followers full_text geo_coordinates geo_type in_reply_to_screen_name in_reply_to_status_id in_reply_to_user_id lang media_key retweet_count retweeted source truncated tweet_type user_id name 375. source.twitter_ads_source.twitter_ads.tweet 375. source.twitter_ads_source.twitter_ads.tweet
Name Type Comment
id integer None
_fivetran_synced text None
account_id text None
card_uri integer None
coordinates_coordinates integer None
coordinates_type integer None
created_at text None
favorite_count integer None
favorited boolean None
followers integer None
full_text text None
geo_coordinates integer None
geo_type integer None
in_reply_to_screen_name integer None
in_reply_to_status_id integer None
in_reply_to_user_id integer None
lang text None
media_key integer None
retweet_count integer None
retweeted boolean None
source text None
truncated boolean None
tweet_type text None
user_id integer None
name integer None
Column Lineage
%3 276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp 276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp id 275. model.twitter_ads_source.stg_twitter_ads__tweet 275. model.twitter_ads_source.stg_twitter_ads__tweet tweet_id 276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp:f0->275. model.twitter_ads_source.stg_twitter_ads__tweet:f0 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report tweet_id 275. model.twitter_ads_source.stg_twitter_ads__tweet:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report tweet_id 275. model.twitter_ads_source.stg_twitter_ads__tweet:f0->258. model.twitter_ads.twitter_ads__url_report:f0
275. model.twitter_ads_source.stg_twitter_ads__tweet
  • Input Column: 276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp[id]
    • Cleaning The column is cast to TEXT type
    • Direct The column is directly copied after casting
    • Output Columns:
      • tweet_id: Directly mapped after casting to TEXT
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 275. model.twitter_ads_source.stg_twitter_ads__tweet[tweet_id]
    • Integration used to join with promoted_tweets table
    • Output Columns:
      • tweet_id: directly copied after joining
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 275. model.twitter_ads_source.stg_twitter_ads__tweet[tweet_id]
    • Integration used to join with other tables
    • Output Columns:
      • tweet_id: directly copied
Column Lineage
%3 276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp 276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp account_id 275. model.twitter_ads_source.stg_twitter_ads__tweet 275. model.twitter_ads_source.stg_twitter_ads__tweet account_id 276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp:f0->275. model.twitter_ads_source.stg_twitter_ads__tweet:f0
275. model.twitter_ads_source.stg_twitter_ads__tweet
  • Input Column: 276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp[account_id]
    • Cleaning The column is cast to TEXT type and set to NULL
    • Output Columns:
      • account_id: Mapped after casting to TEXT and set to NULL
Column Lineage
%3 276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp 276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp full_text 275. model.twitter_ads_source.stg_twitter_ads__tweet 275. model.twitter_ads_source.stg_twitter_ads__tweet full_text 276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp:f0->275. model.twitter_ads_source.stg_twitter_ads__tweet:f0 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report full_text 275. model.twitter_ads_source.stg_twitter_ads__tweet:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report tweet_full_text 275. model.twitter_ads_source.stg_twitter_ads__tweet:f0->258. model.twitter_ads.twitter_ads__url_report:f0
275. model.twitter_ads_source.stg_twitter_ads__tweet
  • Input Column: 276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp[full_text]
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • full_text: It is directly mapped to the output 'full_text' column
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 275. model.twitter_ads_source.stg_twitter_ads__tweet[full_text]
    • Direct directly copied to the output
    • Output Columns:
      • full_text: directly copied
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 275. model.twitter_ads_source.stg_twitter_ads__tweet[full_text]
    • Direct directly copied to the output
    • Output Columns:
      • tweet_full_text: directly copied
Column Lineage
%3 276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp 276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp lang 275. model.twitter_ads_source.stg_twitter_ads__tweet 275. model.twitter_ads_source.stg_twitter_ads__tweet language 276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp:f0->275. model.twitter_ads_source.stg_twitter_ads__tweet:f0 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report language 275. model.twitter_ads_source.stg_twitter_ads__tweet:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0
275. model.twitter_ads_source.stg_twitter_ads__tweet
  • Input Column: 276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp[lang]
    • Cleaning The column is cast to TEXT type
    • Output Columns:
      • language: It is mapped to the output 'language' column
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 275. model.twitter_ads_source.stg_twitter_ads__tweet[language]
    • Direct directly copied to the output
    • Output Columns:
      • language: directly copied
Column Lineage
%3 276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp 276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp name 275. model.twitter_ads_source.stg_twitter_ads__tweet 275. model.twitter_ads_source.stg_twitter_ads__tweet name 276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp:f0->275. model.twitter_ads_source.stg_twitter_ads__tweet:f0 257. model.twitter_ads.twitter_ads__promoted_tweet_report 257. model.twitter_ads.twitter_ads__promoted_tweet_report tweet_name 275. model.twitter_ads_source.stg_twitter_ads__tweet:f0->257. model.twitter_ads.twitter_ads__promoted_tweet_report:f0 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report tweet_name 275. model.twitter_ads_source.stg_twitter_ads__tweet:f0->258. model.twitter_ads.twitter_ads__url_report:f0
275. model.twitter_ads_source.stg_twitter_ads__tweet
  • Input Column: 276. model.twitter_ads_source.stg_twitter_ads__tweet_tmp[name]
    • Cleaning The column is cast to TEXT type and potentially set to NULL.
    • Output Columns:
      • name: It is directly mapped to the 'name' output column after casting.
257. model.twitter_ads.twitter_ads__promoted_tweet_report
  • Input Column: 275. model.twitter_ads_source.stg_twitter_ads__tweet[name]
    • Direct directly copied to the output
    • Output Columns:
      • tweet_name: directly copied
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 275. model.twitter_ads_source.stg_twitter_ads__tweet[name]
    • Direct directly copied to the output
    • Output Columns:
      • tweet_name: directly copied
277. model.twitter_ads_source.stg_twitter_ads__tweet_url

This SQL query processes Twitter ad data, specifically focusing on tweet URLs. It starts by casting fields to specific data types, then performs extensive URL parsing and analysis. The query extracts various components from the expanded URL, including the base URL, host, path, and UTM parameters (source, medium, campaign, content, and term). This transformation and feature extraction from URL data can be valuable for analyzing the effectiveness and reach of Twitter ad campaigns.

CleaningFeaturization
SQL Query
WITH source AS (
  SELECT
    *
  FROM TEST.PUBLIC_twitter_ads_source.stg_twitter_ads__tweet_url_tmp
), fields AS (
  SELECT
    CAST(NULL AS TEXT) AS display_url,
    CAST(NULL AS TEXT) AS expanded_url,
    CAST(NULL AS INT) AS index,
    CAST(NULL AS TEXT) AS indices,
    CAST(NULL AS TEXT) AS tweet_id,
    CAST(NULL AS TEXT) AS url,
    CAST('' AS TEXT) AS source_relation
  FROM source
), final AS (
  SELECT
    source_relation,
    display_url,
    expanded_url,
    index,
    indices,
    tweet_id,
    url,
    SPLIT_PART(expanded_url, '?', 1) AS base_url,
    TRY_CAST(SPLIT_PART(
      SPLIT_PART(
        REPLACE(REPLACE(REPLACE(expanded_url, 'android-app://', ''), 'http://', ''), 'https://', ''),
        '/',
        1
      ),
      '?',
      1
    ) AS TEXT) AS url_host,
    '/' || TRY_CAST(SPLIT_PART(
      CASE
        WHEN LENGTH(REPLACE(REPLACE(expanded_url, 'http://', ''), 'https://', '')) - COALESCE(
          NULLIF(
            STR_POSITION(REPLACE(REPLACE(expanded_url, 'http://', ''), 'https://', ''), '/'),
            0
          ),
          STR_POSITION(REPLACE(REPLACE(expanded_url, 'http://', ''), 'https://', ''), '?') - 1
        ) = 0
        THEN ''
        ELSE RIGHT(
          REPLACE(REPLACE(expanded_url, 'http://', ''), 'https://', ''),
          LENGTH(REPLACE(REPLACE(expanded_url, 'http://', ''), 'https://', '')) - COALESCE(
            NULLIF(
              STR_POSITION(REPLACE(REPLACE(expanded_url, 'http://', ''), 'https://', ''), '/'),
              0
            ),
            STR_POSITION(REPLACE(REPLACE(expanded_url, 'http://', ''), 'https://', ''), '?') - 1
          )
        )
      END,
      '?',
      1
    ) AS TEXT) AS url_path,
    NULLIF(SPLIT_PART(SPLIT_PART(expanded_url, 'utm_source=', 2), '&', 1), '') AS utm_source,
    NULLIF(SPLIT_PART(SPLIT_PART(expanded_url, 'utm_medium=', 2), '&', 1), '') AS utm_medium,
    NULLIF(SPLIT_PART(SPLIT_PART(expanded_url, 'utm_campaign=', 2), '&', 1), '') AS utm_campaign,
    NULLIF(SPLIT_PART(SPLIT_PART(expanded_url, 'utm_content=', 2), '&', 1), '') AS utm_content,
    NULLIF(SPLIT_PART(SPLIT_PART(expanded_url, 'utm_term=', 2), '&', 1), '') AS utm_term
  FROM fields
)
SELECT
  *
FROM final
%3 277. model.twitter_ads_source.stg_twitter_ads__tweet_url 277. model.twitter_ads_source.stg_twitter_ads__tweet_url source_relation display_url expanded_url index indices tweet_id url base_url url_host url_path utm_source utm_medium utm_campaign utm_content utm_term 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp display_url expanded_url index indices tweet_id url 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f1 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f1->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f2 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f1->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f7 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f1->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f8 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f1->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f9 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f1->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f10 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f1->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f11 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f1->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f12 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f1->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f13 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f1->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f14 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f2->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f3 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f3->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f4 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f4->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f5 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f5->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f6
Name Type Comment
source_relation text The source of the record if the unioning functionality is being used. If not this field will be empty.
display_url text The URL as it will be displayed.
expanded_url text The fully expanded URL.
index integer The index of the URL within the tweet (ie if there are multiple URLs)
indices text The start and end point of where the URL is placed in the tweet text.
tweet_id bigint The ID of the related tweet.
url text The 't.co' shortened URL.
base_url text The base URL of the ad, extracted from the `expanded_url`.
url_host text The URL host of the ad, extracted from the `expanded_url`.
url_path text The URL path of the ad, extracted from the `expanded_url`.
utm_source text The utm_source parameter of the ad, extracted from the `expanded_url`.
utm_medium text The utm_medium parameter of the ad, extracted from the `expanded_url`.
utm_campaign text The utm_campaign parameter of the ad, extracted from the `expanded_url`.
utm_content text The utm_content parameter of the ad, extracted from the `expanded_url`.
utm_term text The utm_term parameter of the ad, extracted from the `expanded_url`.
Column Lineage
%3 277. model.twitter_ads_source.stg_twitter_ads__tweet_url 277. model.twitter_ads_source.stg_twitter_ads__tweet_url source_relation 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report source_relation 277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f0->258. model.twitter_ads.twitter_ads__url_report:f0
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 277. model.twitter_ads_source.stg_twitter_ads__tweet_url[source_relation]
    • Integration used to join with other tables
    • Direct directly copied to the output
    • Output Columns:
      • source_relation: directly copied
Column Lineage
%3 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp display_url 277. model.twitter_ads_source.stg_twitter_ads__tweet_url 277. model.twitter_ads_source.stg_twitter_ads__tweet_url display_url 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f0 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report display_url 277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f0->258. model.twitter_ads.twitter_ads__url_report:f0
277. model.twitter_ads_source.stg_twitter_ads__tweet_url
  • Input Column: 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp[display_url]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • display_url: Directly copied to the output
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 277. model.twitter_ads_source.stg_twitter_ads__tweet_url[display_url]
    • Direct directly copied to the output
    • Output Columns:
      • display_url: directly copied
Column Lineage
%3 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp expanded_url 277. model.twitter_ads_source.stg_twitter_ads__tweet_url 277. model.twitter_ads_source.stg_twitter_ads__tweet_url base_url expanded_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f1 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f0 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f2 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f3 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f7 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f6 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f4 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f5 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f8 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report expanded_url 277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f1->258. model.twitter_ads.twitter_ads__url_report:f0
277. model.twitter_ads_source.stg_twitter_ads__tweet_url
  • Input Column: 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp[expanded_url]
    • Direct The column is directly copied without any transformation
    • Featurization Multiple features are extracted from this column
    • Output Columns:
      • expanded_url: Directly copied to the output
      • base_url: Extracted by splitting on '?'
      • url_host: Extracted by complex string manipulation and splitting
      • url_path: Extracted by complex string manipulation and splitting
      • utm_source: Extracted by splitting on 'utm_source=' and '&'
      • utm_medium: Extracted by splitting on 'utm_medium=' and '&'
      • utm_campaign: Extracted by splitting on 'utm_campaign=' and '&'
      • utm_content: Extracted by splitting on 'utm_content=' and '&'
      • utm_term: Extracted by splitting on 'utm_term=' and '&'
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 277. model.twitter_ads_source.stg_twitter_ads__tweet_url[expanded_url]
    • Filtering used in WHERE clause to filter non-null values
    • Direct directly copied to the output
    • Output Columns:
      • expanded_url: directly copied
Column Lineage
%3 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp index 277. model.twitter_ads_source.stg_twitter_ads__tweet_url 277. model.twitter_ads_source.stg_twitter_ads__tweet_url index 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f0
277. model.twitter_ads_source.stg_twitter_ads__tweet_url
  • Input Column: 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp[index]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • index: Directly copied to the output
Column Lineage
%3 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp indices 277. model.twitter_ads_source.stg_twitter_ads__tweet_url 277. model.twitter_ads_source.stg_twitter_ads__tweet_url indices 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f0
277. model.twitter_ads_source.stg_twitter_ads__tweet_url
  • Input Column: 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp[indices]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • indices: Directly copied to the output
Column Lineage
%3 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp tweet_id 277. model.twitter_ads_source.stg_twitter_ads__tweet_url 277. model.twitter_ads_source.stg_twitter_ads__tweet_url tweet_id 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f0
277. model.twitter_ads_source.stg_twitter_ads__tweet_url
  • Input Column: 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp[tweet_id]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • tweet_id: Directly copied to the output
Column Lineage
%3 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp url 277. model.twitter_ads_source.stg_twitter_ads__tweet_url 277. model.twitter_ads_source.stg_twitter_ads__tweet_url url 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f0
277. model.twitter_ads_source.stg_twitter_ads__tweet_url
  • Input Column: 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp[url]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • url: Directly copied to the output
Column Lineage
%3 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp expanded_url 277. model.twitter_ads_source.stg_twitter_ads__tweet_url 277. model.twitter_ads_source.stg_twitter_ads__tweet_url base_url expanded_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f1 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f0 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f2 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f3 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f7 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f6 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f4 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f5 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f8 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report base_url 277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f0->258. model.twitter_ads.twitter_ads__url_report:f0
277. model.twitter_ads_source.stg_twitter_ads__tweet_url
  • Input Column: 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp[expanded_url]
    • Direct The column is directly copied without any transformation
    • Featurization Multiple features are extracted from this column
    • Output Columns:
      • expanded_url: Directly copied to the output
      • base_url: Extracted by splitting on '?'
      • url_host: Extracted by complex string manipulation and splitting
      • url_path: Extracted by complex string manipulation and splitting
      • utm_source: Extracted by splitting on 'utm_source=' and '&'
      • utm_medium: Extracted by splitting on 'utm_medium=' and '&'
      • utm_campaign: Extracted by splitting on 'utm_campaign=' and '&'
      • utm_content: Extracted by splitting on 'utm_content=' and '&'
      • utm_term: Extracted by splitting on 'utm_term=' and '&'
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 277. model.twitter_ads_source.stg_twitter_ads__tweet_url[base_url]
    • Direct directly copied to the output
    • Output Columns:
      • base_url: directly copied
Column Lineage
%3 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp expanded_url 277. model.twitter_ads_source.stg_twitter_ads__tweet_url 277. model.twitter_ads_source.stg_twitter_ads__tweet_url base_url expanded_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f1 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f0 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f2 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f3 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f7 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f6 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f4 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f5 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f8 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report url_host 277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f2->258. model.twitter_ads.twitter_ads__url_report:f0
277. model.twitter_ads_source.stg_twitter_ads__tweet_url
  • Input Column: 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp[expanded_url]
    • Direct The column is directly copied without any transformation
    • Featurization Multiple features are extracted from this column
    • Output Columns:
      • expanded_url: Directly copied to the output
      • base_url: Extracted by splitting on '?'
      • url_host: Extracted by complex string manipulation and splitting
      • url_path: Extracted by complex string manipulation and splitting
      • utm_source: Extracted by splitting on 'utm_source=' and '&'
      • utm_medium: Extracted by splitting on 'utm_medium=' and '&'
      • utm_campaign: Extracted by splitting on 'utm_campaign=' and '&'
      • utm_content: Extracted by splitting on 'utm_content=' and '&'
      • utm_term: Extracted by splitting on 'utm_term=' and '&'
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 277. model.twitter_ads_source.stg_twitter_ads__tweet_url[url_host]
    • Direct directly copied to the output
    • Output Columns:
      • url_host: directly copied
Column Lineage
%3 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp expanded_url 277. model.twitter_ads_source.stg_twitter_ads__tweet_url 277. model.twitter_ads_source.stg_twitter_ads__tweet_url base_url expanded_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f1 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f0 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f2 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f3 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f7 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f6 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f4 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f5 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f8 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report url_path 277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f3->258. model.twitter_ads.twitter_ads__url_report:f0
277. model.twitter_ads_source.stg_twitter_ads__tweet_url
  • Input Column: 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp[expanded_url]
    • Direct The column is directly copied without any transformation
    • Featurization Multiple features are extracted from this column
    • Output Columns:
      • expanded_url: Directly copied to the output
      • base_url: Extracted by splitting on '?'
      • url_host: Extracted by complex string manipulation and splitting
      • url_path: Extracted by complex string manipulation and splitting
      • utm_source: Extracted by splitting on 'utm_source=' and '&'
      • utm_medium: Extracted by splitting on 'utm_medium=' and '&'
      • utm_campaign: Extracted by splitting on 'utm_campaign=' and '&'
      • utm_content: Extracted by splitting on 'utm_content=' and '&'
      • utm_term: Extracted by splitting on 'utm_term=' and '&'
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 277. model.twitter_ads_source.stg_twitter_ads__tweet_url[url_path]
    • Direct directly copied to the output
    • Output Columns:
      • url_path: directly copied
Column Lineage
%3 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp expanded_url 277. model.twitter_ads_source.stg_twitter_ads__tweet_url 277. model.twitter_ads_source.stg_twitter_ads__tweet_url base_url expanded_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f1 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f0 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f2 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f3 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f7 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f6 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f4 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f5 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f8 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report utm_source 277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f7->258. model.twitter_ads.twitter_ads__url_report:f0
277. model.twitter_ads_source.stg_twitter_ads__tweet_url
  • Input Column: 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp[expanded_url]
    • Direct The column is directly copied without any transformation
    • Featurization Multiple features are extracted from this column
    • Output Columns:
      • expanded_url: Directly copied to the output
      • base_url: Extracted by splitting on '?'
      • url_host: Extracted by complex string manipulation and splitting
      • url_path: Extracted by complex string manipulation and splitting
      • utm_source: Extracted by splitting on 'utm_source=' and '&'
      • utm_medium: Extracted by splitting on 'utm_medium=' and '&'
      • utm_campaign: Extracted by splitting on 'utm_campaign=' and '&'
      • utm_content: Extracted by splitting on 'utm_content=' and '&'
      • utm_term: Extracted by splitting on 'utm_term=' and '&'
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 277. model.twitter_ads_source.stg_twitter_ads__tweet_url[utm_source]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • utm_source: Directly copied to the output column of the same name
Column Lineage
%3 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp expanded_url 277. model.twitter_ads_source.stg_twitter_ads__tweet_url 277. model.twitter_ads_source.stg_twitter_ads__tweet_url base_url expanded_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f1 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f0 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f2 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f3 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f7 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f6 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f4 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f5 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f8 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report utm_medium 277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f6->258. model.twitter_ads.twitter_ads__url_report:f0
277. model.twitter_ads_source.stg_twitter_ads__tweet_url
  • Input Column: 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp[expanded_url]
    • Direct The column is directly copied without any transformation
    • Featurization Multiple features are extracted from this column
    • Output Columns:
      • expanded_url: Directly copied to the output
      • base_url: Extracted by splitting on '?'
      • url_host: Extracted by complex string manipulation and splitting
      • url_path: Extracted by complex string manipulation and splitting
      • utm_source: Extracted by splitting on 'utm_source=' and '&'
      • utm_medium: Extracted by splitting on 'utm_medium=' and '&'
      • utm_campaign: Extracted by splitting on 'utm_campaign=' and '&'
      • utm_content: Extracted by splitting on 'utm_content=' and '&'
      • utm_term: Extracted by splitting on 'utm_term=' and '&'
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 277. model.twitter_ads_source.stg_twitter_ads__tweet_url[utm_medium]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • utm_medium: Directly copied to the output column of the same name
Column Lineage
%3 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp expanded_url 277. model.twitter_ads_source.stg_twitter_ads__tweet_url 277. model.twitter_ads_source.stg_twitter_ads__tweet_url base_url expanded_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f1 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f0 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f2 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f3 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f7 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f6 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f4 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f5 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f8 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report utm_campaign 277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f4->258. model.twitter_ads.twitter_ads__url_report:f0
277. model.twitter_ads_source.stg_twitter_ads__tweet_url
  • Input Column: 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp[expanded_url]
    • Direct The column is directly copied without any transformation
    • Featurization Multiple features are extracted from this column
    • Output Columns:
      • expanded_url: Directly copied to the output
      • base_url: Extracted by splitting on '?'
      • url_host: Extracted by complex string manipulation and splitting
      • url_path: Extracted by complex string manipulation and splitting
      • utm_source: Extracted by splitting on 'utm_source=' and '&'
      • utm_medium: Extracted by splitting on 'utm_medium=' and '&'
      • utm_campaign: Extracted by splitting on 'utm_campaign=' and '&'
      • utm_content: Extracted by splitting on 'utm_content=' and '&'
      • utm_term: Extracted by splitting on 'utm_term=' and '&'
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 277. model.twitter_ads_source.stg_twitter_ads__tweet_url[utm_campaign]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • utm_campaign: Directly copied to the output column of the same name
Column Lineage
%3 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp expanded_url 277. model.twitter_ads_source.stg_twitter_ads__tweet_url 277. model.twitter_ads_source.stg_twitter_ads__tweet_url base_url expanded_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f1 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f0 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f2 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f3 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f7 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f6 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f4 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f5 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f8 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report utm_content 277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f5->258. model.twitter_ads.twitter_ads__url_report:f0
277. model.twitter_ads_source.stg_twitter_ads__tweet_url
  • Input Column: 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp[expanded_url]
    • Direct The column is directly copied without any transformation
    • Featurization Multiple features are extracted from this column
    • Output Columns:
      • expanded_url: Directly copied to the output
      • base_url: Extracted by splitting on '?'
      • url_host: Extracted by complex string manipulation and splitting
      • url_path: Extracted by complex string manipulation and splitting
      • utm_source: Extracted by splitting on 'utm_source=' and '&'
      • utm_medium: Extracted by splitting on 'utm_medium=' and '&'
      • utm_campaign: Extracted by splitting on 'utm_campaign=' and '&'
      • utm_content: Extracted by splitting on 'utm_content=' and '&'
      • utm_term: Extracted by splitting on 'utm_term=' and '&'
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 277. model.twitter_ads_source.stg_twitter_ads__tweet_url[utm_content]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • utm_content: Directly copied to the output column of the same name
Column Lineage
%3 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp expanded_url 277. model.twitter_ads_source.stg_twitter_ads__tweet_url 277. model.twitter_ads_source.stg_twitter_ads__tweet_url base_url expanded_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f1 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f0 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f2 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f3 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f7 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f6 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f4 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f5 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f8 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report utm_term 277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f8->258. model.twitter_ads.twitter_ads__url_report:f0
277. model.twitter_ads_source.stg_twitter_ads__tweet_url
  • Input Column: 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp[expanded_url]
    • Direct The column is directly copied without any transformation
    • Featurization Multiple features are extracted from this column
    • Output Columns:
      • expanded_url: Directly copied to the output
      • base_url: Extracted by splitting on '?'
      • url_host: Extracted by complex string manipulation and splitting
      • url_path: Extracted by complex string manipulation and splitting
      • utm_source: Extracted by splitting on 'utm_source=' and '&'
      • utm_medium: Extracted by splitting on 'utm_medium=' and '&'
      • utm_campaign: Extracted by splitting on 'utm_campaign=' and '&'
      • utm_content: Extracted by splitting on 'utm_content=' and '&'
      • utm_term: Extracted by splitting on 'utm_term=' and '&'
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 277. model.twitter_ads_source.stg_twitter_ads__tweet_url[utm_term]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • utm_term: Directly copied to the output column of the same name
278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp

This SQL query creates an empty result set with a single column named '_dbt_source_relation' of type TEXT, which is set to NULL. The LIMIT 0 ensures no rows are returned. This appears to be a template or placeholder query, likely used for initializing or testing purposes in a dbt (data build tool) model.

Other
SQL Query
SELECT
  CAST(NULL AS TEXT) AS _dbt_source_relation
LIMIT 0
%3 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp _fivetran_synced display_url expanded_url index indices tweet_id url 376. source.twitter_ads_source.twitter_ads.tweet_url 376. source.twitter_ads_source.twitter_ads.tweet_url
Name Type Comment
_fivetran_synced text None
display_url text None
expanded_url text None
index integer None
indices text None
tweet_id bigint None
url text None
Column Lineage
%3 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp display_url 277. model.twitter_ads_source.stg_twitter_ads__tweet_url 277. model.twitter_ads_source.stg_twitter_ads__tweet_url display_url 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f0 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report display_url 277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f0->258. model.twitter_ads.twitter_ads__url_report:f0
277. model.twitter_ads_source.stg_twitter_ads__tweet_url
  • Input Column: 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp[display_url]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • display_url: Directly copied to the output
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 277. model.twitter_ads_source.stg_twitter_ads__tweet_url[display_url]
    • Direct directly copied to the output
    • Output Columns:
      • display_url: directly copied
Column Lineage
%3 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp expanded_url 277. model.twitter_ads_source.stg_twitter_ads__tweet_url 277. model.twitter_ads_source.stg_twitter_ads__tweet_url base_url expanded_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f1 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f0 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f2 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f3 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f7 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f6 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f4 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f5 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f8 258. model.twitter_ads.twitter_ads__url_report 258. model.twitter_ads.twitter_ads__url_report base_url expanded_url url_host url_path utm_campaign utm_content utm_medium utm_source utm_term 277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f1->258. model.twitter_ads.twitter_ads__url_report:f1 277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f0->258. model.twitter_ads.twitter_ads__url_report:f0 277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f2->258. model.twitter_ads.twitter_ads__url_report:f2 277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f3->258. model.twitter_ads.twitter_ads__url_report:f3 277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f7->258. model.twitter_ads.twitter_ads__url_report:f7 277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f6->258. model.twitter_ads.twitter_ads__url_report:f6 277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f4->258. model.twitter_ads.twitter_ads__url_report:f4 277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f5->258. model.twitter_ads.twitter_ads__url_report:f5 277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f8->258. model.twitter_ads.twitter_ads__url_report:f8
277. model.twitter_ads_source.stg_twitter_ads__tweet_url
  • Input Column: 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp[expanded_url]
    • Direct The column is directly copied without any transformation
    • Featurization Multiple features are extracted from this column
    • Output Columns:
      • expanded_url: Directly copied to the output
      • base_url: Extracted by splitting on '?'
      • url_host: Extracted by complex string manipulation and splitting
      • url_path: Extracted by complex string manipulation and splitting
      • utm_source: Extracted by splitting on 'utm_source=' and '&'
      • utm_medium: Extracted by splitting on 'utm_medium=' and '&'
      • utm_campaign: Extracted by splitting on 'utm_campaign=' and '&'
      • utm_content: Extracted by splitting on 'utm_content=' and '&'
      • utm_term: Extracted by splitting on 'utm_term=' and '&'
258. model.twitter_ads.twitter_ads__url_report
  • Input Column: 277. model.twitter_ads_source.stg_twitter_ads__tweet_url[expanded_url]
    • Filtering used in WHERE clause to filter non-null values
    • Direct directly copied to the output
    • Output Columns:
      • expanded_url: directly copied
  • Input Column: 277. model.twitter_ads_source.stg_twitter_ads__tweet_url[base_url]
    • Direct directly copied to the output
    • Output Columns:
      • base_url: directly copied
  • Input Column: 277. model.twitter_ads_source.stg_twitter_ads__tweet_url[url_host]
    • Direct directly copied to the output
    • Output Columns:
      • url_host: directly copied
  • Input Column: 277. model.twitter_ads_source.stg_twitter_ads__tweet_url[url_path]
    • Direct directly copied to the output
    • Output Columns:
      • url_path: directly copied
  • Input Column: 277. model.twitter_ads_source.stg_twitter_ads__tweet_url[utm_source]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • utm_source: Directly copied to the output column of the same name
  • Input Column: 277. model.twitter_ads_source.stg_twitter_ads__tweet_url[utm_medium]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • utm_medium: Directly copied to the output column of the same name
  • Input Column: 277. model.twitter_ads_source.stg_twitter_ads__tweet_url[utm_campaign]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • utm_campaign: Directly copied to the output column of the same name
  • Input Column: 277. model.twitter_ads_source.stg_twitter_ads__tweet_url[utm_content]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • utm_content: Directly copied to the output column of the same name
  • Input Column: 277. model.twitter_ads_source.stg_twitter_ads__tweet_url[utm_term]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • utm_term: Directly copied to the output column of the same name
Column Lineage
%3 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp index 277. model.twitter_ads_source.stg_twitter_ads__tweet_url 277. model.twitter_ads_source.stg_twitter_ads__tweet_url index 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f0
277. model.twitter_ads_source.stg_twitter_ads__tweet_url
  • Input Column: 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp[index]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • index: Directly copied to the output
Column Lineage
%3 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp indices 277. model.twitter_ads_source.stg_twitter_ads__tweet_url 277. model.twitter_ads_source.stg_twitter_ads__tweet_url indices 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f0
277. model.twitter_ads_source.stg_twitter_ads__tweet_url
  • Input Column: 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp[indices]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • indices: Directly copied to the output
Column Lineage
%3 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp tweet_id 277. model.twitter_ads_source.stg_twitter_ads__tweet_url 277. model.twitter_ads_source.stg_twitter_ads__tweet_url tweet_id 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f0
277. model.twitter_ads_source.stg_twitter_ads__tweet_url
  • Input Column: 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp[tweet_id]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • tweet_id: Directly copied to the output
Column Lineage
%3 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp url 277. model.twitter_ads_source.stg_twitter_ads__tweet_url 277. model.twitter_ads_source.stg_twitter_ads__tweet_url url 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp:f0->277. model.twitter_ads_source.stg_twitter_ads__tweet_url:f0
277. model.twitter_ads_source.stg_twitter_ads__tweet_url
  • Input Column: 278. model.twitter_ads_source.stg_twitter_ads__tweet_url_tmp[url]
    • Direct The column is directly copied without any transformation
    • Output Columns:
      • url: Directly copied to the output
279. source.amazon_ads_source.amazon_ads.ad_group_history
The model details are not provided
280. source.amazon_ads_source.amazon_ads.ad_group_level_report
The model details are not provided
281. source.amazon_ads_source.amazon_ads.advertised_product_report
The model details are not provided
282. source.amazon_ads_source.amazon_ads.campaign_history
The model details are not provided
283. source.amazon_ads_source.amazon_ads.campaign_level_report
The model details are not provided
284. source.amazon_ads_source.amazon_ads.keyword_history
The model details are not provided
285. source.amazon_ads_source.amazon_ads.portfolio_history
The model details are not provided
286. source.amazon_ads_source.amazon_ads.product_ad_history
The model details are not provided
287. source.amazon_ads_source.amazon_ads.profile
The model details are not provided
288. source.amazon_ads_source.amazon_ads.search_term_ad_keyword_report
The model details are not provided
289. source.amazon_ads_source.amazon_ads.targeting_keyword_report
The model details are not provided
290. source.apple_search_ads_source.apple_search_ads.ad_group_history
The model details are not provided
291. source.apple_search_ads_source.apple_search_ads.ad_group_report
The model details are not provided
292. source.apple_search_ads_source.apple_search_ads.ad_history
The model details are not provided
293. source.apple_search_ads_source.apple_search_ads.ad_level_report
The model details are not provided
294. source.apple_search_ads_source.apple_search_ads.campaign_history
The model details are not provided
295. source.apple_search_ads_source.apple_search_ads.campaign_report
The model details are not provided
296. source.apple_search_ads_source.apple_search_ads.keyword_history
The model details are not provided
297. source.apple_search_ads_source.apple_search_ads.keyword_report
The model details are not provided
298. source.apple_search_ads_source.apple_search_ads.organization
The model details are not provided
299. source.apple_search_ads_source.apple_search_ads.search_term_report
The model details are not provided
300. source.facebook_ads_source.facebook_ads.account_history
The model details are not provided
301. source.facebook_ads_source.facebook_ads.ad_history
The model details are not provided
302. source.facebook_ads_source.facebook_ads.ad_set_history
The model details are not provided
303. source.facebook_ads_source.facebook_ads.basic_ad
The model details are not provided
304. source.facebook_ads_source.facebook_ads.campaign_history
The model details are not provided
305. source.facebook_ads_source.facebook_ads.creative_history
The model details are not provided
306. source.google_ads_source.google_ads.account_history
The model details are not provided
307. source.google_ads_source.google_ads.account_stats
The model details are not provided
308. source.google_ads_source.google_ads.ad_group_criterion_history
The model details are not provided
309. source.google_ads_source.google_ads.ad_group_history
The model details are not provided
310. source.google_ads_source.google_ads.ad_group_stats
The model details are not provided
311. source.google_ads_source.google_ads.ad_history
The model details are not provided
312. source.google_ads_source.google_ads.ad_stats
The model details are not provided
313. source.google_ads_source.google_ads.campaign_history
The model details are not provided
314. source.google_ads_source.google_ads.campaign_stats
The model details are not provided
315. source.google_ads_source.google_ads.keyword_stats
The model details are not provided
316. source.linkedin_source.linkedin_ads.account_history
The model details are not provided
317. source.linkedin_source.linkedin_ads.ad_analytics_by_campaign
The model details are not provided
318. source.linkedin_source.linkedin_ads.ad_analytics_by_creative
The model details are not provided
319. source.linkedin_source.linkedin_ads.campaign_group_history
The model details are not provided
320. source.linkedin_source.linkedin_ads.campaign_history
The model details are not provided
321. source.linkedin_source.linkedin_ads.creative_history
The model details are not provided
322. source.microsoft_ads_source.microsoft_ads.account_history
The model details are not provided
323. source.microsoft_ads_source.microsoft_ads.account_performance_daily_report
The model details are not provided
324. source.microsoft_ads_source.microsoft_ads.ad_group_history
The model details are not provided
325. source.microsoft_ads_source.microsoft_ads.ad_group_performance_daily_report
The model details are not provided
326. source.microsoft_ads_source.microsoft_ads.ad_history
The model details are not provided
327. source.microsoft_ads_source.microsoft_ads.ad_performance_daily_report
The model details are not provided
328. source.microsoft_ads_source.microsoft_ads.campaign_history
The model details are not provided
329. source.microsoft_ads_source.microsoft_ads.campaign_performance_daily_report
The model details are not provided
330. source.microsoft_ads_source.microsoft_ads.keyword_history
The model details are not provided
331. source.microsoft_ads_source.microsoft_ads.keyword_performance_daily_report
The model details are not provided
332. source.microsoft_ads_source.microsoft_ads.search_query_performance_daily_report
The model details are not provided
333. source.pinterest_source.pinterest_ads.ad_group_history
The model details are not provided
334. source.pinterest_source.pinterest_ads.ad_group_report
The model details are not provided
335. source.pinterest_source.pinterest_ads.advertiser_history
The model details are not provided
336. source.pinterest_source.pinterest_ads.advertiser_report
The model details are not provided
337. source.pinterest_source.pinterest_ads.campaign_history
The model details are not provided
338. source.pinterest_source.pinterest_ads.campaign_report
The model details are not provided
339. source.pinterest_source.pinterest_ads.keyword_history
The model details are not provided
340. source.pinterest_source.pinterest_ads.keyword_report
The model details are not provided
341. source.pinterest_source.pinterest_ads.pin_promotion_history
The model details are not provided
342. source.pinterest_source.pinterest_ads.pin_promotion_report
The model details are not provided
343. source.reddit_ads_source.reddit_ads.account
The model details are not provided
344. source.reddit_ads_source.reddit_ads.account_report
The model details are not provided
345. source.reddit_ads_source.reddit_ads.ad
The model details are not provided
346. source.reddit_ads_source.reddit_ads.ad_group
The model details are not provided
347. source.reddit_ads_source.reddit_ads.ad_group_report
The model details are not provided
348. source.reddit_ads_source.reddit_ads.ad_report
The model details are not provided
349. source.reddit_ads_source.reddit_ads.campaign
The model details are not provided
350. source.reddit_ads_source.reddit_ads.campaign_report
The model details are not provided
351. source.snapchat_ads_source.snapchat_ads.ad_account_history
The model details are not provided
352. source.snapchat_ads_source.snapchat_ads.ad_history
The model details are not provided
353. source.snapchat_ads_source.snapchat_ads.ad_hourly_report
The model details are not provided
354. source.snapchat_ads_source.snapchat_ads.ad_squad_history
The model details are not provided
355. source.snapchat_ads_source.snapchat_ads.ad_squad_hourly_report
The model details are not provided
356. source.snapchat_ads_source.snapchat_ads.campaign_history
The model details are not provided
357. source.snapchat_ads_source.snapchat_ads.campaign_hourly_report
The model details are not provided
358. source.snapchat_ads_source.snapchat_ads.creative_history
The model details are not provided
359. source.snapchat_ads_source.snapchat_ads.creative_url_tag_history
The model details are not provided
360. source.tiktok_ads_source.tiktok_ads.ad_history
The model details are not provided
361. source.tiktok_ads_source.tiktok_ads.ad_report_hourly
The model details are not provided
362. source.tiktok_ads_source.tiktok_ads.adgroup_history
The model details are not provided
363. source.tiktok_ads_source.tiktok_ads.adgroup_report_hourly
The model details are not provided
364. source.tiktok_ads_source.tiktok_ads.advertiser
The model details are not provided
365. source.tiktok_ads_source.tiktok_ads.campaign_history
The model details are not provided
366. source.tiktok_ads_source.tiktok_ads.campaign_report_hourly
The model details are not provided
367. source.twitter_ads_source.twitter_ads.account_history
The model details are not provided
368. source.twitter_ads_source.twitter_ads.campaign_history
The model details are not provided
369. source.twitter_ads_source.twitter_ads.campaign_report
The model details are not provided
370. source.twitter_ads_source.twitter_ads.line_item_history
The model details are not provided
371. source.twitter_ads_source.twitter_ads.line_item_keywords_report
The model details are not provided
372. source.twitter_ads_source.twitter_ads.line_item_report
The model details are not provided
373. source.twitter_ads_source.twitter_ads.promoted_tweet_history
The model details are not provided
374. source.twitter_ads_source.twitter_ads.promoted_tweet_report
The model details are not provided
375. source.twitter_ads_source.twitter_ads.tweet
The model details are not provided
376. source.twitter_ads_source.twitter_ads.tweet_url
The model details are not provided