andygrove commented on code in PR #362:
URL: https://github.com/apache/datafusion-comet/pull/362#discussion_r1586401340


##########
spark/src/main/scala/org/apache/comet/CometSparkSessionExtensions.scala:
##########
@@ -1042,10 +1042,10 @@ object CometSparkSessionExtensions extends Logging {
    *   The node with information (if any) attached
    */
   def withInfo[T <: TreeNode[_]](node: T, info: String, exprs: T*): T = {
-    val exprInfo = exprs
-      .flatMap { e => Seq(e.getTagValue(CometExplainInfo.EXTENSION_INFO)) }
-      .flatten
-      .mkString("\n")
+    val exprInfo =
+      (Seq(node.getTagValue(CometExplainInfo.EXTENSION_INFO)) ++ exprs
+        .flatMap(e => 
Seq(e.getTagValue(CometExplainInfo.EXTENSION_INFO)))).flatten
+        .mkString("\n")

Review Comment:
   @parthchandra I found an issue where if I call `withInfo` twice on the same 
node, it would lose the info from the first call so I modified this to preserve 
any existing tag on the node.
   
   Does this seem reasonable?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to