11-- noqa: disable=LT01
2+ -- noqa: disable=all
3+ -- Trouble related to issue:https://github.com/sqlfluff/sqlfluff/issues/7570
24WITH
35include_apps AS (
46 SELECT c .store_app
57 FROM adtech .combined_store_apps_companies AS c
68 WHERE
7- cardinality(c. :include_domains ::text []) > 0
8- AND c .ad_domain = any(c. :include_domains ::text [])
9+ cardinality(:include_domains ::text []) > 0
10+ AND c .ad_domain = any(:include_domains ::text [])
911 AND (
10- NOT c. :require_sdk_api ::boolean
12+ NOT :require_sdk_api ::boolean
1113 OR c .sdk = TRUE
1214 OR c .api_call = TRUE
1315 )
1416 GROUP BY c .store_app
1517 HAVING
16- count (DISTINCT c .ad_domain ) = cardinality(c. :include_domains ::text [])
18+ count (DISTINCT c .ad_domain ) = cardinality(:include_domains ::text [])
1719),
18-
1920exclude_apps AS (
2021 SELECT DISTINCT c .store_app
2122 FROM adtech .combined_store_apps_companies AS c
2223 WHERE
23- cardinality(c. :exclude_domains ::text []) > 0
24- AND c .ad_domain = any(c. :exclude_domains ::text [])
24+ cardinality(:exclude_domains ::text []) > 0
25+ AND c .ad_domain = any(:exclude_domains ::text [])
2526)
26-
2727SELECT
2828 sao .id ,
2929 sao .store_id ,
@@ -41,31 +41,31 @@ SELECT
4141FROM frontend .store_apps_overview AS sao
4242WHERE
4343 (
44- cardinality(sao. :include_domains ::text []) = 0
44+ cardinality(:include_domains ::text []) = 0
4545 OR EXISTS (
4646 SELECT 1
4747 FROM include_apps AS ia
4848 WHERE ia .store_app = sao .id
4949 )
5050 )
5151 AND
52- sao .store_last_updated > sao. :mydate ::date
53- AND (NOT sao. :require_iap ::boolean OR sao .in_app_purchases = TRUE)
54- AND (NOT sao. :require_ads ::boolean OR sao .ad_supported = TRUE)
55- AND (sao. :category ::text IS NULL OR sao .category LIKE sao. :category)
56- AND (sao. :store ::int IS NULL OR sao .store = sao. :store)
52+ sao .store_last_updated > :mydate ::date
53+ AND (NOT :require_iap ::boolean OR sao .in_app_purchases = TRUE)
54+ AND (NOT :require_ads ::boolean OR sao .ad_supported = TRUE)
55+ AND (:category ::text IS NULL OR sao .category LIKE :category)
56+ AND (:store ::int IS NULL OR sao .store = :store)
5757 AND (
58- sao. :ranking_country ::text IS NULL
58+ :ranking_country ::text IS NULL
5959 OR (
60- sao. :ranking_country = ' overall'
60+ :ranking_country = ' overall'
6161 AND EXISTS (
6262 SELECT 1
6363 FROM frontend .store_app_ranks_latest AS sar
6464 WHERE sar .store_id = sao .store_id
6565 )
6666 )
6767 OR (
68- sao. :ranking_country <> ' overall'
68+ :ranking_country <> ' overall'
6969 AND EXISTS (
7070 SELECT 1
7171 FROM frontend .store_app_ranks_latest AS sar
@@ -76,34 +76,34 @@ WHERE
7676 )
7777 )
7878 AND (
79- sao. :min_installs ::bigint IS NULL
80- OR sao. :min_installs = 0
81- OR sao .installs >= sao. :min_installs
79+ :min_installs ::bigint IS NULL
80+ OR :min_installs = 0
81+ OR sao .installs >= :min_installs
8282 )
8383 AND (
8484
85- sao. :max_installs ::bigint IS NULL
86- OR sao .installs <= sao. :max_installs
85+ :max_installs ::bigint IS NULL
86+ OR sao .installs <= :max_installs
8787 )
8888 AND (
8989
90- sao. :min_rating_count ::bigint IS NULL
91- OR sao .rating_count >= sao. :min_rating_count
90+ :min_rating_count ::bigint IS NULL
91+ OR sao .rating_count >= :min_rating_count
9292 )
9393 AND (
9494
95- sao. :max_rating_count ::bigint IS NULL
96- OR sao .rating_count <= sao. :max_rating_count
95+ :max_rating_count ::bigint IS NULL
96+ OR sao .rating_count <= :max_rating_count
9797 )
9898 AND (
9999
100- sao. :min_installs_d30 ::bigint IS NULL
101- OR sao .installs_sum_4w >= sao. :min_installs_d30
100+ :min_installs_d30 ::bigint IS NULL
101+ OR sao .installs_sum_4w >= :min_installs_d30
102102 )
103103 AND (
104104
105- sao. :max_installs_d30 ::bigint IS NULL
106- OR sao .installs_sum_4w <= sao. :max_installs_d30
105+ :max_installs_d30 ::bigint IS NULL
106+ OR sao .installs_sum_4w <= :max_installs_d30
107107 )
108108 -- Exclusion check
109109 AND NOT EXISTS (
@@ -112,4 +112,4 @@ WHERE
112112 )
113113ORDER BY
114114 sao .installs DESC NULLS LAST
115- LIMIT 100 ;
115+ LIMIT 100 ;
0 commit comments