Skip to content

Commit

Permalink
Use getAsJsonObject in StateStoreCommitRequestDeserialiser
Browse files Browse the repository at this point in the history
  • Loading branch information
patchwork01 committed Aug 6, 2024
1 parent 4bf702c commit 98d80e1
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ public class StateStoreCommitRequestDeserialiser {
private final Gson gson;

public StateStoreCommitRequestDeserialiser(TablePropertiesProvider tablePropertiesProvider) {

gson = GsonConfig.standardBuilder()
.registerTypeAdapter(CompactionJob.class, new CompactionJobJsonSerDe())
.registerTypeAdapter(StateStoreCommitRequest.class, new WrapperDeserialiser())
Expand Down Expand Up @@ -122,10 +121,7 @@ private SplitPartitionDeserialiser(TablePropertiesProvider tablePropertiesProvid

@Override
public SplitPartitionCommitRequest deserialize(JsonElement jsonElement, Type type, JsonDeserializationContext context) throws JsonParseException {
if (!jsonElement.isJsonObject()) {
throw new JsonParseException("Expected JsonObject, got " + jsonElement);
}
JsonObject json = (JsonObject) jsonElement;
JsonObject json = jsonElement.getAsJsonObject();
String tableId = json.get(TABLE_ID).getAsString();

PartitionJsonSerDe partitionJsonSerDe = new PartitionJsonSerDe(tablePropertiesProvider.getById(tableId).getSchema());
Expand Down

0 comments on commit 98d80e1

Please sign in to comment.