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

support extract #3

Merged
merged 1 commit into from
Oct 2, 2024
Merged

support extract #3

merged 1 commit into from
Oct 2, 2024

Conversation

alrocar
Copy link
Member

@alrocar alrocar commented Oct 2, 2024

See comment

Extract support never worked, and since pg14 it just send the extract to ClickHouse. There's an extract function in ClickHouse but it has nothing to do with Dates.

d_c7d55a=# select floor(extract('epoch' from timestamp) / 60), count(user_id) u from events group by extract('epoch' from timestamp);
d_c7d55a=# select extract('day' from timestamp), count(user_id) u from events group by extract('day' from timestamp);
 extract |   u
---------+-------
      18 | 30600
(1 row)

d_c7d55a=# explain (verbose, costs off) select extract('day' from timestamp), count(user_id) u from events group by extract('day' from timestamp);

Foreign Scan
   Output: (EXTRACT(day FROM t_3849d138311d4f7b98f3fdbb365df222."timestamp")), (count(t_3849d138311d4f7b98f3fdbb365df222.user_id))
   Relations: Aggregate on (t_3849d138311d4f7b98f3fdbb365df222)
   Remote SQL: SELECT toDayOfMonth("timestamp"), count(user_id) FROM d_c7d55a.t_3849d138311d4f7b98f3fdbb365df222 GROUP BY (toDayOfMonth("timestamp"))
(4 rows)

@jesusbotella
Copy link
Collaborator

Approving this. Couldn't reproduce tests in my local env. We'll take a look but let's fix the issue.

@alrocar
Copy link
Member Author

alrocar commented Oct 2, 2024

I've left only pg14 in ci.yaml, since other versions where failing due to different output and it was being a hell.

I've added a DEVELOPMENT.md with some instructions to debug locally, run tests locally and override the expected files.

@alrocar alrocar merged commit e1095fb into master Oct 2, 2024
4 checks passed
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.

2 participants