{"id":19604562,"url":"https://github.com/prateek/hive-protobuf-udf-example","last_synced_at":"2025-09-06T19:36:46.186Z","repository":{"id":16346001,"uuid":"19095884","full_name":"prateek/hive-protobuf-udf-example","owner":"prateek","description":null,"archived":false,"fork":false,"pushed_at":"2014-04-24T04:41:22.000Z","size":124,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-09T08:38:59.020Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/prateek.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-04-24T04:39:07.000Z","updated_at":"2014-06-30T05:50:02.000Z","dependencies_parsed_at":"2022-08-19T07:01:01.502Z","dependency_job_id":null,"html_url":"https://github.com/prateek/hive-protobuf-udf-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prateek%2Fhive-protobuf-udf-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prateek%2Fhive-protobuf-udf-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prateek%2Fhive-protobuf-udf-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prateek%2Fhive-protobuf-udf-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/prateek","download_url":"https://codeload.github.com/prateek/hive-protobuf-udf-example/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240887775,"owners_count":19873539,"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","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-11T09:37:19.339Z","updated_at":"2025-02-26T16:18:59.260Z","avatar_url":"https://github.com/prateek.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Protobuf Example in Hive #\n\nThis example ilustrates how to use a UDF to read a protobuf field contained in a String in Hive.\n\nThe UDF can be found at `src/main/java/com/cloudera/sa/examples/udf/GetNumberOfEntries.java`, it takes an input for a base64 encoded version of a protobuf document, described by `src/main/protobuf/addressbook.proto` (based on the Google ProtoBuf Examples), and reads the number of occurences of a repeated field in there (Person).\n\nThe UDF can be extended to return multiple values, eg: [Hive’s Split UDF](http://grepcode.com/file/repository.cloudera.com/content/repositories/releases/org.apache.hadoop.hive/hive-exec/0.7.1-cdh3u1/org/apache/hadoop/hive/ql/udf/generic/GenericUDFSplit.java), if desired.\n\n## Usage ##\n1. Install the ProtoBuf dependencies from here (for Java) - [Google Download Page](https://code.google.com/p/protobuf/downloads/list)\n\n2. Follow these steps\n```sh\n# compile the udf jar\n$ mvn package\n\n# create the hive table describing the data\nhive -f hive-scripts/create.hql\n\n# load a single record sample file\nhdfs dfs -put sample-input/sample-hive.csv\n\n# run a test query to validate:\nhive -f hive-scripts/udf-test.hql\n# if successful, it will return -\n# test_address_book, 2\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprateek%2Fhive-protobuf-udf-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprateek%2Fhive-protobuf-udf-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprateek%2Fhive-protobuf-udf-example/lists"}