thankpk opened a new issue, #10397: URL: https://github.com/apache/gravitino/issues/10397
### Version main branch ### Describe what's wrong i curl api list tables and get wrong namespace . api returns metalake name(gravitino) instead of namespace name (test_schema2): ### Error message and/or stacktrace when i curl api: curl 'http://gravitino:9001/iceberg/v1/iceberg_hdfs/namespaces/test_schema2/tables' and got result : Output: {"identifiers":[{"namespace":["grativino"],"name":"hdfs_test_table"}],"next-page-token":null} My expect Output: {"identifiers":[{"namespace":["test_schema2"],"name":"hdfs_test_table"}],"next-page-token":null} i try to log and realize that the code of func ListTablesResponse have need to change logic get level . this code should get level 2 instead of level 0 (metalake name): filteredIdentifiers.add( TableIdentifier.of(Namespace.of(ident.namespace().level(0)), ident.name())); => need to change to: filteredIdentifiers.add( TableIdentifier.of(Namespace.of(ident.namespace().level(2)), ident.name())); ### How to reproduce i use version v1.1.0 (hash: https://github.com/apache/gravitino/commit/5a6b5ae772d50aff98878ae3659fba3598a9027f) User trino: 477 when user call query: show tables (in dbeaver,...) ### Additional context **this is code i log:** private ListTablesResponse filterListTablesResponse( ListTablesResponse listTablesResponse, String metalake, String catalogName) { LOG.info( "List Iceberg tables, catalog 0000000000000000000 aaaaaaaaaaaaaaaa metalake: {}, catalogName: {}", metalake, catalogName); NameIdentifier[] idents = MetadataAuthzHelper.filterByExpression( metalake, AuthorizationExpressionConstants.filterTableAuthorizationExpression, Entity.EntityType.TABLE, toNameIdentifiers(listTablesResponse, metalake, catalogName)); LOG.info("List Iceberg tables, catalog 111111111111111111111111: {}", Arrays.toString(idents)); List<TableIdentifier> filteredIdentifiers = new ArrayList<>(); for (NameIdentifier ident : idents) { LOG.info( "List Iceberg tables, catalog 222222222222222222 aaaaaaaaaaaaaaaaaaaa: Indent: {}, IndentNamespace: {}, Name: {}", ident, ident.namespace(), ident.name()); LOG.info( "List Iceberg tables, catalog 222222222222222222 bbbbbbbbbbbbbbbbb: filteredIdentifiers: {},namespacelevel0: {}, IdentName: {} ", filteredIdentifiers, Namespace.of(ident.namespace().level(0)), ident.name()); filteredIdentifiers.add( TableIdentifier.of(Namespace.of(ident.namespace().level(0)), ident.name())); LOG.info( "List Iceberg tables, catalog 222222222222222222 ccccccccccccc: namespacelevel0: {}, IdentName: {} ", TableIdentifier.of(Namespace.of(ident.namespace().level(0)), ident.name()).namespace(), TableIdentifier.of(Namespace.of(ident.namespace().level(0)), ident.name()).name()); } LOG.info("List Iceberg tables, catalog 333333333333333333333333: {}", filteredIdentifiers); return ListTablesResponse.builder() .addAll(filteredIdentifiers) .nextPageToken(listTablesResponse.nextPageToken()) .build(); } **this is log i get:** 2026-03-12 07:22:08 INFO [iceberg-rest-27] IcebergTableOperations:119 - List Iceberg tables, catalog: iceberg_hdfs, namespace: test_schema2 2026-03-12 07:22:09 INFO [iceberg-rest-27] IcebergTableOperations:565 - List Iceberg tables, catalog 0000000000000000000 aaaaaaaaaaaaaaaa metalake: gravitino, catalogName: iceberg_hdfs 2026-03-12 07:22:09 INFO [iceberg-rest-27] IcebergTableOperations:540 - List Iceberg tables, catalog 0000000000000000000 ccccccccccccccccc,metalake: gravitino,catalogName: iceberg_hdfs, namepsace:test_schema2, indentifiername: hdfs_test_table 2026-03-12T07:22:09.018387598Z iceberg-rest-27 WARN found 4 argument placeholders, but provided 2 for pattern List Iceberg tables, catalog 0000000000000000000 ddddddddddddd,metalake: {},catalogName: {}, namepsace:{}, indentifiername: {} 2026-03-12 07:22:09 INFO [iceberg-rest-27] IcebergTableOperations:551 - List Iceberg tables, catalog 0000000000000000000 ddddddddddddd,metalake: gravitino.iceberg_hdfs.test_schema2,catalogName: hdfs_test_table, namepsace:{}, indentifiername: {} 2026-03-12T07:22:09.019718592Z iceberg-rest-27 WARN found 4 argument placeholders, but provided 2 for pattern List Iceberg tables, catalog 0000000000000000000 ddddddddddddd,metalake: {},catalogName: {}, namepsace:{}, indentifiername: {} 2026-03-12 07:22:09 INFO [iceberg-rest-27] IcebergTableOperations:556 - List Iceberg tables, catalog 0000000000000000000 eeeeeeeeeeeeeeeeee toNameIdentifiers: [gravitino.iceberg_hdfs.test_schema2.hdfs_test_table] 2026-03-12 07:22:09 INFO [iceberg-rest-27] IcebergTableOperations:577 - List Iceberg tables, catalog 111111111111111111111111: [gravitino.iceberg_hdfs.test_schema2.hdfs_test_table] 2026-03-12 07:22:09 INFO [iceberg-rest-27] IcebergTableOperations:581 - List Iceberg tables, catalog 222222222222222222 aaaaaaaaaaaaaaaaaaaa: Indent: gravitino.iceberg_hdfs.test_schema2.hdfs_test_table, IndentNamespace: gravitino.iceberg_hdfs.test_schema2, Name: hdfs_test_table 2026-03-12 07:22:09 INFO [iceberg-rest-27] IcebergTableOperations:586 - List Iceberg tables, catalog 222222222222222222 bbbbbbbbbbbbbbbbb: filteredIdentifiers: [],namespacelevel0: gravitino, IdentName: hdfs_test_table 2026-03-12 07:22:09 INFO [iceberg-rest-27] IcebergTableOperations:595 - List Iceberg tables, catalog 222222222222222222 ccccccccccccc: namespacelevel0: gravitino, IdentName: hdfs_test_table 2026-03-12 07:22:09 INFO [iceberg-rest-27] IcebergTableOperations:601 - List Iceberg tables, catalog 333333333333333333333333: [gravitino.hdfs_test_table] 2026-03-12 07:22:09 INFO [iceberg-rest-27] IcebergTableOperations:135 - List Iceberg tables, catalog: iceberg_hdfs, namespace: test_schema2, listTablesResponseFailed555555555555555555555555555555555: ListTablesResponse{identifiers=[gravitino.hdfs_test_table], next-page-token=null} 2026-03-12 07:22:09 INFO [iceberg-rest-27] IcebergTableOperations:142 - List Iceberg tables, catalog: iceberg_hdfs, namespace: test_schema2, listTablesResponseFailed 6666666666666666: ListTablesResponse{identifiers=[test_schema2.hdfs_test_table], next-page-token=null} -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
