amogh-jahagirdar commented on code in PR #11986:
URL: https://github.com/apache/iceberg/pull/11986#discussion_r1919554870


##########
spark/v3.5/spark/src/main/java/org/apache/iceberg/spark/SparkWriteConf.java:
##########
@@ -723,7 +727,6 @@ public DeleteGranularity deleteGranularity() {
   }
 
   public boolean useDVs() {
-    TableOperations ops = ((HasTableOperations) table).operations();
-    return ops.current().formatVersion() >= 3;
+    return !(table instanceof BaseMetadataTable) && 
TableUtil.formatVersion(table) >= 3;

Review Comment:
   I changed this because it is possible to pass in metadata tables to 
SparkWriteConf and then previously the useDVs check would fail, for cases like 
RewritePositionDeletes which passes in the PositionMetadataTable. Metadata 
tables by definition are read only and I think it doesn't make sense for the 
writeConf.useDVs() API to return true.
   
   RewritePositionDeletes also uses metadataTable.deleteFileFormat() for 
determining the file format to write with but I didn't want to change anything 
additional on the deleteFileFormat() path since that's used in quite a bit more 
places...



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

Reply via email to