LuciferYang commented on PR #56219:
URL: https://github.com/apache/spark/pull/56219#issuecomment-4586298518

   ### Code review
   
   Found 1 issue:
   
   1. The new ANSI codegen path in `nextDayGenCode` is untested. No test 
exercises `NextDay` with `failOnError=true` and a non-foldable invalid 
day-of-week string. The existing ANSI error tests at 
[`DateExpressionsSuite.scala:721`](https://github.com/apache/spark/blob/e220acc69361169d1c91bfa7d8087f1ae5806804/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/DateExpressionsSuite.scala#L719-L741)
 all use `Literal("xx")` (foldable), which is constant-folded at plan time and 
never reaches the new `getNextDateExact` codegen path. The `testNextDay` helper 
does use `NonFoldableLiteral` but only for valid day-of-week strings. A test 
with `NonFoldableLiteral("xx")` under ANSI mode would cover the new branch.
   
   
https://github.com/apache/spark/blob/e220acc69361169d1c91bfa7d8087f1ae5806804/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/datetimeExpressions.scala#L1609-L1618
   
   🤖 Generated with [Claude Code](https://claude.ai/code)
   
   <sub>- If this code review was useful, please react with 👍. Otherwise, react 
with 👎.</sub>


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