## PySpark code to run sql command .
code :
## Importing HiveContext
>>>> from pyspark.sql import Hive Context
## Create a SqlContext using Spark Context (sc)
>>>> sqlContext = HiveContext(sc)
## Writing Query
>>>> query = sqlContext.sql("MSCK REPAIR TABLE [TABLE_NAME]")
inside double quotes (") we can write any hive query. Most queries which work on hive will work here as well .
Comments