Member since
06-19-2019
3
Posts
0
Kudos Received
0
Solutions
06-21-2019
04:20 AM
Thanks Shu. The below command worked for me. sc.textFile("/user/temp/hive.hql").collect().mkString.split(";").map(x => hive.executeQuery(x).show())
... View more
06-20-2019
04:20 AM
For Hadoop 3.1 i am using HWC Connector to connect to Hive and execute the queries.Below is the code snippet used for testing. spark-shell --jars /usr/hdp/current/hive_warehouse_connector/hive-warehouse-connector-assembly-1.0.0.3.1.0.0-78.jar
import com.hortonworks.hwc.HiveWarehouseSession
import com.hortonworks.hwc.HiveWarehouseSession._
val hive = HiveWarehouseSession.session(spark).build()
val query = sc.textFile("/user/temp/hive.hql").collect().mkString.split(";").foreach(qry => hive.executeQuery(qry))
query.show() This is throwing error as given below. <console>:30: error: value show is not a member of Unit Is this not the proper way to run a hql file using Spark. Please suggest.
... View more
Labels:
- Labels:
-
Apache Spark