piotr-szuberski edited a comment on pull request #12611:
URL: https://github.com/apache/beam/pull/12611#issuecomment-686447747


   @TheNeuralBit I've upgraded it a bit.
   - Checking schemas equality is redundant because it will throw an exception 
with a good message anyway (class cast failure or unknown column). Also, it's 
possible to just add row.addFieldValues(Map<String, Object> values) and depend 
on the casts following the schema.
   - I managed to unify addArray and addIterable code duplication with a bit 
ugly casts (needed SuppressWarning("unchecked")) but I don't think it can be 
easily achieved otherwise.
   - Nothing comes to my mind to remove duplication in 
addIterableToMutationBuilder and addIterableToStructBuilder methods. These are 
unrelated classes (Struct.Builder and Mutation.WriteBuilder. Maybe my Java 
knowledge is insufficient here. I could make an interface that simulates 
.setInt64Array, setStructArray etc but it would be even more boilerplate.
   - I unified a bit the API of both python spanners. Not everything could be 
done 1:1, but the corresponding keywords were changed and the positions of 
positional arguments.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to