panbingkun commented on code in PR #38520:
URL: https://github.com/apache/spark/pull/38520#discussion_r1014794699


##########
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/ExpressionTypeCheckingSuite.scala:
##########
@@ -745,4 +745,52 @@ class ExpressionTypeCheckingSuite extends SparkFunSuite 
with SQLHelper with Quer
       )
     )
   }
+
+  test("check types for Lag") {
+    val lag = Lag(Literal(1), NonFoldableLiteral(10), Literal(null), true)
+    assert(lag.checkInputDataTypes() ==
+      DataTypeMismatch(
+        errorSubClass = "FRAME_LESS_OFFSET_WITHOUT_FOLDABLE",
+        messageParameters = Map("offset" -> "\"(- nonfoldableliteral())\"")
+      ))
+  }
+
+  test("check types for SpecifiedWindowFrame") {
+    val swf1 = SpecifiedWindowFrame(RangeFrame, Literal(10.0), 
Literal(2147483648L))
+    assert(swf1.checkInputDataTypes() ==
+      DataTypeMismatch(
+        errorSubClass = "SPECIFIED_WINDOW_FRAME_DIFF_TYPES",

Review Comment:
   Another UT 
   
[DataFrameWindowFramesSuite.scala](https://github.com/apache/spark/pull/38520/files#diff-728befc0ad63fec7c44a606c62f3f63204293d3ca87da2830fde8ae7a291656b)
   <img width="523" alt="image" 
src="https://user-images.githubusercontent.com/15246973/200162999-526942f7-d57e-4a33-a2d5-6bae551dc5ec.png";>
   



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