I'm executing this example from the documentation (in single node mode)

# sc is an existing SparkContext.
from pyspark.sql import HiveContext
sqlContext = HiveContext(sc)

sqlContext.sql("CREATE TABLE IF NOT EXISTS src (key INT, value STRING)")

# Queries can be expressed in HiveQL.
results = sqlContext.sql("FROM src SELECT key, value").collect()




1.       would it be possible to get the results from collect in a more 
human-readable format? For example, I would like to  have a result similar to 
what I would get using hive CLI.

2.       The first query does not seem to create the table. I tried "show 
tables;" from hive after doing it, and the table src did not show up.

Reply via email to