RussellSpitzer opened a new pull request, #13769:
URL: https://github.com/apache/iceberg/pull/13769

   A Proof of Concept pr to show what allowing writing to Parquet Manifests 
might look like as well as the illuminate the rough edges we will need to work 
around to get this into the project.
   
   I'm collecting some thoughts on the work in the document below:
   
   
https://docs.google.com/document/d/13TeFu20jhkUFbb-FaaGQWFiXKO6kKyy_nX1QyFgoUoU/edit?usp=sharing
   
   Implementation issues
   
   
   ### Empty Structs
   
   Parquet does not support an empty struct in the schema but our current 
definition of the manifest has a required “partition” struct. For an 
unpartitioned table this means an empty struct is required in the schema.
   
   POC Work - I work around this by just putting in a dummy placeholder struct 
instead.
   
   ### Public API from Manifest Reader Reliance on Manifest Metadata
   
   Currently the Manifest Reader attempts to extract table’s Specs information 
from inside the avro metadata. This isn’t actually required by any of our code 
and there is basically never a time in production where we read a manifest and 
don’t already have the specs. The tests are a different case and require a lot 
of rewriting.
   
   There is unfortunately one major exception to this,
   
   Snapshot provides several apis like (addedFiles(FileIO io)) which reads 
manifests directly with a FileIO to produce their entries, this creates a 
manifest group directly but without setting specById. In this context we also 
do not have access to the table, we probably will need to change this interface 
if we want to remove reliance on file metadata.
   
   POC Work - Originally I focused on just fixing all the test references after 
skimming and trying to determine if there were any real production uses of the 
API. Once I discovered the issue with BaseSnapshot I tried to determine exactly 
the scope, 30 of the above test failures are related to this issue. Many are 
test related (checking snapshot contents) but there are some public usages in 
cherry-pick snapshot.
   
   ### Refactoring of Parquet InternalReader Implementation
   
   The current parquet InternalReader API returns a reader function before we 
are able to get arguments for custom classes. ManifestReader needs to be able 
to read into custom classes (ManifestEntry, DataFile, etc ..) so the custom 
classes need to be created prior to the reader function being generated.
   
   POC Work - Bit of a sloppy fix here but we move the reader into the Parquet 
class itself so that we can modify the function before it is built. 
   
   ### Use of Immutables in BaseFile
   
   Parquet readers using a reusable container fail because BaseFile returns an 
immutable representation of the splitOffset list. 
   
   POC Work - Just return a mutable list for now
   
   ### Determining Manifest Type Based on Extension
   
   In order to have different behaviors for different types but allow reading 
both avro and parquet manifests, we need to rely on extensions. Most likely not 
a problem in the wild, but many of our tests use manifest file names without a 
type extension. 
   
   
   POC Work - Just fixing tests
   


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