Examples of PrimitiveCategory


Examples of org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector.PrimitiveCategory

   */
  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) {
      case VOID:
      case BOOLEAN:
      case BYTE:
        recordInfo.elementOffset = 0;
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector.PrimitiveCategory

  /**
   * Create a lazy binary primitive class given the type name.
   */
  public static LazyBinaryPrimitive<?,?> createLazyBinaryPrimitiveClass(PrimitiveObjectInspector oi) {
    PrimitiveCategory p = oi.getPrimitiveCategory();
    switch(p) {
      case BOOLEAN: {
        return new LazyBinaryBoolean((WritableBooleanObjectInspector)oi);
      }
      case BYTE: {
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector.PrimitiveCategory

    }
   
    // The return type of a function can be either Java Primitive or Writable.
    if (PrimitiveObjectInspectorUtils.isPrimitiveWritableClass(
        udfMethod.getReturnType())) {
      PrimitiveCategory pc = PrimitiveObjectInspectorUtils
          .getTypeEntryFromPrimitiveWritableClass(udfMethod.getReturnType())
          .primitiveCategory;
      return PrimitiveObjectInspectorFactory
          .getPrimitiveWritableObjectInspector(pc);
    } else {
      PrimitiveCategory pc = PrimitiveObjectInspectorUtils
          .getTypeEntryFromPrimitiveJavaClass(udfMethod.getReturnType())
          .primitiveCategory;
      return PrimitiveObjectInspectorFactory
          .getPrimitiveJavaObjectInspector(pc);
    }
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector.PrimitiveCategory

  transient ObjectInspector writableObjectInspector;
  transient Object writableValue;
 
  public ExprNodeConstantEvaluator(exprNodeConstantDesc expr) {
    this.expr = expr;
    PrimitiveCategory pc = ((PrimitiveTypeInfo)expr.getTypeInfo())
        .getPrimitiveCategory();
    writableObjectInspector = PrimitiveObjectInspectorFactory
        .getPrimitiveWritableObjectInspector(pc);
    // Convert from Java to Writable
    writableValue = PrimitiveObjectInspectorFactory
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector.PrimitiveCategory

  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) {
      case VOID:
        recordInfo.elementOffset = 0;
        recordInfo.elementSize = 0;
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector.PrimitiveCategory

  /**
   * Create a lazy binary primitive class given the type name.
   */
  public static LazyBinaryPrimitive<?, ?> createLazyBinaryPrimitiveClass(
      PrimitiveObjectInspector oi) {
    PrimitiveCategory p = oi.getPrimitiveCategory();
    switch (p) {
    case BOOLEAN:
      return new LazyBinaryBoolean((WritableBooleanObjectInspector) oi);
    case BYTE:
      return new LazyBinaryByte((WritableByteObjectInspector) oi);
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector.PrimitiveCategory

    if (length == 0) {
      return -1;
    }
    Category category = objectInspector.getCategory();
    if (category.equals(Category.PRIMITIVE)) {
      PrimitiveCategory primitiveCategory = ((PrimitiveObjectInspector) objectInspector)
          .getPrimitiveCategory();
      if (primitiveCategory.equals(PrimitiveCategory.STRING) && (length == 1) &&
            (cachedByteArrayRef.getData()[start]
              == LazyBinaryColumnarSerDe.INVALID_UTF__SINGLE_BYTE[0])) {
        return 0;
      }
    }
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector.PrimitiveCategory

  /**
   * Create a lazy primitive class given the type name.
   */
  public static LazyPrimitive<?, ?> createLazyPrimitiveClass(
      PrimitiveObjectInspector oi) {
    PrimitiveCategory p = oi.getPrimitiveCategory();
    switch (p) {
    case BOOLEAN:
      return new LazyBoolean((LazyBooleanObjectInspector) oi);
    case BYTE:
      return new LazyByte((LazyByteObjectInspector) oi);
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector.PrimitiveCategory

      if (arguments[i].getCategory() != ObjectInspector.Category.PRIMITIVE) {
        throw new UDFArgumentTypeException(i,
            "The parameters of GenericUDFReflect(class,method[,arg1[,arg2]...])"
            + " must be primitive (int, double, string, etc).");
      }
      PrimitiveCategory category =
          ((PrimitiveObjectInspector)arguments[i]).getPrimitiveCategory();
      PrimitiveTypeEntry t =
          PrimitiveObjectInspectorUtils.getTypeEntryFromPrimitiveCategory(category);
      parameterJavaClasses[i - 2] = t.primitiveJavaClass;
      parameterJavaTypes[i - 2] = t.primitiveJavaType;
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector.PrimitiveCategory

  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) {
      case VOID:
        recordInfo.elementOffset = 0;
        recordInfo.elementSize = 0;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.