class ProfileFactory {

    public static String get(InputFormat inputFormat, boolean hasComplexTypes, String userProfileName) {
        String profileName = null;
        if (HIVE_ORC_VECTORIZED_PROFILE.equals(userProfileName))
            return userProfileName;
        if (inputFormat instanceof TextInputFormat && !hasComplexTypes) {
            profileName = HIVE_TEXT_PROFILE;
        } else if (inputFormat instanceof RCFileInputFormat) {
            profileName = HIVE_RC_PROFILE;
        } else if (inputFormat instanceof OrcInputFormat) {
            profileName = HIVE_ORC_PROFILE;
        } else {
            //Default case
            profileName = HIVE_PROFILE;
        }
        return profileName;
    }

}