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/08/26 21:49:07 UTC

[GitHub] [incubator-iceberg] rdblue commented on a change in pull request #416: Adding docs on how to use custom catalog with iceberg

rdblue commented on a change in pull request #416: Adding docs on how to use custom catalog with iceberg
URL: https://github.com/apache/incubator-iceberg/pull/416#discussion_r317813862
 
 

 ##########
 File path: site/docs/custom-catalog.md
 ##########
 @@ -0,0 +1,138 @@
+# Custom Catalog Implementation
+
+It's possible to read an iceberg table either from an hdfs path or from a hive table. It's also possible to use a custom metastore in place of hive. The steps to do that are as follows.
+
+- [Custom TableOperations](#custom-table-operations-implementation)
+- [Custom Catalog](#custom-table-implementation)
+- [Custom IcebergSource](#custom-icebergsource)
+
+### Custom table operations implementation
+Extend `BaseMetastoreTableOperations` to provide implementation on how to read and write metadata
+
+Example:
+```java
+
+class CustomTableOperations extends BaseMetastoreTableOperations {
+    private String dbName;
+    private String tableName;
+    private Configuration conf;
+    
+    protected CustomTableOperations(Configuration conf, String dbName, String tableName) {
+        super(conf);
+        this.conf = conf;
+        this.dbName = dbName;
+        this.tableName = tableName;
+    }
+    
+    // The refresh method should provide implementation on how to get the metadata location
+    @Override
+    public TableMetadata refresh() {
+    
+    // Example custom service which returns the metadata location given a dbName and tableName
+    val metadataLocation = CustomService.getMetadataForTable(conf, dbName, tableName)
 
 Review comment:
   Nit: Looks like indentation is off in this file.

----------------------------------------------------------------
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