Remove Validation On Display Datatype (#11208)

This commit is contained in:
Mayur Singal 2023-04-22 16:23:03 +05:30 committed by GitHub
parent ea20309d1f
commit 99f7a0e447
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 0 additions and 16 deletions

View File

@ -144,11 +144,6 @@ public final class DatabaseUtil {
if (column.getArrayDataType() == null) { if (column.getArrayDataType() == null) {
throw new IllegalArgumentException("For column data type array, arrayDataType " + "must not be null"); throw new IllegalArgumentException("For column data type array, arrayDataType " + "must not be null");
} }
if (!column.getDataTypeDisplay().startsWith("array<")) {
throw new IllegalArgumentException(
"For column data type array, dataTypeDisplay must be of type " + "array<arrayDataType>");
}
} }
} }
@ -160,10 +155,6 @@ public final class DatabaseUtil {
} }
validateColumnNames(column.getChildren()); validateColumnNames(column.getChildren());
if (!column.getDataTypeDisplay().startsWith("struct<")) {
throw new IllegalArgumentException(
"For column data type struct, dataTypeDisplay must be of type " + "struct<member fields>");
}
} }
} }

View File

@ -214,13 +214,6 @@ public class TableResourceTest extends EntityResourceTest<Table, CreateTable> {
() -> createEntity(create, ADMIN_AUTH_HEADERS), () -> createEntity(create, ADMIN_AUTH_HEADERS),
BAD_REQUEST, BAD_REQUEST,
"For column data type array, arrayDataType must not be null"); "For column data type array, arrayDataType must not be null");
// No dataTypeDisplay passed for array
columns.get(0).withArrayDataType(INT).withDataTypeDisplay(null);
assertResponse(
() -> createEntity(create, ADMIN_AUTH_HEADERS),
BAD_REQUEST,
"For column data type array, dataTypeDisplay must be of type array<arrayDataType>");
} }
@Test @Test