599166320 commented on code in PR #13168:
URL: https://github.com/apache/druid/pull/13168#discussion_r990633896
##########
processing/src/main/java/org/apache/druid/query/scan/ScanQuery.java:
##########
@@ -496,6 +523,22 @@ public ScanQuery withOverriddenContext(Map<String, Object>
contextOverrides)
return
Druids.ScanQueryBuilder.copy(this).context(computeOverriddenContext(getContext(),
contextOverrides)).build();
}
+ public boolean scanOrderByNonTime()
+ {
+
+ if (orderBys.size() > 1 || (orderBys.size() == 1 &&
!ColumnHolder.TIME_COLUMN_NAME.equals(orderBys.get(0).getColumnName()))) {
+ //order by Ordinary column
+ return true;
+ }
+
+ if (orderBys.size() == 1 &&
ColumnHolder.TIME_COLUMN_NAME.equals(orderBys.get(0).getColumnName()) &&
getDataSource() instanceof InlineDataSource) {
+ //The type of datasource is inlineDataSource and order by __time
+ return true;
+ }
+
+ return false;
Review Comment:
1. For inline data sources, any column can be sorted.
2. The last judgment is wrong. I replace `return
!ColumnHolder.TIME_COLUMN_NAME.equals(orderBys.get(0).getColumnName());` with
`return ColumnHolder.TIME_COLUMN_NAME.equals(orderBys.get(0).getColumnName());`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]