-
Notifications
You must be signed in to change notification settings - Fork 638
YQL-17439: block implementation of From/IntervalFrom/To Datetime UDF functions #1755
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
YQL-17439: block implementation of From/IntervalFrom/To Datetime UDF functions #1755
Conversation
⚪ |
⚪ |
⚪
|
⚪
|
bool isAllNull = inArray->GetNullCount() == length; | ||
if (!isAllNull) { | ||
for (i64 i = 0; i < length; ++i) { | ||
outValues[i] = Core(inValues[i]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please return std::pair from Core, see https://godbolt.org/z/coYsffa5T
@@ -862,8 +869,47 @@ NUdf::TUnboxedValuePod DoAddYears(const NUdf::TUnboxedValuePod& date, i64 years, | |||
}; | |||
|
|||
// From* | |||
|
|||
template<typename TInput, typename TOutput, TOutput Core(TInput), bool Filter(TInput)> | |||
struct TUnaryFixedSizeKernelWithFilter { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add suffix Unsafe and ensure that TInput/TOutput are std::is_arithmetic
⚪
|
⚪
|
⚪
|
⚪
|
⚪ |
⚪ |
⚪
|
⚪
|
⚪
|
Added optimized block implementation of FromSeconds, FromMilliseconds, FromMicroseconds, IntervalFromDays, IntervalFromHours, IntervalFromMinutes, IntervalFromSeconds, IntervalFromMilliseconds, IntervalFromMicroseconds, ToDays, ToHours, ToMinutes.