in src/main/java/com/google/cloud/solutions/autotokenize/pipeline/DlpInspectionPipeline.java [228:263]
private void validateOptions() {
checkArgument(
isNotBlank(options.getReportLocation()) || isNotBlank(options.getReportBigQueryTable()),
"Provide at least one of --reportLocation or --reportBigQueryTable");
switch (options.getSourceType()) {
case JDBC_QUERY:
case JDBC_TABLE:
checkArgument(
JdbcConfigurationExtractor.using(options).jdbcConfiguration() != null,
"JDBCConfiguration missing for source-type");
// For JDBC there is additional check for entry group id.
checkArgument(
options.getDataCatalogInspectionTagTemplateId() == null
|| options.getDataCatalogEntryGroupId() != null,
"provide valid entry group id for JDBC, AVRO or PARQUET source.");
break;
case AVRO:
case PARQUET:
checkArgument(
options.getDataCatalogInspectionTagTemplateId() == null
|| options.getDataCatalogEntryGroupId() != null,
"provide valid entry group id for JDBC, AVRO or PARQUET source.");
break;
case BIGQUERY_TABLE:
case BIGQUERY_QUERY:
break;
case UNRECOGNIZED:
case UNKNOWN_FILE_TYPE:
default:
throw new IllegalArgumentException("" + options.getSourceType() + " is unsupported.");
}
}