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_r267044554
 
 

 ##########
 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:
   It might vary on HSFS implementations (for instance, ADLS) but it would be 
better to check the return boolean.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to