Github user kiszk commented on a diff in the pull request:

    https://github.com/apache/spark/pull/11301#discussion_r56354960
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/trees/TreeNode.scala 
---
    @@ -57,15 +58,15 @@ object CurrentOrigin {
     
       def reset(): Unit = value.set(Origin())
     
    -  def setPosition(line: Int, start: Int): Unit = {
    +  def setPosition(callSite: String, line: Int, start: Int): Unit = {
         value.set(
    -      value.get.copy(line = Some(line), startPosition = Some(start)))
    +      value.get.copy(callSite = Some(callSite), line = Some(line), 
startPosition = Some(start)))
       }
     
       def withOrigin[A](o: Origin)(f: => A): A = {
    +    val current = get
         set(o)
    -    val ret = try f finally { reset() }
    -    reset()
    +    val ret = try f finally { set(current) }
    --- End diff --
    
    [This 
change](https://github.com/apache/spark/pull/11301/commits/2965e93e83ba2283ff7ec36f8c837972a685dc15)
 can generate a comment for ```Column``` with the real call site.
    
    
    ```java
    /* 120 */     while (!shouldStop() && (firstRow || rdd_input.hasNext())) {
    /* 121 */       if (firstRow) {
    /* 122 */         firstRow = false;
    /* 123 */       } else {
    /* 124 */         rdd_row = (InternalRow) rdd_input.next();
    /* 125 */       }
    /* 126 */       rdd_metricValue.add(1);
    /* 127 */       /*** CONSUME: Filter (isnotnull(_1#0) && (_1#0 > 4)) */
    /* 128 */       /* input[0, int] 
[org.apache.spark.sql.catalyst.expressions.BoundReference] @ filter at 
DF.scala:16 */
    /* 129 */       boolean project_isNull4 = rdd_row.isNullAt(0);
    /* 130 */       int project_value4 = project_isNull4 ? -1 : 
(rdd_row.getInt(0));
    /* 131 */       
    /* 132 */       /* (isnotnull(input[0, int]) && (input[0, int] > 4)) 
[org.apache.spark.sql.catalyst.expressions.And] @ select at DF.scala:17 */
    /* 133 */       boolean filter_isNull6 = false;
    /* 134 */       boolean filter_value6 = false;
    /* 135 */       
    /* 136 */       if (!false && !(!(project_isNull4))) {
    /* 137 */       } else {
    /* 138 */         /* (input[0, int] > 4) 
[org.apache.spark.sql.catalyst.expressions.GreaterThan] @ filter at DF.scala:16 
*/
    /* 139 */         boolean filter_isNull9 = true;
    /* 140 */         boolean filter_value9 = false;
    /* 141 */         
    /* 142 */         if (!project_isNull4) {
    /* 143 */           filter_isNull9 = false; // resultCode could change 
nullability.
    /* 144 */           filter_value9 = project_value4 > 4;
    /* 145 */           
    /* 146 */         }
    /* 147 */         if (!filter_isNull9 && !filter_value9) {
    /* 148 */         } else if (!false && !filter_isNull9) {
    /* 149 */           filter_value6 = true;
    /* 150 */         } else {
    /* 151 */           filter_isNull6 = true;
    /* 152 */         }
    /* 153 */       }
    /* 154 */       if (!(!filter_isNull6 && filter_value6)) continue;
    /* 155 */       filter_metricValue1.add(1);
    /* 156 */       
    /* 157 */       /*** CONSUME: Project [(_1#0 * 10) AS (_1 * 10)#1] */
    /* 158 */       
    /* 159 */       /* (input[0, int] * 10) 
[org.apache.spark.sql.catalyst.expressions.Multiply] @ select at DF.scala:17 */
    /* 160 */       boolean project_isNull5 = true;
    /* 161 */       int project_value5 = -1;
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to