deniskuzZ commented on PR #5878:
URL: https://github.com/apache/hive/pull/5878#issuecomment-2984221940

   @henrib, transaction API doesn't work at all:
   ````
   org.apache.iceberg.exceptions.ServiceFailureException: Server error: 
IllegalStateException: Cannot wrap catalog that does not produce BaseTransaction
   ````
   that is what @okumin mentioned
   
   reproduce:
   ````
     public static final String CATALOG_CONFIG_PREFIX = "iceberg.catalog.";
     public static final String CATALOG_NAME = "iceberg.catalog";
   
     private static Map<String, String> getCatalogPropertiesFromConf(
             Configuration conf, String catalogName) {
       Map<String, String> catalogProperties = Maps.newHashMap();
       String keyPrefix = CATALOG_CONFIG_PREFIX + catalogName;
       conf.forEach(config -> {
         if (config.getKey().startsWith(keyPrefix)) {
           catalogProperties.put(
                   config.getKey().substring(keyPrefix.length() + 1),
                   config.getValue());
         }
       });
       return catalogProperties;
     }
   
     @Test
     public void testTableAPI() throws Exception {
       URI iceUri = URI.create("http://localhost:"; + catalogPort + 
"/"+catalogPath);
       Schema schema = getTestSchema();
       final String tblName = "tbl_" + Integer.toHexString(RND.nextInt(65536));
       final TableIdentifier TBL = TableIdentifier.of(DB_NAME, tblName);
       String location = temp.newFolder(TBL.toString()).toString();
   
       Configuration configuration = new Configuration();
       configuration.set("iceberg.catalog", "rest");
       configuration.set("iceberg.catalog.rest.type", "rest");
       configuration.set("iceberg.catalog.rest.uri", iceUri.toString());
   
       String catalogName = configuration.get(CATALOG_NAME);
       Map<String, String> properties = 
getCatalogPropertiesFromConf(configuration, catalogName);
       RESTCatalog restCatalog = (RESTCatalog) 
CatalogUtil.buildIcebergCatalog(catalogName, properties, configuration);
       restCatalog.initialize(catalogName, properties);
   
       restCatalog
           .buildTable(TBL, schema)
           .withLocation(location)
           .createTransaction()
           .commitTransaction();
       
       Table table = catalog.loadTable(TBL);
       Assert.assertEquals(location, table.location());
     }
   ````
   


-- 
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: gitbox-unsubscr...@hive.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org
For additional commands, e-mail: gitbox-h...@hive.apache.org

Reply via email to