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

    https://github.com/apache/spark/pull/19327#discussion_r142533513
  
    --- Diff: 
sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamingJoinSuite.scala 
---
    @@ -425,6 +426,10 @@ class StreamingJoinSuite extends StreamTest with 
StateStoreMetricsTest with Befo
     
         // Test static comparisons
         assert(watermarkFrom("cast(leftTime AS LONG) > 10") === Some(10000))
    +
    +    // Test non-positive results
    +    assert(watermarkFrom("CAST(leftTime AS LONG) > CAST(rightTime AS LONG) 
- 10") === Some(0))
    +    assert(watermarkFrom("CAST(leftTime AS LONG) > CAST(rightTime AS LONG) 
- 100") === Some(-90000))
    --- End diff --
    
    It does not build a physical plan, it simply uses the SparkSQL 
QueryExecution to pass the expression through the analyzer and optimizer, to 
get the conditions in a similar form as a real query would. Instead we can 
simply using SimpleAnalyzer and SimpleTestOptimizer
    ```
        val analyzedPlan = SimpleAnalyzer.execute(plan)
        val optimizedPlan = SimpleTestOptimizer.execute(analyzedPlan)
    ```



---

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

Reply via email to