This is an automated email from the ASF dual-hosted git repository.
jshao pushed a commit to branch branch-1.1
in repository https://gitbox.apache.org/repos/asf/gravitino.git
The following commit(s) were added to refs/heads/branch-1.1 by this push:
new 14da0bc6cc [Cherry-pick to branch-1.1] [#10397] fix(iceberg): Fix
wrong namespaces when listing tables or views (#10398) (#10402)
14da0bc6cc is described below
commit 14da0bc6cc39717f5e99718f5a0bdb7cefa7c276
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Fri Mar 13 14:25:25 2026 +0800
[Cherry-pick to branch-1.1] [#10397] fix(iceberg): Fix wrong namespaces
when listing tables or views (#10398) (#10402)
**Cherry-pick Information:**
- Original commit: e30102470a5b9faedbd135949cb6a3fad5b91504
- Target branch: `branch-1.1`
- Status: ⚠️ **Has conflicts - manual resolution required**
Please review and resolve the conflicts before merging.
---------
Co-authored-by: roryqi <[email protected]>
---
.../gravitino/iceberg/service/rest/IcebergTableOperations.java | 2 +-
.../iceberg/integration/test/IcebergAuthorizationIT.java | 8 +++++++-
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git
a/iceberg/iceberg-rest-server/src/main/java/org/apache/gravitino/iceberg/service/rest/IcebergTableOperations.java
b/iceberg/iceberg-rest-server/src/main/java/org/apache/gravitino/iceberg/service/rest/IcebergTableOperations.java
index 367a50ea19..9270af594e 100644
---
a/iceberg/iceberg-rest-server/src/main/java/org/apache/gravitino/iceberg/service/rest/IcebergTableOperations.java
+++
b/iceberg/iceberg-rest-server/src/main/java/org/apache/gravitino/iceberg/service/rest/IcebergTableOperations.java
@@ -554,7 +554,7 @@ public class IcebergTableOperations {
List<TableIdentifier> filteredIdentifiers = new ArrayList<>();
for (NameIdentifier ident : idents) {
filteredIdentifiers.add(
- TableIdentifier.of(Namespace.of(ident.namespace().level(0)),
ident.name()));
+ TableIdentifier.of(Namespace.of(ident.namespace().level(2)),
ident.name()));
}
return ListTablesResponse.builder()
.addAll(filteredIdentifiers)
diff --git
a/iceberg/iceberg-rest-server/src/test/java/org/apache/gravitino/iceberg/integration/test/IcebergAuthorizationIT.java
b/iceberg/iceberg-rest-server/src/test/java/org/apache/gravitino/iceberg/integration/test/IcebergAuthorizationIT.java
index eb20d4672e..63fcc10a59 100644
---
a/iceberg/iceberg-rest-server/src/test/java/org/apache/gravitino/iceberg/integration/test/IcebergAuthorizationIT.java
+++
b/iceberg/iceberg-rest-server/src/test/java/org/apache/gravitino/iceberg/integration/test/IcebergAuthorizationIT.java
@@ -271,7 +271,13 @@ public class IcebergAuthorizationIT extends BaseIT {
}
protected Set<String> listTableNames(String database) {
- return convertToStringSet(sql("SHOW TABLES in %s", database), 1);
+ List<Object[]> objects = sql("SHOW TABLES in %s", database);
+ for (Object[] row : objects) {
+ if (row.length > 1) {
+ Assertions.assertEquals(database, String.valueOf(row[0]));
+ }
+ }
+ return convertToStringSet(objects, 1);
}
protected List<Object[]> sql2(String query) {