fivetran-kostaszoumpatianos commented on PR #1772:
URL: https://github.com/apache/polaris/pull/1772#issuecomment-2935320077

   Thanks @adutra , this is interesting. 
   I was able to replicate that via the iceberg library in Java.
   
   Something like that fails for me:
   ```
             Namespace namespace = Namespace.of("test_database");
             TableIdentifier tableId = TableIdentifier.of(namespace.toString(), 
"history");
              
              // Set up catalog properties
             var uri = "http://127.0.0.1:8181/api/catalog";;
             var catalogName = "quickstart_catalog";
             var clientCredentials = "XXXXX:YYYYYY";
   
             Map<String, String> properties = new HashMap<>();
             properties.put(CatalogProperties.CATALOG_IMPL, 
"org.apache.iceberg.rest.RESTCatalog");
             properties.put("header.X-Iceberg-Access-Delegation", "true");
             properties.put(CatalogProperties.URI, uri);
             properties.put("header.Polaris-Client-ID", 
UUID.randomUUID().toString().replace("-", ""));
             properties.put(CatalogProperties.WAREHOUSE_LOCATION, catalogName);
             properties.put("credential", clientCredentials);
             properties.put("scope", "PRINCIPAL_ROLE:ALL");
     
             RESTCatalog catalog = new RESTCatalog();
             catalog.initialize("polaris", properties); 
             catalog.setConf(new org.apache.hadoop.conf.Configuration()); 
     
               if (!catalog.namespaceExists(namespace)) {
                   catalog.createNamespace(namespace);
               }      
    
               // Create table
               Map<String, Type> schema = new HashMap<>();
               schema.put("id", Types.IntegerType.get());
               schema.put("number", Types.IntegerType.get());
               Set<String> pks = new HashSet<>();
               pks.add("id");
               catalog.buildTable(
                               TableIdentifier.of(namespace.toString(), 
"history"),
                               buildIcebergSchema(schema, pks))
                       .withProperty("stage-create", "true")
                       .create();
   ```
   
   


-- 
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-unsubscr...@polaris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to