PageRenderTime 39ms CodeModel.GetById 12ms RepoModel.GetById 0ms app.codeStats 0ms

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