github-code-scanning[bot] commented on code in PR #13952:
URL: https://github.com/apache/druid/pull/13952#discussion_r1208966736


##########
processing/src/main/java/org/apache/druid/query/QueryToolChest.java:
##########
@@ -330,4 +332,32 @@
   {
     throw new UOE("Query type '%s' does not support returning results as 
arrays", query.getType());
   }
+
+  /**
+   * Converts a sequence of this query's ResultType into a sequence of {@link 
FrameSignaturePair}. The array signature
+   * is the one give by {@link #resultArraySignature(Query)}. If the toolchest 
doesn't support this method, then it can
+   * return an empty optional. It is the duty of the callees to throw an 
appropriate exception in that case or use an
+   * alternative fallback approach
+   *
+   * Check documentation of {@link #resultsAsArrays(Query, Sequence)} as the 
behaviour of the rows represented by the
+   * frame sequence is identical.
+   *
+   * Each Frame has a separate {@link RowSignature} because for some query 
types like the Scan query, every
+   * column in the final result might not be present in the individual 
ResultType (and subsequently Frame). Therefore,
+   * this is done to preserve the space by not populating the column in that 
particular Frame and omitting it from its
+   * signature
+   *  @param query Query being executed by the toolchest. Used to determine 
the rowSignature of the Frames
+   * @param resultSequence results of the form returned by {@link 
#mergeResults(QueryRunner)}
+   * @param memoryAllocatorFactory
+   * @param useNestedForUnknownTypes true if the unknown types in the results 
can be serded using complex types
+   */
+  public Optional<Sequence<FrameSignaturePair>> resultsAsFrames(
+      QueryType query,
+      Sequence<ResultType> resultSequence,
+      MemoryAllocatorFactory memoryAllocatorFactory,
+      boolean useNestedForUnknownTypes

Review Comment:
   ## Useless parameter
   
   The parameter 'useNestedForUnknownTypes' is never used.
   
   [Show more 
details](https://github.com/apache/druid/security/code-scanning/4988)



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

Reply via email to