You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iceberg.apache.org by et...@apache.org on 2024/11/18 07:31:06 UTC
(iceberg) branch revert-10858-use-encode-decode-namespace-methods created (now 16e4311a14)
This is an automated email from the ASF dual-hosted git repository.
etudenhoefner pushed a change to branch revert-10858-use-encode-decode-namespace-methods
in repository https://gitbox.apache.org/repos/asf/iceberg.git
at 16e4311a14 Revert "Core: Use encoding/decoding methods for namespaces and deprecate Spli…"
This branch includes the following new commits:
new 16e4311a14 Revert "Core: Use encoding/decoding methods for namespaces and deprecate Spli…"
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(iceberg) 01/01: Revert "Core: Use encoding/decoding methods for namespaces and deprecate Spli…"
Posted by et...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
etudenhoefner pushed a commit to branch revert-10858-use-encode-decode-namespace-methods
in repository https://gitbox.apache.org/repos/asf/iceberg.git
commit 16e4311a141dd62502de31816447996b8eba1f3c
Author: Eduard Tudenhoefner <et...@gmail.com>
AuthorDate: Mon Nov 18 08:30:56 2024 +0100
Revert "Core: Use encoding/decoding methods for namespaces and deprecate Spli…"
This reverts commit 5fc1413a5efc4419ccc081f3031325f107ccddab.
---
.../java/org/apache/iceberg/rest/RESTSessionCatalog.java | 2 +-
core/src/main/java/org/apache/iceberg/rest/RESTUtil.java | 16 +++-------------
.../java/org/apache/iceberg/rest/RESTCatalogAdapter.java | 6 +++++-
3 files changed, 9 insertions(+), 15 deletions(-)
diff --git a/core/src/main/java/org/apache/iceberg/rest/RESTSessionCatalog.java b/core/src/main/java/org/apache/iceberg/rest/RESTSessionCatalog.java
index cc42604f70..b895956353 100644
--- a/core/src/main/java/org/apache/iceberg/rest/RESTSessionCatalog.java
+++ b/core/src/main/java/org/apache/iceberg/rest/RESTSessionCatalog.java
@@ -615,7 +615,7 @@ public class RESTSessionCatalog extends BaseViewSessionCatalog
Map<String, String> queryParams = Maps.newHashMap();
if (!namespace.isEmpty()) {
- queryParams.put("parent", RESTUtil.encodeNamespace(namespace));
+ queryParams.put("parent", RESTUtil.NAMESPACE_JOINER.join(namespace.levels()));
}
ImmutableList.Builder<Namespace> namespaces = ImmutableList.builder();
diff --git a/core/src/main/java/org/apache/iceberg/rest/RESTUtil.java b/core/src/main/java/org/apache/iceberg/rest/RESTUtil.java
index 45422b8ae8..fab01162ca 100644
--- a/core/src/main/java/org/apache/iceberg/rest/RESTUtil.java
+++ b/core/src/main/java/org/apache/iceberg/rest/RESTUtil.java
@@ -33,24 +33,14 @@ import org.apache.iceberg.relocated.com.google.common.collect.Iterables;
import org.apache.iceberg.relocated.com.google.common.collect.Maps;
public class RESTUtil {
+ private static final char NAMESPACE_SEPARATOR = '\u001f';
+ public static final Joiner NAMESPACE_JOINER = Joiner.on(NAMESPACE_SEPARATOR);
+ public static final Splitter NAMESPACE_SPLITTER = Splitter.on(NAMESPACE_SEPARATOR);
private static final String NAMESPACE_ESCAPED_SEPARATOR = "%1F";
private static final Joiner NAMESPACE_ESCAPED_JOINER = Joiner.on(NAMESPACE_ESCAPED_SEPARATOR);
private static final Splitter NAMESPACE_ESCAPED_SPLITTER =
Splitter.on(NAMESPACE_ESCAPED_SEPARATOR);
- /**
- * @deprecated since 1.7.0, will be made private in 1.8.0; use {@link
- * RESTUtil#encodeNamespace(Namespace)} instead.
- */
- @Deprecated public static final Joiner NAMESPACE_JOINER = Joiner.on(NAMESPACE_ESCAPED_SEPARATOR);
-
- /**
- * @deprecated since 1.7.0, will be made private in 1.8.0; use {@link
- * RESTUtil#decodeNamespace(String)} instead.
- */
- @Deprecated
- public static final Splitter NAMESPACE_SPLITTER = Splitter.on(NAMESPACE_ESCAPED_SEPARATOR);
-
private RESTUtil() {}
public static String stripTrailingSlash(String path) {
diff --git a/core/src/test/java/org/apache/iceberg/rest/RESTCatalogAdapter.java b/core/src/test/java/org/apache/iceberg/rest/RESTCatalogAdapter.java
index 6477dfcd00..aa77b5ad10 100644
--- a/core/src/test/java/org/apache/iceberg/rest/RESTCatalogAdapter.java
+++ b/core/src/test/java/org/apache/iceberg/rest/RESTCatalogAdapter.java
@@ -298,7 +298,11 @@ public class RESTCatalogAdapter implements RESTClient {
if (asNamespaceCatalog != null) {
Namespace ns;
if (vars.containsKey("parent")) {
- ns = RESTUtil.decodeNamespace(vars.get("parent"));
+ ns =
+ Namespace.of(
+ RESTUtil.NAMESPACE_SPLITTER
+ .splitToStream(vars.get("parent"))
+ .toArray(String[]::new));
} else {
ns = Namespace.empty();
}