Skip to content

Commit

Permalink
[MINOR][SQL][TESTS] Use formatString.format(value) instead of `valu…
Browse files Browse the repository at this point in the history
…e.formatted(formatString)`

### What changes were proposed in this pull request?
The pr aims to use `formatString.format(value)` instead of `value.formatted(formatString)` for eliminating Warning.

### Why are the changes needed?
<img width="876" alt="image" src="https://github.com/user-attachments/assets/0e5798f4-ec53-41f7-aba9-8f8e51347f59">

### Does this PR introduce _any_ user-facing change?
No.

### How was this patch tested?
Pass GA.

### Was this patch authored or co-authored using generative AI tooling?
No.

Closes #48262 from panbingkun/minor_formatted.

Authored-by: panbingkun <[email protected]>
Signed-off-by: yangjie01 <[email protected]>
  • Loading branch information
panbingkun authored and LuciferYang committed Sep 26, 2024
1 parent 7b20e58 commit 218051a
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ object CompressionSchemeBenchmark extends BenchmarkBase with AllCompressionSchem

schemes.filter(_.supports(tpe)).foreach { scheme =>
val (compressFunc, compressionRatio, buf) = prepareEncodeInternal(count, tpe, scheme, input)
val label = s"${getFormattedClassName(scheme)}(${compressionRatio.formatted("%.3f")})"
val label = s"${getFormattedClassName(scheme)}(${"%.3f".format(compressionRatio)})"

benchmark.addCase(label)({ i: Int =>
for (n <- 0L until iters) {
Expand Down

0 comments on commit 218051a

Please sign in to comment.