File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
core/src/main/scala/org/apache/spark/sql
hive/src/main/scala/org/apache/spark/sql/hive Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -295,6 +295,14 @@ class SQLContext(@transient val sparkContext: SparkContext)
295295 def table (tableName : String ): SchemaRDD =
296296 new SchemaRDD (this , catalog.lookupRelation(None , tableName))
297297
298+ /**
299+ * :: DeveloperApi ::
300+ * Allows extra strategies to be injected into the query planner at runtime. Note this API
301+ * should be consider experimental and is not intended to be stable across releases.
302+ */
303+ @ DeveloperApi
304+ var extraStrategies : Seq [Strategy ] = Nil
305+
298306 protected [sql] class SparkPlanner extends SparkStrategies {
299307 val sparkContext : SparkContext = self.sparkContext
300308
@@ -305,6 +313,7 @@ class SQLContext(@transient val sparkContext: SparkContext)
305313 def numPartitions = self.numShufflePartitions
306314
307315 val strategies : Seq [Strategy ] =
316+ extraStrategies ++ (
308317 CommandStrategy (self) ::
309318 DataSourceStrategy ::
310319 TakeOrdered ::
@@ -315,7 +324,7 @@ class SQLContext(@transient val sparkContext: SparkContext)
315324 ParquetOperations ::
316325 BasicOperators ::
317326 CartesianProduct ::
318- BroadcastNestedLoopJoin :: Nil
327+ BroadcastNestedLoopJoin :: Nil )
319328
320329 /**
321330 * Used to build table scan operators where complex projection and filtering are done using
Original file line number Diff line number Diff line change @@ -327,7 +327,7 @@ class HiveContext(sc: SparkContext) extends SQLContext(sc) {
327327 val hivePlanner = new SparkPlanner with HiveStrategies {
328328 val hiveContext = self
329329
330- override val strategies : Seq [Strategy ] = Seq (
330+ override val strategies : Seq [Strategy ] = extraStrategies ++ Seq (
331331 DataSourceStrategy ,
332332 CommandStrategy (self),
333333 HiveCommandStrategy (self),
You can’t perform that action at this time.
0 commit comments