chore: add SQL tests for FIRST/LAST aggregates#3891
Conversation
mbutrovich
left a comment
There was a problem hiding this comment.
Thanks @comphead! Always good to have more tests.
I think we can close #1630 as it referred to not using |
Oh I see. You are right, we can close it. Let's just update the docs though |
|
I'll check also #1646 if everything works, we can just close 2 tickets and remove deterministic warning, otherwise we can refer to 1646 |
|
Thanks everyone for review |
Which issue does this PR close?
Closes #1630 #1646 .
Rationale for this change
Summary
Adds comprehensive SQL file tests for
firstandlastaggregation functions withIGNORE NULLSsemantics.Motivation
The existing
first_last.sqltest file had only 3 basic queries coveringfirst/lastwithout anyIGNORE NULLScoverage. The Scala test suite (CometAggregateSuite) has someIGNORE NULLStestsbut several are disabled (TODO #1646). SQL file tests are the preferred approach for expression testing in Comet and provide better coverage across the
ConfigMatrix(dictionary encoding on/off).What's added
Tests are organized into three sections: FIRST, LAST, and FIRST + LAST combined, each covering:
IGNORE NULLSNULLis returned when no non-null values existexpect_fallbackdue toSortAggregate)first(val, true)/first(val, false)equivalence withIGNORE NULLSsyntaxIF(val % 2 = 0, NULL, val)inside aggregationfirst/lastIGNORE NULLS alongside regularfirst/last,count,sumIGNORE NULLSresultDECIMAL(10,2)DATEvaluesWhat changes are included in this PR?
How are these changes tested?