Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion be/src/vec/functions/function_datetime_floor_ceil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ class FunctionDateTimeFloorCeil : public IFunction {
}
}

if (block.get_by_position(arguments[0]).type->is_nullable()) {
if (block.get_by_position(result).type->is_nullable()) {
block.replace_by_position(
result,
ColumnNullable::create(std::move(col_to), std::move(result_null_map_column)));
Expand Down
2 changes: 1 addition & 1 deletion be/src/vec/functions/function_other_types_to_date.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ class FromDays : public IFunction {
}

// Wrap result in nullable column only if input has nullable arguments
if (block.get_by_position(arguments[0]).type->is_nullable()) {
if (block.get_by_position(result).type->is_nullable()) {
block.replace_by_position(result,
ColumnNullable::create(std::move(res_column),
std::move(result_null_map_column)));
Expand Down
6 changes: 6 additions & 0 deletions regression-test/suites/correctness_p0/test_time_round.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,12 @@ suite("test_time_round") {
testFoldConst("select minute_ceil('2025-09-10 12:34:56.45', 5)")
testFoldConst("select minute_ceil('2025-09-10 12:34:56.12345', '2025-09-10 12:30:00.678')")
testFoldConst("select minute_ceil('2025-09-10 12:34:56.9', 10, '2025-09-10 12:30:00.234567')")
testFoldConst("""select minute_ceil(CAST('2021-12-31 12:23:34' AS DATETIMEV2(0)),
nullable(CAST('2021-12-31 12:23:34' AS DATETIMEV2(0))));""")
testFoldConst("""select minute_ceil(nullable(CAST('2021-12-31 12:23:34' AS DATETIMEV2(0))),
CAST('2021-12-31 12:23:34' AS DATETIMEV2(0)));""")
testFoldConst("""select minute_ceil(nullable(CAST('2021-12-31 12:23:34' AS DATETIMEV2(0))),
nullable(CAST('2021-12-31 12:23:34' AS DATETIMEV2(0))));""")

testFoldConst("select minute_floor('2025-09-10 12:34:56')")
testFoldConst("select minute_floor('2025-09-10 12:34:56', 5)")
Expand Down
Loading