You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by "DanielLeens (via GitHub)" <gi...@apache.org> on 2026/04/26 02:21:43 UTC

Re: [PR] [Fix][Connector-V2] Fix ORC File Source corrupts BINARY type data [seatunnel]

DanielLeens commented on PR #10820:
URL: https://github.com/apache/seatunnel/pull/10820#issuecomment-4321077316

   Thanks for the update. I re-reviewed the latest head locally, including the real call path from ORC schema inference to `readBytesVal()`.
   
   This PR fixes a real user-facing bug: ORC `BINARY` values were going through a lossy `bytes -> String -> byte[]` round-trip before they entered the SeaTunnel row. The normal path absolutely hits this code because `OrcReadStrategy.orcDataType2SeaTunnelDataType()` now maps ORC `BINARY` to `PrimitiveByteArrayType.INSTANCE` at `OrcReadStrategy.java:254-273`, and the actual cell read then goes through `readBytesVal()` at `OrcReadStrategy.java:449-472`.
   
   The key runtime chain is:
   ```text
   ORC reader startup
     -> OrcReadStrategy.orcDataType2SeaTunnelDataType() [254-273]
         -> BINARY => PrimitiveByteArrayType.INSTANCE
     -> readColumn(...)
         -> readBytesVal(...) [449-472]
             -> old behavior: decode bytes as String, then encode again
             -> new behavior: return raw byte[] unless the configured target type is STRING
     -> SeaTunnelRow reaches downstream with the original binary payload preserved
   ```
   
   I also checked the new regression test in `OrcReadStrategyTest.java:113-170`. It uses a real ORC resource, verifies that the BINARY field comes back as `byte[]`, and confirms that the UNION<string> branch still returns `String`. That is the right coverage for this fix.
   
   I did not find any blocking issue in the current implementation. Compatibility is fully preserved, and the change slightly improves CPU/GC behavior by removing an unnecessary string round-trip. Build is green on the current head, so from my side this is ready to merge.
   


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org