rdblue commented on code in PR #11811:
URL: https://github.com/apache/iceberg/pull/11811#discussion_r1890504071


##########
core/src/main/java/org/apache/iceberg/avro/ValueReaders.java:
##########
@@ -228,7 +249,9 @@ public static List<Pair<Integer, ValueReader<?>>> 
buildReadPlan(
       if (constant != null) {
         readPlan.add(Pair.of(pos, ValueReaders.constant(constant)));
       } else if (field.initialDefault() != null) {
-        readPlan.add(Pair.of(pos, 
ValueReaders.constant(field.initialDefault())));
+        readPlan.add(
+            Pair.of(
+                pos, ValueReaders.constant(convert.apply(field.type(), 
field.initialDefault()))));

Review Comment:
   This raises a question: should we also convert the constants passed by 
`idToConstant`?
   
   I think we _should_ but not yet. The problem is that this conversion 
probably can't be done twice because of assumptions in the conversion (like 
casting strings to `UTF8String` in Spark) so it is worth a separate PR to 
refactor all of the conversions to be done in one place. That will also be 
different for each file format so it could get messy.



-- 
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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to