Sparksql crud operation through hivecontext


Hi All,

Could you please provide an example spark SQL CRUD operation over HiveContext ?All Create, Retrieve, Delete & Update Operations should be done through Spark SQL(HiveContext).


Launch spark-shell by using the command spark-shell --master yarn --conf spark.ui.port = 12345
Connect to hive database using sqlContext
sqlContext.sql(“use database”)

To list the tables use this query
sqlContext.sql(“show tables”).show

To view the data in the table, use the query
sqlContext.sql(“select * from orders limit 10″).show


Insert, Update and Delete are not very common and there are several restrictions.

You can follow this vide for further details


@dgadiraju thank you sir