Fix an issue with passing order by and limit to realtime tasks#15301
Fix an issue with passing order by and limit to realtime tasks#15301cryptoe merged 4 commits intoapache:masterfrom
Conversation
| }).map(List::toArray); | ||
| } | ||
|
|
||
| private static ScanQuery prepareScanQuery(@NotNull ScanQuery scanQuery) |
There was a problem hiding this comment.
Can you please add a Javadoc for how we are preparing the scan query.
|
|
||
| private static ScanQuery prepareScanQuery(@NotNull ScanQuery scanQuery) | ||
| { | ||
| if (ScanQuery.Order.NONE.equals(scanQuery.getTimeOrder())) { |
There was a problem hiding this comment.
I think we can optimize this further - Consider if we have a scan query without any ordering but with a limit. In that case, we don't need to set the limit to 0 to fetch the results. We can keep the limit as is.
Therefore instead of checking the timeOrder, we'd also need to check the ordering inside, and if its empty or not.
There was a problem hiding this comment.
Good catch! I've updated the condition
LakshSingla
left a comment
There was a problem hiding this comment.
LGTM, though I wonder if we can further optimize the change by planning the native query using #15241 and the MSQ query as is. However it would be difficult to generate the two plans and pass it to MSQ.
…e#15301) While running queries on real time tasks using MSQ, there is an issue with queries with certain order by columns. If the query specifies a non time column, the query is planned as it is supported by MSQ. However, this throws an exception when passed to real time tasks once as the native query stack does not support it. This PR resolves this by removing the ordering from the query before contacting real time tasks. Fixes a bug with MSQ while reading data from real time tasks with non time ordering
… (#15308) While running queries on real time tasks using MSQ, there is an issue with queries with certain order by columns. If the query specifies a non time column, the query is planned as it is supported by MSQ. However, this throws an exception when passed to real time tasks once as the native query stack does not support it. This PR resolves this by removing the ordering from the query before contacting real time tasks. Fixes a bug with MSQ while reading data from real time tasks with non time ordering
…e#15301) While running queries on real time tasks using MSQ, there is an issue with queries with certain order by columns. If the query specifies a non time column, the query is planned as it is supported by MSQ. However, this throws an exception when passed to real time tasks once as the native query stack does not support it. This PR resolves this by removing the ordering from the query before contacting real time tasks. Fixes a bug with MSQ while reading data from real time tasks with non time ordering
While running queries on real time tasks using MSQ, there is an issue with queries with certain order by columns.
If the query specifies a non time column, the query is planned as it is supported by MSQ. However, this throws an exception when passed to real time tasks once as the native query stack does not support it. This PR resolves this by removing the ordering from the query before contacting real time tasks.
This PR has: