wmoustafa commented on code in PR #9830:
URL: https://github.com/apache/iceberg/pull/9830#discussion_r3470626194
##########
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:
I believe this might be the only option for a DSv2-based implementation (I
understand Spark 4.2 has a `loadTableOrView` method that may alleviate this,
but for now this is the 4.1 behavior). For this particular reason, I have also
put together an alternate routing method here
https://github.com/wmoustafa/iceberg-1/pull/2 that does not use the exception
as the control flow, by leveraging analysis rules instead of DSv2 routing. Let
me know your thoughts on the alternate method.
--
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]