Package org.apache.hadoop.hive.ql.exec

Examples of org.apache.hadoop.hive.ql.exec.UDFArgumentLengthException


      throws UDFArgumentException {
    this.argumentOIs = arguments;
    returnOIResolver = new GenericUDFUtils.ReturnObjectInspectorResolver(true);

    if (arguments.length != 3) {
      throw new UDFArgumentLengthException(
          "The function IF(expr1,expr2,expr3) accepts exactly 3 arguments.");
    }

    boolean conditionTypeIsOk = (arguments[0].getCategory() == ObjectInspector.Category.PRIMITIVE);
    if (conditionTypeIsOk) {
View Full Code Here


  @Override
  public ObjectInspector initialize(ObjectInspector[] arguments)
      throws UDFArgumentException {
    if (arguments.length != 1) {
      throw new UDFArgumentLengthException(
          "The operator 'IS NULL' only accepts 1 argument.");
    }
    return PrimitiveObjectInspectorFactory.writableBooleanObjectInspector;
  }
View Full Code Here

  @Override
  public ObjectInspector initialize(ObjectInspector[] arguments)
      throws UDFArgumentException {
    if (arguments.length < 2) {
      throw new UDFArgumentLengthException(
          "The function ELT(N,str1,str2,str3,...) needs at least two arguments.");
    }

    for(int i = 0; i < arguments.length; i++) {
      Category category = arguments[i].getCategory();
View Full Code Here

  private ObjectInspectorConverters.Converter[] converters;
 
  public ObjectInspector initialize(ObjectInspector[] arguments)
  throws UDFArgumentException {   
    if (arguments.length != 2) {
      throw new UDFArgumentLengthException(
          "The function SPLIT(s, regexp) takes exactly 2 arguments.");
    }
   
    converters = new ObjectInspectorConverters.Converter[arguments.length];
    for(int i = 0; i < arguments.length; i++) {
View Full Code Here

  @Override
  public ObjectInspector initialize(ObjectInspector[] arguments)
      throws UDFArgumentException {
    if(arguments.length != 3) {
      throw new UDFArgumentLengthException(
          "The function TRANSLATE(expr,from_string,to_string) accepts exactly 3 arguments, but "
          + arguments.length + " arguments is found.");
    }

    for(int i = 0; i < 3; i++) {
View Full Code Here

  private BinaryConverter baConverter;

  @Override
  public ObjectInspector initialize(ObjectInspector[] arguments) throws UDFArgumentException {
    if (arguments.length < 1) {
      throw new UDFArgumentLengthException(
          "The function BINARY requires at least one argument, got "
          + arguments.length);
    }
    try {
      argumentOI = (PrimitiveObjectInspector) arguments[0];
View Full Code Here

  @Override
  public ObjectInspector initialize(ObjectInspector[] arguments)
  throws UDFArgumentException {
    if (arguments.length != 1) {
      throw new UDFArgumentLengthException("The function MAP_KEYS only accepts one argument.");
    } else if (!(arguments[0] instanceof MapObjectInspector)) {
      throw new UDFArgumentTypeException(0, "\""
          + Category.MAP.toString().toLowerCase()
          + "\" is expected at function MAP_KEYS, " + "but \""
          + arguments[0].getTypeName() + "\" is found");
View Full Code Here

  @Override
  public ObjectInspector initialize(ObjectInspector[] arguments)
  throws UDFArgumentException {
   
    if (arguments.length < 2) {
      throw new UDFArgumentLengthException(
          "The function GenericUDFReflect(class,method[,arg1[,arg2]...])"
          + " accepts 2 or more arguments.");
    }

    for (int i = 0; i < 2; i++) {
View Full Code Here

  private ObjectInspectorConverters.Converter[] converters;

  @Override
  public ObjectInspector initialize(ObjectInspector[] arguments) throws UDFArgumentException {
    if (arguments.length != 2 && arguments.length != 3) {
      throw new UDFArgumentLengthException(
          "The function LOCATE accepts exactly 2 or 3 arguments.");
    }

    for (int i = 0; i < arguments.length; i++) {
      Category category = arguments[i].getCategory();
View Full Code Here

  private ObjectInspector returnOI;

  @Override
  public ObjectInspector initialize(ObjectInspector[] arguments) throws UDFArgumentException {
    if (arguments.length != 2) {
      throw new UDFArgumentLengthException(
          "The function INDEX accepts exactly 2 arguments.");
    }

    if (arguments[0] instanceof MapObjectInspector) {
      // index into a map
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hive.ql.exec.UDFArgumentLengthException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.