Level | Technologies | Target Product | Product Versions | Source |
---|---|---|---|---|
Beginner |
Teiid, VDB, View, Hive Translator, Hive, Hadoop |
DV |
DV 6.0+ |
This quickstart demonstrates using the Hive translator with HiveServer2 JDBC Driver to access data in Hadoop HDFS. VDB hive-vdb.xml be used to define View within DDL metadata.
The examples use java:/HiveDS
referenced with Hive data source, which will be setup by running setup.cli
-
Hadoop, Hive
Refer to Installing Hadoop 1.x to Red Hat Linux to finished Hadoop setup.
Refer to Downloading and installing Apache Hive to finished Hive setup.
Install Hive driver module. Download TeiidModule-Hive12.zip and copy it into your server installation in the /jboss-eap-6.1/modules folder. unzip it. That’s all. Do not modify the $JBOSS_HOME/standlone/configuration/standlone.xml.
Refer to ConnectToAHadoopSourceUsingHive2
Refer to Prerequisites to start the Server.
run the following CLI script
cd $JBOSS_HOME/bin ./jboss-cli.sh --connect --file={path}/vdb-Hivehadoop/src/scripts/setup.cli
Note
|
Maybe you need modify the connection-url=jdbc:hive2://{host-name}:10000/default to your URL, for example: connection-url=jdbc:hive2://127.0.0.1:10000/default |
Copy (deploy) the following VDB related files to the $JBOSS_HOME/standalone/deployments directory
src/vdb/hive-vdb.xml src/vdb/hive-vdb.xml.dodeploy
Open the admin console(http://localhost:9990/console) to make sure the VDB is deployed. See Query Demonstrations below to demonstrate query.
-
Change your working directory to "${quickstart.install.dir}/simpleclient"
-
Use the simpleclient example to run the following queries:
Example: mvn exec:java -Dvdb="portfolio" -Dsql="example query" -Dusername="xx" -Dpassword="xx"
The following sql can be used with -Dsql:
SELECT * FROM EMPLOYEEVIEW