Skip to content

Commit

Permalink
[GLUTEN-8074][CH] Fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
lwz9103 committed Nov 28, 2024
1 parent f7f385e commit df7223c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ class GlutenClickHouseDecimalSuite
test("GLUTEN-8074 Fix adjust output constant column") {
val sql =
s"""
|select bround(1002.5786, -3),
|select bround(1002.5786, 3),
| bround(-10.8, 0),
| bround(13.888888888889, 5)
|from $decimalTable
Expand Down
6 changes: 2 additions & 4 deletions cpp-ch/local-engine/Parser/SerializedPlanParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,10 @@ void SerializedPlanParser::adjustOutput(const DB::QueryPlanPtr & query_plan, con
{
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");
const DataTypePtr string_type = std::make_shared<DataTypeString>();
ColumnWithTypeAndName to_type_column = {string_type->createColumnConst(1, final_type->getName()), string_type, "__cast_const__"};
FunctionBasePtr cast_function = cast_resolver->build({origin_column, to_type_column});
ColumnPtr cast_col = cast_function->execute({origin_column, to_type_column}, final_type, 1);
Field cast_field;
cast_col->get(0, cast_field);
Field cast_field = ColumnConst::create(cast_function->execute({origin_column, to_type_column}, final_type, 1), 1)->getField();
ColumnWithTypeAndName final_column(final_type->createColumnConst(0, cast_field), final_type, origin_column.name);
final_columns.emplace_back(std::move(final_column));
}
Expand Down

0 comments on commit df7223c

Please sign in to comment.