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.4.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();
}
}
}
}
This section contains information for developers who would like to release the project.
The manual steps to perform a release are shown below:
- Pick a concrete version for the release (freeze -SNAPSHOT) and commit the changes.
mvn versions:set -DnewVersion=1.0.4.7.2.3.0-220
- Verify that build using the release profile finishes successfully.
mvn package -Prelease
- Upload the artifacts to the nexus staging repository
mvn deploy -Prelease
- Visit the nexus staging repository and verify the content (sha, asc, jar, sources, etc.).
- Close and then release the staging repository.
- Create a tag corresponding to the newly release version in the git repository.
git tag 1.0.4.7.2.3.0-220
- Push tag to the remote repository
git push origin 1.0.4.7.2.3.0-220
- Prepare for next depelopment iteration 8a. Change version in pom files
mvn versions:set -DnewVersion=1.0.5.7.2.3.0-SNAPSHOT
8b. Update release instructions in README.md to reflect version changes 8c. Commit 9. Push master to the remote repository
git push origin master
More details about the release steps can be found here.