} else {
LOG.warn(
"kite.datasetName is deprecated, instead use kite.uri=<dataset-uri>");
Preconditions.checkArgument(datasetName != null,
"kite.datasetName is required if kite.uri is not used");
DatasetRepository repo = getDatasetRepository();
descriptor = repo.load(datasetNamespace, datasetName).getDescriptor();
}
DatasetDescriptor.Builder descriptorBuilder = new DatasetDescriptor.Builder(
descriptor);
configureSchema(descriptorBuilder, avroSchemaFile, avroSchemaReflectClass);
if (columnDescriptorFile != null) {
File columnDescriptor = new File(columnDescriptorFile);
try {
if (columnDescriptor.exists()) {
descriptorBuilder.columnMapping(columnDescriptor);
} else {
descriptorBuilder.columnMapping(Resources.getResource(
columnDescriptorFile).openStream());
}
} catch (IOException e) {
throw new MojoExecutionException("Problem while reading file "
+ columnDescriptorFile, e);
}
}
if (uri != null) {
Datasets.update(uri, descriptorBuilder.build());
} else {
// datasetName is checked above
DatasetRepository repo = getDatasetRepository();
repo.update(datasetNamespace, datasetName, descriptorBuilder.build());
}
}