sdf-jkl commented on code in PR #19733:
URL: https://github.com/apache/datafusion/pull/19733#discussion_r2737534751
##########
datafusion/functions/src/datetime/date_part.rs:
##########
@@ -237,6 +243,68 @@ impl ScalarUDFImpl for DatePartFunc {
})
}
+ // Only casting the year is supported since pruning other IntervalUnit is
not possible
+ // date_part(col, YEAR) = 2024 => col >= '2024-01-01' and col <
'2025-01-01'
+ // But for anything less than YEAR simplifying is not possible without
specifying the bigger interval
+ // date_part(col, MONTH) = 1 => col = '2023-01-01' or col = '2024-01-01'
or ... or col = '3000-01-01'
+ fn preimage(
Review Comment:
There is a PR for `preimage` doc improvement here #20008.
I am however, not sure that this doc needs to explain `preimage`. I think
the doc's goal is to be a very minimal guide on adding and registering a
function. There is also no mention of `simplify` too.
--
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]