use of bio.terra.model.TableModel in project jade-data-repo by DataBiosphere.
the class DatasetValidationsTest method testIntPartitionWithBadRange.
@Test
public void testIntPartitionWithBadRange() throws Exception {
ColumnModel column = new ColumnModel().name("column").datatype("int64");
TableModel table = new TableModel().name("table").columns(Collections.singletonList(column)).partitionMode(TableModel.PartitionModeEnum.INT).intPartitionOptions(new IntPartitionOptionsModel().column(column.getName()).min(5L).max(2L).interval(-1L));
DatasetRequestModel req = buildDatasetRequest();
req.getSchema().tables(Collections.singletonList(table)).relationships(Collections.emptyList()).assets(Collections.emptyList());
ErrorModel errorModel = expectBadDatasetCreateRequest(req);
checkValidationErrorModel(errorModel, new String[] { "InvalidIntPartitionRange", "InvalidIntPartitionInterval" });
}
use of bio.terra.model.TableModel in project jade-data-repo by DataBiosphere.
the class DatasetValidationsTest method testIntPartitionWithMismatchedType.
@Test
public void testIntPartitionWithMismatchedType() throws Exception {
ColumnModel column = new ColumnModel().name("column").datatype("timestamp");
TableModel table = new TableModel().name("table").columns(Collections.singletonList(column)).partitionMode(TableModel.PartitionModeEnum.INT).intPartitionOptions(new IntPartitionOptionsModel().column(column.getName()).min(1L).max(2L).interval(1L));
DatasetRequestModel req = buildDatasetRequest();
req.getSchema().tables(Collections.singletonList(table)).relationships(Collections.emptyList()).assets(Collections.emptyList());
ErrorModel errorModel = expectBadDatasetCreateRequest(req);
checkValidationErrorModel(errorModel, new String[] { "InvalidIntPartitionColumnType" });
}
use of bio.terra.model.TableModel in project jade-data-repo by DataBiosphere.
the class DatasetValidationsTest method testIntPartitionWithBadOptions.
@Test
public void testIntPartitionWithBadOptions() throws Exception {
TableModel table = new TableModel().name("table").columns(Collections.emptyList()).partitionMode(TableModel.PartitionModeEnum.INT).datePartitionOptions(new DatePartitionOptionsModel().column("foo"));
DatasetRequestModel req = buildDatasetRequest();
req.getSchema().tables(Collections.singletonList(table)).relationships(Collections.emptyList()).assets(Collections.emptyList());
ErrorModel errorModel = expectBadDatasetCreateRequest(req);
checkValidationErrorModel(errorModel, new String[] { "InvalidDatePartitionOptions", "MissingIntPartitionOptions" });
}
use of bio.terra.model.TableModel in project jade-data-repo by DataBiosphere.
the class DatasetValidationsTest method testDatePartitionWithMissingColumn.
@Test
public void testDatePartitionWithMissingColumn() throws Exception {
TableModel table = new TableModel().name("table").columns(Collections.emptyList()).partitionMode(TableModel.PartitionModeEnum.DATE).datePartitionOptions(new DatePartitionOptionsModel().column("not_a_column"));
DatasetRequestModel req = buildDatasetRequest();
req.getSchema().tables(Collections.singletonList(table)).relationships(Collections.emptyList()).assets(Collections.emptyList());
ErrorModel errorModel = expectBadDatasetCreateRequest(req);
checkValidationErrorModel(errorModel, new String[] { "InvalidDatePartitionColumnName" });
}
use of bio.terra.model.TableModel in project jade-data-repo by DataBiosphere.
the class DatasetValidationsTest method testIntPartitionTooManyPartitions.
@Test
public void testIntPartitionTooManyPartitions() throws Exception {
ColumnModel column = new ColumnModel().name("column").datatype("int64");
TableModel table = new TableModel().name("table").columns(Collections.singletonList(column)).partitionMode(TableModel.PartitionModeEnum.INT).intPartitionOptions(new IntPartitionOptionsModel().column(column.getName()).min(0L).max(4001L).interval(1L));
DatasetRequestModel req = buildDatasetRequest();
req.getSchema().tables(Collections.singletonList(table)).relationships(Collections.emptyList()).assets(Collections.emptyList());
ErrorModel errorModel = expectBadDatasetCreateRequest(req);
checkValidationErrorModel(errorModel, new String[] { "TooManyIntPartitions" });
}
Aggregations