npawar commented on a change in pull request #4877: Results in ResultTable if 
responseFormat=sql
URL: https://github.com/apache/incubator-pinot/pull/4877#discussion_r353524760
 
 

 ##########
 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:
   It was a deliberate decision to have List<Object[]> in the new ResultTable. 
Otherwise we end up converting non-serializable values to string currently. And 
now that we have schema in the ResultTable, we can just keep Object
   Reference PR:https://github.com/apache/incubator-pinot/pull/4807

----------------------------------------------------------------
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]

Reply via email to