You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2020/06/06 04:44:23 UTC

[GitHub] [druid] jon-wei commented on a change in pull request #9978: Fix join filter rewrites with nested queries

jon-wei commented on a change in pull request #9978:
URL: https://github.com/apache/druid/pull/9978#discussion_r436237490



##########
File path: processing/src/main/java/org/apache/druid/segment/join/filter/rewrite/JoinFilterPreAnalysisGroup.java
##########
@@ -0,0 +1,82 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.druid.segment.join.filter.rewrite;
+
+import org.apache.druid.query.filter.Filter;
+import org.apache.druid.segment.join.filter.JoinFilterPreAnalysis;
+
+import java.util.concurrent.ConcurrentHashMap;
+
+/**
+ * A JoinFilterPreAnalysisGroup holds all of the JoinFilterPreAnalysis objects for a given query and
+ * also stores the per-query parameters that control the filter rewrite operations (from the query context).
+ *
+ * The analyses map is keyed by Filter: each Filter in the map belongs to separate level of query
+ * (e.g. outer query, subquery level 1, etc.)
+ *
+ * A concurrent hash map is used since the per-level Filter processing occurs across multiple threads.
+ */
+public class JoinFilterPreAnalysisGroup
+{
+  private final boolean enableFilterPushDown;
+  private final boolean enableFilterRewrite;
+  private final boolean enableRewriteValueColumnFilters;
+  private final long filterRewriteMaxSize;
+  private final ConcurrentHashMap<Filter, JoinFilterPreAnalysis> analyses;

Review comment:
       The main one I would be concerned with is InFilter, and to a lesser extent AND/OR.
   
   I added lazy computation/caching for InFilter/AndFilter/OrFilter hashcodes, as long as the hashing is done once per query, and not once per segment, I wouldn't expect hashing overhead to outweigh the benefits of the rewrite (esp since such large filters would be expensive to apply per-row on the RHS)




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org