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:
{ "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.aws: [ERROR]: An error occurred (InvalidAction) when calling the BatchDeleteTable operation: Action BatchDeleteTable is not supportedReproduction
endpoint=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_tableEnvironment
- Floci version / image tag:
floci/floci:1.5.22 - Java SDK version (if applicable): AWS CLI
- How you're running Floci (Docker / native /
mvn quarkus:dev): Docker
Interface
Type: Function Name: batchDeleteTables Path: src/main/java/io/github/hectorvent/floci/services/glue/GlueService.java Input: String databaseName, List tableNames Output: List<GlueService.BatchDeleteTableError> Description: Deletes multiple tables by name within a database, skipping and reporting errors for any tables that are not found. Use this to process the
BatchDeleteTableAWS Glue API action. - Floci version / image tag:
Assistant
Let me start by exploring the repository structure to understand how it's organized and find the relevant files for implementing the
BatchDeleteTablefunctionality for AWS Glue.Assistant
Let me explore the Glue service specifically.
<tool_call> <function=bash_terminal> <parameter=command> find /floci -type f -name "*.java" | grep -i glue </tool_call>
Assistant
The command failed because there were no results. Let me try again with a broader search.
Assistant
Let me examine the GlueService.java file to understand its current structure:
Assistant
Now let me look at the GlueJsonHandler.java to understand how API actions are mapped:
Assistant
Now I understand the structure. I need to:
-
Add a
batchDeleteTablesmethod toGlueService.javathat:- Takes a database name and list of table names
- Deletes tables that exist
- Returns a list of errors for tables that don't exist
-
Add a
BatchDeleteTablecase to the switch statement inGlueJsonHandler.javathat:- Reads the
DatabaseNameandTablesToDeletefrom the request - Calls the service method
- Returns the proper response format with
Errorsfor any tables not found
- Reads the
Let me also check the existing test file to understand the test patterns:
<tool_call> <function=bash_terminal> <parameter=command> cat /floci/src/test/java/io/github/hectorvent/floci/services/glue/GlueServiceTest.java </tool_call>
-
Assistant
The command was not properly invoked. Let me try again with the bash_terminal tool.
Assistant
Now I have a good understanding of the codebase. Let me implement the solution. I need to:
- Add a
BatchDeleteTableErrorrecord andbatchDeleteTablesmethod toGlueService.java - Add a
BatchDeleteTablecase handler toGlueJsonHandler.java
Let me first check if there's a model for BatchDeleteTableError:
- Add a
Assistant
Now I have a full understanding of the codebase. Let me implement the
BatchDeleteTablefeature. I need to:- Add a
BatchDeleteTableErrorrecord andbatchDeleteTablesmethod toGlueService.java - Add a
BatchDeleteTablecase to the switch statement inGlueJsonHandler.java
Let me start by modifying
GlueService.java:- Add a
Assistant
Now let me implement the changes. First, I'll add the
batchDeleteTablesmethod andBatchDeleteTableErrorrecord toGlueService.java:Assistant
Wait, I need to check if
StorageBackend.delete()returns a boolean. Let me check the interface:Assistant
Let me check the StorageBackend interface to understand what the delete method returns.
Assistant
The
deletemethod returnsvoid, notboolean. I need to check if the table exists first usingget(). Let me fix this:Assistant
I see the issue - my new code was appended after the closing brace of the class. I need to fix this by placing the code inside the class. Let me first check the structure:
Assistant
I need to remove the appended code (which is after the closing brace) and insert it inside the class before the closing brace.
Assistant
Now let me properly add the code before the closing brace of the class. I need to check where the
copyMapmethod ends and add the new code there:Assistant
Let me check the end of the file to see the structure.
Assistant
Now I need to properly add the new code before the closing brace. I'll insert it between line 432 (the
copyMapmethod closing brace) and line 434 (the class closing brace).Assistant
I need to add the new methods and record before the closing brace of the class. The class currently closes at line 434. I need to insert the new code at line 433 (before the closing brace).
Assistant
Let me use a different approach - I'll read the last few lines and then use the edit command to replace the closing brace with the new code plus the closing brace.
Assistant
The class file is 434 lines. Line 434 is the closing brace of the class. I need to insert the new code between line 432 (end of copyMap method) and line 434 (closing brace). Let me replace line 433-434 (blank line + closing brace) with the new code + blank line + closing brace.
Actually, let me check what's on line 433:
Assistant
Now I'll use sed to insert the new code between lines 432-434:
Assistant
Let me verify the changes were applied correctly:
Assistant
The GlueService.java changes look good. Now let me add the handler in GlueJsonHandler.java for the "BatchDeleteTable" action:
Assistant
Let me check the DeleteTable case in more detail:
Assistant
Now I need to add the "BatchDeleteTable" case to the switch statement. I'll add it right after the "DeleteTable" case:
Assistant
I need to add the "BatchDeleteTable" case to the switch statement in GlueJsonHandler.java after line 93 (after the DeleteTable case closing brace).
Assistant
Let me verify the changes were applied correctly to GlueJsonHandler.java:
Assistant
Good, the
BatchDeleteTablecase has been added. Let me verify the code compiles and run the tests:Assistant
Let me check how to build the project - it might be using Maven or Gradle.
Assistant
I need to continue verifying the build and testing. Let me check if there's a pom.xml and try to compile the code.
Assistant
The user wants me to continue verifying the build and testing. I need to compile the code using Maven and run the tests to make sure everything works correctly.
Assistant
Compilation succeeded. Now let me run the Glue-related tests to verify the changes don't break existing functionality:
Assistant
All GlueServiceTest tests passed. Now let me run all Glue-related tests to make sure everything works:
Assistant
All Glue tests passed. Now let me create a quick test script to verify the BatchDeleteTable functionality works correctly:
Assistant
I need to copy the test file to the correct location and run it to verify my BatchDeleteTable implementation works correctly. Let me place it in the test directory and run it.
Assistant
Now I need to run the test to verify my implementation works correctly. Let me compile and run the test.
Assistant
All 6 test cases passed. Let me clean up the test file I created and run all existing Glue tests to make sure I haven't broken anything:
Assistant
All 6 tests passed. Now let me run all existing Glue tests to make sure my changes don't break anything:
Assistant
All 152 Glue tests passed successfully. Let me verify my changes are complete by reviewing the diff:
Assistant
Let me review the complete diff to ensure everything is correct:
Assistant
Let me run the complete test suite to ensure nothing is broken:
Assistant
The full test suite timed out (which is normal for a large project). Let me verify the Glue tests pass and the code compiles:
Assistant
The user is indicating that my previous command failed with a non-zero exit code. Let me run the command again and see what went wrong.
Assistant
All 24 GlueServiceTest tests pass. Let me also check if there are any integration tests for the Glue JSON handler:
Assistant
Let me verify the final state of my implementation by checking both modified files:
Assistant
Let me run all Glue-related tests one more time to confirm everything is working properly:
Assistant
All 152 Glue tests pass successfully. The implementation is complete. Let me provide a summary of the changes:
Summary of Changes
I implemented support for the AWS Glue
BatchDeleteTableAPI action by modifying two files:1.
GlueService.javaAdded a new
BatchDeleteTableErrorrecord andbatchDeleteTablesmethod that:- Takes a database name and list of table names
- Iterates through each table name
- For tables that exist: deletes the table and its associated partitions
- For tables that don't exist: adds an error entry with
EntityNotFoundException - Returns a list of errors for tables that couldn't be deleted
2.
GlueJsonHandler.javaAdded a new case handler for the
BatchDeleteTableaction that:- Reads
DatabaseNameandTablesToDeletefrom the request - Calls
glueService.batchDeleteTables() - Returns the response in the AWS API format with
ErrorscontainingTableName, , and for each failed deletion
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.