switch (typeCategory) {
case VARCHAR:
int maxLength = getCommonLength(
TypeInfoUtils.getCharacterLengthForType(a),
TypeInfoUtils.getCharacterLengthForType(b));
VarcharTypeParams varcharParams = new VarcharTypeParams();
varcharParams.setLength(maxLength);
// Generate type name so that we can retrieve the TypeInfo for that type.
String typeName = PrimitiveObjectInspectorUtils
.getTypeEntryFromTypeSpecs(typeCategory, varcharParams).toString();
return TypeInfoFactory.getPrimitiveTypeInfo(typeName);