Skip to content
New issue

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

Control snapshot v0: is_daily flag not correctly set, when daily snapshot timestamp isn't 00:00:00 #156

Open
tta-scalefree opened this issue Mar 6, 2024 · 2 comments

Comments

@tta-scalefree
Copy link
Collaborator

In the generated code for control_snapshot_v0, the Is_daily flag is currently not correctly set to reflect the user's input for daily_snapshot_time - If this parameter is set to any timestamp other than 00:00:00.

Current macro:
CASE
WHEN EXTRACT(MINUTE FROM sdts) = 0 AND EXTRACT(SECOND FROM sdts) = 0 AND EXTRACT(HOUR FROM sdts) = 0 THEN TRUE
ELSE FALSE
END AS is_daily

Meaning, is_daily flag is only true, if daily snapshot definition is 00:00:00.

Proposal to change the macro code to parse user definition of daily snapshot:
CASE
WHEN
EXTRACT(HOUR FROM sdts) = EXTRACT(HOUR FROM TO_TIME('{{ daily_snapshot_time }}'))
AND EXTRACT(MINUTE FROM sdts) = EXTRACT(MINUTE FROM TO_TIME('{{ daily_snapshot_time }}'))
AND EXTRACT(SECOND FROM sdts) = EXTRACT(SECOND FROM TO_TIME('{{ daily_snapshot_time }}'))
THEN TRUE
ELSE FALSE
END AS is_daily

@tkirschke
Copy link
Member

Next ToDo: Implement and test changes for all other environments

@tkirschke tkirschke modified the milestone: Performance Optimization Jun 21, 2024
@tkirschke
Copy link
Member

Consider: is_hourly & is_daily should be removed. Our macro does not allow hourly snapshots.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants