Github user JoshRosen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/3429#discussion_r22092141
  
    --- Diff: 
sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveInspectors.scala ---
    @@ -119,12 +269,44 @@ private[hive] trait HiveInspectors {
           System.arraycopy(writable.getBytes, 0, temp, 0, temp.length)
           temp
         case poi: WritableConstantDateObjectInspector => 
poi.getWritableConstantValue.get()
    -    case hvoi: HiveVarcharObjectInspector => 
hvoi.getPrimitiveJavaObject(data).getValue
    -    case hdoi: HiveDecimalObjectInspector => 
HiveShim.toCatalystDecimal(hdoi, data)
    -    // org.apache.hadoop.hive.serde2.io.TimestampWritable.set will reset 
current time object
    -    // if next timestamp is null, so Timestamp object is cloned
    -    case ti: TimestampObjectInspector => 
ti.getPrimitiveJavaObject(data).clone()
    -    case pi: PrimitiveObjectInspector => pi.getPrimitiveJavaObject(data)
    +    case mi: StandardConstantMapObjectInspector =>
    +      // take the value from the map inspector object, rather than the 
input data
    +      mi.getWritableConstantValue.map { case (k, v) =>
    +        (unwrap(k, mi.getMapKeyObjectInspector),
    +          unwrap(v, mi.getMapValueObjectInspector))
    +      }.toMap
    +    case li: StandardConstantListObjectInspector =>
    +      // take the value from the list inspector object, rather than the 
input data
    +      li.getWritableConstantValue.map(unwrap(_, 
li.getListElementObjectInspector)).toSeq
    +    // if the value is null, we don't care about the object inspector type
    +    case _ if data == null => null
    +    case poi: VoidObjectInspector => null // always be null for void 
object inspector
    +    case pi: PrimitiveObjectInspector => pi match {
    +      // We think HiveVarchar is also a String
    +      case hvoi: HiveVarcharObjectInspector if hvoi.preferWritable() =>
    +        hvoi.getPrimitiveWritableObject(data).getHiveVarchar.getValue
    +      case hvoi: HiveVarcharObjectInspector => 
hvoi.getPrimitiveJavaObject(data).getValue
    +      case x: StringObjectInspector if x.preferWritable() =>
    +        x.getPrimitiveWritableObject(data).toString
    +      case x: IntObjectInspector if x.preferWritable() => x.get(data)
    +      case x: BooleanObjectInspector if x.preferWritable() => x.get(data)
    +      case x: FloatObjectInspector if x.preferWritable() => x.get(data)
    +      case x: DoubleObjectInspector if x.preferWritable() => x.get(data)
    +      case x: LongObjectInspector if x.preferWritable() => x.get(data)
    +      case x: ShortObjectInspector if x.preferWritable() => x.get(data)
    +      case x: ByteObjectInspector if x.preferWritable() => x.get(data)
    +      case x: HiveDecimalObjectInspector => HiveShim.toCatalystDecimal(x, 
data)
    +      case x: BinaryObjectInspector if x.preferWritable() =>
    +        x.getPrimitiveWritableObject(data).copyBytes()
    --- End diff --
    
    Since this didn't break the pull request builder and it's nighttime now (so 
we're probably not merging tons of stuff), I'm going to hold off on reverting 
this for a little bit to see if we can come up with a quick hotfix.  Otherwise, 
I'll revert this commit when I get up tomorrow.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to