lwz9103 commented on code in PR #8076:
URL: https://github.com/apache/incubator-gluten/pull/8076#discussion_r1861795680
##########
cpp-ch/local-engine/Parser/SerializedPlanParser.cpp:
##########
@@ -160,20 +160,31 @@ void SerializedPlanParser::adjustOutput(const
DB::QueryPlanPtr & query_plan, con
else
{
need_final_project = true;
-
bool need_const = origin_column.column &&
isColumnConst(*origin_column.column);
- ColumnWithTypeAndName final_column(
- need_const ? final_type->createColumnConst(0,
assert_cast<const ColumnConst &>(*origin_column.column).getField())
- : final_type->createColumn(),
- final_type,
- origin_column.name);
- final_columns.emplace_back(std::move(final_column));
+ if (need_const)
+ {
+ const DB::ContextPtr context =
DB::CurrentThread::get().getQueryContext();
+ const FunctionOverloadResolverPtr & cast_resolver =
FunctionFactory::instance().get("CAST", context);
+ const DataTypePtr string_type =
DB::DataTypeFactory::instance().get("String");
Review Comment:
thanks, it's more concise and clear
--
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]