In the following code I'm trying to start a hive thrift server from spark:
val conf = new SparkConf().setAppName("HiveDemo")
val sc = new SparkContext(conf)
val sql = new HiveContext(sc)
sql.setConf("hive.server2.thrift.port", "10001")
val df = sql.read.parquet("s3n://...")
df.registerTempTable("test")
HiveThriftServer2.startWithContext(sql)
while (true) {
Thread.`yield`()
}
And I'm running this code as a step on an EMR cluster with the following configs:
emr-4.6.0
spark 1.6.1
hive 1.0.0
And I'm attaching to the cluster to test if the table is created with beeline using:
!connect jdbc:hive2://localhost:10001
I get Error: Could not open client transport with JDBC Uri: jdbc:hive2://localhost:10001: java.net.ConnectException: Connection refused
Is there an additional setup step that I'm missing on EMR?