View Javadoc

1   /*
2    * Copyright (c) 2011.  The Apache Software Foundation
3    *
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "License"); you may not use this file except in compliance
10   * with the License.  You may obtain a copy of the License at
11   *
12   *     http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing, software
15   * distributed under the License is distributed on an "AS IS" BASIS,
16   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17   * See the License for the specific language governing permissions and
18   * limitations under the License.
19   */
20  
21  package org.apache.hadoop.hbase.hbql.statement.select;
22  
23  import org.apache.expreval.expr.var.NamedParameter;
24  import org.apache.hadoop.hbase.client.Result;
25  import org.apache.hadoop.hbase.hbql.client.HBqlException;
26  import org.apache.hadoop.hbase.hbql.client.HConnection;
27  import org.apache.hadoop.hbase.hbql.impl.AggregateValue;
28  import org.apache.hadoop.hbase.hbql.impl.HConnectionImpl;
29  import org.apache.hadoop.hbase.hbql.mapping.ColumnAttrib;
30  import org.apache.hadoop.hbase.hbql.mapping.MappingContext;
31  import org.apache.hadoop.hbase.hbql.statement.SelectStatement;
32  
33  import java.io.Serializable;
34  import java.util.List;
35  
36  public interface SelectElement extends Serializable {
37  
38      static final long serialVersionUID = 1L;
39  
40      void validate(MappingContext mappingContext, HConnection connection) throws HBqlException;
41  
42      List<ColumnAttrib> getAttribsUsedInExpr();
43  
44      void assignAsNamesForExpressions(SelectStatement selectStatement);
45  
46      void assignSelectValue(HConnectionImpl connection, Object newobj, int maxVerions, Result result) throws HBqlException;
47  
48      int setParameter(String name, Object val) throws HBqlException;
49  
50      List<NamedParameter> getParameterList();
51  
52      void reset();
53  
54      String getAsName();
55  
56      String getElementName();
57  
58      boolean hasAsName();
59  
60      boolean isAFamilySelect();
61  
62      String asString();
63  
64      AggregateValue newAggregateValue() throws HBqlException;
65  
66      boolean isAnAggregateElement();
67  
68      void validateTypes(boolean allowColumns, boolean allowCollections) throws HBqlException;
69  }