Jefffrey commented on code in PR #10833:
URL: https://github.com/apache/datafusion/pull/10833#discussion_r1632234019
##########
datafusion/functions/src/datetime/date_part.rs:
##########
@@ -127,7 +127,12 @@ impl ScalarUDFImpl for DatePartFunc {
ColumnarValue::Scalar(scalar) => scalar.to_array()?,
};
- let arr = match part.to_lowercase().as_str() {
+ let arr = match part
+ .to_lowercase()
+ .replacen('\'', "", 2)
+ .replacen('\"', "", 2)
+ .as_str()
Review Comment:
Hmm, this will still let `select extract("'epoch'" from now());` through
But this is quite a minor thing, not sure how much it matters in the wider
picture :sweat_smile:
--
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]