Package org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector

Examples of org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector.Category


    if (arguments.length != 2) {
      throw new UDFArgumentException(opName + " requires two arguments.");
    }

    for (int i = 0; i < 2; i++) {
      Category category = arguments[i].getCategory();
      if (category != Category.PRIMITIVE) {
        throw new UDFArgumentTypeException(i, "The "
            + GenericUDFUtils.getOrdinal(i + 1)
            + " argument of " + opName + "  is expected to a "
            + Category.PRIMITIVE.toString().toLowerCase() + " type, but "
            + category.toString().toLowerCase() + " is found");
      }
    }

    // During map/reduce tasks, there may not be a valid HiveConf from the SessionState.
    // So lookup and save any needed conf information during query compilation in the Hive conf
View Full Code Here


      throws UDFArgumentException {
    if (arguments.length != 1) {
      throw new UDFArgumentLengthException(
          "The function SIZE only accepts 1 argument.");
    }
    Category category = arguments[0].getCategory();
    String typeName = arguments[0].getTypeName();
    if (category != Category.MAP && category != Category.LIST
        && !typeName.equals(serdeConstants.VOID_TYPE_NAME)) {
      throw new UDFArgumentTypeException(0, "\""
          + Category.MAP.toString().toLowerCase() + "\" or \""
View Full Code Here

   * @param recordInfo
   *          modify this byteinfo object and return it
   */
  public static void checkObjectByteInfo(ObjectInspector objectInspector,
      byte[] bytes, int offset, RecordInfo recordInfo) {
    Category category = objectInspector.getCategory();
    switch (category) {
    case PRIMITIVE:
      PrimitiveCategory primitiveCategory = ((PrimitiveObjectInspector) objectInspector)
          .getPrimitiveCategory();
      switch (primitiveCategory) {
View Full Code Here

   * @param o1
   * @param o2
   * @return true if the given object inspectors represent the same types.
   */
  public static boolean compareTypes(ObjectInspector o1, ObjectInspector o2) {
    Category c1 = o1.getCategory();
    Category c2 = o2.getCategory();

    // Return false if categories are not equal
    if (!c1.equals(c2)) {
      return false;
    }
View Full Code Here

    }

    argumentOIs = arguments;

    for (int i = 0; i < arguments.length; i++) {
      Category category = arguments[i].getCategory();
      if (category != Category.PRIMITIVE) {
        throw new UDFArgumentTypeException(i, "The "
            + GenericUDFUtils.getOrdinal(i + 1)
            + " argument of function FIELD is expected to a "
            + Category.PRIMITIVE.toString().toLowerCase() + " type, but "
            + category.toString().toLowerCase() + " is found");
      }
    }

    return PrimitiveObjectInspectorFactory.writableIntObjectInspector;
  }
View Full Code Here

   * @param o1
   * @param o2
   * @return true if the given object inspectors represent the same types.
   */
  public static boolean compareTypes(ObjectInspector o1, ObjectInspector o2) {
    Category c1 = o1.getCategory();
    Category c2 = o2.getCategory();

    // Return false if categories are not equal
    if (!c1.equals(c2)) {
      return false;
    }
View Full Code Here

   *          modify this byteinfo object and return it
   */
  public static void checkObjectByteInfo(ObjectInspector objectInspector,
      byte[] bytes, int offset, RecordInfo recordInfo) {
    VInt vInt = vIntThreadLocal.get();
    Category category = objectInspector.getCategory();
    switch (category) {
    case PRIMITIVE:
      PrimitiveCategory primitiveCategory = ((PrimitiveObjectInspector) objectInspector)
          .getPrimitiveCategory();
      switch (primitiveCategory) {
View Full Code Here

      throw new UDFArgumentLengthException(
          "The function scale accepts exactly 3 arguments.");
    }

    for (int i = 0; i < arguments.length; i++) {
      Category category = arguments[i].getCategory();
      if (category != Category.PRIMITIVE) {
        throw new UDFArgumentTypeException(i, "The "
            + GenericUDFUtils.getOrdinal(i + 1)
            + " argument of function LOCATE is expected to a "
            + Category.PRIMITIVE.toString().toLowerCase()
            + " type, but " + category.toString().toLowerCase()
            + " is found");
      }
    }

    converters = new Converter[arguments.length];
View Full Code Here

   * @param o1
   * @param o2
   * @return true if the given object inspectors represent the same types.
   */
  public static boolean compareTypes(ObjectInspector o1, ObjectInspector o2) {
    Category c1 = o1.getCategory();
    Category c2 = o2.getCategory();

    // Return false if categories are not equal
    if (!c1.equals(c2)) {
      return false;
    }
View Full Code Here

  Object parseJson(JsonNode jsonNode);
    ObjectInspector getReturnType()
   
    final public class InspectorHandleFactory {
      static public InspectorHandle GenerateInspectorHandle( ObjectInspector insp ) throws UDFArgumentException {
        Category cat = insp.getCategory();
        switch( cat)  {
        case LIST:
          return new InspectorHandle.ListHandle( (ListObjectInspector)insp );
        case MAP:
          return new InspectorHandle.MapHandle( (MapObjectInspector)insp);
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector.Category

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.