Hivecontext.sql returns empty result

I am creating a hive context and querying the hive table as shown below, Spark context is created using a thread cluster

HiveContext hv = new HiveContext(sc)
hv.sql("use schema")
val df = hv.sql(query)

      

However, it returns an empty framework.

However, if I run the query directly in the hive environment, it returns valid values. What could be the problem

+3


source to share


1 answer


Generally, the dataframe in spark can be thought of as a map to fetch / calculate data, it won't be implemented until the data is needed. To get the data you can use df.collect ()



0


source







All Articles