Support Questions

Find answers, ask questions, and share your expertise

Fetch Hive Table from HCatalog/Hive

avatar
Rising Star

What's the horton-recommended way to get Hive data in Java code? Thinking:

  • hcat api
  • jdbc query
  • HDFS call

We're just trying to get Hive data into a data structure in java, like a Collection, and operate on it. Typical Map/Reduce stuff. Specifically this would be used in a Crunch/Cascading setup.

Thanks!

1 ACCEPTED SOLUTION

avatar

Hi @Landon Robinson, take a look at http://docs.hortonworks.com/HDPDocuments/HDP2/HDP-2.3.4/bk_dataintegration/content/hive-jdbc-odbc-dr...

If you're writing Java code, the easiest to use is probably the provided JDBC driver.

You can get the current version of the JDBC driver in one of two ways:

1. At /user/hdp/current/hive-client/lib/hive-jdbc.jar on your edge/client node

2. here- you'll need to pick the jar corresponding to your HDP version (Ambari shows this under the Admin->Stacks and Versions->Versions tab, or you can display it on the CLI by typing "hdp-select", which shows the version number of each installed component.

View solution in original post

1 REPLY 1

avatar

Hi @Landon Robinson, take a look at http://docs.hortonworks.com/HDPDocuments/HDP2/HDP-2.3.4/bk_dataintegration/content/hive-jdbc-odbc-dr...

If you're writing Java code, the easiest to use is probably the provided JDBC driver.

You can get the current version of the JDBC driver in one of two ways:

1. At /user/hdp/current/hive-client/lib/hive-jdbc.jar on your edge/client node

2. here- you'll need to pick the jar corresponding to your HDP version (Ambari shows this under the Admin->Stacks and Versions->Versions tab, or you can display it on the CLI by typing "hdp-select", which shows the version number of each installed component.