I'm working on BEAM-4257 issue and the approach I'm following is to create a new class 'BigQueryInsertError' that also extends 'GenericJson' and that contains three keys 'TableRow row', 'TableDataInsertAllResponse.InsertErrors error', and 'TableReference ref' and use this type as the contained items returned by WriteResults.getFailedInserts
The problem is that I always get errors when deserialising as it deserialises the inner TableRow as a LinkedHashMap and fails when trying to assign it. Here you can see the full stacktrace: https://pastebin.com/MkUD9L3W
Testing it a bit further I've spotted other GenericJson subclasses that cannot be encoded/decoded following that method. For example TableDataInsertAllResponse.InsertErrors itself. See the example below:
TableDataInsertAllResponse.InsertErrors err = new TableDataInsertAllResponse.InsertErrors().setIndex(0L);
ObjectMapper mapper = new ObjectMapper().disable(SerializationFeature.FAIL_ON_EMPTY_BEANS);
So a couple of questions here:
* Which is the appropriate way of encoding/decoding GenericJson subclasses? (Maybe this issues can be tackled using Jackson's type annotations, but I'm quite a newbie on Jackson and I couldn't figure out how)
* This will (hopefully) be my very first contribution to Apache Beam and I'd like to get some feedback/comments/ideas/... on the issue and the suggested solution.