Spark Sql and Hql
[cloudera@quickstart ~]$ sudo find / -name
'hive-site.xml'
[cloudera@quickstart ~]$ sudo chmod -R 777
/usr/lib/spark/conf
[cloudera@quickstart ~]$ cp
/etc/hive/conf.dist/hive-site.xml
/usr/lib/spark/conf
_____________________________________
from hive-site.xml -->
set hive.metastore.warehouse.dir to some directory path
'hive-site.xml'
[cloudera@quickstart ~]$ sudo chmod -R 777
/usr/lib/spark/conf
[cloudera@quickstart ~]$ cp
/etc/hive/conf.dist/hive-site.xml
/usr/lib/spark/conf
_____________________________________
from hive-site.xml -->
set hive.metastore.warehouse.dir to some directory path
import org.apache.spark.sql.hive.HiveContext
val hq = new HiveContext(sc);
val hivedf = hq.sql("use leela_db")
val hivedf2 = hq.sql("select * from emp_sal")
hivedf2.show();
val sal_avg = hq.sql("select avg(salary) from emp_sal")
sal_avg.show()
Nice post ! Thanks for sharing valuable information with us. Keep sharing.. Big data hadoop online training
ReplyDeleteGood Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging.
ReplyDeleteBig Data Hadoop training in electronic city
Good Blog
ReplyDeleteWe are making the Best Software training in bangalore.
Software Training Institute in Bangalore
Selenium Training in Bangalore
Hadoop Training in Bangalore
Devops Training in Bangalore
Python Training in Bangalore
RPA Training in Bangalore
AWS Training in Bangalore
TABLEAU Training in Bangalore
Spark Training in Bangalore
Your post is very great.I read this post. It’s very helpful. I will definitely go ahead and take advantage of this. You absolutely have wonderful stories. Cheers for sharing with us your blog. For more learning about data science visit at Data science course in Bangalore
ReplyDelete