Spark 之 SparkPlanInfo

[复制链接]
发表于 2025-5-25 09:01:01 | 显示全部楼层 |阅读模式
src/main/scala/org/apache/spark/sql/execution/SparkPlanInfo.scala
  1.     new SparkPlanInfo(
  2.       plan.nodeName,
  3.       plan.simpleString(SQLConf.get.maxToStringFields),
  4.       children.map(fromSparkPlan),
  5.       metadata,
  6.       metrics)
复制代码
src/main/scala/org/apache/spark/sql/catalyst/plans/QueryPlan.scala
  1.   override def simpleString(maxFields: Int): String = statePrefix + super.simpleString(maxFields)
复制代码
src/main/scala/org/apache/spark/sql/catalyst/trees/TreeNode.scala
  1.   /**
  2.    * ONE line description of this node.
  3.    * @param maxFields Maximum number of fields that will be converted to strings.
  4.    *                  Any elements beyond the limit will be dropped.
  5.    */
  6.   def simpleString(maxFields: Int): String = s"$nodeName ${argString(maxFields)}".trim
复制代码
  1.   /** Returns a string representing the arguments to this node, minus any children */
  2.   def argString(maxFields: Int): String = stringArgs.flatMap {
  3.     case tn: TreeNode[_] if allChildren.contains(tn) => Nil
  4.     case Some(tn: TreeNode[_]) if allChildren.contains(tn) => Nil
  5.     case Some(tn: TreeNode[_]) => tn.simpleString(maxFields) :: Nil
  6.     case tn: TreeNode[_] => tn.simpleString(maxFields) :: Nil
  7.     case seq: Seq[Any] if seq.toSet.subsetOf(allChildren.asInstanceOf[Set[Any]]) => Nil
  8.     case iter: Iterable[_] if iter.isEmpty => Nil
  9.     case array: Array[_] if array.isEmpty => Nil
  10.     case xs @ (_: Seq[_] | _: Set[_] | _: Array[_]) =>
  11.       formatArg(xs, maxFields) :: Nil
  12.     case null => Nil
  13.     case None => Nil
  14.     case Some(null) => Nil
  15.     case Some(table: CatalogTable) =>
  16.       stringArgsForCatalogTable(table)
  17.     case Some(any) => any :: Nil
  18.     case map: CaseInsensitiveStringMap =>
  19.       redactMapString(map.asCaseSensitiveMap().asScala, maxFields)
  20.     case map: Map[_, _] =>
  21.       redactMapString(map, maxFields)
  22.     case t: TableSpec =>
  23.       t.copy(properties = Utils.redact(t.properties).toMap,
  24.         options = Utils.redact(t.options).toMap) :: Nil
  25.     case table: CatalogTable =>
  26.       stringArgsForCatalogTable(table)
  27.     case other => other :: Nil
  28.   }.mkString(", ")
复制代码
src/main/scala/org/apache/spark/sql/catalyst/expressions/namedExpressions.scala
  1. override def toString: String = s"$child AS $name#${exprId.id}$typeSuffix$delaySuffix"
复制代码



免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。
继续阅读请点击广告

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×
回复

使用道具 举报

© 2001-2025 Discuz! Team. Powered by Discuz! X3.5

GMT+8, 2025-7-10 01:30 , Processed in 0.077007 second(s), 31 queries 手机版|qidao123.com技术社区-IT企服评测▪应用市场 ( 浙ICP备20004199 )|网站地图

快速回复 返回顶部 返回列表