By chance, I found a package-private class RowUtils.RowCases. I'm going to give this a try.
https://github.com/apache/beam/blob/7418c84de2b68b06e0318766ca6c69f4d2144390/sdks/java/core/src/main/java/org/apache/beam/sdk/values/RowUtils.java#L80 On Fri, Oct 15, 2021 at 5:09 PM Andrew Pilloud <[email protected]> wrote: > I don't think FieldAccessDescriptor will help you here. You don't want to > access fields, you want to apply a method to them. I took a quick look and > didn't find anything. If we had something like this it would probably live > in one of these two folders, you might be able to find some examples to > start from: > > https://github.com/apache/beam/tree/master/sdks/java/core/src/main/java/org/apache/beam/sdk/schemas/transforms > > https://github.com/apache/beam/tree/master/sdks/java/core/src/main/java/org/apache/beam/sdk/schemas/utils > > > > > On Fri, Oct 15, 2021 at 1:28 PM Matthew Ouyang <[email protected]> > wrote: > >> I have a Row that has a struct that has string fields and an array of >> structs which also has string fields. Is there any simple way to apply a >> whitespace trim to all string fields (like a ** wildcard)? I know >> FieldAccessDescriptor.withAllFields exists but will that work for anything >> beyond the top level? I'm hoping that I don't have to traverse the Row in >> code. >> >
