Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose Delta Uniform write commit size in logs #3898

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ class IcebergConversionTransaction(

protected abstract class TransactionHelper(impl: PendingUpdate[_]) {
private var committed = false
var writeSize = 0L

def opType: String

Expand All @@ -94,6 +95,7 @@ class IcebergConversionTransaction(
override def opType: String = "append"

def add(add: AddFile): Unit = {
writeSize += add.size
appender.appendFile(
convertDeltaAddFileToIcebergDataFile(
add,
Expand Down Expand Up @@ -134,6 +136,7 @@ class IcebergConversionTransaction(
override def opType: String = "overwrite"

def add(add: AddFile): Unit = {
writeSize += add.size
overwriter.addFile(
convertDeltaAddFileToIcebergDataFile(
add,
Expand Down Expand Up @@ -169,6 +172,7 @@ class IcebergConversionTransaction(
override def opType: String = "rewrite"

def rewrite(removes: Seq[RemoveFile], adds: Seq[AddFile]): Unit = {
writeSize += adds.map(_.size).sum
val dataFilesToDelete = removes.map { f =>
assert(!f.dataChange, "Rewrite operation should not add data")
convertDeltaRemoveFileToIcebergDataFile(
Expand Down Expand Up @@ -487,7 +491,9 @@ class IcebergConversionTransaction(
"version" -> postCommitSnapshot.version,
"timestamp" -> postCommitSnapshot.timestamp,
"tableOp" -> tableOp.getClass.getSimpleName.stripSuffix("$"),
"prevConvertedDeltaVersion" -> lastConvertedDeltaVersion
"prevConvertedDeltaVersion" -> lastConvertedDeltaVersion,
"tableSize" -> postCommitSnapshot.sizeInBytes,
"commitWriteSize" -> fileUpdates.map(_.writeSize).sum
) ++ icebergTxnTypes ++ errorData
)
}
Expand Down
Loading