PageRenderTime 21ms CodeModel.GetById 15ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 1ms

/tags/release-0.0.0-rc0/hive/external/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDAFResolver2.java

#
Java | 62 lines | 7 code | 4 blank | 51 comment | 0 complexity | 8ee0f50399812a93ca91fe0372b9b504 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.udf.generic;
20
21import org.apache.hadoop.hive.ql.parse.SemanticException;
22
23/**
24 * This interface extends the <tt>GenericUDAFResolver</tt> interface and
25 * provides more flexibility in terms of discovering the parameter types
26 * supplied to the UDAF. Implementations that extend this interface will
27 * also have access to extra information such as the specification of the
28 * <tt>DISTINCT</tt> qualifier or the invocation with the special wildcard
29 * character.
30 * <p>
31 * <b>Note:</b> The implementation of function does not have to handle the
32 * actual <tt>DISTINCT</tt> or wildcard implementation. This information is
33 * provided only to allow the function implementation to accept or reject
34 * such invocations. For example - the implementation of <tt>COUNT</tt> UDAF
35 * requires that the <tt>DISTINCT</tt> qualifier be supplied when more than
36 * one parameters are specified in the invocation. The actual filtering of
37 * data bound to parameter types for <tt>DISTINCT</tt> implementation is
38 * handled by the framework and not the <tt>COUNT</tt> UDAF implementation.
39 */
40@SuppressWarnings("deprecation")
41public interface GenericUDAFResolver2 extends GenericUDAFResolver {
42
43  /**
44   * Get the evaluator for the parameter types.
45   *
46   * The reason that this function returns an object instead of a class is
47   * because it is possible that the object needs some configuration (that can
48   * be serialized). In that case the class of the object has to implement the
49   * Serializable interface. At execution time, we will deserialize the object
50   * from the plan and use it to evaluate the aggregations.
51   * <p>
52   * If the class of the object does not implement Serializable, then we will
53   * create a new instance of the class at execution time.
54   * </p>
55   *
56   * @param info The parameter information that is applicable to the UDAF being
57   *          invoked.
58   * @throws SemanticException
59   */
60  GenericUDAFEvaluator getEvaluator(
61      GenericUDAFParameterInfo info) throws SemanticException;
62}