Skip to content

[Feature] Refine toString format of CommitMessageImpl #4938

@smdsbz

Description

@smdsbz

Search before asking

  • I searched in the issues and found nothing similar.

Motivation

Currently the toString method of DataIncrement only outputs newFiles and changelogFiles, deletedFiles are skipped and lost.

Moreover the output format of DataIncrement enforces new line, regardless of whether the file lists are empty, while neither its containing object CommitMessageImpl and ManifestCommittable does. Such inconsistency causes log lines difficult to be distinguished from each other, leading to poor developing / troubleshooting experience.

Current output format for a simple 3-entries insertion

xxxxx logs before xxxxxxx
xxxxx logs before xxxxxxx
xxxxx logs before xxxxxxx
[ManifestCommittable {identifier = 9223372036854775807, watermark = null, logOffsets = {}, commitMessages = [FileCommittable {partition = org.apache.paimon.data.BinaryRow@9c67b85d, bucket = 20, newFilesIncrement = NewFilesIncrement {newFiles = [
data-78ca1a70-f11d-4291-a38c-acf80e92b144-0.parquet
], changelogFiles = [

]}, compactIncrement = CompactIncrement {compactBefore = [

], compactAfter = [

], changelogFiles = [

]}, indexIncrement = IndexIncrement{newIndexFiles=[IndexManifestEntry{indexType=HASH, fileName='index-f251d12f-dab4-42b9-8fd8-a46f5b79d6d6-0', fileSize=4, rowCount=1, deletionVectorMetas=null}],deletedIndexFiles=[]}}, FileCommittable {partition = org.apache.paimon.data.BinaryRow@9c67b85d, bucket = 179, newFilesIncrement = NewFilesIncrement {newFiles = [
data-e50b96bf-bcb8-45ee-bf27-564bb3ae5c2d-0.parquet
], changelogFiles = [

]}, compactIncrement = CompactIncrement {compactBefore = [

], compactAfter = [

], changelogFiles = [

]}, indexIncrement = IndexIncrement{newIndexFiles=[IndexManifestEntry{indexType=HASH, fileName='index-97892043-5256-4b80-9c72-50091c9fdcec-0', fileSize=4, rowCount=1, deletionVectorMetas=null}],deletedIndexFiles=[]}}, FileCommittable {partition = org.apache.paimon.data.BinaryRow@9c67b85d, bucket = 193, newFilesIncrement = NewFilesIncrement {newFiles = [
data-de4dc4c9-586b-4385-b563-8e2278d20f21-0.parquet
], changelogFiles = [

]}, compactIncrement = CompactIncrement {compactBefore = [

], compactAfter = [

], changelogFiles = [

]}, indexIncrement = IndexIncrement{newIndexFiles=[IndexManifestEntry{indexType=HASH, fileName='index-b3046513-c77b-4f3d-933c-bea67db3139d-0', fileSize=4, rowCount=1, deletionVectorMetas=null}],deletedIndexFiles=[]}}]]
xxxx logs after xxxxx
xxxx logs after xxxxx
xxxx logs after xxxxx

Solution

  • Render deletedFiles in DataIncrement#toString.
  • Remove manually added new lines, directly output an inline [] for file lists that are empty.
    If someone wishes to pretty-print this structure, they can do so by accessing members recursively and build their own renderer.

Anything else?

No response

Are you willing to submit a PR?

  • I'm willing to submit a PR!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions