PageRenderTime 53ms CodeModel.GetById 22ms RepoModel.GetById 0ms app.codeStats 0ms

/tags/release-0.1-rc2/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
Possible License(s): Apache-2.0, BSD-3-Clause, JSON, CPL-1.0
  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. package org.apache.hadoop.hive.ql.plan;
  19. import java.io.Serializable;
  20. import java.util.List;
  21. /**
  22. * FilterDesc.
  23. *
  24. */
  25. @Explain(displayName = "Filter Operator")
  26. public class FilterDesc implements Serializable {
  27. /**
  28. * sampleDesc is used to keep track of the sampling descriptor.
  29. */
  30. public static class sampleDesc {
  31. // The numerator of the TABLESAMPLE clause
  32. private int numerator;
  33. // The denominator of the TABLESAMPLE clause
  34. private int denominator;
  35. // Input files can be pruned
  36. private boolean inputPruning;
  37. public sampleDesc() {
  38. }
  39. public sampleDesc(int numerator, int denominator,
  40. List<String> tabBucketCols, boolean inputPruning) {
  41. this.numerator = numerator;
  42. this.denominator = denominator;
  43. this.inputPruning = inputPruning;
  44. }
  45. public int getNumerator() {
  46. return numerator;
  47. }
  48. public int getDenominator() {
  49. return denominator;
  50. }
  51. public boolean getInputPruning() {
  52. return inputPruning;
  53. }
  54. }
  55. private static final long serialVersionUID = 1L;
  56. private org.apache.hadoop.hive.ql.plan.ExprNodeDesc predicate;
  57. private boolean isSamplingPred;
  58. private transient sampleDesc sampleDescr;
  59. public FilterDesc() {
  60. }
  61. public FilterDesc(
  62. final org.apache.hadoop.hive.ql.plan.ExprNodeDesc predicate,
  63. boolean isSamplingPred) {
  64. this.predicate = predicate;
  65. this.isSamplingPred = isSamplingPred;
  66. sampleDescr = null;
  67. }
  68. public FilterDesc(
  69. final org.apache.hadoop.hive.ql.plan.ExprNodeDesc predicate,
  70. boolean isSamplingPred, final sampleDesc sampleDescr) {
  71. this.predicate = predicate;
  72. this.isSamplingPred = isSamplingPred;
  73. this.sampleDescr = sampleDescr;
  74. }
  75. @Explain(displayName = "predicate")
  76. public org.apache.hadoop.hive.ql.plan.ExprNodeDesc getPredicate() {
  77. return predicate;
  78. }
  79. public void setPredicate(
  80. final org.apache.hadoop.hive.ql.plan.ExprNodeDesc predicate) {
  81. this.predicate = predicate;
  82. }
  83. @Explain(displayName = "isSamplingPred", normalExplain = false)
  84. public boolean getIsSamplingPred() {
  85. return isSamplingPred;
  86. }
  87. public void setIsSamplingPred(final boolean isSamplingPred) {
  88. this.isSamplingPred = isSamplingPred;
  89. }
  90. @Explain(displayName = "sampleDesc", normalExplain = false)
  91. public sampleDesc getSampleDescr() {
  92. return sampleDescr;
  93. }
  94. public void setSampleDescr(final sampleDesc sampleDescr) {
  95. this.sampleDescr = sampleDescr;
  96. }
  97. }