Skip to content

Commit f0bbde7

Browse files
committed
add documentation
1 parent 1e8714b commit f0bbde7

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

datafusion_iceberg/src/table.rs

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1066,6 +1066,25 @@ fn value_to_scalarvalue(value: &Value) -> Result<ScalarValue, DataFusionError> {
10661066
}
10671067
}
10681068

1069+
/// Writes record batches as Parquet data files to an Iceberg table.
1070+
///
1071+
/// This is a convenience function that writes standard data files (not delete files)
1072+
/// to the specified Iceberg table. The function handles partitioning and file generation,
1073+
/// returning the metadata information needed for the next step of table operations.
1074+
///
1075+
/// # Arguments
1076+
/// * `table` - Reference to the Iceberg table to write to
1077+
/// * `batches` - Stream of record batches to write
1078+
/// * `context` - DataFusion task context for execution
1079+
/// * `branch` - Optional branch name to write to (defaults to main branch)
1080+
///
1081+
/// # Returns
1082+
/// A vector of `DataFile` metadata objects containing information about the written files
1083+
/// that can be used in subsequent table metadata operations.
1084+
///
1085+
/// # Errors
1086+
/// Returns `DataFusionError` if writing fails due to I/O errors, schema mismatches,
1087+
/// or other issues during the write process.
10691088
#[inline]
10701089
pub async fn write_parquet_data_files(
10711090
table: &Table,
@@ -1076,6 +1095,26 @@ pub async fn write_parquet_data_files(
10761095
write_parquet_files(table, batches, context, None, branch).await
10771096
}
10781097

1098+
/// Writes record batches as Parquet equality delete files to an Iceberg table.
1099+
///
1100+
/// This function creates equality delete files that mark rows for deletion based on
1101+
/// equality constraints on specific columns. The equality IDs specify which columns
1102+
/// are used for the equality comparison when applying the deletes.
1103+
///
1104+
/// # Arguments
1105+
/// * `table` - Reference to the Iceberg table to write delete files to
1106+
/// * `batches` - Stream of record batches containing the delete records
1107+
/// * `context` - DataFusion task context for execution
1108+
/// * `equality_ids` - Field IDs of columns used for equality-based deletion
1109+
/// * `branch` - Optional branch name to write to (defaults to main branch)
1110+
///
1111+
/// # Returns
1112+
/// A vector of `DataFile` metadata objects containing information about the written
1113+
/// delete files that can be used in subsequent table metadata operations.
1114+
///
1115+
/// # Errors
1116+
/// Returns `DataFusionError` if writing fails due to I/O errors, schema mismatches,
1117+
/// or other issues during the write process.
10791118
#[inline]
10801119
pub async fn write_parquet_equality_delete_files(
10811120
table: &Table,

0 commit comments

Comments
 (0)