Examples of BaseTypeParams


Examples of org.apache.hadoop.hive.serde2.typeinfo.BaseTypeParams

      new PrimitiveObjectInspectorUtils.ParameterizedObjectInspectorMap();

  public static PrimitiveObjectInspector getParameterizedObjectInspector(
      PrimitiveTypeSpec typeSpec) {
    PrimitiveCategory primitiveCategory = typeSpec.getPrimitiveCategory();
    BaseTypeParams typeParams = typeSpec.getTypeParams();
    PrimitiveObjectInspector poi =
        cachedParameterizedLazyObjectInspectors.getObjectInspector(typeSpec);
    if (poi == null) {
      // Object inspector hasn't been cached for this type/params yet, create now
      switch (primitiveCategory) {
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.typeinfo.BaseTypeParams

  }

  public static AbstractPrimitiveLazyObjectInspector<?> getLazyObjectInspector(
      PrimitiveTypeSpec typeSpec, boolean escaped, byte escapeChar) {
    PrimitiveCategory primitiveCategory = typeSpec.getPrimitiveCategory();
    BaseTypeParams typeParams = typeSpec.getTypeParams();

    if (typeParams == null) {
      return getLazyObjectInspector(primitiveCategory, escaped, escapeChar);
    } else {
      switch(primitiveCategory) {
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.typeinfo.BaseTypeParams

      throws SemanticException {
    ExprNodeDesc ret;

    // Get base type, since type string may be parameterized
    String baseType = TypeInfoUtils.getBaseName(tableFieldTypeInfo.getTypeName());
    BaseTypeParams typeParams = null;
    // If TypeInfo is parameterized, provide the params to the UDF factory method.
    typeParams = tableFieldTypeInfo.getTypeParams();
    if (typeParams != null) {
      switch (tableFieldTypeInfo.getPrimitiveCategory()) {
        case VARCHAR:
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.typeinfo.BaseTypeParams

        return this;
      }

      PrimitiveTypeEntry result;
      try {
        BaseTypeParams newTypeParams = (BaseTypeParams)typeParamsClass.newInstance();
        newTypeParams.set(parameters);
        String typeNameWithParams = this.typeName + newTypeParams.toString();
        if (typeNameToTypeEntry.containsKey(typeNameWithParams)) {
          return typeNameToTypeEntry.get(typeNameWithParams);
        }
        result = (PrimitiveTypeEntry)this.clone();
        result.typeParams = newTypeParams;
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.typeinfo.BaseTypeParams

    public static BaseTypeParams createTypeParams(String typeName, String[] parameters)
        throws SerDeException {
      try {
        PrimitiveTypeEntry typeEntry = getTypeEntryFromTypeName(typeName);
        if (typeEntry != null && typeEntry.typeParamsClass != null) {
          BaseTypeParams newTypeParams = (BaseTypeParams)typeEntry.typeParamsClass.newInstance();
          newTypeParams.set(parameters);
          return newTypeParams;
        } else {
          return null;
        }
      } catch (Exception err) {
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.typeinfo.BaseTypeParams

    }

    public PrimitiveObjectInspector getObjectInspector(
        PrimitiveTypeSpec typeSpec) {
      PrimitiveCategory category = typeSpec.getPrimitiveCategory();
      BaseTypeParams params = typeSpec.getTypeParams();
      HashMap<String, PrimitiveObjectInspector> entriesForCategory = entries.get(category);
      if (entriesForCategory == null) {
        return null;
      }
      return (PrimitiveObjectInspector)entriesForCategory.get(params.toString());
    }
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.typeinfo.BaseTypeParams

   * @return
   */
  public static AbstractPrimitiveWritableObjectInspector getPrimitiveWritableObjectInspector(
      PrimitiveTypeSpec typeSpec) {
    PrimitiveCategory primitiveCategory = typeSpec.getPrimitiveCategory();
    BaseTypeParams primitiveTypeParams = typeSpec.getTypeParams();

    if (primitiveTypeParams == null) {
      // No type params, just search the unparameterized types
      return getPrimitiveWritableObjectInspector(primitiveCategory);
    } else {
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.typeinfo.BaseTypeParams

   * @param value
   */
  public static ConstantObjectInspector getPrimitiveWritableConstantObjectInspector(
      PrimitiveTypeSpec typeSpecs, Object value) {
    PrimitiveCategory primitiveCategory = typeSpecs.getPrimitiveCategory();
    BaseTypeParams typeParams = typeSpecs.getTypeParams();

    switch (primitiveCategory) {
    case BOOLEAN:
      return new WritableConstantBooleanObjectInspector((BooleanWritable)value);
    case BYTE:
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.typeinfo.BaseTypeParams

   * @return
   */
  public static AbstractPrimitiveJavaObjectInspector getPrimitiveJavaObjectInspector(
        PrimitiveTypeSpec typeSpec) {
    PrimitiveCategory primitiveCategory = typeSpec.getPrimitiveCategory();
    BaseTypeParams primitiveTypeParams = typeSpec.getTypeParams();

    if (primitiveTypeParams == null) {
      // No type params, just search the unparameterized types
      return getPrimitiveJavaObjectInspector(primitiveCategory);
    } else {
View Full Code Here

Examples of org.apache.hadoop.hive.serde2.typeinfo.BaseTypeParams

      byte[] separator, int separatorIndex, Text nullSequence, boolean escaped,
      byte escapeChar) throws SerDeException {
    ObjectInspector.Category c = typeInfo.getCategory();
    switch (c) {
    case PRIMITIVE:
      BaseTypeParams typeParams = ((PrimitiveTypeInfo)typeInfo).getTypeParams();
      return LazyPrimitiveObjectInspectorFactory.getLazyObjectInspector(
          (PrimitiveTypeInfo) typeInfo, escaped, escapeChar);
    case MAP:
      return LazyObjectInspectorFactory.getLazySimpleMapObjectInspector(
          createLazyObjectInspector(((MapTypeInfo) typeInfo)
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.