pvary commented on PR #16790:
URL: https://github.com/apache/iceberg/pull/16790#issuecomment-5616565037
After this PR, using the same projection to wrap consecutive rows mutates
nested rows that were already projected from earlier rows. `getRow()` now
returns a shared instance instead of a fresh wrapper per access.
Repro:
```
RowDataProjection projection = RowDataProjection.create(schema,
schema.select("location"));
RowData first = projection.wrap(GenericRowData.of(1L,
GenericRowData.of(1.0f, 1.0f))).getRow(0, 2);
assertThat(first.getFloat(0)).isEqualTo(1.0f);
RowData second = projection.wrap(GenericRowData.of(2L,
GenericRowData.of(9.0f, 9.0f))).getRow(0, 2);
assertThat(first).isNotSameAs(second); // fails
assertThat(first.getFloat(0)).isEqualTo(1.0f); // fails, now 9.0
```
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]