Skip to content

refactor(spark): use SLF4J parameterized logging instead of string concatenation#19184

Merged
yihua merged 1 commit into
apache:masterfrom
voonhous:cleanup-slf4j-log-templating-spark-datasource
Jul 4, 2026
Merged

refactor(spark): use SLF4J parameterized logging instead of string concatenation#19184
yihua merged 1 commit into
apache:masterfrom
voonhous:cleanup-slf4j-log-templating-spark-datasource

Conversation

@voonhous

@voonhous voonhous commented Jul 4, 2026

Copy link
Copy Markdown
Member

Describe the issue this Pull Request addresses

A number of LOG calls in the hudi-spark test classes build their message with + string concatenation. This eagerly builds the string even when the level is disabled and reads worse than a parameterized statement. This PR converts them to SLF4J {} templating. Part of the ongoing logging cleanup (follows #19155, #19156, #19157, #19158, #19159, #19160).

Summary and Changelog

  • Converted string-concatenation LOG calls to {} placeholders in two hudi-spark test classes (TestHoodieClientMultiWriter, TestDataValidationCheckForLogCompactionActions). Mechanical and behavior-preserving.

Impact

none - test-only, purely mechanical logging change.

Risk Level

none

Documentation Update

none

Note: these classes use plain LoggerFactory.getLogger LOG fields. Migrating them to the Lombok @Slf4j annotation will be done in a separate round of cleanup sweeps; this PR only covers the concatenation-to-templating conversion.

Contributor's checklist

  • Read through contributor's guide
  • Enough context is provided in the sections above
  • Adequate tests were added if applicable

…ncatenation

Convert LOG string concatenation to {} placeholders in the hudi-spark
test classes TestHoodieClientMultiWriter and
TestDataValidationCheckForLogCompactionActions. Mechanical and
behavior-preserving.
@voonhous voonhous changed the title refactor(spark): use SLF4J parameterized logging instead of string co… refactor(spark): use SLF4J parameterized logging instead of string concatenation Jul 4, 2026

@hudi-agent hudi-agent left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ 🤖 This review was generated by an AI agent and may contain mistakes. Please verify any suggestions before applying.

Thanks for working on this! This PR mechanically converts string-concatenation LOG calls to SLF4J {} parameterized logging in two hudi-spark test classes. I checked each conversion — the placeholder counts match their argument counts and the message content is preserved in every case, so the changes are behavior-preserving. No correctness issues found. A few style/readability suggestions in the inline comments. Please take a look, and this should be ready for a Hudi committer or PMC member to take it from here. A couple of small suggestions on the exception-logging pattern — passing e directly as the last SLF4J argument preserves the stack trace and keeps log messages fixed and searchable.

cc @yihua

@hudi-bot

hudi-bot commented Jul 4, 2026

Copy link
Copy Markdown
Collaborator

CI report:

Bot commands @hudi-bot supports the following commands:
  • @hudi-bot run azure re-run the last Azure build

@yihua yihua left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@yihua yihua merged commit 7954323 into apache:master Jul 4, 2026
76 of 77 checks passed
@voonhous voonhous deleted the cleanup-slf4j-log-templating-spark-datasource branch July 5, 2026 06:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S PR with lines of changes in (10, 100]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants