yew1eb opened a new pull request, #1635:
URL: https://github.com/apache/auron/pull/1635

   
   # Which issue does this PR close?
   
   Closes #1579 .
   
    # Rationale for this change
   `nvl2(expr1, expr2, expr3)` semantics:
   - if expr1 is not null → return expr2
   - if expr1 is null     → return expr3
   
   The original nvl2 test was incorrect and asserted the wrong expected result:
   ```scala
         sql(
           "create table t1 using parquet as select 'base'" +
             " as base, 3 as exponent")
         val functions =
           """
             |select
             |  nvl2(null, base, exponent), nvl2(4, base, exponent)
             |from t1
                         """.stripMargin
   
         val df = sql(functions)
         checkAnswer(df, Seq(Row("base", 3)))   // ← WRONG!
   ```
   
   Original test incorrectly expected Row("base", 3) but actual result is 
Row(3, "base").
   
   
   # What changes are included in this PR?
   - Removed the original incorrect nvl2 test.
   - Replaced with correct and strengthened test case.
   
   # Are there any user-facing changes?
   No.
   
   # How was this patch tested?
   Unit tests passed.
   
   


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

Reply via email to