Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add hive4 query runner and tests #24418

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import io.trino.operator.RetryPolicy;
import io.trino.plugin.exchange.filesystem.FileSystemExchangePlugin;
import io.trino.plugin.exchange.filesystem.containers.MinioStorage;
import io.trino.plugin.hive.containers.HiveMinioDataLake;
import io.trino.plugin.hive.containers.Hive3MinioDataLake;
import io.trino.spi.ErrorType;
import io.trino.testing.BaseFailureRecoveryTest;
import io.trino.testing.QueryRunner;
Expand Down Expand Up @@ -59,7 +59,7 @@ protected QueryRunner createQueryRunner(
Module failureInjectionModule)
throws Exception
{
HiveMinioDataLake hiveMinioDataLake = closeAfterClass(new HiveMinioDataLake(bucketName));
Hive3MinioDataLake hiveMinioDataLake = closeAfterClass(new Hive3MinioDataLake(bucketName));
hiveMinioDataLake.start();
MinioStorage minioStorage = closeAfterClass(new MinioStorage("test-exchange-spooling-" + randomNameSuffix()));
minioStorage.start();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
*/
package io.trino.plugin.deltalake;

import io.trino.plugin.hive.containers.Hive3MinioDataLake;
import io.trino.plugin.hive.containers.HiveHadoop;
import io.trino.plugin.hive.containers.HiveMinioDataLake;
import io.trino.testing.QueryRunner;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.TestInstance;
Expand All @@ -29,12 +29,12 @@
public abstract class BaseDeltaLakeAwsConnectorSmokeTest
extends BaseDeltaLakeConnectorSmokeTest
{
protected HiveMinioDataLake hiveMinioDataLake;
protected Hive3MinioDataLake hiveMinioDataLake;

@Override
protected HiveHadoop createHiveHadoop()
{
hiveMinioDataLake = closeAfterClass(new HiveMinioDataLake(bucketName));
hiveMinioDataLake = closeAfterClass(new Hive3MinioDataLake(bucketName));
hiveMinioDataLake.start();
return hiveMinioDataLake.getHiveHadoop(); // closed by superclass
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/
package io.trino.plugin.deltalake;

import io.trino.plugin.hive.containers.HiveMinioDataLake;
import io.trino.plugin.hive.containers.Hive3MinioDataLake;
import io.trino.testing.AbstractTestQueryFramework;
import io.trino.testing.QueryRunner;
import io.trino.tpch.TpchTable;
Expand All @@ -32,7 +32,7 @@ public abstract class BaseDeltaLakeCompatibility
{
protected final String bucketName;
protected final String resourcePath;
protected HiveMinioDataLake hiveMinioDataLake;
protected Hive3MinioDataLake hiveMinioDataLake;

public BaseDeltaLakeCompatibility(String resourcePath)
{
Expand All @@ -44,7 +44,7 @@ public BaseDeltaLakeCompatibility(String resourcePath)
protected QueryRunner createQueryRunner()
throws Exception
{
hiveMinioDataLake = closeAfterClass(new HiveMinioDataLake(bucketName));
hiveMinioDataLake = closeAfterClass(new Hive3MinioDataLake(bucketName));
hiveMinioDataLake.start();

QueryRunner queryRunner = DeltaLakeQueryRunner.builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
import io.airlift.log.Level;
import io.airlift.log.Logger;
import io.airlift.log.Logging;
import io.trino.plugin.hive.containers.Hive3MinioDataLake;
import io.trino.plugin.hive.containers.HiveHadoop;
import io.trino.plugin.hive.containers.HiveMinioDataLake;
import io.trino.plugin.tpch.TpchPlugin;
import io.trino.testing.DistributedQueryRunner;
import io.trino.testing.QueryRunner;
Expand Down Expand Up @@ -259,7 +259,7 @@ public static void main(String[] args)
{
String bucketName = "test-bucket";

HiveMinioDataLake hiveMinioDataLake = new HiveMinioDataLake(bucketName);
Hive3MinioDataLake hiveMinioDataLake = new Hive3MinioDataLake(bucketName);
hiveMinioDataLake.start();

QueryRunner queryRunner = builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
package io.trino.plugin.deltalake;

import io.trino.plugin.base.util.AutoCloseableCloser;
import io.trino.plugin.hive.containers.Hive3MinioDataLake;
import io.trino.plugin.hive.containers.HiveHadoop;
import io.trino.plugin.hive.containers.HiveMinioDataLake;
import io.trino.testing.containers.Minio;
import org.testcontainers.containers.GenericContainer;

Expand All @@ -26,11 +26,11 @@ public final class SparkDeltaLake
implements AutoCloseable
{
private final AutoCloseableCloser closer = AutoCloseableCloser.create();
private final HiveMinioDataLake hiveMinio;
private final Hive3MinioDataLake hiveMinio;

public SparkDeltaLake(String bucketName)
{
hiveMinio = closer.register(new HiveMinioDataLake(bucketName));
hiveMinio = closer.register(new Hive3MinioDataLake(bucketName));
hiveMinio.start();

closer.register(new GenericContainer<>("ghcr.io/trinodb/testing/spark3-delta:" + getDockerImagesVersion()))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import io.trino.plugin.deltalake.transactionlog.AddFileEntry;
import io.trino.plugin.deltalake.transactionlog.TransactionLogAccess;
import io.trino.plugin.deltalake.transactionlog.statistics.DeltaLakeFileStatistics;
import io.trino.plugin.hive.containers.HiveMinioDataLake;
import io.trino.plugin.hive.containers.Hive3MinioDataLake;
import io.trino.spi.type.DateType;
import io.trino.spi.type.DecimalType;
import io.trino.spi.type.DoubleType;
Expand Down Expand Up @@ -68,7 +68,7 @@ protected QueryRunner createQueryRunner()
throws Exception
{
this.bucketName = "delta-test-create-table-statistics-" + randomNameSuffix();
HiveMinioDataLake hiveMinioDataLake = closeAfterClass(new HiveMinioDataLake(bucketName));
Hive3MinioDataLake hiveMinioDataLake = closeAfterClass(new Hive3MinioDataLake(bucketName));
hiveMinioDataLake.start();

return DeltaLakeQueryRunner.builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
package io.trino.plugin.deltalake;

import com.google.common.collect.ImmutableSet;
import io.trino.plugin.hive.containers.HiveMinioDataLake;
import io.trino.plugin.hive.containers.Hive3MinioDataLake;
import io.trino.testing.AbstractTestQueryFramework;
import io.trino.testing.QueryRunner;
import org.junit.jupiter.api.Test;
Expand All @@ -31,13 +31,13 @@ public class TestDeltaLakeDelete
extends AbstractTestQueryFramework
{
private final String bucketName = "test-delta-lake-connector-test-" + randomNameSuffix();
private HiveMinioDataLake hiveMinioDataLake;
private Hive3MinioDataLake hiveMinioDataLake;

@Override
protected QueryRunner createQueryRunner()
throws Exception
{
hiveMinioDataLake = closeAfterClass(new HiveMinioDataLake(bucketName));
hiveMinioDataLake = closeAfterClass(new Hive3MinioDataLake(bucketName));
hiveMinioDataLake.start();

return DeltaLakeQueryRunner.builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import io.trino.metadata.QualifiedObjectName;
import io.trino.metadata.Split;
import io.trino.metadata.TableHandle;
import io.trino.plugin.hive.containers.HiveMinioDataLake;
import io.trino.plugin.hive.containers.Hive3MinioDataLake;
import io.trino.security.AllowAllAccessControl;
import io.trino.spi.QueryId;
import io.trino.spi.connector.ColumnHandle;
Expand Down Expand Up @@ -60,14 +60,14 @@ public class TestDeltaLakeDynamicFiltering
extends AbstractTestQueryFramework
{
private final String bucketName = "delta-lake-test-dynamic-filtering-" + randomNameSuffix();
private HiveMinioDataLake hiveMinioDataLake;
private Hive3MinioDataLake hiveMinioDataLake;

@Override
protected QueryRunner createQueryRunner()
throws Exception
{
verify(new DynamicFilterConfig().isEnableDynamicFiltering(), "this class assumes dynamic filtering is enabled by default");
hiveMinioDataLake = closeAfterClass(new HiveMinioDataLake(bucketName));
hiveMinioDataLake = closeAfterClass(new Hive3MinioDataLake(bucketName));
hiveMinioDataLake.start();

QueryRunner queryRunner = DeltaLakeQueryRunner.builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
package io.trino.plugin.deltalake;

import io.trino.metastore.HiveMetastore;
import io.trino.plugin.hive.containers.HiveMinioDataLake;
import io.trino.plugin.hive.containers.Hive3MinioDataLake;
import io.trino.plugin.hive.metastore.thrift.BridgingHiveMetastore;
import io.trino.testing.AbstractTestQueryFramework;
import io.trino.testing.QueryRunner;
Expand All @@ -39,11 +39,11 @@ public class TestDeltaLakeFlushMetadataCacheProcedure
protected QueryRunner createQueryRunner()
throws Exception
{
HiveMinioDataLake hiveMinioDataLake = closeAfterClass(new HiveMinioDataLake(bucketName, HIVE3_IMAGE));
Hive3MinioDataLake hiveMinioDataLake = closeAfterClass(new Hive3MinioDataLake(bucketName, HIVE3_IMAGE));
hiveMinioDataLake.start();
metastore = new BridgingHiveMetastore(
testingThriftHiveMetastoreBuilder()
.metastoreClient(hiveMinioDataLake.getHiveHadoop().getHiveMetastoreEndpoint())
.metastoreClient(hiveMinioDataLake.getHiveMetastoreEndpoint())
.build(this::closeAfterClass));

return DeltaLakeQueryRunner.builder("default")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

import com.google.common.collect.ImmutableMap;
import io.trino.plugin.hive.TestingHivePlugin;
import io.trino.plugin.hive.containers.HiveMinioDataLake;
import io.trino.plugin.hive.containers.Hive3MinioDataLake;
import io.trino.testing.AbstractTestQueryFramework;
import io.trino.testing.QueryRunner;
import org.junit.jupiter.api.AfterAll;
Expand All @@ -35,14 +35,14 @@ public class TestDeltaLakeSharedHiveMetastoreWithViews
extends AbstractTestQueryFramework
{
private final String bucketName = "delta-lake-shared-hive-with-views-" + randomNameSuffix();
private HiveMinioDataLake hiveMinioDataLake;
private Hive3MinioDataLake hiveMinioDataLake;
private String schema;

@Override
protected QueryRunner createQueryRunner()
throws Exception
{
this.hiveMinioDataLake = closeAfterClass(new HiveMinioDataLake(bucketName));
this.hiveMinioDataLake = closeAfterClass(new Hive3MinioDataLake(bucketName));
this.hiveMinioDataLake.start();

QueryRunner queryRunner = DeltaLakeQueryRunner.builder()
Expand All @@ -54,7 +54,7 @@ protected QueryRunner createQueryRunner()
queryRunner.installPlugin(new TestingHivePlugin(queryRunner.getCoordinator().getBaseDataDir().resolve("hive_data")));
queryRunner.createCatalog("hive", "hive", ImmutableMap.<String, String>builder()
.put("hive.metastore", "thrift")
.put("hive.metastore.uri", hiveMinioDataLake.getHiveHadoop().getHiveMetastoreEndpoint().toString())
.put("hive.metastore.uri", hiveMinioDataLake.getHiveMetastoreEndpoint().toString())
.put("fs.hadoop.enabled", "false")
.put("fs.native-s3.enabled", "true")
.put("s3.aws-access-key", MINIO_ACCESS_KEY)
Expand All @@ -67,7 +67,7 @@ protected QueryRunner createQueryRunner()

schema = queryRunner.getDefaultSession().getSchema().orElseThrow();
queryRunner.execute("CREATE TABLE hive." + schema + ".hive_table (a_integer integer)");
hiveMinioDataLake.getHiveHadoop().runOnHive("CREATE VIEW " + schema + ".hive_view AS SELECT * FROM " + schema + ".hive_table");
hiveMinioDataLake.runOnHive("CREATE VIEW " + schema + ".hive_view AS SELECT * FROM " + schema + ".hive_table");
queryRunner.execute("CREATE TABLE delta." + schema + ".delta_table (a_varchar varchar)");

return queryRunner;
Expand All @@ -82,7 +82,7 @@ protected QueryRunner createQueryRunner()
public void cleanup()
{
assertQuerySucceeds("DROP TABLE IF EXISTS hive." + schema + ".hive_table");
hiveMinioDataLake.getHiveHadoop().runOnHive("DROP VIEW IF EXISTS " + schema + ".hive_view");
hiveMinioDataLake.runOnHive("DROP VIEW IF EXISTS " + schema + ".hive_view");
assertQuerySucceeds("DROP TABLE IF EXISTS delta." + schema + ".delta_table");
assertQuerySucceeds("DROP SCHEMA IF EXISTS hive." + schema);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/
package io.trino.plugin.deltalake;

import io.trino.plugin.hive.containers.HiveMinioDataLake;
import io.trino.plugin.hive.containers.Hive3MinioDataLake;
import io.trino.testing.AbstractTestQueryFramework;
import io.trino.testing.QueryRunner;
import org.junit.jupiter.api.Test;
Expand All @@ -35,7 +35,7 @@ public TestDeltaLakeUpdate()
protected QueryRunner createQueryRunner()
throws Exception
{
HiveMinioDataLake hiveMinioDataLake = closeAfterClass(new HiveMinioDataLake(bucketName));
Hive3MinioDataLake hiveMinioDataLake = closeAfterClass(new Hive3MinioDataLake(bucketName));
hiveMinioDataLake.start();

return DeltaLakeQueryRunner.builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import com.google.common.collect.ContiguousSet;
import io.trino.Session;
import io.trino.operator.OperatorStats;
import io.trino.plugin.hive.containers.HiveMinioDataLake;
import io.trino.plugin.hive.containers.Hive3MinioDataLake;
import io.trino.spi.QueryId;
import io.trino.testing.AbstractTestQueryFramework;
import io.trino.testing.MaterializedResult;
Expand Down Expand Up @@ -48,13 +48,13 @@ public class TestPredicatePushdown
*/
private final TableResource testTable = new TableResource("custkey_15rowgroups");

private HiveMinioDataLake hiveMinioDataLake;
private Hive3MinioDataLake hiveMinioDataLake;

@Override
protected QueryRunner createQueryRunner()
throws Exception
{
hiveMinioDataLake = closeAfterClass(new HiveMinioDataLake(bucketName));
hiveMinioDataLake = closeAfterClass(new Hive3MinioDataLake(bucketName));
hiveMinioDataLake.start();

return DeltaLakeQueryRunner.builder()
Expand Down
Loading
Loading