Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
FunctionParams.java
Go to the documentation of this file.
1 // Copyright 2012 Cloudera Inc.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 package com.cloudera.impala.analysis;
16 
17 import java.util.List;
18 
23 class FunctionParams implements Cloneable {
24  private final boolean isStar_;
25  private boolean isDistinct_;
26  private final List<Expr> exprs_;
27 
28  // c'tor for non-star params
29  public FunctionParams(boolean isDistinct, List<Expr> exprs) {
30  isStar_ = false;
31  this.isDistinct_ = isDistinct;
32  this.exprs_ = exprs;
33  }
34 
35  // c'tor for non-star, non-distinct params
36  public FunctionParams(List<Expr> exprs) {
37  this(false, exprs);
38  }
39 
40  static public FunctionParams createStarParam() {
41  return new FunctionParams();
42  }
43 
44  public boolean isStar() { return isStar_; }
45  public boolean isDistinct() { return isDistinct_; }
46  public List<Expr> exprs() { return exprs_; }
47  public void setIsDistinct(boolean v) { isDistinct_ = v; }
48  public int size() { return exprs_ == null ? 0 : exprs_.size(); }
49 
50  // c'tor for <agg>(*)
51  private FunctionParams() {
52  exprs_ = null;
53  isStar_ = true;
54  isDistinct_ = false;
55  }
56 }
FunctionParams(boolean isDistinct, List< Expr > exprs)