cloud-fan commented on code in PR #57278:
URL: https://github.com/apache/spark/pull/57278#discussion_r3589318376
##########
sql/core/src/test/scala/org/apache/spark/sql/BinBySuite.scala:
##########
@@ -104,64 +109,73 @@ class BinBySuite extends QueryTest with
SharedSparkSession {
}
}
- test("BIN BY emits a NULL-range row with all computed columns NULL") {
+ test("BIN BY aligns to an origin later than the range") {
withSQLConf(
SQLConf.BIN_BY_ENABLED.key -> "true",
SQLConf.SESSION_LOCAL_TIMEZONE.key -> "UTC") {
+ // ALIGN TO after the range exercises the negative step-back in the
bin-boundary arithmetic.
Review Comment:
The literal step-back (`k -= 1`) lives only in `timeBucketDTInterval`'s
multi-day branch (`DateTimeUtils.scala:1286-1288`), which a 5-MINUTE width
never reaches — that width takes the sub-day `bucketDays == 0` pure-`floorDiv`
branch (`1275-1277`). The test does correctly exercise a *negative bucket
index* (origin after the range), but this wording risks implying it covers the
DST step-back correction.
```suggestion
// ALIGN TO after the range exercises a negative bucket index (origin
later than the range).
```
--
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]