rdblue commented on a change in pull request #688: [ISSUE #672] Add
SupportsNamespaces for 'HadoopCatalog' and 'HiveCatalog'
URL: https://github.com/apache/incubator-iceberg/pull/688#discussion_r360476043
##########
File path: core/src/main/java/org/apache/iceberg/hadoop/HadoopCatalog.java
##########
@@ -195,6 +205,109 @@ public void renameTable(TableIdentifier from,
TableIdentifier to) {
throw new UnsupportedOperationException("Cannot rename Hadoop tables");
}
+ @Override
+ public void createNamespace(Namespace namespace, Map<String, String> meta) {
+ Preconditions.checkArgument(!namespace.isEmpty(),
+ "Cannot create namespace with invalid name: %s", namespace.toString());
+ Preconditions.checkArgument(meta == null || meta.size() == 0,
+ "Hadoop Catalog not support namespace metaData: %s",
namespace.toString());
+
+ Path nsPath = new Path(SLASH.join(warehouseLocation,
SLASH.join(namespace.levels())));
+ FileSystem fs = Util.getFs(nsPath, conf);
+ try {
+ fs.mkdirs(nsPath);
+ } catch (IOException e) {
+ throw new RuntimeIOException("Create namespace failed: %s",
namespace.toString(), e.getMessage());
+ }
+ }
+
+ @Override
+ public List<Namespace> listNamespaces(Namespace namespace) {
+ // Preconditions.checkArgument(!namespace.isEmpty(), "Your Namespace must
be not empty!");
Review comment:
This should be removed.
----------------------------------------------------------------
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]