You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2022/08/28 22:35:53 UTC

[GitHub] [iceberg] rdblue commented on a diff in pull request #5632: Core: Avoid reading ManifestFile when create ManifestReader

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


##########
core/src/main/java/org/apache/iceberg/ManifestReader.java:
##########
@@ -101,20 +100,34 @@ private String fileClass() {
 
   protected ManifestReader(
       InputFile file,
+      int specId,
       Map<Integer, PartitionSpec> specsById,
       InheritableMetadata inheritableMetadata,
       FileType content) {
     this.file = file;
     this.inheritableMetadata = inheritableMetadata;
     this.content = content;
 
+    if (specsById != null) {
+      this.spec = specsById.get(specId);
+      Preconditions.checkArgument(
+          spec != null, "Could not find PartitionSpec for specId: %s", specId);

Review Comment:
   In Iceberg, we don't use class or variable names in error messages. The people reading these messages are not Iceberg developers so it is better to just use normal words. Here, this should be `"Cannot find partition spec for id: %s"`



-- 
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-unsubscribe@iceberg.apache.org

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


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