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
Let me understand the issue:
- The bug is that
BatchDeleteTableAWS Glue API action is not supported in Floci - The expected behavior is that when deleting multiple tables (some existing, some not found), it should delete the existing ones and return errors for the missing ones
- I need to implement the
batchDeleteTablesinterface inGlueService.java
Let me start by exploring the repository structure to understand how it's organized.
- The bug is that
Assistant
Let me look at the GlueService.java file first to understand the current implementation.
Assistant
Let me look at the GlueService.java file to understand the current implementation and what I need to add.
Assistant
The issue mentions the file is at
src/main/java/io/github/hectorvent/floci/services/glue/GlueService.java. Let me read it using bash or the open tool.Assistant
Now let me look at the GlueJsonHandler to understand how API actions are mapped:
Assistant
Now let me look at the test file and the AwsException class:
Assistant
Now let me look at the AwsException class and the integration test:
Assistant
Let me look at the AwsException class and also understand how errors are formatted in AWS responses:
Assistant
Now let me check the compatibility test file to understand how glue tests work:
Assistant
Now I have a good understanding of the codebase. Let me implement the
BatchDeleteTablefeature. I need to:- Add a
batchDeleteTablesmethod toGlueService.javawith aBatchDeleteTableErrorrecord - Add a handler for
BatchDeleteTableinGlueJsonHandler.java
Let me first check if there are any existing tests I need to be aware of:
- Add a
Assistant
Now I have a complete understanding of the codebase. Let me implement the
batchDeleteTablesmethod inGlueService.javaand add the handler inGlueJsonHandler.java.Let me start by adding the
batchDeleteTablesmethod and theBatchDeleteTableErrorrecord toGlueService.java:Assistant
Now I'll add the
batchDeleteTablesmethod andBatchDeleteTableErrorrecord. Let me find the right place to add them - after thedeleteTablemethod is a good place.Looking at the structure:
deleteTableis around line 164-170- After
deleteTableI'll addbatchDeleteTables
Let me look at the exact line numbers:
Assistant
Now I have the exact line numbers. Let me add the
batchDeleteTablesmethod andBatchDeleteTableErrorrecord to GlueService.java after thedeleteTablemethod (after line 172):Assistant
Now I have a good understanding of the codebase. Let me implement the
batchDeleteTablesmethod. I'll add it to theGlueService.javafile after thedeleteTablemethod, and add the handler inGlueJsonHandler.java.Assistant
Now I'll implement the
batchDeleteTablesmethod inGlueService.javaafter thedeleteTablemethod, and then add the handler inGlueJsonHandler.java.Assistant
Now let me insert this method into GlueService.java after the deleteTable method. I'll also need to add the handler in GlueJsonHandler.java. Let me first do the GlueService.java edit:
Assistant
Now I'll insert the batchDeleteTables method and the BatchDeleteTableError record after line 172 (after the deleteTable method closing brace).
Assistant
The exit code is 0, which means the command succeeded. Let me verify the change was applied correctly.
Assistant
I see the code was inserted but it's missing a blank line before
createPartition. Let me fix that.Assistant
The user wants me to continue. Let me verify the GlueService.java changes are correct and then add the handler in GlueJsonHandler.java.
Assistant
Let me fix the formatting issue - there's a missing blank line between the record and the next method:
Assistant
The sed command didn't work as expected. Let me try a different approach to fix the blank line issue.
Assistant
Let me verify the fix is correct now.
Assistant
The GlueService.java changes look correct. Now let me add the handler in GlueJsonHandler.java. First, let me find the exact location where I need to add the handler:
Assistant
Now I need to add the handler for "BatchDeleteTable" in GlueJsonHandler.java. Let me look at the structure around the DeleteTable case to understand the pattern.
Assistant
Now I need to add the handler for "BatchDeleteTable" in GlueJsonHandler.java after the DeleteTable case.
Assistant
Now let me insert this handler into GlueJsonHandler.java after line 93 (after the DeleteTable case):
Assistant
Now I need to insert the handler after line 93 in GlueJsonHandler.java. Let me use sed to insert the code after line 93.
Assistant
Let me verify the changes were applied correctly:
Assistant
The handler is now in place. Let me verify the full implementation compiles correctly:
Assistant
Let me check the build system:
Assistant
The compilation succeeded. Let me run the existing Glue tests to make sure everything is working:
Assistant
Let me verify that the tests passed successfully:
Assistant
All tests pass. Now let me run the integration tests as well to verify the full end-to-end behavior:
Assistant
All existing tests pass. Now let me verify my implementation by checking the complete changes and making sure everything is correct. Let me also write a quick test script to validate the BatchDeleteTable functionality:
Assistant
There's an error with the -q flag. Let me check what's happening.
Assistant
The tests pass successfully. Now let me verify my implementation by looking at the complete changes I've made:
Assistant
Let me run all the Glue-related tests to ensure everything is working properly:
Assistant
All 152 Glue tests pass successfully. Let me run all tests in the project to ensure nothing is broken:
Assistant
Let me create a test script to verify the BatchDeleteTable functionality works as expected:
Assistant
Let me create a simpler test to verify the implementation works correctly. I'll add a test to the existing test class:
Assistant
Let me verify the glue-catalog.bats tests pass and check for any edge cases:
Assistant
Let me verify my implementation is complete by reviewing the final state of both files:
Assistant
Now let me verify the GlueJsonHandler.java has the handler as well.
Assistant
Let me run all Glue tests once more to confirm everything works:
Assistant
All 152 Glue tests pass successfully. Let me summarize what I've implemented:
Summary of Changes
1. GlueService.java
-
Added
batchDeleteTables(String databaseName, List<String> tableNames)method that:- Iterates through each table name in the list
- For existing tables: deletes them (including any partitions)
- For non-existing tables: creates an error entry with
EntityNotFoundException - Returns a list of
BatchDeleteTableErrorobjects
-
Added
BatchDeleteTableErrorrecord with fields:tableName,errorCode,errorMessage
2. GlueJsonHandler.java
- Added handler for "BatchDeleteTable" action in the switch statement that:
- Extracts
DatabaseNamefrom request - Extracts table names from
TablesToDeletearray - Calls
glueService.batchDeleteTables() - Formats response as AWS JSON with array containing and
- Extracts
-
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.