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


##########
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:
   I agree, but if I'm not wrong, this code is used on both read and write 
paths.
   
   Write path: WriteFile -> ToRequestedSchema -> VisitSchemaWithPartner -> 
visitStructWithPartner -> Struct
   
   As you mentioned it’s used in the read path as well. 
   
   Since it’s used on both paths, won’t we need context on which path is being 
executed? If we use InitialDefault then it will provide the wrong default 
values on write paths. Feel free to correct me, if there’s any misunderstanding.



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