wirybeaver commented on code in PR #12629:
URL: https://github.com/apache/gluten/pull/12629#discussion_r4473825193


##########
gluten-iceberg/src/main/scala/org/apache/gluten/execution/IcebergScanTransformer.scala:
##########
@@ -385,6 +417,60 @@ object IcebergScanTransformer {
     GlutenIcebergSourceUtil.isSupportedScan(scan)
   }
 
+  private[execution] def validateDeleteFile(
+      deleteFile: ReadRel.LocalFiles.FileOrFiles.IcebergReadOptions.DeleteFile,
+      supportsEqualityDelete: Boolean,
+      supportsDeletionVector: Boolean,
+      dataFilePath: Option[String] = None): Option[String] = {
+    val content = deleteFile.getFileContent
+    val format = deleteFile.getFileFormatCase
+    if (
+      content ==
+        
ReadRel.LocalFiles.FileOrFiles.IcebergReadOptions.FileContent.EQUALITY_DELETES 
&&
+        !supportsEqualityDelete
+    ) {
+      Some("Contains equality delete files")
+    } else if (
+      format ==
+        
ReadRel.LocalFiles.FileOrFiles.IcebergReadOptions.DeleteFile.FileFormatCase.PUFFIN
+    ) {
+      if (!supportsDeletionVector) {
+        Some("Delete file format puffin is not supported")
+      } else if (
+        content !=
+          
ReadRel.LocalFiles.FileOrFiles.IcebergReadOptions.FileContent.POSITION_DELETES
+      ) {
+        Some("Puffin delete file must contain position deletes")
+      } else if (
+        !deleteFile.hasContentOffset ||
+        deleteFile.getContentOffset < 0 ||
+        !deleteFile.hasContentSizeInBytes ||
+        deleteFile.getContentSizeInBytes <= 0 ||

Review Comment:
   fixed



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