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

Simplify extensability of BaseHiveConnectorTest #10753

Merged
merged 1 commit into from
Jan 24, 2022
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 @@ -177,17 +177,14 @@ public abstract class BaseHiveConnectorTest
private static final DateTimeFormatter TIMESTAMP_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSSSSSSSS");
private final String catalog;
private final Session bucketedSession;
private final Map<String, String> extraProperties;

protected BaseHiveConnectorTest(Map<String, String> extraProperties)
protected BaseHiveConnectorTest()
{
this.catalog = HIVE_CATALOG;
this.bucketedSession = createBucketedSession(Optional.of(new SelectedRole(ROLE, Optional.of("admin"))));
this.extraProperties = ImmutableMap.copyOf(requireNonNull(extraProperties, "extraProperties is null"));
}

@Override
protected final QueryRunner createQueryRunner()
protected static QueryRunner createHiveQueryRunner(Map<String, String> extraProperties)
throws Exception
{
DistributedQueryRunner queryRunner = HiveQueryRunner.builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,18 @@
package io.trino.plugin.hive;

import io.trino.testing.FaultTolerantExecutionConnectorTestHelper;
import io.trino.testing.QueryRunner;

import static org.assertj.core.api.Assertions.assertThatThrownBy;

public class TestHiveFaultTolerantExecutionConnectorTest
extends BaseHiveConnectorTest
{
public TestHiveFaultTolerantExecutionConnectorTest()
@Override
protected QueryRunner createQueryRunner()
throws Exception
{
super(FaultTolerantExecutionConnectorTestHelper.getExtraProperties());
return BaseHiveConnectorTest.createHiveQueryRunner(FaultTolerantExecutionConnectorTestHelper.getExtraProperties());
findepi marked this conversation as resolved.
Show resolved Hide resolved
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,15 @@
package io.trino.plugin.hive;

import com.google.common.collect.ImmutableMap;
import io.trino.testing.QueryRunner;

public class TestHivePipelinedExecutionConnectorTest
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does "pipelined execution" mean here?

it this is "test hive with defaults", let's call the class just TestHiveConnectorTest

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah - effectively it is with defaults (no failure recovery). I will rename in a separate PR after this gets merged.

extends BaseHiveConnectorTest
{
public TestHivePipelinedExecutionConnectorTest()
@Override
protected QueryRunner createQueryRunner()
throws Exception
{
super(ImmutableMap.of());
return BaseHiveConnectorTest.createHiveQueryRunner(ImmutableMap.of());
}
}