Skip to content

Instantly share code, notes, and snippets.

@vinodkc
Last active December 8, 2020 16:22
Show Gist options
  • Save vinodkc/2985338984392cbfa03b46859de9ee5a to your computer and use it in GitHub Desktop.
Save vinodkc/2985338984392cbfa03b46859de9ee5a to your computer and use it in GitHub Desktop.

Step 1: Login to LLAP host node

step 2:

cd /tmp
wget https://raw.githubusercontent.com/dbompart/hive_warehouse_connector/master/hwc_info_collect.sh
chmod +x  hwc_info_collect.sh
./hwc_info_collect.sh

step 3: Read instructions in the output of above script and use the command shown in the script output , start the spark-shell with HWC support

step 4: Run below statement (replace ' < fill table name > ' with your table name )

import com.hortonworks.hwc.HiveWarehouseSession
import com.hortonworks.hwc.HiveWarehouseSession._
val hive = HiveWarehouseSession.session(spark).build()
hive.showDatabases().show()
hive.executeQuery("select * from <fill table name>").show

courtesy : David Bompart

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment