tustvold commented on code in PR #9613:
URL: https://github.com/apache/arrow-datafusion/pull/9613#discussion_r1529004736


##########
datafusion/functions/src/datetime/date_part.rs:
##########
@@ -157,28 +114,28 @@ impl ScalarUDFImpl for DatePartFunc {
             ColumnarValue::Scalar(scalar) => scalar.to_array()?,
         };
 
-        let arr = match date_part.to_lowercase().as_str() {
-            "year" => extract_date_part!(&array, temporal::year),
-            "quarter" => extract_date_part!(&array, temporal::quarter),
-            "month" => extract_date_part!(&array, temporal::month),
-            "week" => extract_date_part!(&array, temporal::week),
-            "day" => extract_date_part!(&array, temporal::day),
-            "doy" => extract_date_part!(&array, temporal::doy),
-            "dow" => extract_date_part!(&array, 
temporal::num_days_from_sunday),
-            "hour" => extract_date_part!(&array, temporal::hour),
-            "minute" => extract_date_part!(&array, temporal::minute),
-            "second" => extract_date_part!(&array, seconds),
-            "millisecond" => extract_date_part!(&array, millis),
-            "microsecond" => extract_date_part!(&array, micros),
-            "nanosecond" => extract_date_part!(&array, nanos),
-            "epoch" => extract_date_part!(&array, epoch),
-            _ => exec_err!("Date part '{date_part}' not supported"),
-        }?;
+        let arr = match part.to_lowercase().as_str() {

Review Comment:
   Yes this was a copypasta



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