aokolnychyi commented on a change in pull request #675: Inherit snapshot ids
for manifest entries
URL: https://github.com/apache/incubator-iceberg/pull/675#discussion_r369994726
##########
File path: core/src/main/java/org/apache/iceberg/ManifestReader.java
##########
@@ -60,29 +62,77 @@
/**
* Returns a new {@link ManifestReader} for an {@link InputFile}.
* <p>
- * <em>Note:</em> Most callers should use {@link #read(InputFile, Map)} to
ensure that the
- * schema used by filters is the latest table schema. This should be used
only when reading a
- * manifest without filters.
+ * <em>Note:</em> Most callers should use {@link #read(ManifestFile, FileIO,
Map)} to ensure that
+ * manifest entries with partial metadata can inherit missing properties
from the manifest metadata.
+ * <p>
+ * <em>Note:</em> Most callers should use {@link #read(InputFile, Map)} if
all manifest entries
+ * contain full metadata and they want to ensure that the schema used by
filters is the latest
+ * table schema. This should be used only when reading a manifest without
filters.
*
* @param file an InputFile
* @return a manifest reader
*/
public static ManifestReader read(InputFile file) {
- return new ManifestReader(file, null);
+ return new ManifestReader(file, null, InheritableMetadataFactory.empty());
}
/**
* Returns a new {@link ManifestReader} for an {@link InputFile}.
+ * <p>
+ * <em>Note:</em> Most callers should use {@link #read(ManifestFile, FileIO,
Map)} to ensure that
+ * manifest entries with partial metadata can inherit missing properties
from the manifest metadata.
*
* @param file an InputFile
* @param specsById a Map from spec ID to partition spec
* @return a manifest reader
*/
public static ManifestReader read(InputFile file, Map<Integer,
PartitionSpec> specsById) {
- return new ManifestReader(file, specsById);
+ return new ManifestReader(file, specsById,
InheritableMetadataFactory.empty());
+ }
+
+ /**
+ * Returns a new {@link ManifestReader} for a {@link ManifestFile}.
+ *
+ * @param manifest a ManifestFile
+ * @param io a FileIO
+ * @param specsById a Map from spec ID to partition spec
+ * @return a manifest reader
+ */
+ public static ManifestReader read(ManifestFile manifest, FileIO io,
Map<Integer, PartitionSpec> specsById) {
Review comment:
I have implemented the feature flag locally. As soon as #738 is in, I’ll
update this PR and I think we will merge it quickly as well. If this is already
blocking your work, I can extract the API changes in ManifestReader. Let me
know.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]