@@ -514,11 +514,15 @@ trait LeafExecNode extends SparkPlan {
514
514
override def producedAttributes : AttributeSet = outputSet
515
515
override def verboseStringWithOperatorId (): String = {
516
516
val argumentString = argString(SQLConf .get.maxToStringFields)
517
- s """
518
- |( ${ExplainUtils .getOpId(this )}) $nodeName ${ExplainUtils .getCodegenId(this )}
519
- | ${ExplainUtils .generateFieldString(" Arguments" , argumentString)}
520
- | ${ExplainUtils .generateFieldString(" Output" , producedAttributes)}
521
- """ .stripMargin
517
+ val result = s """
518
+ |( ${ExplainUtils .getOpId(this )}) $nodeName ${ExplainUtils .getCodegenId(this )}
519
+ | ${ExplainUtils .generateFieldString(" Output" , producedAttributes)}
520
+ """ .stripMargin
521
+ if (argumentString != null && ! argumentString.isEmpty) {
522
+ s """ ${result} |Arguments: $argumentString\n """ .stripMargin
523
+ } else {
524
+ s " ${result}"
525
+ }
522
526
}
523
527
}
524
528
@@ -535,11 +539,15 @@ trait UnaryExecNode extends SparkPlan {
535
539
override final def children : Seq [SparkPlan ] = child :: Nil
536
540
override def verboseStringWithOperatorId (): String = {
537
541
val argumentString = argString(SQLConf .get.maxToStringFields)
538
- s """
539
- |( ${ExplainUtils .getOpId(this )}) $nodeName ${ExplainUtils .getCodegenId(this )}
540
- | ${ExplainUtils .generateFieldString(" Input" , child.output)}
541
- | ${ExplainUtils .generateFieldString(" Arguments" , argumentString)}
542
- """ .stripMargin
542
+ val result = s """
543
+ |( ${ExplainUtils .getOpId(this )}) $nodeName ${ExplainUtils .getCodegenId(this )}
544
+ | ${ExplainUtils .generateFieldString(" Input" , child.output)}
545
+ """ .stripMargin
546
+ if (argumentString != null && ! argumentString.isEmpty) {
547
+ s """ ${result} |Arguments: $argumentString\n """ .stripMargin
548
+ } else {
549
+ s " ${result}"
550
+ }
543
551
}
544
552
}
545
553
@@ -550,11 +558,15 @@ trait BinaryExecNode extends SparkPlan {
550
558
override final def children : Seq [SparkPlan ] = Seq (left, right)
551
559
override def verboseStringWithOperatorId (): String = {
552
560
val argumentString = argString(SQLConf .get.maxToStringFields)
553
- s """
554
- |( ${ExplainUtils .getOpId(this )}) $nodeName ${ExplainUtils .getCodegenId(this )}
555
- | ${ExplainUtils .generateFieldString(" Left output" , left.output)}
556
- | ${ExplainUtils .generateFieldString(" Right output" , right.output)}
557
- | ${ExplainUtils .generateFieldString(" Arguments" , argumentString)}
558
- """ .stripMargin
561
+ val result = s """
562
+ |( ${ExplainUtils .getOpId(this )}) $nodeName ${ExplainUtils .getCodegenId(this )}
563
+ | ${ExplainUtils .generateFieldString(" Left output" , left.output)}
564
+ | ${ExplainUtils .generateFieldString(" Right output" , right.output)}
565
+ """ .stripMargin
566
+ if (argumentString != null && ! argumentString.isEmpty) {
567
+ s """ ${result} |Arguments: $argumentString\n """ .stripMargin
568
+ } else {
569
+ s " ${result}"
570
+ }
559
571
}
560
572
}
0 commit comments