Github user chenghao-intel commented on a diff in the pull request:

    https://github.com/apache/spark/pull/224#discussion_r11007398
  
    --- Diff: 
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/ExpressionEvaluationSuite.scala
 ---
    @@ -26,7 +26,186 @@ import org.apache.spark.sql.catalyst.types._
     /* Implicit conversions */
     import org.apache.spark.sql.catalyst.dsl.expressions._
     
    -class ExpressionEvaluationSuite extends FunSuite {
    +import org.apache.spark.sql.catalyst.types._
    +import org.apache.spark.sql.catalyst.dsl._
    +
    +
    +/**
    + * Root class of expression evaluation test
    + */
    +trait ExprEvalTest {
    +  type Execution = (Row => Row)
    +
    +  def engine: Execution
    +}
    +
    +case class InterpretExprEvalTest(exprs: Seq[Expression]) extends 
ExprEvalTest {
    +  override def engine: Execution = new Projection(exprs)
    --- End diff --
    
    Yes, you're right, actually what we need now is just the single Expression. 
    But I put the projection who contains multiple expressions/fields, because:
    1) We may have the case which need to computing multiple fields for a 
single input row. (Of cause that can be replaced by multiple expressions with 
different row feeding.)
    2) In the future expression evaluation optimization, I am thinking to 
CSE(Common Sub expression Elimination), the Projection may hide the details in 
each expression computing.


---
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.
---

Reply via email to