RussellSpitzer commented on a change in pull request #2877:
URL: https://github.com/apache/iceberg/pull/2877#discussion_r680282436



##########
File path: 
spark/src/main/java/org/apache/iceberg/spark/source/RowDataReader.java
##########
@@ -186,28 +186,29 @@ protected Schema tableSchema() {
   }
 
   private CloseableIterable<InternalRow> newDataIterable(DataTask task, Schema 
readSchema) {
-    StructInternalRow row = new StructInternalRow(tableSchema.asStruct());
+    Schema taskSchema = task.schema() == null ? tableSchema : task.schema();
+    StructInternalRow row = new StructInternalRow(taskSchema.asStruct());

Review comment:
       I think that's a good solution as well, I was worried about redoing the 
whole setup for every data task here but that makes sense to me. Basically we 
will only be projecting within our original row construction and not doing the 
projection in spark.




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