spark-shell
启动 spark-shell
[hadoop@hadoop2 bin]$ ./spark-shell --master local[2] \
--jars /opt/module/hive-1.2.2/lib/mysql-connector-java-5.1.27-bin.jar
通过 spark-shell 操作 hive
WebUI 查看任务:
spark-sql
启动 spark-sql
[hadoop@hadoop2 bin]$ ./spark-sql --master local[2] \
--jars /opt/module/hive-1.2.2/lib/mysql-connector-java-5.1.27-bin.jar
通过 spark-shell 操作 hive
执行 select * from emp;
执行 select * from dept;
执行 select * from emp e join dept d on e.deptno = d.deptno;
WebUI 查看
查看执行计划:
执行 explain select * from emp e join dept d on e.deptno = d.deptno;
执行 explain extended select * from emp e join dept d on e.deptno = d.deptno;