How do we can read data from hive and join them using DF in spark?

hive
apache-spark
scala

#1

i’m using below command to read & join the data from hive tables
spark.sql(“select o.order_id,sum(oi.order_item_subtotal) from orders o join orders_items oi on o.order_id = oi.order_item_order_id where o.order_status = ‘COMPLETE’ group by o.order_id limit 10”);

can you please suggest me is it correct way to read & to join hive tables of Spark 2.3.0.

Learn Spark 1.6.x or Spark 2.x on our state of the art big data labs

  • Click here for access to state of the art 13 node Hadoop and Spark Cluster


#2

@p_balaji_srinivasu Yes, You can read data from hive using a spark.

create your own hive database and try the query.


#3

@annapurna
thanks …:slight_smile: Now its working fine.


#4