ayushtkn commented on code in PR #5404:
URL: https://github.com/apache/hive/pull/5404#discussion_r1976699088
##########
common/src/java/org/apache/hadoop/hive/common/CompressionUtils.java:
##########
@@ -169,30 +169,30 @@ public static List<File> unTar(final String
inputFileName, final String outputDi
// no sub-directories
continue;
}
- LOG.debug(String.format("Attempting to write output directory %s.",
- outputFile.getAbsolutePath()));
+ LOG.debug("Attempting to write output directory %s.".formatted(
+ outputFile.getAbsolutePath()));
if (!outputFile.exists()) {
- LOG.debug(String.format("Attempting to create output directory
%s.",
- outputFile.getAbsolutePath()));
+ LOG.debug("Attempting to create output directory %s.".formatted(
+ outputFile.getAbsolutePath()));
if (!outputFile.mkdirs()) {
- throw new IllegalStateException(String.format("Couldn't create
directory %s.",
- outputFile.getAbsolutePath()));
+ throw new IllegalStateException("Couldn't create directory
%s.".formatted(
+ outputFile.getAbsolutePath()));
}
}
} else {
final OutputStream outputFileStream;
if (flatten) {
File flatOutputFile = new File(outputDir, outputFile.getName());
- LOG.debug(String.format("Creating flat output file %s.",
flatOutputFile.getAbsolutePath()));
+ LOG.debug("Creating flat output file
%s.".formatted(flatOutputFile.getAbsolutePath()));
outputFileStream = new FileOutputStream(flatOutputFile);
} else if (!outputFile.getParentFile().exists()) {
- LOG.debug(String.format("Attempting to create output directory
%s.",
- outputFile.getParentFile().getAbsoluteFile()));
+ LOG.debug("Attempting to create output directory %s.".formatted(
+ outputFile.getParentFile().getAbsoluteFile()));
if (!outputFile.getParentFile().getAbsoluteFile().mkdirs()) {
- throw new IllegalStateException(String.format("Couldn't create
directory %s.",
- outputFile.getParentFile().getAbsolutePath()));
+ throw new IllegalStateException("Couldn't create directory
%s.".formatted(
+ outputFile.getParentFile().getAbsolutePath()));
}
- LOG.debug(String.format("Creating output file %s.",
outputFile.getAbsolutePath()));
+ LOG.debug("Creating output file
%s.".formatted(outputFile.getAbsolutePath()));
Review Comment:
I think rather than using `formatted`, we can directly use log4 format {} +
any other places in other files for similar stuff
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]