You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ASOF JOIN with LIMIT hangs indefinitely when input has ≥ 64 rows #368
ASOF JOIN combined with a LIMIT clause causes the query to hang forever (never returns) when the input CTEs/tables contain 64 or more rows. With fewer than 64 rows it produces correct results. Removing LIMIT works correctly for any number of rows.
To Reproduce
importduckdbcon=duckdb.connect()
sql="""WITH trades AS ( SELECT 'AAPL' AS symbol, TIMESTAMP '2024-01-01 10:00:00' + idx * INTERVAL 10 SECONDS AS trade_time, 100 AS quantity FROM range(64) AS trade_rows(idx) -- hangs; change to 63 to succeed),quotes AS ( SELECT 'AAPL' AS symbol, TIMESTAMP '2024-01-01 09:59:50' + idx * INTERVAL 10 SECONDS AS quote_time, 150.0 AS price FROM range(64) AS quote_rows(idx))SELECT t.symbol, t.trade_time, t.quantity, q.quote_time, q.price, t.quantity * q.price AS notionalFROM trades AS tASOF LEFT JOIN quotes AS q ON t.symbol = q.symbol AND t.trade_time >= q.quote_timeLIMIT 5"""df=con.execute(sql).df() # <-- hangs here foreverprint(df)
OS:
OSX, Windows
DuckDB Package Version:
1.5
Python Version:
3.10-3.14
Full Name:
Aliaksandr Zhura
Affiliation:
Infio
What is the latest build you tested with? If possible, we recommend testing with the latest nightly build.
I have tested with a stable release
Did you include all relevant data sets for reproducing the issue?
No - Other reason (please specify in the issue body)
Did you include all code required to reproduce the issue?
Yes, I have
Did you include all relevant configuration to reproduce the issue?
Activity