You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2019/03/19 18:49:30 UTC
[GitHub] [incubator-iceberg] rominparekh commented on a change in pull
request #134: Adding Drop and Rename APIs to Tables interface.
rominparekh commented on a change in pull request #134: Adding Drop and Rename APIs to Tables interface.
URL: https://github.com/apache/incubator-iceberg/pull/134#discussion_r267044365
##########
File path: core/src/main/java/com/netflix/iceberg/hadoop/HadoopTables.java
##########
@@ -66,6 +70,28 @@ public Table load(String location) {
return new BaseTable(ops, location);
}
+ @Override
+ public void drop(String location) {
+ final Path path = new Path(location);
+ final FileSystem fs = Util.getFS(path, conf);
+ try {
+ fs.delete(path, true);
+ } catch (IOException e) {
+ throw new RuntimeIOException(e);
+ }
+ }
+
+ @Override
+ public void rename(String location, String newLoaction) {
+ final Path path = new Path(location);
+ final FileSystem fs = Util.getFS(path, conf);
+ try {
+ fs.rename(path, new Path(path, newLoaction));
Review comment:
The `rename` API returns a boolean. `true` if rename was successful and in `false` in some cases. For instance, if the parent directory is not present in `newLocation` then `rename` will return a `false` instead of throwing an exception. Example:
```
rename `/a/b/c/x` to `/a/b/d/x` will return `false` if `d` does not exist.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org