Examples of PrimitiveTypeEntry


Examples of org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorUtils.PrimitiveTypeEntry

   */
  public static PrimitiveObjectInspector getPrimitiveObjectInspectorFromClass(
      Class<?> c) {
    if (Writable.class.isAssignableFrom(c)) {
      // It is a writable class
      PrimitiveTypeEntry te = PrimitiveObjectInspectorUtils
          .getTypeEntryFromPrimitiveWritableClass(c);
      if (te == null) {
        throw new RuntimeException("Internal error: Cannot recognize " + c);
      }
      return PrimitiveObjectInspectorFactory
          .getPrimitiveWritableObjectInspector(te.primitiveCategory);
    } else {
      // It is a Java class
      PrimitiveTypeEntry te = PrimitiveObjectInspectorUtils
          .getTypeEntryFromPrimitiveJavaClass(c);
      if (te == null) {
        throw new RuntimeException("Internal error: Cannot recognize " + c);
      }
      return PrimitiveObjectInspectorFactory
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorUtils.PrimitiveTypeEntry

    private TypeInfo parseType() {

      Token t = expect("type");

      // Is this a primitive type?
      PrimitiveTypeEntry primitiveType = PrimitiveObjectInspectorUtils
          .getTypeEntryFromTypeName(t.text);
      if (primitiveType != null
          && !primitiveType.primitiveCategory.equals(PrimitiveCategory.UNKNOWN)) {
        return TypeInfoFactory.getPrimitiveTypeInfo(primitiveType.typeName);
      }
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorUtils.PrimitiveTypeEntry

    tbIn = new TypedBytesWritableInput(din);
    tbOut = new TypedBytesWritableOutput(barrStr);
    String columnTypeProperty = tbl.getProperty(Constants.LIST_COLUMN_TYPES);
    columnTypes = Arrays.asList(columnTypeProperty.split(","));
    for (String columnType : columnTypes) {
      PrimitiveTypeEntry dstTypeEntry = PrimitiveObjectInspectorUtils
          .getTypeEntryFromTypeName(columnType);
      dstOIns.add(PrimitiveObjectInspectorFactory
          .getPrimitiveWritableObjectInspector(dstTypeEntry.primitiveCategory));
    }
  }
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorUtils.PrimitiveTypeEntry

        assert pos == row.size();
        assert pos == rowTypeName.size();
        row.add(wrt);
        rowTypeName.add(type.name());
        String typeName = typedBytesToTypeName.get(type);
        PrimitiveTypeEntry srcTypeEntry = PrimitiveObjectInspectorUtils
            .getTypeEntryFromTypeName(typeName);
        srcOIns
            .add(PrimitiveObjectInspectorFactory
            .getPrimitiveWritableObjectInspector(srcTypeEntry.primitiveCategory));
        converters.add(ObjectInspectorConverters.getConverter(srcOIns.get(pos),
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorUtils.PrimitiveTypeEntry

            "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.primitive.PrimitiveObjectInspectorUtils.PrimitiveTypeEntry

      // there is no overlap between columns and partitioning columns
      Iterator<FieldSchema> partColsIter = crtTblDesc.getPartCols().iterator();
      while (partColsIter.hasNext()) {
        FieldSchema fs = partColsIter.next();
        String partCol = fs.getName();
        PrimitiveTypeEntry pte = PrimitiveObjectInspectorUtils.getTypeEntryFromTypeName(
            fs.getType());
        if(null == pte){
          throw new SemanticException(ErrorMsg.PARTITION_COLUMN_NON_PRIMITIVE.getMsg() + " Found "
        + partCol + " of type: " + fs.getType());
        }
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorUtils.PrimitiveTypeEntry

   */
  public static PrimitiveObjectInspector getPrimitiveObjectInspectorFromClass(
      Class<?> c) {
    if (Writable.class.isAssignableFrom(c)) {
      // It is a writable class
      PrimitiveTypeEntry te = PrimitiveObjectInspectorUtils
          .getTypeEntryFromPrimitiveWritableClass(c);
      if (te == null) {
        throw new RuntimeException("Internal error: Cannot recognize " + c);
      }
      return PrimitiveObjectInspectorFactory
          .getPrimitiveWritableObjectInspector(te.primitiveCategory);
    } else {
      // It is a Java class
      PrimitiveTypeEntry te = PrimitiveObjectInspectorUtils
          .getTypeEntryFromPrimitiveJavaClass(c);
      if (te == null) {
        throw new RuntimeException("Internal error: Cannot recognize " + c);
      }
      return PrimitiveObjectInspectorFactory
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorUtils.PrimitiveTypeEntry

    private TypeInfo parseType() {

      Token t = expect("type");

      // Is this a primitive type?
      PrimitiveTypeEntry typeEntry =
          PrimitiveObjectInspectorUtils.getTypeEntryFromTypeName(t.text);
      if (typeEntry != null && typeEntry.primitiveCategory != PrimitiveCategory.UNKNOWN ) {
        String[] params = parseParams();
        switch (typeEntry.primitiveCategory) {
        case CHAR:
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorUtils.PrimitiveTypeEntry

   * @param fullName Fully qualified name of the type
   * @return PrimitiveTypeInfo instance
   */
  private static PrimitiveTypeInfo createPrimitiveTypeInfo(String fullName) {
    String baseName = TypeInfoUtils.getBaseName(fullName);
    PrimitiveTypeEntry typeEntry =
        PrimitiveObjectInspectorUtils.getTypeEntryFromTypeName(baseName);
    if (null == typeEntry) {
      throw new RuntimeException("Unknown type " + fullName);
    }

View Full Code Here

Examples of org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorUtils.PrimitiveTypeEntry

      DynamicSerDeTypeMap btMap = (DynamicSerDeTypeMap) bt;
      return ObjectInspectorFactory.getStandardMapObjectInspector(
          dynamicSerDeStructBaseToObjectInspector(btMap.getKeyType()),
          dynamicSerDeStructBaseToObjectInspector(btMap.getValueType()));
    } else if (bt.isPrimitive()) {
      PrimitiveTypeEntry pte = PrimitiveObjectInspectorUtils
          .getTypeEntryFromPrimitiveJavaClass(bt.getRealType());
      return PrimitiveObjectInspectorFactory.getPrimitiveJavaObjectInspector(pte.primitiveCategory);
    } else {
      // Must be a struct
      DynamicSerDeStructBase btStruct = (DynamicSerDeStructBase) bt;
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.