cryptoe commented on a change in pull request #12314:
URL: https://github.com/apache/druid/pull/12314#discussion_r822657543
##########
File path: processing/src/main/java/org/apache/druid/segment/filter/Filters.java
##########
@@ -433,10 +434,15 @@ public static Filter convertToCNFFromQueryContext(Query
query, @Nullable Filter
return null;
}
boolean useCNF = query.getContextBoolean(QueryContexts.USE_FILTER_CNF_KEY,
QueryContexts.DEFAULT_USE_FILTER_CNF);
- return useCNF ? Filters.toCnf(filter) : filter;
+ try {
+ return useCNF ? Filters.toCnf(filter) : filter;
+ }
+ catch (CNFFilterExplosionException cnfFilterExplosionException) {
+ return filter; // cannot convert to CNF, return the filter as is
Review comment:
I understand where your coming from. In such a case, I would then tend
towards not throwing an exception and refactoring the `Filter.toCnf(filter)` to
return an appropriate state which helps us decide if the
conversionWasSucessfull or not. Maybe use `Optional.of()`so that we avoid
throwing exceptions due to performance overheads of exceptions.
We can take this up as future work. Maybe when we are making this limit
configurable.
--
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]