mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-10-30 01:59:23 +00:00
fix: DELETE endpoint for profiler data (#12912)
This commit is contained in:
parent
a45c644bc4
commit
edea862082
@ -402,16 +402,21 @@ public class TableRepository extends EntityRepository<Table> {
|
||||
public void deleteTableProfile(String fqn, String entityType, Long timestamp) {
|
||||
// Validate the request content
|
||||
String extension;
|
||||
Class classMapper;
|
||||
if (entityType.equalsIgnoreCase(Entity.TABLE)) {
|
||||
extension = TABLE_PROFILE_EXTENSION;
|
||||
classMapper = TableProfile.class;
|
||||
} else if (entityType.equalsIgnoreCase("column")) {
|
||||
extension = TABLE_COLUMN_PROFILE_EXTENSION;
|
||||
classMapper = ColumnProfile.class;
|
||||
} else if (entityType.equalsIgnoreCase("system")) {
|
||||
extension = SYSTEM_PROFILE_EXTENSION;
|
||||
classMapper = SystemProfile.class;
|
||||
} else {
|
||||
throw new IllegalArgumentException("entityType must be table or column");
|
||||
throw new IllegalArgumentException("entityType must be table, column or system");
|
||||
}
|
||||
|
||||
TableProfile storedTableProfile =
|
||||
JsonUtils.readValue(getExtensionAtTimestamp(fqn, extension, timestamp), TableProfile.class);
|
||||
Object storedTableProfile = JsonUtils.readValue(getExtensionAtTimestamp(fqn, extension, timestamp), classMapper);
|
||||
if (storedTableProfile == null) {
|
||||
throw new EntityNotFoundException(String.format("Failed to find table profile for %s at %s", fqn, timestamp));
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user