msamirkhan commented on a change in pull request #29353:
URL: https://github.com/apache/spark/pull/29353#discussion_r479566417



##########
File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcSerializer.scala
##########
@@ -27,12 +27,19 @@ import org.apache.spark.sql.catalyst.util._
 import org.apache.spark.sql.types._
 
 /**
- * A serializer to serialize Spark rows to ORC structs.
+ * A serializer to serialize Spark rows to ORC structs. Multiple calls return 
the same [[OrcStruct]]
+ * object. If needed, caller should copy before making a new call.
  */
 class OrcSerializer(dataSchema: StructType) {
 
-  private val result = createOrcValue(dataSchema).asInstanceOf[OrcStruct]
-  private val converters = 
dataSchema.map(_.dataType).map(newConverter(_)).toArray
+  // TODO: repeating steps here. Can pass as parameter to newConverter, but 
only done once at the

Review comment:
       Apologies for the delay. Created 
https://issues.apache.org/jira/browse/SPARK-32732 and added to TODO comment.




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

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