Trino
Last updated
select
name,
sum(count) as count,
CAST(max(count) AS double) * 1e9 AS frequency,
unit,
description
from {{TABLE}}
where "carId" = '{{ dataset.carId }}'
group by nameselect time / 1e9 as "timestamp", value
from {{TABLE}}
where "carId" = '{{ dataset.carId }}'
{%- if timestamp_start %}
and CAST({{timestamp_start}} AS BIGINT) * 1e9 <= time
{%- endif %}
{%- if timestamp_stop %}
and CAST({{timestamp_stop}} AS BIGINT) * 1e9 >= time
{%- endif %}
and name = '{{ signal.name }}'