What is the best approach to use getOrCreate for streaming job with
HiveContext.It seems for SQLContext the recommended approach is to use
getOrCreate:
https://spark.apache.org/docs/latest/streaming-programming-guide.html#dataframe-and-sql-operationsval
sqlContext = SQLContext.getOrCreate(rdd.sparkContext)However the method does
not seem inherited to HiveContext.I currently create my own singleton class and
use it like this: val sqlContext =
SQLHiveContextSingleton.getInstance(linesRdd.sparkContext)
However, i am not sure if this is reliable. What would be the best approach?Any
examples?