hutiefang76 opened a new issue, #12577:
URL: https://github.com/apache/seatunnel/issues/12577

   ### Search before asking
   
   - [x] I searched existing issues and pull requests for the same problem.
   
   ### What happened
   
   `SeaTunnelRow` caches its estimated byte size, but `setField` does not 
invalidate that cache. A field update can therefore leave the row reporting its 
previous size to consumers using the byte estimate.
   
   Reproduction:
   
   ```java
   SeaTunnelRow row = new SeaTunnelRow(new Object[] {"abc"});
   row.getBytesSize(); // 3
   row.setField(0, "abcdef");
   row.getBytesSize(); // still 3; expected 6
   ```
   
   The same problem occurs with `getBytesSize(SeaTunnelRowType)`. It also 
affects shortening a field or replacing it with null. This report concerns 
updates through `setField`; direct mutation of the exposed fields array or 
nested values is a separate contract.
   
   ### SeaTunnel Version
   
   Current dev at `4c4fd615d677695b619ca0e04fcfd82e104cd4a9`.
   
   ### SeaTunnel Config
   
   Not configuration-dependent; the reproduction above uses the affected Java 
API directly.
   
   ### Running Command
   
   Run the API reproduction above on JDK 8 or 17.
   
   ### Error Exception
   
   No exception; the cached estimate is stale.
   
   ### Java or Scala Version
   
   Reproduced on JDK 8 and 17.
   
   ### Are you willing to submit PR?
   
   - [x] Yes
   
   ### Code of Conduct
   
   - [x] I agree to follow the project Code of Conduct.
   


-- 
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]

Reply via email to