Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/18540#discussion_r128894905
  
    --- Diff: 
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercionSuite.scala
 ---
    @@ -1109,6 +1109,31 @@ class TypeCoercionSuite extends AnalysisTest {
           EqualTo(Literal(Array(1, 2)), Literal("123")),
           EqualTo(Literal(Array(1, 2)), Literal("123")))
       }
    +
    +  test("cast WindowFrame boundaries to the type they operate upon") {
    +    // Can cast frame boundaries to order dataType.
    +    ruleTest(WindowFrameCoercion,
    +      windowSpec(
    +        Seq(UnresolvedAttribute("a")),
    +        Seq(SortOrder(Literal(1L), Ascending)),
    +        SpecifiedWindowFrame(RangeFrame, Literal(3), 
Literal(2147483648L))),
    +      windowSpec(
    +        Seq(UnresolvedAttribute("a")),
    +        Seq(SortOrder(Literal(1L), Ascending)),
    +        SpecifiedWindowFrame(RangeFrame, Cast(3, LongType), 
Literal(2147483648L)))
    +    )
    +    // Cannot cast frame boundaries to order dataType.
    +    ruleTest(WindowFrameCoercion,
    +      windowSpec(
    +        Seq(UnresolvedAttribute("a")),
    +        Seq(SortOrder(Literal.default(DateType), Ascending)),
    +        SpecifiedWindowFrame(RangeFrame, Literal(10.0), 
Literal(2147483648L))),
    +      windowSpec(
    +        Seq(UnresolvedAttribute("a")),
    +        Seq(SortOrder(Literal.default(DateType), Ascending)),
    +        SpecifiedWindowFrame(RangeFrame, Literal(10.0), 
Literal(2147483648L)))
    +    )
    --- End diff --
    
    can we add some more test cases with special window frame boundary?


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

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

Reply via email to