You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "nastra (via GitHub)" <gi...@apache.org> on 2023/03/24 11:20:09 UTC
[GitHub] [iceberg] nastra commented on a diff in pull request #7188: Refactoring metadata location and adding API to get data and metadata location #7187
nastra commented on code in PR #7188:
URL: https://github.com/apache/iceberg/pull/7188#discussion_r1147444582
##########
core/src/main/java/org/apache/iceberg/LocationProviders.java:
##########
@@ -167,5 +185,42 @@ private static String pathContext(String tableLocation) {
return resolvedContext;
}
+
+ @Override
+ public String dataLocation() {
+ return this.storageLocation;
+ }
+ }
+
+ static class DefaultMetadataLocationProvider implements MetadataLocationProvider {
+ private static final String METADATA_FOLDER_NAME = "metadata";
+ private String metadataLocation;
+
+ DefaultMetadataLocationProvider(String tableLocation, Map<String, String> properties) {
+ this.metadataLocation =
+ LocationUtil.stripTrailingSlash(
+ metadataLocation(
+ Preconditions.checkNotNull(tableLocation, "table location cannot be null"),
Review Comment:
generally it is better to use `Preconditions.checkArgument(... != null, ...)` as it is better in indicating that something wrong was passed (rather than surfacing a NPE). See also https://github.com/apache/iceberg/issues/6625 for some background
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org