Indhumathi27 opened a new pull request, #6796:
URL: https://github.com/apache/hive/pull/6796

   
   ### What changes were proposed in this pull request?
     **MapJoinDesc#getExprs()** caches small-table value column names at 
compile time. For a FULL OUTER MapJoin using a dynamic partitioned hash join, a 
filter-tag value column can be appended to the small table's runtime value 
struct after that caching happens, shifting the positions of the columns that 
follow it. The cached column name then resolves to the wrong runtime field (and 
object inspector), producing a type mismatch on read.
   
     This adds **MapJoinOperator#correctSmallTableValueObjectInspectors()**, 
invoked once from **initializeOp()** for FULL OUTER dynamic partitioned hash 
joins. It uses **MapJoinDesc#getValueIndex(alias)**
     — a positional accessor into the same runtime struct that isn't affected 
by the shift — to correct the small table's field object inspectors in 
**joinValuesStandardObjectInspectors** (and, transitively, 
**outputObjInspector**), so downstream operators see the corrected types.
   
     Since not every small-table alias in this join shape is guaranteed to have 
a ReduceSink KEY/VALUE-struct layout, the new **getSmallTableStructFieldOI** 
helper checks field existence via **getAllStructFieldRefs()** before use, 
rather than relying on **StructObjectInspector#getStructFieldRef**, which 
throws instead of returning null when the field isn't found.
   
   
   ### Why are the changes needed?
    Without this fix, the described query shape throws **ClassCastException: 
LongWritable cannot be cast to ShortWritable** (or an equivalent Writable type 
mismatch) during **MapJoinOperator#closeOp → 
generateFullOuterSmallTableNoMatches**, failing the query.
   
   
   ### Does this PR introduce _any_ user-facing change?
   No
   
   ### How was this patch tested?
   test case added
   


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

Reply via email to