We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the solution you'd like A clear and concise description of what you want to happen.
The duration_in function can be used to specify the time interval for the aggregation result of state_agg.
create table if not exists states(state STRING); insert into states values ('2020-01-01 10:00:00', 'starting'), ('2020-01-01 10:30:00', 'running'), ('2020-01-03 16:00:00', 'error'), ('2020-01-03 18:30:00', 'starting'), ('2020-01-03 19:30:00', 'running'), ('2020-01-05 12:00:00', 'stopping');
select duration_in(state_agg(time, state), 'running') from states; -- 0 years 0 mons 3 days 22 hours 0 mins 0.000000000 secs
select duration_in(state_agg(time, state), 'running', Timestamp '2020-01-01 11:00:00'); -- 0 years 0 mons 3 days 21 hours 30 mins 0.000000000 secs
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Describe the solution you'd like
A clear and concise description of what you want to happen.
The duration_in function can be used to specify the time interval for the aggregation result of state_agg.
The text was updated successfully, but these errors were encountered: