bq. However the method does not seem inherited to HiveContext. Can you clarify the above observation ? HiveContext extends SQLContext .
On Fri, Mar 4, 2016 at 1:23 PM, jelez <je...@hotmail.com> wrote: > 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-operations > val 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? > > > > -- > View this message in context: > http://apache-spark-user-list.1001560.n3.nabble.com/How-to-get-the-singleton-instance-of-SQLContext-HiveContext-val-sqlContext-SQLContext-getOrCreate-rd-tp26399.html > Sent from the Apache Spark User List mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscr...@spark.apache.org > For additional commands, e-mail: user-h...@spark.apache.org > >