Examples of PrimitiveTypeEntry


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)) {
        if (primitiveType.isParameterized()) {
          primitiveType = primitiveType.addParameters(parseParams());
        }
        // If type has qualifiers, the TypeInfo needs them in its type string
        return TypeInfoFactory.getPrimitiveTypeInfo(primitiveType.toString());
      }

      // Is this a list type?
      if (serdeConstants.LIST_TYPE_NAME.equals(t.text)) {
        expect("<");
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);
    } else {
      // Must be a struct
      DynamicSerDeStructBase btStruct = (DynamicSerDeStructBase) bt;
View Full Code Here

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

  private TypeInfoFactory() {
    // prevent instantiation
  }

  public static TypeInfo getPrimitiveTypeInfo(String typeName) {
    PrimitiveTypeEntry typeEntry = PrimitiveObjectInspectorUtils
        .getTypeEntryFromTypeName(TypeInfoUtils.getBaseName(typeName));
    if (null == typeEntry) {
      throw new RuntimeException("Cannot getPrimitiveTypeInfo for " + typeName);
    }
    TypeInfo result = cachedPrimitiveTypeInfo.get(typeName);
View Full Code Here

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

              typeSpec);
      if (oi == null) {
        // Do a bit of validation - not all primitive types use parameters.
        switch (primitiveCategory) {
          case VARCHAR:
            PrimitiveTypeEntry typeEntry = PrimitiveObjectInspectorUtils.getTypeEntryFromTypeSpecs(
                primitiveCategory,
                primitiveTypeParams);
            oi = new WritableHiveVarcharObjectInspector(typeEntry);
            oi.setTypeParams(primitiveTypeParams);
            cachedParameterizedPrimitiveWritableObjectInspectorCache.setObjectInspector(oi);
View Full Code Here

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

              typeSpec);
      if (oi == null) {
        // Do a bit of validation - not all primitive types use parameters.
        switch (primitiveCategory) {
          case VARCHAR:
            PrimitiveTypeEntry typeEntry = PrimitiveObjectInspectorUtils.getTypeEntryFromTypeSpecs(
                primitiveCategory,
                primitiveTypeParams);
            oi = new JavaHiveVarcharObjectInspector(typeEntry);
            oi.setTypeParams(primitiveTypeParams);
            cachedParameterizedPrimitiveJavaObjectInspectorCache.setObjectInspector(oi);
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

    tbIn = new TypedBytesWritableInput(din);
    tbOut = new TypedBytesWritableOutput(barrStr);
    String columnTypeProperty = tbl.getProperty(serdeConstants.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

   */
  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
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.