siddharthteotia commented on a change in pull request #4877: Results in
ResultTable if responseFormat=sql
URL: https://github.com/apache/incubator-pinot/pull/4877#discussion_r353487130
##########
File path:
pinot-core/src/main/java/org/apache/pinot/core/query/reduce/SelectionDataTableReducer.java
##########
@@ -96,14 +112,27 @@ public void reduceAndSetResults(String tableName,
DataSchema dataSchema, Map<Ser
// Selection order-by
SelectionOperatorService selectionService = new
SelectionOperatorService(_selection, dataSchema);
selectionService.reduceWithOrdering(dataTables);
-
brokerResponseNative.setSelectionResults(selectionService.renderSelectionResultsWithOrdering(_preserveType));
+ if (_responseFormatSql) {
+ // TODO: Selection uses Serializable[] in all its operations
+ // Converting that to Object[] end to end would be a big change,
and will be done in future PRs
+
brokerResponseNative.setResultTable(selectionService.renderResultTableWithOrdering());
+ } else {
+
brokerResponseNative.setSelectionResults(selectionService.renderSelectionResultsWithOrdering(_preserveType));
+ }
} else {
// Selection only
List<String> selectionColumns =
SelectionOperatorUtils.getSelectionColumns(_selection.getSelectionColumns(),
dataSchema);
-
brokerResponseNative.setSelectionResults(SelectionOperatorUtils.renderSelectionResultsWithoutOrdering(
- SelectionOperatorUtils.reduceWithoutOrdering(dataTables,
selectionSize), dataSchema, selectionColumns,
- _preserveType));
+ List<Serializable[]> reducedRows =
SelectionOperatorUtils.reduceWithoutOrdering(dataTables, selectionSize);
+ if (_responseFormatSql) {
+ // TODO: Selection uses Serializable[] in all its operations
Review comment:
Is it possible to have List<Serializable[]> in ResultTable instead of
current implementation of List<Object[]>?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]