fix: enforce Glue table version checks (#1211)

This commit is contained in:
David Phillips authored and GitHub committed 2026-06-07 00:39:30 -05:00
1 parent 882fd03457
commit ec8e1cf85e
3 files changed
+53 -3

No files matched your search

@@ -79,8 +79,7 @@ public class GlueJsonHandler {
case "UpdateTable" -> {
String dbName = request.get("DatabaseName").asText();
Table table = mapper.treeToValue(request.get("TableInput"), Table.class);
String versionId = request.path("VersionId").asText(null);
glueService.updateTable(dbName, table, versionId);
glueService.updateTable(dbName, table, request.path("VersionId").asText(null));
yield Response.ok().build();
}
case "GetTableVersions" -> {
@@ -141,7 +141,7 @@ public class GlueService {
"Table not found: " + databaseName + "." + table.getName(), 400));
if (versionId != null && !versionId.equals(existing.getVersionId())) {
throw new AwsException("ConcurrentModificationException",
"Table was modified concurrently: " + databaseName + "." + table.getName(), 400);
"Update table failed due to concurrent modifications.", 400);
}
validateSchemaReference(table);
table.setDatabaseName(databaseName);
@@ -418,4 +418,5 @@ public class GlueService {
private static Map<String, String> copyMap(Map<String, String> source) {
return source != null ? new LinkedHashMap<>(source) : null;
}
}