You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by kiszk <gi...@git.apache.org> on 2016/06/12 20:27:52 UTC

[GitHub] spark pull request #11301: [SPARK-13432][SQL] add the source file name and l...

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

    https://github.com/apache/spark/pull/11301#discussion_r66726703
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/Column.scala ---
    @@ -37,6 +39,16 @@ private[sql] object Column {
       def apply(expr: Expression): Column = new Column(expr)
     
       def unapply(col: Column): Option[Expression] = Some(col.expr)
    +
    +  @scala.annotation.varargs
    +  def updateExpressionsOrigin(cols: Column*): Unit = {
    +    // Update Expression.origin using the callSite of an operation
    +    val callSite = org.apache.spark.util.Utils.getCallSite().shortForm
    +    cols.map(col => col.expr.foreach(e => e.origin.callSite = Some(callSite)))
    +    // Update CurrentOrigin for setting origin for LogicalPlan node
    +    CurrentOrigin.set(
    +      Origin(Some(callSite), CurrentOrigin.get.line, CurrentOrigin.get.startPosition))
    --- End diff --
    
    Since I was too busy, I did not have time to work for this PR. Sorry.
    
    My current idea is to set ```CurrentOrigin``` at [```SQLExecution.withNewExecutionId```](https://github.com/apache/spark/blob/master/sql/core/src/main/scala/org/apache/spark/sql/execution/SQLExecution.scala#L57), and then [```TreeNode.toOriginString```](https://github.com/apache/spark/pull/11301/files#diff-eac5b02bb450a235fef5e902a2671254R446) dumps ```CurrentOrigin.get.callSite```.
    
    My next step seems to pass ```callSite``` from an operation such as ```filter``` to ```DataSet``` to ```LogicalPlan``` that can be accessed at ```SQLExecution.withNewExecutionId```.



---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org