zclllyybb commented on code in PR #59206:
URL: https://github.com/apache/doris/pull/59206#discussion_r2677791562
##########
be/src/vec/functions/function_other_types_to_date.cpp:
##########
@@ -532,22 +535,28 @@ struct DateTrunc {
auto* state = reinterpret_cast<DateTruncState*>(
context->get_function_state(FunctionContext::THREAD_LOCAL));
DCHECK(state != nullptr);
- state->callback_function(datetime_column, res, input_rows_count);
+ state->callback_function(datetime_column, res, input_rows_count,
state->timezone);
block.replace_by_position(result, std::move(res));
return Status::OK();
}
private:
template <TimeUnit Unit>
static void execute_impl_right_const(const ColumnPtr& datetime_column,
ColumnPtr& result_column,
- size_t input_rows_count) {
+ size_t input_rows_count, const
cctz::time_zone& timezone) {
auto& data = static_cast<const
ColumnType*>(datetime_column.get())->get_data();
auto& res =
static_cast<ColumnType*>(result_column->assume_mutable().get())->get_data();
for (size_t i = 0; i < input_rows_count; ++i) {
auto dt = binary_cast<NativeType, DateValueType>(data[i]);
+ if constexpr (PType == TYPE_TIMESTAMPTZ) {
+ dt.convert_utc_to_local(timezone);
Review Comment:
可能这种操作,把dt的值输出到一个datetimev2value更合理
--
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]