This is an automated email from the ASF dual-hosted git repository.

taiyangli pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-gluten.git


The following commit(s) were added to refs/heads/main by this push:
     new fcc51b9997 avoid unnecesssary const column materialization (#8789)
fcc51b9997 is described below

commit fcc51b999788d93b38fe1b9a3d06b3704c222794
Author: 李扬 <[email protected]>
AuthorDate: Fri Feb 21 10:34:24 2025 +0800

    avoid unnecesssary const column materialization (#8789)
---
 cpp-ch/local-engine/Functions/SparkFunctionNextDay.cpp | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/cpp-ch/local-engine/Functions/SparkFunctionNextDay.cpp 
b/cpp-ch/local-engine/Functions/SparkFunctionNextDay.cpp
index 7de50f6efb..b567859000 100644
--- a/cpp-ch/local-engine/Functions/SparkFunctionNextDay.cpp
+++ b/cpp-ch/local-engine/Functions/SparkFunctionNextDay.cpp
@@ -188,12 +188,8 @@ DB::ColumnPtr SparkFunctionNextDay::executeConst(const 
DB::ColumnsWithTypeAndNam
     auto nested_result_type = DB::removeNullable(result_type);
     auto next_week_day = 
getDayOfWeek((*arguments[1].column)[0].safeGet<String>());
     if (next_week_day == -1) [[unlikely]]
-    {
-        auto default_date_col = 
nested_result_type->createColumnConst(from_date_col->size(), 0);
-        auto null_map_col = 
DB::DataTypeUInt8().createColumnConst(from_date_col->size(), 
1)->convertToFullColumnIfConst();
-        return DB::ColumnNullable::create(default_date_col, null_map_col);
-    }
-   
+        return 
result_type->createColumnConstWithDefaultValue(from_date_col->size());
+
     auto to_date_col = result_type->createColumn();
     to_date_col->reserve(from_date_col->size());
     DB::WhichDataType ty_which(nested_result_type);


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to