-
Notifications
You must be signed in to change notification settings - Fork 1.6k
AssertionError in UNION ALL query #5751
Copy link
Copy link
Closed
Labels
BugIncorrect or unexpected behaviorIncorrect or unexpected behaviorSQLIssues or changes relating to SQL executionIssues or changes relating to SQL execution
Description
To reproduce
Run this query on demo:
DECLARE @recent_data_boundary := dateadd('d', -1, date_trunc('day',now())),
@historical_data_boundary := dateadd('m', -6, date_trunc('month',now()))
WITH historical_and_recent_trades AS (
SELECT
timestamp, symbol,
first(price) AS open,
max(price) as high,
min(price) as low,
last(price) AS close,
sum(amount) AS volume
FROM trades
WHERE
timestamp >= @recent_data_boundary
SAMPLE BY 10m
UNION ALL
SELECT *
FROM trades_OHLC_15m
WHERE
timestamp > @historical_data_boundary
AND timestamp < @recent_data_boundary
)
SELECT open, high FROM historical_and_recent_trades order by timestamp descand observe this error:
java.lang.AssertionError
at io.questdb.griffin.SqlCodeGenerator.checkIfSetCastIsRequired(SqlCodeGenerator.java:887)
at io.questdb.griffin.SqlCodeGenerator.generateSetFactory(SqlCodeGenerator.java:5158)
at io.questdb.griffin.SqlCodeGenerator.generateQuery(SqlCodeGenerator.java:3356)
at io.questdb.griffin.SqlCodeGenerator.generateSubQuery(SqlCodeGenerator.java:5266)
at io.questdb.griffin.SqlCodeGenerator.generateSelectChoose(SqlCodeGenerator.java:3843)
at io.questdb.griffin.SqlCodeGenerator.generateSelect(SqlCodeGenerator.java:3813)
at io.questdb.griffin.SqlCodeGenerator.generateQuery0(SqlCodeGenerator.java:3366)
at io.questdb.griffin.SqlCodeGenerator.generateQuery(SqlCodeGenerator.java:3354)
at io.questdb.griffin.SqlCodeGenerator.generateSubQuery(SqlCodeGenerator.java:5266)
at io.questdb.griffin.SqlCodeGenerator.generateSelectChoose(SqlCodeGenerator.java:3843)
at io.questdb.griffin.SqlCodeGenerator.generateSelect(SqlCodeGenerator.java:3813)
at io.questdb.griffin.SqlCodeGenerator.generateQuery0(SqlCodeGenerator.java:3366)
at io.questdb.griffin.SqlCodeGenerator.generateQuery(SqlCodeGenerator.java:3354)
at io.questdb.griffin.SqlCodeGenerator.generate(SqlCodeGenerator.java:531)
at io.questdb.griffin.SqlCompilerImpl.generateSelectOneShot(SqlCompilerImpl.java:3909)
at io.questdb.griffin.SqlCompilerImpl.generateSelectWithRetries(SqlCompilerImpl.java:482)
at io.questdb.griffin.SqlCompilerImpl.compileUsingModel(SqlCompilerImpl.java:2869)
at io.questdb.griffin.SqlCompilerImpl.compileInner(SqlCompilerImpl.java:2285)
at io.questdb.griffin.SqlCompilerImpl.compile(SqlCompilerImpl.java:365)
at io.questdb.cairo.pool.SqlCompilerPool$C.compile(SqlCompilerPool.java:138)
at io.questdb.cutlass.http.processors.JsonQueryProcessor.compileAndExecuteQuery(JsonQueryProcessor.java:515)
at io.questdb.cutlass.http.processors.JsonQueryProcessor.execute0(JsonQueryProcessor.java:226)
at io.questdb.cutlass.http.processors.JsonQueryProcessor.onRequestComplete(JsonQueryProcessor.java:303)
at io.questdb.cutlass.http.HttpConnectionContext.handleClientRecv(HttpConnectionContext.java:937)
at io.questdb.cutlass.http.HttpConnectionContext.handleClientOperation(HttpConnectionContext.java:308)
at io.questdb.cutlass.http.HttpServer.handleClientOperation(HttpServer.java:345)
at io.questdb.cutlass.http.HttpServer$1.lambda$$0(HttpServer.java:129)
at io.questdb.network.AbstractIODispatcher.processIOQueue(AbstractIODispatcher.java:216)
at io.questdb.cutlass.http.HttpServer$1.run(HttpServer.java:133)
at io.questdb.mp.Worker.run(Worker.java:152)
QuestDB version:
8.3.3
OS, in case of Docker specify Docker and the Host OS:
Linux
File System, in case of Docker specify Host File System:
ext4
Full Name:
Andrei Pechkurov
Affiliation:
QuestDB
Have you followed Linux, MacOs kernel configuration steps to increase Maximum open files and Maximum virtual memory areas limit?
- Yes, I have
Additional context
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
BugIncorrect or unexpected behaviorIncorrect or unexpected behaviorSQLIssues or changes relating to SQL executionIssues or changes relating to SQL execution