public static String normalizeColumnValueForItsDataType(String value,CarbonDimension dimension){
  try {
    Object parsedValue=null;
switch (dimension.getDataType()) {
case DECIMAL:
      return parseStringToBigDecimal(value,dimension);
case INT:
case LONG:
    parsedValue=normalizeIntAndLongValues(value,dimension.getDataType());
  break;
case DOUBLE:
parsedValue=Double.parseDouble(value);
break;
default :
return value;
}
if (null != parsedValue) {
return value;
}
return null;
}
 catch (Exception e) {
return null;
}
}

public static String normalizeColumnValueForItsDataType ( String value , CarbonDimension dimension ) { try { Object parsedValue = null ; switch ( dimension . getDataType ( ) ) { case DECIMAL : return parseStringToBigDecimal ( value , dimension ) ; case INT : case LONG : parsedValue = normalizeIntAndLongValues ( value , dimension . getDataType ( ) ) ; break ; case DOUBLE : parsedValue = Double . parseDouble ( value ) ; break ; default : return value ; } if ( null != parsedValue ) { return value ; } return null ; } catch ( Exception e ) { return null ; } }
this method will parse a given string value corresponding to its data type
