zclllyybb commented on code in PR #27343:
URL: https://github.com/apache/doris/pull/27343#discussion_r1401809411
##########
be/src/vec/functions/function_timestamp.cpp:
##########
@@ -804,39 +804,63 @@ class DateTimeToTimestamp : public IFunction {
size_t get_number_of_arguments() const override { return 1; }
DataTypePtr get_return_type_impl(const ColumnsWithTypeAndName& arguments)
const override {
- return make_nullable(std::make_shared<DataTypeInt64>());
+ if (arguments[0].type->is_nullable()) {
+ return make_nullable(std::make_shared<DataTypeInt64>());
+ }
+ return std::make_shared<DataTypeInt64>();
}
Status execute_impl(FunctionContext* context, Block& block, const
ColumnNumbers& arguments,
size_t result, size_t input_rows_count) const override
{
const auto& arg_col = block.get_by_position(arguments[0]).column;
- const auto& column_data = assert_cast<const ColumnUInt64&>(*arg_col);
- auto res_col = ColumnInt64::create();
- auto null_vector = ColumnVector<UInt8>::create();
- res_col->get_data().resize_fill(input_rows_count, 0);
- null_vector->get_data().resize_fill(input_rows_count, false);
- NullMap& null_map = null_vector->get_data();
- auto& res_data = res_col->get_data();
- const cctz::time_zone& time_zone = context->state()->timezone_obj();
- for (int i = 0; i < input_rows_count; i++) {
- if (arg_col->is_null_at(i)) {
- null_map[i] = true;
- continue;
+ if (arg_col->is_nullable()) {
Review Comment:
we have a framework to deal when all arguments are nullable. Is this
necessary?
--
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]