troubleshooting

How to use the TUMBLE function in Risingwave with a timestamp within a struct?

I have a payload containing a timestamp within a struct and I'm trying to use the TUMBLE function in Risingwave, but it seems to be causing an error. Is there a way to work around this issue?

je

jean baptiste Dalido

Asked on Aug 29, 2023

  1. Risingwave currently has a limitation with using the TUMBLE function with a timestamp within a struct.
  2. One workaround is to use a Common Table Expression (CTE) to rename the struct column and then use the renamed column in the TUMBLE function.
-- Example workaround using CTE
with cte as (
  select (s).t as renamed_timestamp, (s).c from t
)
select * from tumble(cte, cte.renamed_timestamp, INTERVAL '60' MINUTE);
  1. By renaming the struct column within a CTE, you can use the renamed column in the TUMBLE function without encountering the error.
Aug 29, 2023Edited by