clintropolis commented on a change in pull request #11068:
URL: https://github.com/apache/druid/pull/11068#discussion_r608306486
##########
File path: processing/src/main/java/org/apache/druid/query/Queries.java
##########
@@ -219,4 +224,73 @@
return retVal;
}
+
+ /**
+ * Helper for implementations of {@link Query#getRequiredColumns()}. Returns
the list of columns that will be read
+ * out of a datasource by a query that uses the provided objects in the
usual way.
+ *
+ * The returned set always contains {@code __time}, no matter what.
+ *
+ * If the virtual columns, filter, dimensions, aggregators, or additional
columns refer to a virtual column, then the
+ * inputs of the virtual column will be returned instead of the name of the
virtual column itself. Therefore, the
+ * returned list will never contain the names of any virtual columns.
+ *
+ * @param virtualColumns virtual columns whose inputs should be included.
+ * @param filter optional filter whose inputs should be included.
+ * @param dimensions dimension specs whose inputs should be included.
+ * @param aggregators aggregators whose inputs should be included.
+ * @param additionalColumns additional columns to include. Each of these
will be added to the returned set, unless it
+ * refers to a virtual column, in which case the
virtual column inputs will be added instead.
+ */
+ public static Set<String> computeRequiredColumns(
Review comment:
:+1:
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]