github-actions[bot] commented on code in PR #17970:
URL: https://github.com/apache/doris/pull/17970#discussion_r1148753558
##########
be/src/vec/functions/function_timestamp.cpp:
##########
@@ -221,6 +298,48 @@ struct MakeDateImpl {
}
}
}
+ template <typename DateValueType, typename ReturnType>
+ static void execute_impl_right_const(const PaddedPODArray<Int32>& ldata,
Int32 rdata,
+ PaddedPODArray<ReturnType>& res,
NullMap& null_map) {
+ auto len = ldata.size();
+ res.resize(len);
+
+ const auto& r = rdata;
+ for (size_t i = 0; i < len; ++i) {
+ const auto& l = ldata[i];
+ if (r <= 0 || l < 0 || l > 9999) {
+ null_map[i] = 1;
+ continue;
+ }
+
+ auto& res_val = *reinterpret_cast<DateValueType*>(&res[i]);
+ if constexpr (std::is_same_v<DateValueType, VecDateTimeValue>) {
+ VecDateTimeValue ts_value = VecDateTimeValue();
+ ts_value.set_time(l, 1, 1, 0, 0, 0);
+
+ DateTimeVal ts_val;
Review Comment:
warning: variable has incomplete type 'doris::DateTimeVal'
[clang-diagnostic-error]
```cpp
DateTimeVal ts_val;
^
```
**be/src/udf/udf.h:47:** forward declaration of 'doris::DateTimeVal'
```cpp
struct DateTimeVal;
^
```
##########
be/src/vec/functions/function_timestamp.cpp:
##########
@@ -221,6 +298,48 @@
}
}
}
+ template <typename DateValueType, typename ReturnType>
+ static void execute_impl_right_const(const PaddedPODArray<Int32>& ldata,
Int32 rdata,
+ PaddedPODArray<ReturnType>& res,
NullMap& null_map) {
+ auto len = ldata.size();
+ res.resize(len);
+
+ const auto& r = rdata;
+ for (size_t i = 0; i < len; ++i) {
+ const auto& l = ldata[i];
+ if (r <= 0 || l < 0 || l > 9999) {
+ null_map[i] = 1;
+ continue;
+ }
+
+ auto& res_val = *reinterpret_cast<DateValueType*>(&res[i]);
+ if constexpr (std::is_same_v<DateValueType, VecDateTimeValue>) {
+ VecDateTimeValue ts_value = VecDateTimeValue();
+ ts_value.set_time(l, 1, 1, 0, 0, 0);
+
+ DateTimeVal ts_val;
+ ts_value.to_datetime_val(&ts_val);
Review Comment:
warning: no member named 'to_datetime_val' in
'doris::vectorized::VecDateTimeValue'; did you mean 'to_datetime_v2'?
[clang-diagnostic-error]
```suggestion
ts_value.to_datetime_v2(&ts_val);
```
**be/src/vec/runtime/vdatetime_value.h:572:** 'to_datetime_v2' declared here
```cpp
uint64_t to_datetime_v2() const {
^
```
##########
be/src/vec/functions/function_timestamp.cpp:
##########
@@ -221,6 +298,48 @@
}
}
}
+ template <typename DateValueType, typename ReturnType>
+ static void execute_impl_right_const(const PaddedPODArray<Int32>& ldata,
Int32 rdata,
+ PaddedPODArray<ReturnType>& res,
NullMap& null_map) {
+ auto len = ldata.size();
+ res.resize(len);
+
+ const auto& r = rdata;
+ for (size_t i = 0; i < len; ++i) {
+ const auto& l = ldata[i];
+ if (r <= 0 || l < 0 || l > 9999) {
+ null_map[i] = 1;
+ continue;
+ }
+
+ auto& res_val = *reinterpret_cast<DateValueType*>(&res[i]);
+ if constexpr (std::is_same_v<DateValueType, VecDateTimeValue>) {
+ VecDateTimeValue ts_value = VecDateTimeValue();
+ ts_value.set_time(l, 1, 1, 0, 0, 0);
+
+ DateTimeVal ts_val;
+ ts_value.to_datetime_val(&ts_val);
+ if (ts_val.is_null) {
+ null_map[i] = 1;
+ continue;
+ }
+
+ TimeInterval interval(DAY, r - 1, false);
+ res_val = VecDateTimeValue::from_datetime_val(ts_val);
Review Comment:
warning: no member named 'from_datetime_val' in
'doris::vectorized::VecDateTimeValue' [clang-diagnostic-error]
```cpp
res_val = VecDateTimeValue::from_datetime_val(ts_val);
^
```
--
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]