Java Code Examples for org.apache.hadoop.hive.common.type.HiveDecimal#bigDecimalValue()

The following examples show how to use org.apache.hadoop.hive.common.type.HiveDecimal#bigDecimalValue() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SqoopHCatExportHelper.java    From aliyun-maxcompute-data-collectors with Apache License 2.0 6 votes vote down vote up
private Object convertDecimalTypes(Object val, String javaColType) {
  HiveDecimal hd = (HiveDecimal) val;
  BigDecimal bd = hd.bigDecimalValue();

  if (javaColType.equals(BIG_DECIMAL_TYPE)) {
    return bd;
  } else if (javaColType.equals(STRING_TYPE)) {
    String bdStr = null;
    if (bigDecimalFormatString) {
      bdStr = bd.toPlainString();
    } else {
      bdStr = bd.toString();
    }
    return bdStr;
  }
  return null;
}
 
Example 2
Source File: OrcBatchReader.java    From Flink-CEPplus with Apache License 2.0 4 votes vote down vote up
private static BigDecimal readBigDecimal(HiveDecimalWritable hiveDecimalWritable) {
	HiveDecimal hiveDecimal = hiveDecimalWritable.getHiveDecimal();
	return hiveDecimal.bigDecimalValue();
}
 
Example 3
Source File: OrcBatchReader.java    From flink with Apache License 2.0 4 votes vote down vote up
private static BigDecimal readBigDecimal(HiveDecimalWritable hiveDecimalWritable) {
	HiveDecimal hiveDecimal = hiveDecimalWritable.getHiveDecimal();
	return hiveDecimal.bigDecimalValue();
}
 
Example 4
Source File: OrcBatchReader.java    From flink with Apache License 2.0 4 votes vote down vote up
private static BigDecimal readBigDecimal(HiveDecimalWritable hiveDecimalWritable) {
	HiveDecimal hiveDecimal = hiveDecimalWritable.getHiveDecimal();
	return hiveDecimal.bigDecimalValue();
}