amansinha100 commented on a change in pull request #1466: DRILL-6381: Add support for index based planning and execution URL: https://github.com/apache/drill/pull/1466#discussion_r228055114
########## File path: contrib/format-maprdb/src/main/java/org/apache/drill/exec/planner/index/MapRDBFunctionalIndexInfo.java ########## @@ -0,0 +1,168 @@ +/* + * 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.drill.exec.planner.index; + +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; +import org.apache.drill.common.expression.CastExpression; +import org.apache.drill.common.expression.LogicalExpression; +import org.apache.drill.common.expression.SchemaPath; + +import java.util.Map; +import java.util.Set; + +public class MapRDBFunctionalIndexInfo implements FunctionalIndexInfo { + + final private IndexDescriptor indexDesc; + + private boolean hasFunctionalField = false; + + //when we scan schemaPath in groupscan's columns, we check if this column(schemaPath) should be rewritten to '$N', + //When there are more than two functions on the same column in index, CAST(a.b as INT), CAST(a.b as VARCHAR), + // then we should map SchemaPath a.b to a set of SchemaPath, e.g. $1, $2 + private Map<SchemaPath, Set<SchemaPath>> columnToConvert; + + // map of functional index expression to destination SchemaPath e.g. $N + private Map<LogicalExpression, LogicalExpression> exprToConvert; + + //map of SchemaPath involved in a functional field + private Map<LogicalExpression, Set<SchemaPath>> pathsInExpr; + + private Set<SchemaPath> newPathsForIndexedFunction; + + private Set<SchemaPath> allPathsInFunction; + + public MapRDBFunctionalIndexInfo(IndexDescriptor indexDesc) { + this.indexDesc = indexDesc; + columnToConvert = Maps.newHashMap(); Review comment: The checkstyle-validation had identified a bunch of non-shaded Guava classes in the core classes when I created the PR and I had fixed those by using the shaded version. But oddly, it did not complain for the MapR-DB plugin classes. Does this enforcement not occur for the plugins ? I am not sure..but in any case I looked through the new code added in MapR-DB plugin and have modified the imports to use shaded Guava classes. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services