FANNG1 commented on code in PR #5698:
URL: https://github.com/apache/gravitino/pull/5698#discussion_r1861817797
##########
iceberg/iceberg-rest-server/src/test/java/org/apache/gravitino/iceberg/integration/test/IcebergRESTS3IT.java:
##########
@@ -124,4 +130,70 @@ private String getFromEnvOrDefault(String envVar, String
defaultValue) {
String envValue = System.getenv(envVar);
return Optional.ofNullable(envValue).orElse(defaultValue);
}
+
+ /**
+ * Parses a string representing table properties into a map of key-value
pairs.
+ *
+ * @param tableProperties A string representing the table properties in the
format:
+ * "[key1=value1,key2=value2,...]"
+ * @return A Map where each key is a property name (String) and the
corresponding value is the
+ * property value (String). Example input:
+ * "[write.data.path=path/to/data,write.metadata.path=path/to/metadata]"
Example output: {
+ * "write.data.path" -> "path/to/data", "write.metadata.path" ->
"path/to/metadata" }
+ */
+ private Map<String, String> parseTableProperties(String tableProperties) {
+ Map<String, String> propertiesMap = new HashMap<>();
+ String[] pairs = tableProperties.substring(1, tableProperties.length() -
1).split(",");
+ for (String pair : pairs) {
+ String[] keyValue = pair.split("=", 2); // Split at most once
+ if (keyValue.length == 2) {
+ propertiesMap.put(keyValue[0].trim(), keyValue[1].trim());
+ }
+ }
+ return propertiesMap;
+ }
+
+ @Test
+ void testWritePathCredential() {
Review Comment:
could you rename the test name to `testCredentialWithMultiLocations`?
--
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]