szehon-ho commented on code in PR #4812:
URL: https://github.com/apache/iceberg/pull/4812#discussion_r919505235
##########
core/src/main/java/org/apache/iceberg/io/DeleteSchemaUtil.java:
##########
@@ -20,13 +20,38 @@
package org.apache.iceberg.io;
import org.apache.iceberg.MetadataColumns;
+import org.apache.iceberg.Partitioning;
import org.apache.iceberg.Schema;
+import org.apache.iceberg.Table;
+import org.apache.iceberg.types.TypeUtil;
import org.apache.iceberg.types.Types;
public class DeleteSchemaUtil {
private DeleteSchemaUtil() {
}
+ public static Schema metadataTableSchema(Table table) {
+ return metadataTableSchema(table, Partitioning.partitionType(table));
+ }
+
+ public static Schema metadataTableSchema(Table table, Types.StructType
partitionType) {
+ Schema result = new Schema(
+ MetadataColumns.DELETE_FILE_PATH,
+ MetadataColumns.DELETE_FILE_POS,
+ Types.NestedField.optional(
+ MetadataColumns.DELETE_FILE_ROW_FIELD_ID, "row",
table.schema().asStruct(),
+ MetadataColumns.DELETE_FILE_ROW_DOC));
+
+ if (partitionType.fields().size() > 0) {
Review Comment:
This was emulated from other metadata table like BaseFilesTable, but good
point.
--
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]