PageRenderTime 33ms CodeModel.GetById 14ms app.highlight 14ms RepoModel.GetById 2ms app.codeStats 0ms

/tags/release-0.0.0-rc0/hive/external/ql/src/java/org/apache/hadoop/hive/ql/plan/FilterDesc.java

#
Java | 119 lines | 70 code | 22 blank | 27 comment | 0 complexity | 3bade9efa0be9541f2a3ea3ebe289692 MD5 | raw file
  1/**
  2 * Licensed to the Apache Software Foundation (ASF) under one
  3 * or more contributor license agreements.  See the NOTICE file
  4 * distributed with this work for additional information
  5 * regarding copyright ownership.  The ASF licenses this file
  6 * to you under the Apache License, Version 2.0 (the
  7 * "License"); you may not use this file except in compliance
  8 * with the License.  You may obtain a copy of the License at
  9 *
 10 *     http://www.apache.org/licenses/LICENSE-2.0
 11 *
 12 * Unless required by applicable law or agreed to in writing, software
 13 * distributed under the License is distributed on an "AS IS" BASIS,
 14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 15 * See the License for the specific language governing permissions and
 16 * limitations under the License.
 17 */
 18
 19package org.apache.hadoop.hive.ql.plan;
 20
 21import java.io.Serializable;
 22import java.util.List;
 23
 24/**
 25 * FilterDesc.
 26 *
 27 */
 28@Explain(displayName = "Filter Operator")
 29public class FilterDesc implements Serializable {
 30
 31  /**
 32   * sampleDesc is used to keep track of the sampling descriptor.
 33   */
 34  public static class sampleDesc {
 35    // The numerator of the TABLESAMPLE clause
 36    private int numerator;
 37
 38    // The denominator of the TABLESAMPLE clause
 39    private int denominator;
 40
 41    // Input files can be pruned
 42    private boolean inputPruning;
 43
 44    public sampleDesc() {
 45    }
 46
 47    public sampleDesc(int numerator, int denominator,
 48        List<String> tabBucketCols, boolean inputPruning) {
 49      this.numerator = numerator;
 50      this.denominator = denominator;
 51      this.inputPruning = inputPruning;
 52    }
 53
 54    public int getNumerator() {
 55      return numerator;
 56    }
 57
 58    public int getDenominator() {
 59      return denominator;
 60    }
 61
 62    public boolean getInputPruning() {
 63      return inputPruning;
 64    }
 65  }
 66
 67  private static final long serialVersionUID = 1L;
 68  private org.apache.hadoop.hive.ql.plan.ExprNodeDesc predicate;
 69  private boolean isSamplingPred;
 70  private transient sampleDesc sampleDescr;
 71
 72  public FilterDesc() {
 73  }
 74
 75  public FilterDesc(
 76      final org.apache.hadoop.hive.ql.plan.ExprNodeDesc predicate,
 77      boolean isSamplingPred) {
 78    this.predicate = predicate;
 79    this.isSamplingPred = isSamplingPred;
 80    sampleDescr = null;
 81  }
 82
 83  public FilterDesc(
 84      final org.apache.hadoop.hive.ql.plan.ExprNodeDesc predicate,
 85      boolean isSamplingPred, final sampleDesc sampleDescr) {
 86    this.predicate = predicate;
 87    this.isSamplingPred = isSamplingPred;
 88    this.sampleDescr = sampleDescr;
 89  }
 90
 91  @Explain(displayName = "predicate")
 92  public org.apache.hadoop.hive.ql.plan.ExprNodeDesc getPredicate() {
 93    return predicate;
 94  }
 95
 96  public void setPredicate(
 97      final org.apache.hadoop.hive.ql.plan.ExprNodeDesc predicate) {
 98    this.predicate = predicate;
 99  }
100
101  @Explain(displayName = "isSamplingPred", normalExplain = false)
102  public boolean getIsSamplingPred() {
103    return isSamplingPred;
104  }
105
106  public void setIsSamplingPred(final boolean isSamplingPred) {
107    this.isSamplingPred = isSamplingPred;
108  }
109
110  @Explain(displayName = "sampleDesc", normalExplain = false)
111  public sampleDesc getSampleDescr() {
112    return sampleDescr;
113  }
114
115  public void setSampleDescr(final sampleDesc sampleDescr) {
116    this.sampleDescr = sampleDescr;
117  }
118
119}