danielcweeks commented on code in PR #9830:
URL: https://github.com/apache/iceberg/pull/9830#discussion_r3470379637


##########
spark/v3.5/spark/src/main/java/org/apache/iceberg/spark/SparkCatalog.java:
##########
@@ -576,7 +577,14 @@ public View loadView(Identifier ident) throws 
NoSuchViewException {
     if (null != asViewCatalog) {
       try {
         org.apache.iceberg.view.View view = 
asViewCatalog.loadView(buildIdentifier(ident));
-        return new SparkView(catalogName, view);
+        // Check if the view is a materialized view. If it is, and storage 
table is fresh, throw
+        // IllegalStateException
+        if (isMaterializedView(view) && isFresh(view)) {

Review Comment:
   This doesn't seem right to me.  Why would we throw if it's fresh? I feel 
like we should be returning a MV implementation with the associated table, not 
using exceptions as control flow.



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