thswlsqls opened a new pull request, #9079:
URL: https://github.com/apache/paimon/pull/9079

   
   ### Purpose
   
   fix #9076
   
   - `PaimonObjectInspectorFactory` returned Hive's `JavaBinaryObjectInspector` 
for `BLOB`, which casts its input to `byte[]`, but the read path passes a 
`Blob` (`InternalRow.createFieldGetter` -> `row.getBlob(pos)`). Every Hive 
`SELECT` on a BLOB column failed with `ClassCastException`.
   - Add `PaimonBlobObjectInspector`, mirroring the sibling inspectors, 
converting `Blob` to `byte[]` on read; `convert()` covers the opposite (write) 
direction of the same type.
   - Keeps `TypeInfoFactory.binaryTypeInfo`, so the Hive-facing column type and 
writable class are unchanged.
   - Spark (`DataConverter`) and Flink (`FlinkRowDataWithBlob`) already convert 
at the engine boundary. Follow-up to #8070.
   
   ### Tests
   
   - Extended `PaimonBlobObjectInspectorTest` with 
`testGetPrimitiveJavaObjectFromBlob`, `testGetPrimitiveWritableObjectFromBlob` 
and `testConvert`; all three fail with the reported `ClassCastException` before 
this change.
   - `mvn -pl paimon-hive/paimon-hive-connector-common clean install` — 103 
unit tests and 83 `*ITCase` tests passed, including `HiveOnMrReadITCase`, 
`HiveOnTezReadITCase` and `HiveWriteITCase`.
   


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