viirya commented on a change in pull request #25384: 
[SPARK-26859][SQL][BACKPORT-2.3] Fix field writer index bug in non-vectorized 
ORC deserializer
URL: https://github.com/apache/spark/pull/25384#discussion_r311879224
 
 

 ##########
 File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcDeserializer.scala
 ##########
 @@ -47,18 +47,20 @@ class OrcDeserializer(
       }.toArray
   }
 
-  private val validColIds = requestedColIds.filterNot(_ == -1)
-
   def deserialize(orcStruct: OrcStruct): InternalRow = {
-    var i = 0
-    while (i < validColIds.length) {
-      val value = orcStruct.getFieldValue(validColIds(i))
-      if (value == null) {
-        resultRow.setNullAt(i)
-      } else {
-        fieldWriters(i)(value)
+    var fieldWriterIndex = 0
+    var targetColumnIndex = 0
+    while (targetColumnIndex < requestedColIds.length) {
 
 Review comment:
   Why don't change `fieldWriters` following original PR?

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


With regards,
Apache Git Services

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

Reply via email to