rdblue commented on code in PR #4826:
URL: https://github.com/apache/iceberg/pull/4826#discussion_r929265614
##########
nessie/src/test/java/org/apache/iceberg/nessie/TestNessieTable.java:
##########
@@ -531,27 +531,26 @@ protected String getTableLocation(String tableName) {
return getTableLocationPath(tableName).toString();
}
- private String metadataLocation(String tableName) {
- return Paths.get(getTableBasePath(tableName), "metadata").toString();
- }
-
@SuppressWarnings("RegexpSinglelineJava") // respecting this rule requires a
lot more lines of code
- private List<String> metadataFiles(String tableName) {
- return Arrays.stream(Objects.requireNonNull(new
File(metadataLocation(tableName)).listFiles()))
+ private List<String> metadataFiles(String tablePath) {
+ return Arrays.stream(Objects.requireNonNull(new File((
+ tablePath + "/" + "metadata")
+ .replace("file:", ""))
+ .listFiles()))
.map(File::getAbsolutePath)
.collect(Collectors.toList());
}
- protected List<String> metadataVersionFiles(String tableName) {
- return filterByExtension(tableName,
getFileExtension(TableMetadataParser.Codec.NONE));
+ protected List<String> metadataVersionFiles(Path tablePath) {
+ return filterByExtension(tablePath.toString(),
getFileExtension(TableMetadataParser.Codec.NONE));
}
- protected List<String> manifestFiles(String tableName) {
- return filterByExtension(tableName, ".avro");
+ protected List<String> manifestFiles(Path tablePath) {
Review Comment:
Why is this passing a `Path`, only to convert to string and strip the
`file:` from the `toString` representation in `filterByExtension`? Can you just
pass `Path`?
--
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]