PranjalChaitanya commented on code in PR #779:
URL: https://github.com/apache/iceberg-go/pull/779#discussion_r2928382006


##########
table/arrow_utils.go:
##########
@@ -832,7 +872,12 @@ func (a *arrowProjectionVisitor) Struct(st 
iceberg.StructType, structArr arrow.A
                } else if !field.Required {
                        dt := retOrPanic(TypeToArrowType(field.Type, false, 
a.useLargeTypes))
 
-                       arr = 
array.MakeArrayOfNull(compute.GetAllocator(a.ctx), dt, structArr.Len())
+                       if field.WriteDefault != nil {

Review Comment:
   Thank you for your comments! I'll fix all of them, but I needed alignment on 
this one.
   
   The reason I modified this function specifically was because I believed that 
it was used in the write path. After reading your comments, it seems to me that 
ToRequestedSchema() and by extension Struct() are used in both the read and 
write paths. Is my understanding of this correct?
   
   If my understanding is correct, we need to provide information on which path 
is being executed, to determine which default value to use. I think the safest 
and most backwards compatible way to solve this would involve adding a flag to 
the arrowProjectionVisitor struct. Let me know what you think!



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