clintropolis commented on code in PR #18407:
URL: https://github.com/apache/druid/pull/18407#discussion_r2288855629
##########
processing/src/main/java/org/apache/druid/segment/projections/ProjectionFilterMatch.java:
##########
@@ -34,4 +39,86 @@ private ProjectionFilterMatch()
{
// no instantiation
}
+
+ /**
+ * Rewrites a query {@link Filter} if possible, removing the {@link Filter}
of a projection. To match a projection
+ * filter, the query filter must be equal to the projection filter, or must
contain the projection filter as the child
+ * of an AND filter. This method returns null
+ * indicating that a rewrite is impossible with the implication that the
query cannot use the projection because the
+ * projection doesn't contain all the rows the query would match if not
using the projection.
+ */
+ @Nullable
+ public static Filter rewriteFilter(Filter projectionFilter, Filter
queryFilter)
Review Comment:
nit: to me it doesn't quite feel like it belongs here at least since
`rewriteFilter` isn't really something that belongs to `ProjectionFilterMatch`,
rather `ProjectionFilterMatch` is a tool used by `rewriteFilter`. Between this
and where it used to live I think i kind of prefer the old place where this
logic to lived with the rest of the projection matching stuff since it all is
sort of related. Or if really really want to split out, maybe it should be a
standalone `ProjectionFilterRewrite` utility?
Also with this split out, it seems important to indicate that the query
filter be rewritten with the projection remapped column names using
`rewriteRequiredColumns` before calling this to make sure matching is possible
--
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]