Copilot commented on code in PR #22734:
URL: https://github.com/apache/datafusion/pull/22734#discussion_r3349925711


##########
datafusion/spark/src/function/datetime/next_day.rs:
##########
@@ -210,7 +210,7 @@ where
 fn spark_next_day(days: i32, day_of_week: &str) -> Option<i32> {
     let date = Date32Type::to_naive_date_opt(days)?;
 
-    let day_of_week = day_of_week.trim().to_uppercase();
+    let day_of_week = day_of_week.to_uppercase();

Review Comment:
   `to_uppercase()` performs full Unicode uppercasing and allocates a new 
`String`. Since Spark day-name tokens are ASCII-only, consider using an 
ASCII-only approach (e.g., `to_ascii_uppercase()` or matching via 
`eq_ignore_ascii_case` without allocation) to reduce overhead and make the 
behavior more strictly aligned to Spark’s expected token set.



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