Skip to content

[AMORO-4044][amoro-format-iceberg] Fix SLF4J log format placeholder in TableEntriesScan#4102

Open
lintingbin wants to merge 2 commits intoapache:masterfrom
lintingbin:fix/slf4j-format-placeholder-in-TableEntriesScan
Open

[AMORO-4044][amoro-format-iceberg] Fix SLF4J log format placeholder in TableEntriesScan#4102
lintingbin wants to merge 2 commits intoapache:masterfrom
lintingbin:fix/slf4j-format-placeholder-in-TableEntriesScan

Conversation

@lintingbin
Copy link
Contributor

Why are the changes needed?

In TableEntriesScan, both buildDataFile() and buildDeleteFile() use LOG.info("No specId found for the current fileRecord[%S]", filePath) to log a warning when no specId is found. However, SLF4J uses {} as the parameter placeholder, not %S (which is printf-style). As a result, the filePath variable is never substituted into the log message, making the log output useless for debugging.

This was discovered while reviewing PR #4085.

Brief change log

  • Replace %S with {} in two LOG calls within buildDataFile() and buildDeleteFile()
  • Change log level from info to warn since a missing specId is an abnormal condition that deserves attention

How was this patch tested?

  • Verified by code inspection — straightforward format string fix
  • Existing tests pass without modification

Documentation

  • Does this pull request introduce a new feature? (yes / no)
    no
  • If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)
    not applicable

Replace printf-style `%S` with SLF4J-style `{}` in LOG calls within
buildDataFile() and buildDeleteFile(). The `%S` placeholder is not
recognized by SLF4J, so the filePath parameter was never substituted
into the log message. Also change log level from info to warn since
missing specId is an abnormal condition worth attention.

Signed-off-by: Darcy <lintingbin@lilith.com>
Copy link
Member

@klion26 klion26 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lintingbin Thanks for the contribution, LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants