RussellSpitzer commented on code in PR #6886: URL: https://github.com/apache/iceberg/pull/6886#discussion_r1142340365
########## spark/v3.3/spark/src/test/java/org/apache/iceberg/spark/source/TestSparkCatalogWarehouse.java: ########## @@ -0,0 +1,74 @@ +/* + * 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.iceberg.spark.source; + +import java.util.Map; +import org.apache.iceberg.hive.HiveCatalog; +import org.apache.iceberg.relocated.com.google.common.collect.ImmutableMap; +import org.apache.iceberg.spark.Spark3Util; +import org.apache.iceberg.spark.SparkCatalog; +import org.apache.iceberg.spark.SparkCatalogTestBase; +import org.junit.Test; +import org.junit.runners.Parameterized; + +public class TestSparkCatalogWarehouse extends SparkCatalogTestBase { + + public TestSparkCatalogWarehouse( Review Comment: A few notes here 1. These tests probably belong in org.apache.iceberg.spark.TestCreateTable 2. We Probably don't need to actually parameterize these tests since we can just make new catalogs in the tests by setting new parameters. This would also make it clear what tests were doing what. 3. I think we need to cover the following cases, (TestCreateTable is already parameterized so we just need to write these once to hit all catalog types) a. Create a table with an explicit location (we should have this already) b. Create a table with a catalog specific warehouse location c. Create a table with out any locations and use the Spark warehouse directory 4. We prefer to use AssertJ for assertions, we rarely use naked asserts. See #7131 which has some new guidance For (a and b) the table location which is created must use the database name and table name in the location. For example if I make a table "foo.bar" and specify the catalog warehouse as "fs:///bazz", I should get table location "fs:///bazz/foo/bar" -- 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]
