MonkeyCanCode commented on code in PR #4535:
URL: https://github.com/apache/polaris/pull/4535#discussion_r3300730067


##########
plugins/spark/v4.0/integration/src/intTest/java/org/apache/polaris/spark/quarkus/it/PolarisManagementClient.java:
##########
@@ -0,0 +1,102 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.polaris.spark.quarkus.it;
+
+import static java.util.concurrent.TimeUnit.MINUTES;
+import static 
org.apache.polaris.service.it.ext.PolarisServerManagerLoader.polarisServerManager;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.jakarta.rs.json.JacksonJsonProvider;
+import jakarta.ws.rs.client.Client;
+import jakarta.ws.rs.client.ClientBuilder;
+import java.util.Map;
+import java.util.Random;
+import org.apache.iceberg.rest.HTTPClient;
+import org.apache.iceberg.rest.RESTClient;
+import org.apache.iceberg.rest.auth.AuthSession;
+import org.apache.iceberg.rest.auth.OAuth2Util;
+import org.apache.iceberg.rest.responses.OAuthTokenResponse;
+import org.apache.polaris.service.it.env.ClientCredentials;
+import org.apache.polaris.service.it.env.ManagementApi;
+import org.apache.polaris.service.it.env.PolarisApiEndpoints;
+
+/**
+ * This class provides a REST client for the Polaris Management service 
endpoints and its auth-token
+ * endpoint, which is used in Spark client tests to run commands that Spark 
SQL can’t issue directly
+ * (e.g., createCatalog).
+ */
+public final class PolarisManagementClient implements AutoCloseable {
+  private final PolarisApiEndpoints endpoints;

Review Comment:
   I am not sure if it is wise to share these code with spark 4 as there are 
incompatible changes between spark 3 and 4. Also, looking at how iceberg handle 
this, they also use diff dir layer for this purpose:
   ```
   https://github.com/apache/iceberg/tree/main/spark/v3.5
   https://github.com/apache/iceberg/tree/main/spark/v4.0
   https://github.com/apache/iceberg/tree/main/spark/v4.1
   ```



-- 
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]

Reply via email to