Skip to content

Commit c858993

Browse files
Fix Dremio: rename 'prev' alias to 'prev_b' (reserved keyword)
Co-Authored-By: Itamar Hartstein <haritamar@gmail.com>
1 parent 0184a34 commit c858993

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

macros/edr/tests/test_volume_threshold.sql

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -212,25 +212,26 @@
212212
comparison as (
213213
select
214214
curr.bucket_end as current_period,
215-
prev.bucket_end as previous_period,
215+
prev_b.bucket_end as previous_period,
216216
{{ elementary.edr_cast_as_int("curr.row_count") }} as current_row_count,
217-
{{ elementary.edr_cast_as_int("prev.row_count") }}
217+
{{ elementary.edr_cast_as_int("prev_b.row_count") }}
218218
as previous_row_count,
219219
case
220-
when prev.row_count is null or prev.row_count = 0
220+
when prev_b.row_count is null or prev_b.row_count = 0
221221
then null
222222
else
223223
round(
224224
cast(
225-
(curr.row_count - prev.row_count)
225+
(curr.row_count - prev_b.row_count)
226226
* 100.0
227-
/ prev.row_count as {{ elementary.edr_type_numeric() }}
227+
/ prev_b.row_count
228+
as {{ elementary.edr_type_numeric() }}
228229
),
229230
2
230231
)
231232
end as percent_change
232233
from current_bucket curr
233-
left join previous_bucket prev on 1 = 1
234+
left join previous_bucket prev_b on 1 = 1
234235
),
235236

236237
result as (

0 commit comments

Comments
 (0)