-
Notifications
You must be signed in to change notification settings - Fork 853
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
[Feature]: join with multiple equality conditions #7107
Comments
ok, now i see that the documentation shows this example as an invalid join:
which is similar to what i'm trying to use. in the code the condition fails on
because in this case |
pr #7032 lets my join expression pass, but another issue arises:
this prevents me (at least i think so) from setting the bar start based on the market session opening hour. |
@fabriziomello the issue with the multiple conditions is not triggered with the patch anymore, but i get stuck on the here's my test case:
i hope i didn't forget any command. it simply creates normal table with 30-minute data, turns it into a hypertable, fills in some data, it also creates table with market session opens, and creates simple continuous aggregate. this part works fine. then i try to run this command:
before it failed on the |
This is a know restriction, the |
that i was afraid of. i just didn't come up with a working solution for that task tbh. i just need each day the first bar start on the hour that market opens... and for different assets it's different, and sometimes the trading hours are also reduced, and the trading hours might change over time. so i doubt it would even work if i just do it per exchange. any suggestions or best practices with regard to this? i've read timescaledb is used by financial companies, so there might be a solution. |
What type of bug is this?
Unexpected error
What subsystems and features are affected?
Continuous aggregate
What happened?
i'm trying to create a 2-hour continuous aggregate from 1-hour continuous aggregate. the culprit is that this is a market data and i want each time bucket start at the market session start (rounded down to hours), so for each asset the origin might be different, and it also differs because of dst (my data is timestamp without time zone, but in fact utc).
i tried with
market_session_bar_h1_starts
being a view and now it is a table, but i still get the same error:if i run just the
select
part, the query works fine and returns results. i'm atm on version 2.15.3 and postgresql 16.3.here is a sample content of the joined table:
i guess this is the related code, but nothing that would be clear to me. the
else
branch is the one that is triggered imo.just some more info to clarify it. the joined table contains
bar_start
for each hour that appears in themarket_bars_h1
so this should really be an equality join (and it works when i just run theselect
, only creating the continous view fails). frommarket_session_bar_h1_starts
it can be seen that there are several different times but for all of them thefirst_bar_start
is the same (because they are in the same trading session).TimescaleDB version affected
2.15.3
PostgreSQL version used
16.3
What operating system did you use?
gentoo linux
What installation method did you use?
Source
What platform did you run on?
On prem/Self-hosted
Relevant log output and stack trace
No response
How can we reproduce the bug?
The text was updated successfully, but these errors were encountered: