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

org.apache.hadoop.hive.ql.optimizer.BucketJoinProcCtx Maven / Gradle / Ivy

There is a newer version: 4.0.0
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.optimizer;

import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.hive.conf.HiveConf;
import org.apache.hadoop.hive.ql.exec.JoinOperator;
import org.apache.hadoop.hive.ql.lib.NodeProcessorCtx;
import org.apache.hadoop.hive.ql.metadata.Partition;

public class BucketJoinProcCtx implements NodeProcessorCtx {
  private static final Log LOG =
    LogFactory.getLog(BucketJoinProcCtx.class.getName());

  private final HiveConf conf;

  private Set rejectedJoinOps = new HashSet();

  // The set of join operators which can be converted to a bucketed map join
  private Set convertedJoinOps = new HashSet();

  // In checking if a mapjoin can be converted to bucket mapjoin,
  // some join alias could be changed: alias -> newAlias
  private transient Map aliasToNewAliasMap;

  private Map> tblAliasToNumberOfBucketsInEachPartition;
  private Map>> tblAliasToBucketedFilePathsInEachPartition;
  private Map> bigTblPartsToBucketFileNames;
  private Map bigTblPartsToBucketNumber;
  private List joinAliases;
  private String baseBigAlias;
  private boolean bigTablePartitioned;

  public BucketJoinProcCtx(HiveConf conf) {
    this.conf = conf;
  }

  public HiveConf getConf() {
    return conf;
  }

  public Set getRejectedJoinOps() {
    return rejectedJoinOps;
  }

  public Set getConvertedJoinOps() {
    return convertedJoinOps;
  }

  public void setRejectedJoinOps(Set rejectedJoinOps) {
    this.rejectedJoinOps = rejectedJoinOps;
  }

  public void setConvertedJoinOps(Set setOfConvertedJoins) {
    this.convertedJoinOps = setOfConvertedJoins;
  }

  public Map> getTblAliasToNumberOfBucketsInEachPartition() {
    return tblAliasToNumberOfBucketsInEachPartition;
  }

  public Map>> getTblAliasToBucketedFilePathsInEachPartition() {
    return tblAliasToBucketedFilePathsInEachPartition;
  }

  public Map> getBigTblPartsToBucketFileNames() {
    return bigTblPartsToBucketFileNames;
  }

  public Map getBigTblPartsToBucketNumber() {
    return bigTblPartsToBucketNumber;
  }

  public void setTblAliasToNumberOfBucketsInEachPartition(
    Map> tblAliasToNumberOfBucketsInEachPartition) {
    this.tblAliasToNumberOfBucketsInEachPartition = tblAliasToNumberOfBucketsInEachPartition;
  }

  public void setTblAliasToBucketedFilePathsInEachPartition(
    Map>> tblAliasToBucketedFilePathsInEachPartition) {
    this.tblAliasToBucketedFilePathsInEachPartition = tblAliasToBucketedFilePathsInEachPartition;
  }

  public void setBigTblPartsToBucketFileNames(
    Map> bigTblPartsToBucketFileNames) {
    this.bigTblPartsToBucketFileNames = bigTblPartsToBucketFileNames;
  }

  public void setBigTblPartsToBucketNumber(Map bigTblPartsToBucketNumber) {
    this.bigTblPartsToBucketNumber = bigTblPartsToBucketNumber;
  }

  public void setJoinAliases(List joinAliases) {
    this.joinAliases = joinAliases;
  }

  public void setBaseBigAlias(String baseBigAlias) {
    this.baseBigAlias = baseBigAlias;
  }

  public List getJoinAliases() {
    return joinAliases;
  }

  public String getBaseBigAlias() {
    return baseBigAlias;
  }

  public boolean isBigTablePartitioned() {
    return bigTablePartitioned;
  }

  public void setBigTablePartitioned(boolean bigTablePartitioned) {
    this.bigTablePartitioned = bigTablePartitioned;
  }

  public void setAliasToNewAliasMap(Map aliasToNewAliasMap) {
    this.aliasToNewAliasMap = aliasToNewAliasMap;
  }

  public Map getAliasToNewAliasMap() {
    return aliasToNewAliasMap;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy