Examples of DecimalTypeInfo


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

      break;
    case BINARY:
      convertedType = dtFactory.createSqlType(SqlTypeName.BINARY);
      break;
    case DECIMAL:
      DecimalTypeInfo dtInf = (DecimalTypeInfo) type;
      convertedType = dtFactory
          .createSqlType(SqlTypeName.DECIMAL, dtInf.precision(), dtInf.scale());
      break;
    case VARCHAR:
      convertedType = dtFactory.createSqlType(SqlTypeName.VARCHAR,
          ((BaseCharTypeInfo) type).getLength());
      break;
View Full Code Here

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

          case CHAR:
          case VARCHAR:
            result.cols[j] = new BytesColumnVector(VectorizedRowBatch.DEFAULT_SIZE);
            break;
          case DECIMAL:
            DecimalTypeInfo tInfo = (DecimalTypeInfo) poi.getTypeInfo();
            result.cols[j] = new DecimalColumnVector(VectorizedRowBatch.DEFAULT_SIZE,
                tInfo.precision(), tInfo.scale());
            break;
          default:
            throw new RuntimeException("Vectorizaton is not supported for datatype:"
                + poi.getPrimitiveCategory());
          }
View Full Code Here

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

        case CHAR:
        case VARCHAR:
          cvList.add(new BytesColumnVector(VectorizedRowBatch.DEFAULT_SIZE));
          break;
        case DECIMAL:
          DecimalTypeInfo tInfo = (DecimalTypeInfo) poi.getTypeInfo();
          cvList.add(new DecimalColumnVector(VectorizedRowBatch.DEFAULT_SIZE,
              tInfo.precision(), tInfo.scale()));
          break;
        default:
          throw new HiveException("Vectorizaton is not supported for datatype:"
              + poi.getPrimitiveCategory());
        }
View Full Code Here

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

    private void initPartialResultInspector() {
      // the output type of the vectorized partial aggregate must match the
      // expected type for the row-mode aggregation
      // For decimal, the type is "same number of integer digits and 4 more decimal digits"
     
      DecimalTypeInfo dtiSum = GenericUDAFAverage.deriveSumFieldTypeInfo(inputPrecision, inputScale);
      this.sumScale = (short) dtiSum.scale();
      this.sumPrecision = (short) dtiSum.precision();
     
      List<ObjectInspector> foi = new ArrayList<ObjectInspector>();
      foi.add(PrimitiveObjectInspectorFactory.writableLongObjectInspector);
      foi.add(PrimitiveObjectInspectorFactory.getPrimitiveWritableObjectInspector(dtiSum));
      List<String> fname = new ArrayList<String>();
View Full Code Here

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

  }

  @Override
  public void init(AggregationDesc desc) throws HiveException {
    ExprNodeDesc inputExpr = desc.getParameters().get(0);
    DecimalTypeInfo tiInput = (DecimalTypeInfo) inputExpr.getTypeInfo();
    this.inputScale = (short) tiInput.scale();
    this.inputPrecision = (short) tiInput.precision();

    initPartialResultInspector();
  }
View Full Code Here

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

              if (genericUDF != null) {
                ((SettableUDF)genericUDF).setTypeInfo(varcharTypeInfo);
              }
              break;
            case HiveParser.TOK_DECIMAL:
              DecimalTypeInfo decTypeInfo = ParseUtils.getDecimalTypeTypeInfo(funcNameNode);
              if (genericUDF != null) {
                ((SettableUDF)genericUDF).setTypeInfo(decTypeInfo);
              }
              break;
            default:
View Full Code Here

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

    testWriterLong(TypeInfoFactory.longTypeInfo);
  }

  @Test
  public void testVectorExpressionWriterDecimal() throws HiveException {
    DecimalTypeInfo typeInfo = TypeInfoFactory.getDecimalTypeInfo(38, 18);
    testWriterDecimal(typeInfo);
  }
View Full Code Here

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

    testWriterDecimal(typeInfo);
  }

  @Test
  public void testVectorExpressionSetterDecimal() throws HiveException {
    DecimalTypeInfo typeInfo = TypeInfoFactory.getDecimalTypeInfo(38, 18);
    testSetterDecimal(typeInfo);
  }
View Full Code Here

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

      aggregation.sum = HiveDecimal.ZERO;
    }

    @Override
    protected ObjectInspector getSumFieldJavaObjectInspector() {
      DecimalTypeInfo typeInfo = deriveResultDecimalTypeInfo();
      return PrimitiveObjectInspectorFactory.getPrimitiveJavaObjectInspector(typeInfo);
    }
View Full Code Here

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

      return PrimitiveObjectInspectorFactory.getPrimitiveJavaObjectInspector(typeInfo);
    }

    @Override
    protected ObjectInspector getSumFieldWritableObjectInspector() {
      DecimalTypeInfo typeInfo = deriveResultDecimalTypeInfo();
      return PrimitiveObjectInspectorFactory.getPrimitiveWritableObjectInspector(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.