private void validateGlobalSortPartitions(String globalSortPartitions) throws InvalidLoadOptionException { if (globalSortPartitions != null) { try { int num = Integer.parseInt(globalSortPartitions); if (num <= 0) { throw new InvalidLoadOptionException("'GLOBAL_SORT_PARTITIONS' should be greater than 0"); } } catch (NumberFormatException e) { throw new InvalidLoadOptionException(e.getMessage()); } } }
/** * validates both timestamp and date for illegal values */ private void validateDateTimeFormat(String dateTimeLoadFormat, String dateTimeLoadOption) throws InvalidLoadOptionException { // allowing empty value to be configured for dateformat option. if (dateTimeLoadFormat != null && !dateTimeLoadFormat.trim().equalsIgnoreCase("")) { try { new SimpleDateFormat(dateTimeLoadFormat); } catch (IllegalArgumentException e) { throw new InvalidLoadOptionException( "Error: Wrong option: " + dateTimeLoadFormat + " is provided for option " + dateTimeLoadOption); } } }
if (maxColumnsInt != null) { if (columnCountInSchema >= maxColumnsInt) { throw new InvalidLoadOptionException( "csv headers should be less than the max columns " + maxColumnsInt); } else if (maxColumnsInt > CSVInputFormat.THRESHOLD_MAX_NUMBER_OF_COLUMNS_FOR_PARSING) { throw new InvalidLoadOptionException( "max columns cannot be greater than the threshold value: " + CSVInputFormat.THRESHOLD_MAX_NUMBER_OF_COLUMNS_FOR_PARSING); throw new InvalidLoadOptionException( "csv header columns should be less than max threashold: " + CSVInputFormat.THRESHOLD_MAX_NUMBER_OF_COLUMNS_FOR_PARSING);
private void validateAndSetColumnCompressor(CarbonLoadModel carbonLoadModel) throws InvalidLoadOptionException { try { String columnCompressor = carbonLoadModel.getColumnCompressor(); if (StringUtils.isBlank(columnCompressor)) { columnCompressor = CarbonProperties.getInstance().getProperty( CarbonCommonConstants.COMPRESSOR, CarbonCommonConstants.DEFAULT_COMPRESSOR); } // check and load compressor CompressorFactory.getInstance().getCompressor(columnCompressor); carbonLoadModel.setColumnCompressor(columnCompressor); } catch (Exception e) { LOGGER.error(e); throw new InvalidLoadOptionException("Failed to load the compressor"); } }
private void validateSortScope(String sortScope) throws InvalidLoadOptionException { if (sortScope != null) { // We support global sort for Hive standard partition, but don't support // global sort for other partition type. if (table.getPartitionInfo(table.getTableName()) != null && !table.isHivePartitionTable() && sortScope.equalsIgnoreCase(SortScopeOptions.SortScope.GLOBAL_SORT.toString())) { throw new InvalidLoadOptionException("Don't support use global sort on " + table.getPartitionInfo().getPartitionType() + " partition table."); } } }
bad_record_path = CarbonUtil.checkAndAppendHDFSUrl(bad_record_path); } else { throw new InvalidLoadOptionException( "Cannot redirect bad records as bad record location is not provided."); if (!headerOption.equalsIgnoreCase("true") && !headerOption.equalsIgnoreCase("false")) { throw new InvalidLoadOptionException( "'header' option should be either 'true' or 'false'."); throw new InvalidLoadOptionException( "When 'header' option is true, 'fileheader' option is not required."); complex_delimeter_level1.equalsIgnoreCase(complex_delimeter_level2) || delimeter.equalsIgnoreCase(complex_delimeter_level2)) { throw new InvalidLoadOptionException("Field Delimiter and Complex types delimiter are same"); } else { carbonLoadModel.setComplexDelimiterLevel1(complex_delimeter_level1);
throw new InvalidLoadOptionException( "Can not use all_dictionary_path or columndict without single_pass."); } else {
model.setDictionaryServerPort(Integer.parseInt(Maps.getOrDefault(options, "dictport", "-1"))); } catch (NumberFormatException e) { throw new InvalidLoadOptionException(e.getMessage());