munendrasn commented on code in PR #11585: URL: https://github.com/apache/iceberg/pull/11585#discussion_r1848290762
########## core/src/main/java/org/apache/iceberg/SerializableTable.java: ########## @@ -400,7 +400,14 @@ public Transaction newTransaction() { @Override public StaticTableOperations operations() { - return (StaticTableOperations) ((BaseTable) lazyTable()).operations(); + if (lazyTable() instanceof BaseTable) { + BaseTable table = (BaseTable) lazyTable(); + return (StaticTableOperations) table.operations(); + } else if (lazyTable() instanceof BaseMetadataTable) { + BaseMetadataTable table = (BaseMetadataTable) lazyTable(); + return (StaticTableOperations) table.table().operations(); + } + return null; Review Comment: In what case, `null` would be returned. it might need to NPE in other places.. would having strict check preferred in this case? -- 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-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org