HeartSaVioR commented on code in PR #59594:
URL: https://github.com/apache/spark/pull/59594#discussion_r4314589309


##########
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/StreamingJoinHelperSuite.scala:
##########
@@ -17,14 +17,37 @@
 
 package org.apache.spark.sql.catalyst.analysis
 
+import org.apache.spark.sql.catalyst.dsl.expressions._
 import org.apache.spark.sql.catalyst.expressions.{Attribute, 
AttributeReference, AttributeSet}
 import org.apache.spark.sql.catalyst.optimizer.SimpleTestOptimizer
 import org.apache.spark.sql.catalyst.parser.CatalystSqlParser
 import org.apache.spark.sql.catalyst.plans.logical.{EventTimeWatermark, 
Filter, LeafNode, Statistics}
-import org.apache.spark.sql.types.{IntegerType, MetadataBuilder, TimestampType}
+import org.apache.spark.sql.types.{IntegerType, LongType, MetadataBuilder, 
TimestampType}
 
 class StreamingJoinHelperSuite extends AnalysisTest {
 
+  test("state watermark extraction preserves arithmetic term multiplicity") {
+    val leftTime = AttributeReference("leftTime", TimestampType)()
+    val metadata = new MetadataBuilder().putLong(EventTimeWatermark.delayKey, 
1000).build()
+    val rightTime = AttributeReference("rightTime", TimestampType, metadata = 
metadata)()
+    val left = leftTime.cast(LongType)
+    val right = rightTime.cast(LongType)
+
+    val cases = Seq(
+      (left > right + 2 + 2, Some(14000L)),
+      (left > right - 2 - 2, Some(6000L)),
+      (left + left > right, None),

Review Comment:
   To reviewers: None means this condition cannot calculate the state watermark 
and other join condition is needed.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to