Skip to content

Commit 1e8714b

Browse files
committed
add better interfaces
1 parent e443e5f commit 1e8714b

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

datafusion_iceberg/src/table.rs

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -966,7 +966,7 @@ impl DataSink for IcebergDataSink {
966966
.map_err(DataFusionIcebergError::from)?;
967967

968968
let metadata_files =
969-
write_parquet_with_sink(table, data, context, None, self.0.branch.as_deref()).await?;
969+
write_parquet_data_files(table, data, context, self.0.branch.as_deref()).await?;
970970

971971
table
972972
.new_transaction(self.0.branch.as_deref())
@@ -1066,7 +1066,28 @@ fn value_to_scalarvalue(value: &Value) -> Result<ScalarValue, DataFusionError> {
10661066
}
10671067
}
10681068

1069-
pub async fn write_parquet_with_sink(
1069+
#[inline]
1070+
pub async fn write_parquet_data_files(
1071+
table: &Table,
1072+
batches: SendableRecordBatchStream,
1073+
context: &Arc<TaskContext>,
1074+
branch: Option<&str>,
1075+
) -> Result<Vec<DataFile>, DataFusionError> {
1076+
write_parquet_files(table, batches, context, None, branch).await
1077+
}
1078+
1079+
#[inline]
1080+
pub async fn write_parquet_equality_delete_files(
1081+
table: &Table,
1082+
batches: SendableRecordBatchStream,
1083+
context: &Arc<TaskContext>,
1084+
equality_ids: &[i32],
1085+
branch: Option<&str>,
1086+
) -> Result<Vec<DataFile>, DataFusionError> {
1087+
write_parquet_files(table, batches, context, Some(equality_ids), branch).await
1088+
}
1089+
1090+
async fn write_parquet_files(
10701091
table: &Table,
10711092
batches: SendableRecordBatchStream,
10721093
context: &Arc<TaskContext>,

0 commit comments

Comments
 (0)