All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.apache.hadoop.hive.ql.index.HiveIndexQueryContext Maven / Gradle / Ivy

There is a newer version: 4.0.1
Show newest version
/**
 * 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.hadoop.hive.ql.index;

import java.io.Serializable;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import org.apache.hadoop.hive.ql.exec.Task;
import org.apache.hadoop.hive.ql.hooks.ReadEntity;
import org.apache.hadoop.hive.ql.metadata.Partition;
import org.apache.hadoop.hive.ql.plan.ExprNodeDesc;

/**
 * Used to pass information between the IndexProcessor and the plugin
 * IndexHandler during query processing
 *
 */
public class HiveIndexQueryContext {

  private HashSet additionalSemanticInputs; // additional inputs to add to the parse context when
                                                        // merging the index query tasks
  private String indexInputFormat;        // input format to set on the TableScanOperator to activate indexing
  private String indexIntermediateFile;   // name of intermediate file written by the index query for the
                                          // TableScanOperator to use
  private List> queryTasks;      // list of tasks that will execute the index query and write
                                                              // results to a temporary file
  private ExprNodeDesc residualPredicate; // predicate that could not be processed by an index handler
                                          // and should be used on the base table scan (see HIVE-2115)
  private Set queryPartitions; // partitions accessed by the original query

  public HiveIndexQueryContext() {
    this.additionalSemanticInputs = null;
    this.indexInputFormat = null;
    this.indexIntermediateFile = null;
    this.queryTasks = null;
  }

  public HashSet getAdditionalSemanticInputs() {
    return additionalSemanticInputs;
  }
  public void addAdditionalSemanticInputs(HashSet additionalParseInputs) {
    if (this.additionalSemanticInputs == null) {
      this.additionalSemanticInputs = new HashSet();
    }
    this.additionalSemanticInputs.addAll(additionalParseInputs);
  }

  public String getIndexInputFormat() {
    return indexInputFormat;
  }
  public void setIndexInputFormat(String indexInputFormat) {
    this.indexInputFormat = indexInputFormat;
  }

  public String getIndexIntermediateFile() {
    return indexIntermediateFile;
  }
  public void setIndexIntermediateFile(String indexIntermediateFile) {
    this.indexIntermediateFile = indexIntermediateFile;
  }

  public List> getQueryTasks() {
    return queryTasks;
  }
  public void setQueryTasks(List> indexQueryTasks) {
    this.queryTasks = indexQueryTasks;
  }

  public void setResidualPredicate(ExprNodeDesc residualPredicate) {
    this.residualPredicate = residualPredicate;
  }

  public ExprNodeDesc getResidualPredicate() {
    return residualPredicate;
  }

  public Set getQueryPartitions() {
    return queryPartitions;
  }

  public void setQueryPartitions(Set queryPartitions) {
    this.queryPartitions = queryPartitions;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy