-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Closed
Copy link
Labels
BugIncorrect or unexpected behaviorIncorrect or unexpected behaviorSQLIssues or changes relating to SQL executionIssues or changes relating to SQL executionexternal
Description
To reproduce
Demo:
SELECT max(timestamp) OVER (PARTITION BY split_part(symbol, '-', 1), split_part(symbol, '_', 2))
as max
FROM (trades LIMIT 1000);Error:
there is no matching function `split_part` with the argument types: (INT, CHAR, SYMBOL)
Looks suspiciously like the paramlist is being checked in reverse order, which can be easy to forget on those models. As proof:
SELECT max(timestamp) OVER (PARTITION BY substring(symbol, 1, 5), split_part(symbol, '_', 2))
as max
FROM (trades LIMIT 1000);Error:
there is no matching function `substring` with the argument types: (INT, INT, SYMBOL)
Workaround is to subquery:
SELECT max(timestamp) OVER (PARTITION BY part1, part2) as max FROM (
SELECT *, split_part(symbol, '-', 1) as part1, split_part(symbol, '-', 2) as part2
FROM (trades LIMIT 1000)
);QuestDB version:
9.3.1
OS, in case of Docker specify Docker and the Host OS:
N/A
File System, in case of Docker specify Host File System:
N/A
Full Name:
Nick Woolmer
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 executionexternal