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