okumin commented on code in PR #6108: URL: https://github.com/apache/hive/pull/6108#discussion_r2397201962
########## iceberg/iceberg-handler/src/test/queries/positive/iceberg_rest_catalog_gravitino.q: ########## @@ -0,0 +1,86 @@ +-- SORT_QUERY_RESULTS Review Comment: I verified the diff is likely expected. ``` % diff iceberg/iceberg-handler/src/test/queries/positive/iceberg_rest_catalog_hms.q iceberg/iceberg-handler/src/test/queries/positive/iceberg_rest_catalog_gravitino.q 68a69,73 > --! In CI, Testcontainers' .withFileSystemBind() is not able to bind the same host path to the same container path, > --! so as a workaround, the .metadata.json files from container are manually synced in a daemon process, > --! since the sync can take some time, need to wait for it to happen after the insert operation. > ! sleep 20; > ``` ########## iceberg/iceberg-handler/src/test/results/positive/llap/iceberg_rest_catalog_gravitino.q.out: ########## @@ -0,0 +1,231 @@ +PREHOOK: query: create database ice_rest Review Comment: I verified the diff is likely expected. ``` % diff iceberg/iceberg-handler/src/test/results/positive/llap/iceberg_rest_catalog_hms.q.out iceberg/iceberg-handler/src/test/results/positive/llap/iceberg_rest_catalog_gravitino.q.out 219d218 < default 233d231 < default ``` ########## itests/qtest-iceberg/src/test/java/org/apache/hadoop/hive/cli/TestIcebergRESTCatalogGravitinoLlapLocalCliDriver.java: ########## @@ -0,0 +1,281 @@ +/* + * 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.hadoop.hive.cli; + +import com.github.dockerjava.api.command.CopyArchiveFromContainerCmd; +import org.apache.commons.compress.archivers.tar.TarArchiveEntry; +import org.apache.commons.compress.archivers.tar.TarArchiveInputStream; +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.hive.cli.control.CliAdapter; +import org.apache.hadoop.hive.cli.control.CliConfigs; +import org.apache.hadoop.hive.metastore.conf.MetastoreConf; +import org.apache.hadoop.hive.ql.session.SessionState; +import org.apache.iceberg.CatalogUtil; +import org.apache.iceberg.hive.CatalogUtils; +import org.apache.iceberg.hive.client.HiveRESTCatalogClient; +import org.junit.After; +import org.junit.Before; +import org.junit.ClassRule; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.TestRule; +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; +import org.junit.runners.Parameterized.Parameters; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.testcontainers.containers.output.Slf4jLogConsumer; +import org.testcontainers.containers.wait.strategy.Wait; +import org.testcontainers.containers.wait.strategy.WaitAllStrategy; +import org.testcontainers.utility.DockerImageName; +import org.testcontainers.utility.MountableFile; +import org.testcontainers.containers.GenericContainer; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.time.Duration; +import java.util.Comparator; +import java.util.List; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; + +@RunWith(Parameterized.class) +public class TestIcebergRESTCatalogGravitinoLlapLocalCliDriver { + + private static final Logger LOG = LoggerFactory.getLogger(TestIcebergRESTCatalogGravitinoLlapLocalCliDriver.class); + + private static final String CATALOG_NAME = "ice01"; + private static final String GRAVITINO_CONF_FILE_TEMPLATE = "gravitino-h2-test-template.conf"; + private static final String GRAVITINO_ROOT_DIR = "/root/gravitino-iceberg-rest-server"; + private static final long GRAVITINO_STARTUP_TIMEOUT_MINUTES = 5L; + + private static final String GRAVITINO_STARTUP_SCRIPT = GRAVITINO_ROOT_DIR + "/bin/start-iceberg-rest-server.sh"; + private static final String GRAVITINO_H2_LIB = GRAVITINO_ROOT_DIR + "/libs/h2-driver.jar"; + private static final String GRAVITINO_CONF_FILE = GRAVITINO_ROOT_DIR + "/conf/gravitino-iceberg-rest-server.conf"; + + private static final CliAdapter adapter = new CliConfigs.TestIcebergRESTCatalogGravitinoLlapLocalCliDriver().getCliAdapter(); + private static final DockerImageName GRAVITINO_IMAGE = + DockerImageName.parse("apache/gravitino-iceberg-rest:1.0.0-rc3"); Review Comment: Let's use 1.0.0 ########## itests/qtest-iceberg/src/test/resources/gravitino-h2-test-template.conf: ########## @@ -0,0 +1,14 @@ +gravitino.iceberg-rest.httpPort = 9001 + +# --- Iceberg REST Catalog Backend (set to JDBC) --- +gravitino.iceberg-rest.catalog-backend = jdbc Review Comment: The memory mode does still not work? ########## itests/qtest-iceberg/pom.xml: ########## @@ -475,6 +475,23 @@ <version>${project.version}</version> <scope>test</scope> </dependency> + <dependency> + <groupId>org.apache.httpcomponents.client5</groupId> + <artifactId>httpclient5</artifactId> + </dependency> + <dependency> + <groupId>org.apache.httpcomponents.core5</groupId> + <artifactId>httpcore5</artifactId> + </dependency> + <dependency> + <groupId>org.apache.httpcomponents.core5</groupId> + <artifactId>httpcore5-h2</artifactId> + </dependency> + <dependency> + <groupId>org.testcontainers</groupId> + <artifactId>testcontainers</artifactId> + <scope>test</scope> + </dependency> Review Comment: Why do we need these ones? ########## itests/qtest-iceberg/src/test/java/org/apache/hadoop/hive/cli/TestIcebergRESTCatalogGravitinoLlapLocalCliDriver.java: ########## @@ -0,0 +1,281 @@ +/* + * 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.hadoop.hive.cli; Review Comment: Please follow SonarQube's instructions. https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=6108&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true -- 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]
