A project for building and using a docker image of Hiveserver2, pre-configured to run with Tez in local mode as the underlying execution engine and in-memory Derby as the metastore.
Use mvn install to build the project and create the docker image for HS2.
You can use the docker image by managing containers explicitly via the docker CLI or by exploiting the dependency on https://www.testcontainers.org/.
Create HS2 container using Docker CLI:
docker run -p "10000:10000" -d com.github.zabetak/hs2-embedded:1.0.0.7.2.3.0-SNAPSHOT
(Optional) Use the schema-loader utility to create some tables and start playing around:
docker exec CONTAINER_NAME schema-loader tpcds
Create HS2 container using testcontainers:
public class TestHS2Container {
@Rule
public HS2Container hs2 = new HS2Container();
@Test
public void testSimpleDDL() throws Exception {
try (Connection c = DriverManager.getConnection(hs2.getJdbcURL())) {
try (PreparedStatement ps = c
.prepareStatement("CREATE TABLE test1 (uid VARCHAR(64), link STRING, source STRING)")) {
ps.executeUpdate();
}
}
}
}
Content type
Image
Digest
Size
713.5 MB
Last updated
almost 5 years ago
docker pull zabetak/hs2-embedded:1.0.3.7.2.3.0-220