mosche commented on code in PR #17172:
URL: https://github.com/apache/beam/pull/17172#discussion_r870936447
##########
sdks/java/core/src/main/java/org/apache/beam/sdk/schemas/FieldValueGetter.java:
##########
@@ -33,5 +33,9 @@
@Nullable
ValueT get(ObjectT object);
+ default @Nullable Object getRaw(ObjectT object) {
Review Comment:
Thanks so much for having a look @TheNeuralBit 🙏
`getRaw()` was based on a
[conversation](https://lists.apache.org/thread/gjq453fm32s76zlvjs4kb5g3rgxnh7gs)
with @reuvenlax.
> getValues() is maybe poorly named - might be better called getRawValues.
What you're looking for is probably the getBaseValues() method.
> getValues is mostly used in code that knows exactly what it's doing for
optimization purposes. It goes along with the attachValues method, which is
similarly tricky to use. It's there to enable 0-copy code, but not
necessarily intended for general consumption.
`RowWithGetters.getValues()` returns the "raw" unmodified result of the
getters:
```java
public List<Object> getValues() {
return getters.stream().map(g ->
g.get(getterTarget)).collect(Collectors.toList());
}
```
As I am pushing down the transformation of the getter result into the getter
itself, I needed a way to bypass that in order to maintain the current
semantics of `getValues()`. Let me know if the name makes sense given that
context.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]