ISSUE DESCRIPTION [BUG] Glue BatchDeleteTable is unsupported Service AWS Glue AWS API…
- User
ISSUE DESCRIPTION
[BUG] Glue BatchDeleteTable is unsupported
Service
AWS API Action
Expected behavior
AWS behavior supports
BatchDeleteTable. When the request contains one existing table and one missing table, AWS deletes the existing table and returns anErrorsentry for the missing table.AWS behavior verified with AWS CLI:
json{ "Errors": [ { "TableName": "missing_table", "ErrorDetail": { "ErrorCode": "EntityNotFoundException", "ErrorMessage": "Table missing_table not found" } } ] }A subsequent
GetTablefor the existing table returnsEntityNotFoundException.Actual behavior
Floci
floci/floci:1.5.22rejectsBatchDeleteTableas an unsupported action.textaws: [ERROR]: An error occurred (InvalidAction) when calling the BatchDeleteTable operation: Action BatchDeleteTable is not supportedReproduction
bashendpoint=http://localhost:4566 export AWS_ACCESS_KEY_ID=<redacted-secret> AWS_SECRET_ACCESS_KEY=<redacted-secret> AWS_DEFAULT_REGION=us-east-1 db=test_floci_batch_delete aws --endpoint-url "$endpoint" glue create-database --database-input "Name=$db" aws --endpoint-url "$endpoint" glue create-table \ --database-name "$db" \ --table-input 'Name=existing_table,StorageDescriptor={Columns=[{Name=id,Type=int}]}' aws --endpoint-url "$endpoint" glue batch-delete-table \ --database-name "$db" \ --tables-to-delete existing_table missing_table - Assistant
I'll start by exploring the repository structure to understand the codebase and locate the relevant files.
- Assistant
Let me first explore the repository structure to understand how the Glue service is implemented.
- Assistant
Let me look at the main GlueService.java file to understand the current structure and how other methods are implemented.
- Assistant
Let me continue reading the file to see the existing methods, especially around table operations.
- Assistant
Let me look at the GlueJsonHandler to understand how actions are routed:
- Assistant
Now let me look at the existing test file:
- Assistant
Let me search for existing batch operations to understand the pattern:
- Assistant
Let me look at the integration test to understand the expected behavior:
- Assistant
Let me continue reading the test file to see if there are any batch operations tested.
- Assistant
Let me continue reading the test file to see if there are any batch operations tested.
- Assistant
Let me see the full GlueJsonHandler to understand the complete switch statement:
- Assistant
Let me look at the rest of the GlueJsonHandler and then check the existing
deleteTablemethod: - Assistant
Let me look at the full GlueService file:
- Assistant
Let me look at the deleteTable method:
- Assistant
Let me look at the full deleteTable method:
- Assistant
Now I understand the issue. I need to implement
BatchDeleteTablein bothGlueService.javaandGlueJsonHandler.java. Let me first check the end of the GlueService file to see the helper methods: - Assistant
Now let me look at the helper methods:
- Assistant
Let me see those helper methods:
- Assistant
Now I have a good understanding of the codebase. Let me plan my approach:
- Add a
batchDeleteTablesmethod toGlueService.javathat iterates over the table names, checks if each exists, deletes if found, and returns error info for missing ones - Add a
BatchDeleteTablecase inGlueJsonHandler.javathat parses the request and calls the service method - Add tests for the new method
Let me also check if there's a build system I can use to verify the changes:
- Add a
- Assistant
Let me check if there's a
BatchDeleteTableErrorinner class already defined in GlueService: - Assistant
Good, there's no
BatchDeleteTableErroryet. Let me check the existingdeleteTablemethod more carefully: - Assistant
I see that
deleteTabledoesn't check if the table exists first. ForBatchDeleteTable, I need to:- Check if each table exists
- Delete it if it does
- Return errors for tables that don't exist
Let me now create a plan and implement the solution. First, let me add the
batchDeleteTablesmethod toGlueService.java: - Assistant
Now I have a good understanding of the codebase. Let me implement the solution. I need to:
- Add a
batchDeleteTablesmethod toGlueService.java - Add a
BatchDeleteTablecase inGlueJsonHandler.java - Add tests for the new functionality
Let me first add the
batchDeleteTablesmethod toGlueService.java: - Add a
- Assistant
Good. Now let me add the
BatchDeleteTablecase toGlueJsonHandler.java: - Assistant
Now let me add the
BatchDeleteTablecase to the switch statement: - Assistant
Now I need to check if the imports are already there in GlueJsonHandler:
- Assistant
Good. The imports already include
ArrayList,LinkedHashMap,List, andMap. Let me run the existing tests to make sure they still pass: - Assistant
Let me check the full test result:
- Assistant
All 24 existing tests pass. Now let me add tests for the new
batchDeleteTablesmethod. Let me first look at the end of the test file to understand the pattern: - Assistant
Now let me add tests for the new
batchDeleteTablesmethod. I'll add them before the helper methods: - Assistant
Now let me run the tests to verify the implementation:
- Assistant
All 28 tests pass (24 original + 4 new). Let me remove the unused variable in
batchDeleteTables: - Assistant
Let me run the tests again to make sure everything still passes after the cleanup:
- Assistant
All 28 tests pass. Let me also check if there are any other tests that might be affected by my changes:
- Assistant
Now let me verify the JSON response format. The AWS API uses PascalCase (
ErrorCode,ErrorMessage), but Java records use camelCase by default. Let me check how the existing models handle this: - Assistant
I need to check how the Jackson serialization is configured in this project. Let me check the ObjectMapper configuration or how other models handle property naming.
- Assistant
Let me check the JacksonConfig to understand how the ObjectMapper is configured:
- Assistant
Let me check how other similar error responses are handled in the codebase:
- Assistant
Let me check how the response is serialized in the AwsJsonController:
- Assistant
Let me check how the Glue controller works, since it appears to use a different protocol:
- Assistant
Let me check how the response is being written in the JSON 1.1 controller:
- Assistant
Let me check how other services format their responses with PascalCase keys:
- Assistant
Let me check how the Glue model objects are serialized - do they use @JsonProperty or default naming?
- Assistant
I see that the Glue models use
@JsonPropertyannotations for PascalCase naming. But the records I created (BatchDeleteTableError,ErrorDetail) are plain Java records that will serialize with camelCase names. I need to add@JsonPropertyannotations to them.Let me check how other records are used in the codebase:
- Assistant
Let me check how
VersionDeletionResultis serialized - it haserrorCodeanderrorMessagetoo: - Assistant
Let me check how
DeleteSchemaVersionsis handled in the GlueJsonHandler to see if there's a conversion step: - Assistant
I see! The pattern is to manually construct the response with PascalCase keys using
LinkedHashMap. I need to update myBatchDeleteTablehandler inGlueJsonHandler.java: - Assistant
I need to update the
BatchDeleteTablehandler to use PascalCase keys in the response, similar to howhandleDeleteSchemaVersionsdoes it. Let me update the handler to manually construct the response with PascalCase keys: - Assistant
Good. Now let me run the tests again to make sure everything still compiles and passes:
- Assistant
All tests pass. Let me also verify the full compilation of the project to ensure there are no compilation errors:
- Assistant
The compilation succeeds. Let me run all existing tests to ensure I haven't broken anything:
- Assistant
Let me run just the Glue-related tests:
- Assistant
All 66 Glue-related tests pass (28 + 14 + 24). Let me now review the final state of the changes:
- Assistant
Let me review the full diff:
- Assistant
The diff looks good. Let me now go through the checklist and verify everything:
CHECKLIST
1. If an error was reported in the issue description, I have successfully reproduced it.
- Yes. The issue reports that
BatchDeleteTablereturnsInvalidActionbecause it falls through to thedefaultcase in the switch statement ofGlueJsonHandler.java. I verified this by examining the code - there was nocase "BatchDeleteTable"in the switch statement.
- Yes. The issue reports that
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.