Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -942,7 +942,7 @@ class DataQuanta[Out: ClassTag](val operator: ElementaryOperator, outputIndex: I
collector
}

def explain(): Unit = {
def explain(toJson: Boolean = false): Unit = {
// Set up the sink.
val collector = new java.util.LinkedList[Out]()
val sink = LocalCallbackSink.createCollectingSink(collector, dataSetType[Out])
Expand All @@ -951,7 +951,7 @@ class DataQuanta[Out: ClassTag](val operator: ElementaryOperator, outputIndex: I

// Do the explanation.
this.planBuilder.sinks += sink
this.planBuilder.buildAndExplain()
this.planBuilder.buildAndExplain(toJson)
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,13 @@ class PlanBuilder(private[api] val wayangContext: WayangContext, private var job
/**
* Build the [[org.apache.wayang.core.api.Job]] and explain it.
*/
def buildAndExplain(): Unit = {
def buildAndExplain(toJson: Boolean = false): Unit = {
val plan: WayangPlan = new WayangPlan(this.sinks.toArray: _*)
this.wayangContext.explain(plan, this.udfJars.toArray: _*)
if (toJson) {
this.wayangContext.explain(plan, toJson, this.udfJars.toArray: _*)
} else {
this.wayangContext.explain(plan, this.udfJars.toArray: _*)
}
}

/**
Expand Down
Loading