{"id":18657309,"url":"https://github.com/jmrozanec/hive-unit","last_synced_at":"2025-10-23T19:06:50.552Z","repository":{"id":21229326,"uuid":"24544561","full_name":"jmrozanec/hive-unit","owner":"jmrozanec","description":"Unit testing for Hive","archived":false,"fork":false,"pushed_at":"2014-10-08T15:56:57.000Z","size":5876,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-15T22:50:10.046Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jmrozanec.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-09-27T22:47:47.000Z","updated_at":"2014-09-28T03:15:06.000Z","dependencies_parsed_at":"2022-08-17T22:40:36.044Z","dependency_job_id":null,"html_url":"https://github.com/jmrozanec/hive-unit","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jmrozanec/hive-unit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmrozanec%2Fhive-unit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmrozanec%2Fhive-unit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmrozanec%2Fhive-unit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmrozanec%2Fhive-unit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jmrozanec","download_url":"https://codeload.github.com/jmrozanec/hive-unit/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmrozanec%2Fhive-unit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280675609,"owners_count":26371569,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-23T02:00:06.710Z","response_time":142,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T07:27:37.081Z","updated_at":"2025-10-23T19:06:50.521Z","avatar_url":"https://github.com/jmrozanec.png","language":"Java","readme":"## hive-unit: A simple way to test Hive scripts.\n\n[![Build Status](https://travis-ci.org/jmrozanec/hive-unit.svg)](https://travis-ci.org/jmrozanec/hive-unit)\n\n### Usage\n\nhive-unit provides means to test Hive scripts. This can be done against an Hive instance \nincluding an embedded Derby database, and a local HiveThriftService; or against an existing Hive cluster. \nThis allows to create unit and integration tests very easily.\nA DSL is provided following builder pattern, making it easy to declare test conditions.\n\nHive scripts testing can be done in a similar way to [PigUnit](http://pig.apache.org/docs/r0.8.1/pigunit.html).\nFor more examples check [this class](https://github.com/jmrozanec/hive_test/blob/master/src/test/java/com/jointhegrid/hive_test/HiveTestTest.java)\n\n        @Test\n            public void testScriptListInput() {\n                Map\u003cString, List\u003cString\u003e\u003e input = Maps.\u003cString, List\u003cString\u003e\u003enewHashMap();\n                List\u003cString\u003e lines = Lists.newArrayList();\n                lines.add(\"msmith,10\");\n                lines.add(\"mjohnson,2\");\n                lines.add(\"mwilliamson,7\");\n                lines.add(\"mjones,4\");\n                lines.add(\"mdavies,5\");\n\n                input.put(\"$INPUT1\", lines);\n\n                Response output =\n                        HiveBuilder.create()\n                                .hiveTestWithEmbeddedHive(\"src/test/resources/scripts/passing-scores.hql\")\n                                .outputForInput(input);\n\n                List\u003cString\u003e expected = Lists.newArrayList();\n                expected.add(\"msmith,10\");\n                expected.add(\"mwilliamson,7\");\n\n                assertEquals(ResponseStatus.SUCCESS, output.getResponseStatus());\n                assertEquals(expected, output.getResult());\n            }\n\n\n### Maven\n\n#### Soon will be available at Maven central!\n\n\n#### Execution profiles\n\n##### Without a local Hadoop install\n\nBy default, we're set to download a local copy of Hadoop when you first build Hive Test, or whenever the project is cleaned, just before running our test cases.\n\nYou can force a redownload and installation of Hadoop by manually activating the download-hadoop profile\n\n    mvn --activate-profiles download-hadoop test\n\nYou can also perform the download and extraction process independent of testing.\n\nDownload Hadoop (into the maven target directory)\n\n    mvn --activate-profiles download-hadoop wagon:download-single\n\nExtract Hadoop  (into the maven target directory)\n\n    mvn --activate-profiles download-hadoop exec:exec\n\n\n##### With a local Hadoop install\n\nWe'll skip attempting to download and use a local copy of Hadoop if any of the following are true\n\n* set your HADOOP_HOME environment variable to a hadoop distribution\n* hadoop tar extracted to  $home/hadoop/hadoop-0.20.2_local\n\nHive Test will work so long as you have Hadoop in your path, i.e. /usr/bin/hadoop. In this case, you'll want to deactivate the hadoop download.\n\n    mvn --activate-profiles -hadoop-home-defined test\n\n\n\n\n### Contribute!\n\nContributions are welcome! You can contribute by\n * starring this repo!\n * adding new features\n * enhancing existing code\n * testing\n * enhancing documentation\n * bringing suggestions and reporting bugs\n * spreading the word / telling us how you use it!\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjmrozanec%2Fhive-unit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjmrozanec%2Fhive-unit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjmrozanec%2Fhive-unit/lists"}