szehon-ho commented on code in PR #5376:
URL: https://github.com/apache/iceberg/pull/5376#discussion_r944972504


##########
core/src/main/java/org/apache/iceberg/BaseFilesTable.java:
##########
@@ -185,5 +232,60 @@ public Iterable<FileScanTask> split(long splitSize) {
     ManifestFile manifest() {
       return manifest;
     }
+
+    private List<Function<ContentFile<?>, Object>> accessors(boolean 
partitioned) {

Review Comment:
   I gave a try but there are two issues that break the projection.
   1.  BaseFile::size() returns a fixed size (DataFile.getType()), regardless 
of the projection schema.  I guess this can be fixed, but hopefully doesnt 
break anything.
   2. A more serious issue, BaseFile has a field called 'fileOrdinal', but it 
is not on the FilesTable schemas (again DataFile.getType()).  It seems its 
working today because its the last field, and projection on the files table 
will never request that field.
   
   My initial idea for list of explicit accessors was its cleanly decouples the 
table from the messiness of the underlying BaseFile/DataFile classes.  Maybe we 
can try to keep that pattern and encapsulate the logic in a StructLike class 
like this ?  Or let me know which approach is better for you



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