Skip to content
This repository has been archived by the owner on Mar 30, 2021. It is now read-only.

Commit

Permalink
introduce option to choose druid's v2 groupByEngine
Browse files Browse the repository at this point in the history
  • Loading branch information
Harish Butani committed Sep 8, 2016
1 parent 17679a1 commit 021aa66
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,12 @@ object DruidPlanner {
"executed."
)

val DRUID_USE_V2_GBY_ENGINE = booleanConf(
"spark.sparklinedata.druid.option.use.v2.groupByEngine",
defaultValue = Some(false),
doc = "for druid queries use the smile binary protocol"
)

def getDruidQuerySpecs(plan : SparkPlan) : Seq[DruidQuery] = {
plan.collect {
case PhysicalRDD(_, r : DruidRDD, _, _, _) => r.dQuery
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,12 @@ private[druid] class DruidStrategy(val planner: DruidPlanner) extends Strategy
*/
qs = QuerySpecTransforms.transform(planner.sqlContext, dqb.drInfo, qs)

qs.context.foreach{ ctx =>
if( planner.sqlContext.getConf(DruidPlanner.DRUID_USE_V2_GBY_ENGINE) ) {
ctx.groupByStrategy = Some("v2")
}
}

val (queryHistorical : Boolean, numSegsPerQuery : Int) =
if ( !pAgg.canBeExecutedInHistorical ) {
(false, -1)
Expand Down
3 changes: 2 additions & 1 deletion src/main/scala/org/sparklinedata/druid/DruidQuerySpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,8 @@ case class QuerySpecContext(
minTopNThreshold : Option[Int] = None,
maxResults : Option[Int] = None,
maxIntermediateRows : Option[Int] = None,
groupByIsSingleThreaded : Option[Boolean] = None
groupByIsSingleThreaded : Option[Boolean] = None,
var groupByStrategy : Option[String] = None
)

sealed trait QuerySpec {
Expand Down

0 comments on commit 021aa66

Please sign in to comment.