From d2e1723dfc00e028dd3b89f22b06f5c4aa8a2e76 Mon Sep 17 00:00:00 2001 From: Shivam Malhotra Date: Fri, 25 Oct 2024 16:22:19 -0500 Subject: [PATCH] Review with Ryan --- .../java/io/deephaven/iceberg/util/IcebergTableAdapter.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/extensions/iceberg/src/main/java/io/deephaven/iceberg/util/IcebergTableAdapter.java b/extensions/iceberg/src/main/java/io/deephaven/iceberg/util/IcebergTableAdapter.java index c13128f8c1c..2d4e2259bb0 100644 --- a/extensions/iceberg/src/main/java/io/deephaven/iceberg/util/IcebergTableAdapter.java +++ b/extensions/iceberg/src/main/java/io/deephaven/iceberg/util/IcebergTableAdapter.java @@ -291,7 +291,9 @@ private SpecAndSchema getSpecAndSchema(@NotNull final IcebergReadInstructions re } else { // Use the schema from the snapshot snapshot = snapshotFromInstructions; - schema = schema(snapshot.schemaId()).get(); + schema = schema(snapshot.schemaId()).orElseThrow(() -> new IllegalArgumentException( + "Schema with id " + snapshot.schemaId() + " not found for table " + tableIdentifier + ", snapshot " + + snapshot.snapshotId())); partitionSpec = table.spec(); updatedInstructions = readInstructions.withSnapshot(snapshot); }