Skip to content

fix(sql): make sample by week align to natural calendar.#5785

Merged
bluestreak01 merged 5 commits intomasterfrom
issue#5776
Jun 30, 2025
Merged

fix(sql): make sample by week align to natural calendar.#5785
bluestreak01 merged 5 commits intomasterfrom
issue#5776

Conversation

@kafka1991
Copy link
Copy Markdown
Collaborator

When the SAMPLE BY week statement does not specify a FROM clause, it need to align to natural calendar.
close ##5776

@glasstiger
Copy link
Copy Markdown
Contributor

[PR Coverage check]

😍 pass : 2 / 2 (100.00%)

file detail

path covered line new line coverage
🔵 io/questdb/std/datetime/microtime/Timestamps.java 2 2 100.00%

@bluestreak01 bluestreak01 merged commit f5ffaac into master Jun 30, 2025
37 checks passed
@bluestreak01 bluestreak01 deleted the issue#5776 branch June 30, 2025 23:47
@bobreim
Copy link
Copy Markdown

bobreim commented Jul 1, 2025

Hi @kafka1991,

I checked the code. Thanks for the quick reaction!

If I understand correctly:
The timezone is already processed in the micros argument. In my example, offset is not used and therefore 0. Therefore, the new if-statement is true and the 1970 Thursday will be subtracted.

I do have a question, why is the 1970 Thursday subtraction not applied when an offset is given?

@kafka1991
Copy link
Copy Markdown
Collaborator Author

I do have a question, why is the 1970 Thursday subtraction not applied when an offset is given?

Hi, @bobreim

If an offset is provided in the input, it means the offset serves as the baseline.

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

Successfully merging this pull request may close these issues.

5 participants