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


##########
plugins/spark/v3.5/integration/src/intTest/java/org/apache/polaris/spark/quarkus/it/BundleSanityChecker.java:
##########
@@ -0,0 +1,41 @@
+/*
+ * 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 org.apache.spark.sql.SparkSession;
+
+public class BundleSanityChecker {
+  public static void main(String[] args) {
+    try (SparkSession spark = SparkSession.builder().getOrCreate()) {
+      spark.sql("USE polaris");
+      spark.sql("CREATE NAMESPACE bundle_ns");
+      spark.sql("CREATE TABLE bundle_ns.t (id INT, value STRING) USING 
ICEBERG");

Review Comment:
   So when the sql failed, the catch block would catch it (e.g. change `USE 
polaris` to `USE polaris_known`) such as following:
   ```
   ./gradlew :polaris-spark-integration-3.5_2.12:intTest
   ...
   BundleJarSanityIT > testBundleJarLoading(Path, PolarisApiEndpoints, 
ClientCredentials) FAILED
       java.lang.AssertionError at BundleJarSanityIT.java:142
   ...
   2026-06-01 21:59:43,992 INFO  [io.qua.htt.access-log] 
[ea6f1dc2-296f-4477-ae6d-52f0c49c7a4c_0000000000000000002,POLARIS] [,,,] 
(executor-thread-1) 127.0.0.1 - root [01/Jun/2026:21:59:43 -0500] "POST 
/api/management/v1/catalogs HTTP/1.1" 201 425
   2026-06-01 21:59:44,008 INFO  [io.qua.htt.access-log] 
[ea6f1dc2-296f-4477-ae6d-52f0c49c7a4c_0000000000000000003,POLARIS] [,,,] 
(executor-thread-1) 127.0.0.1 - - [01/Jun/2026:21:59:44 -0500] "POST 
/api/catalog/v1/oauth/tokens HTTP/1.1" 200 765
   [Isolated Spark] SLF4J(W): Class path contains multiple SLF4J providers.
   [Isolated Spark] SLF4J(W): Found provider 
[org.slf4j.impl.JBossSlf4jServiceProvider@57bc27f5]
   [Isolated Spark] SLF4J(W): Found provider 
[ch.qos.logback.classic.spi.LogbackServiceProvider@5fb759d6]
   [Isolated Spark] SLF4J(W): See 
https://www.slf4j.org/codes.html#multiple_bindings for an explanation.
   [Isolated Spark] SLF4J(I): Actual provider is of type 
[org.slf4j.impl.JBossSlf4jServiceProvider@57bc27f5]
   [Isolated Spark] Jun 01, 2026 9:59:50 PM 
org.jboss.logmanager.JBossLoggerFinder getLogger
   [Isolated Spark] ERROR: The LogManager accessed before the 
"java.util.logging.manager" system property was set to 
"org.jboss.logmanager.LogManager". Results may be unexpected.
   [Isolated Spark] 
org.apache.spark.sql.catalyst.analysis.NoSuchDatabaseException: 
[SCHEMA_NOT_FOUND] The schema `polaris_known` cannot be found. Verify the 
spelling and correctness of the schema and catalog.
   [Isolated Spark] If you did not qualify the name with a catalog, verify the 
current_schema() output, or qualify the name with the correct catalog.
   [Isolated Spark] To tolerate the error on drop use DROP SCHEMA IF EXISTS.
   [Isolated Spark]     at 
org.apache.spark.sql.connector.catalog.CatalogManager.$anonfun$setCurrentNamespace$1(CatalogManager.scala:122)
   [Isolated Spark]     at 
org.apache.spark.sql.connector.catalog.CatalogManager.$anonfun$setCurrentNamespace$1$adapted(CatalogManager.scala:119)
   [Isolated Spark]     at 
org.apache.spark.sql.catalyst.catalog.SessionCatalog.setCurrentDatabaseWithNameCheck(SessionCatalog.scala:344)
   [Isolated Spark]     at 
org.apache.spark.sql.connector.catalog.CatalogManager.setCurrentNamespace(CatalogManager.scala:119)
   [Isolated Spark]     at 
org.apache.spark.sql.execution.datasources.v2.SetCatalogAndNamespaceExec.$anonfun$run$2(SetCatalogAndNamespaceExec.scala:36)
   [Isolated Spark]     at 
org.apache.spark.sql.execution.datasources.v2.SetCatalogAndNamespaceExec.$anonfun$run$2$adapted(SetCatalogAndNamespaceExec.scala:36)
   [Isolated Spark]     at scala.Option.foreach(Option.scala:407)
   [Isolated Spark]     at 
org.apache.spark.sql.execution.datasources.v2.SetCatalogAndNamespaceExec.run(SetCatalogAndNamespaceExec.scala:36)
   [Isolated Spark]     at 
org.apache.spark.sql.execution.datasources.v2.V2CommandExec.result$lzycompute(V2CommandExec.scala:43)
   [Isolated Spark]     at 
org.apache.spark.sql.execution.datasources.v2.V2CommandExec.result(V2CommandExec.scala:43)
   [Isolated Spark]     at 
org.apache.spark.sql.execution.datasources.v2.V2CommandExec.executeCollect(V2CommandExec.scala:49)
   [Isolated Spark]     at 
org.apache.spark.sql.execution.QueryExecution$$anonfun$eagerlyExecuteCommands$1.$anonfun$applyOrElse$1(QueryExecution.scala:107)
   [Isolated Spark]     at 
org.apache.spark.sql.execution.SQLExecution$.$anonfun$withNewExecutionId$6(SQLExecution.scala:125)
   [Isolated Spark]     at 
org.apache.spark.sql.execution.SQLExecution$.withSQLConfPropagated(SQLExecution.scala:201)
   [Isolated Spark]     at 
org.apache.spark.sql.execution.SQLExecution$.$anonfun$withNewExecutionId$1(SQLExecution.scala:108)
   [Isolated Spark]     at 
org.apache.spark.sql.SparkSession.withActive(SparkSession.scala:900)
   [Isolated Spark]     at 
org.apache.spark.sql.execution.SQLExecution$.withNewExecutionId(SQLExecution.scala:66)
   [Isolated Spark]     at 
org.apache.spark.sql.execution.QueryExecution$$anonfun$eagerlyExecuteCommands$1.applyOrElse(QueryExecution.scala:107)
   [Isolated Spark]     at 
org.apache.spark.sql.execution.QueryExecution$$anonfun$eagerlyExecuteCommands$1.applyOrElse(QueryExecution.scala:98)
   [Isolated Spark]     at 
org.apache.spark.sql.catalyst.trees.TreeNode.$anonfun$transformDownWithPruning$1(TreeNode.scala:461)
   [Isolated Spark]     at 
org.apache.spark.sql.catalyst.trees.CurrentOrigin$.withOrigin(origin.scala:76)
   [Isolated Spark]     at 
org.apache.spark.sql.catalyst.trees.TreeNode.transformDownWithPruning(TreeNode.scala:461)
   [Isolated Spark]     at 
org.apache.spark.sql.catalyst.plans.logical.LogicalPlan.org$apache$spark$sql$catalyst$plans$logical$AnalysisHelper$$super$transformDownWithPruning(LogicalPlan.scala:32)
   [Isolated Spark]     at 
org.apache.spark.sql.catalyst.plans.logical.AnalysisHelper.transformDownWithPruning(AnalysisHelper.scala:267)
   [Isolated Spark]     at 
org.apache.spark.sql.catalyst.plans.logical.AnalysisHelper.transformDownWithPruning$(AnalysisHelper.scala:263)
   [Isolated Spark]     at 
org.apache.spark.sql.catalyst.plans.logical.LogicalPlan.transformDownWithPruning(LogicalPlan.scala:32)
   [Isolated Spark]     at 
org.apache.spark.sql.catalyst.plans.logical.LogicalPlan.transformDownWithPruning(LogicalPlan.scala:32)
   [Isolated Spark]     at 
org.apache.spark.sql.catalyst.trees.TreeNode.transformDown(TreeNode.scala:437)
   [Isolated Spark]     at 
org.apache.spark.sql.execution.QueryExecution.eagerlyExecuteCommands(QueryExecution.scala:98)
   [Isolated Spark]     at 
org.apache.spark.sql.execution.QueryExecution.commandExecuted$lzycompute(QueryExecution.scala:85)
   [Isolated Spark]     at 
org.apache.spark.sql.execution.QueryExecution.commandExecuted(QueryExecution.scala:83)
   [Isolated Spark]     at 
org.apache.spark.sql.Dataset.<init>(Dataset.scala:220)
   [Isolated Spark]     at 
org.apache.spark.sql.Dataset$.$anonfun$ofRows$2(Dataset.scala:100)
   [Isolated Spark]     at 
org.apache.spark.sql.SparkSession.withActive(SparkSession.scala:900)
   [Isolated Spark]     at 
org.apache.spark.sql.Dataset$.ofRows(Dataset.scala:97)
   [Isolated Spark]     at 
org.apache.spark.sql.SparkSession.$anonfun$sql$4(SparkSession.scala:691)
   [Isolated Spark]     at 
org.apache.spark.sql.SparkSession.withActive(SparkSession.scala:900)
   [Isolated Spark]     at 
org.apache.spark.sql.SparkSession.sql(SparkSession.scala:682)
   [Isolated Spark]     at 
org.apache.spark.sql.SparkSession.sql(SparkSession.scala:713)
   [Isolated Spark]     at 
org.apache.spark.sql.SparkSession.sql(SparkSession.scala:744)
   [Isolated Spark]     at 
org.apache.polaris.spark.quarkus.it.BundleSanityChecker.main(BundleSanityChecker.java:26)
   ```



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