Github user chenghao-intel commented on a diff in the pull request:

    https://github.com/apache/spark/pull/7520#discussion_r36498714
  
    --- Diff: 
sql/hive/src/main/scala/org/apache/spark/sql/hive/orc/OrcRelation.scala ---
    @@ -120,16 +110,33 @@ private[orc] class OrcOutputWriter(
         ).asInstanceOf[RecordWriter[NullWritable, Writable]]
       }
     
    -  override def writeInternal(row: InternalRow): Unit = {
    +  private def wrapOrcStruct(
    +      o: OrcStruct,
    +      oi: SettableStructObjectInspector,
    +      a: InternalRow): OrcStruct = {
    +    val fieldRefs = oi.getAllStructFieldRefs
    +    val row = a.asInstanceOf[InternalRow]
         var i = 0
    -    while (i < row.numFields) {
    -      reusableOutputBuffer(i) = wrappers(i)(row.get(i, 
dataSchema(i).dataType))
    +    while (i < fieldRefs.length) {
    --- End diff --
    
    Just curious if this change we have to make.
    Previously create an reusable array and associated with the compatible 
StructObjectInspector.
    Now, we create an reusable OrcStruct object and also attached with the 
OrcStructInspector,
    
    Seems no differences to a orc serializer, isn't it?


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