core/src/main/java/org/apache/carbondata/core/util/CarbonProperties.java
/**
   * Below method will be used to validate the data file version parameter
   * if parameter is invalid current version will be set
   */
Below method will be used to validate the data file version parameter
if parameter is invalid current version will be set
Below method will be used to validate the data file version parameter if parameter is invalid current version will be set
private void validateCarbonDataFileVersion() {
    String carbondataFileVersionString =
        carbonProperties.getProperty(CARBON_DATA_FILE_VERSION);
    if (carbondataFileVersionString == null) {
      carbonProperties.setProperty(CARBON_DATA_FILE_VERSION,
          CarbonCommonConstants.CARBON_DATA_FILE_DEFAULT_VERSION);
    } else {
      try {
        ColumnarFormatVersion.valueOf(carbondataFileVersionString);
      } catch (IllegalArgumentException e) {
        LOGGER.warn("Specified file version property is invalid: " + carbondataFileVersionString
            + ". Using " + CarbonCommonConstants.CARBON_DATA_FILE_DEFAULT_VERSION
            + " as default file version");
        carbonProperties.setProperty(CARBON_DATA_FILE_VERSION,
            CarbonCommonConstants.CARBON_DATA_FILE_DEFAULT_VERSION);
      }
    }
    LOGGER.info("Carbon Current data file version: " + carbonProperties
        .setProperty(CARBON_DATA_FILE_VERSION,
            CarbonCommonConstants.CARBON_DATA_FILE_DEFAULT_VERSION));
  }
private void validateCarbonDataFileVersion ( ) { String carbondataFileVersionString = carbonProperties . getProperty ( CARBON_DATA_FILE_VERSION ) ; if ( carbondataFileVersionString == null ) { carbonProperties . setProperty ( CARBON_DATA_FILE_VERSION , CarbonCommonConstants . CARBON_DATA_FILE_DEFAULT_VERSION ) ; } else { try { ColumnarFormatVersion . valueOf ( carbondataFileVersionString ) ; } catch ( IllegalArgumentException e ) { LOGGER . warn ( "Specified file version property is invalid: " + carbondataFileVersionString + ". Using " + CarbonCommonConstants . CARBON_DATA_FILE_DEFAULT_VERSION + " as default file version" ) ; carbonProperties . setProperty ( CARBON_DATA_FILE_VERSION , CarbonCommonConstants . CARBON_DATA_FILE_DEFAULT_VERSION ) ; } } LOGGER . info ( "Carbon Current data file version: " + carbonProperties . setProperty ( CARBON_DATA_FILE_VERSION , CarbonCommonConstants . CARBON_DATA_FILE_DEFAULT_VERSION ) ) ; }
Below method will be used to validate the data file version parameter
 if parameter is invalid current version will be set
Below method will be used to validate the data file version parameter if parameter is invalid current version will be set
// use default property if user does not specify version property // use default property if user specifies an invalid version property