aokolnychyi commented on code in PR #5959:
URL: https://github.com/apache/iceberg/pull/5959#discussion_r1022336022
##########
spark/v3.2/spark/src/test/java/org/apache/iceberg/spark/TestSpark3Util.java:
##########
@@ -122,6 +125,31 @@ public void testLoadIcebergCatalog() throws Exception {
"Should retrieve underlying catalog class", catalog instanceof
CachingCatalog);
}
+ // Bug 5935
+ @Test
+ public void testCurrentSessionSetAsActive() throws Exception {
+ stopMetastoreAndSpark();
+ startMetastoreAndSpark();
+
Assert.assertFalse(spark.conf().contains(SQLConf.V2_SESSION_CATALOG_IMPLEMENTATION().key()));
+ String testTableName = "default.testtable";
+ SparkSession hiveSupportSession = spark.newSession();
+ try {
+
hiveSupportSession.conf().set(SQLConf.V2_SESSION_CATALOG_IMPLEMENTATION().key(),
+ SparkSessionCatalog.class.getName());
+ hiveSupportSession.conf().set("spark.sql.catalog.spark_catalog.type",
"hive");
+
+ // create an iceberg table
+ String tableString = String.format("CREATE TABLE %s (id bigint, data
string)" +
+ " USING iceberg PARTITIONED BY (data) TBLPROPERTIES('%s'='%s')",
testTableName,
+ TableProperties.FORMAT_VERSION, "2");
+ hiveSupportSession.sql(tableString);
+ // Now load the created iceberg table
+ Spark3Util.loadIcebergTable(hiveSupportSession, testTableName);
Review Comment:
@rdblue @RussellSpitzer, do you agree?
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]