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

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


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


  private transient ObjectInspectorConverters.Converter[] converters;

  @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

  @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

    return PrimitiveObjectInspectorFactory.writableLongObjectInspector;
  }

  protected void initializeInput(ObjectInspector[] arguments) throws UDFArgumentException {
    if (arguments.length < 1) {
      throw new UDFArgumentLengthException("The function " + getName().toUpperCase() +
          "requires at least one argument");
    }
    for (ObjectInspector argument : arguments) {
      if (arguments[0].getCategory() != Category.PRIMITIVE) {
        throw new UDFArgumentException(getName().toUpperCase() +
View Full Code Here

  @Override
  public ObjectInspector initialize(ObjectInspector[] arguments) throws UDFArgumentException {

    if (arguments.length % 2 != 0) {
      throw new UDFArgumentLengthException(
          "Arguments must be in key/value pairs");
    }

    GenericUDFUtils.ReturnObjectInspectorResolver keyOIResolver =
        new GenericUDFUtils.ReturnObjectInspectorResolver(true);
View Full Code Here

  private transient BytesWritable result = new BytesWritable();

  @Override
  public ObjectInspector initialize(ObjectInspector[] arguments) throws UDFArgumentException {
    if (arguments.length != 2) {
      throw new UDFArgumentLengthException("Encode() requires exactly two arguments");
    }

    if (arguments[0].getCategory() != Category.PRIMITIVE ||
        PrimitiveGrouping.STRING_GROUP != PrimitiveObjectInspectorUtils.getPrimitiveGrouping(
            ((PrimitiveObjectInspector)arguments[0]).getPrimitiveCategory())){
View Full Code Here

  private transient 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 transient 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

  private transient TimestampConverter tc;

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

  private DecimalTypeInfo typeInfo;

  @Override
  public ObjectInspector initialize(ObjectInspector[] arguments) throws UDFArgumentException {
    if (arguments.length < 1) {
      throw new UDFArgumentLengthException(
          "The function DECIMAL requires at least one argument, got "
          + arguments.length);
    }
    try {
      argumentOI = (PrimitiveObjectInspector) arguments[0];
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.