Skip to content
This repository has been archived by the owner on Sep 18, 2023. It is now read-only.

[DNM] Enable wscg for aggregation #1068

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,8 @@ case class ColumnarCollapseCodegenStages(
if (containsSubquery(p.condition) || containsSubquery(p.projectList)) =>
false
case p: ColumnarCodegenSupport if p.supportColumnarCodegen =>
plan.children.map(existsJoins(_, count)).exists(_ == true)
if (count >= 1) true
else plan.children.map(existsJoins(_, count)).exists(_ == true)
case _ =>
false
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1343,7 +1343,9 @@ arrow::Status ExpressionCodegenVisitor::Visit(const gandiva::LiteralNode& node)
auto cur_func_id = *func_count_;
std::stringstream codes_ss;
if (node.return_type()->id() == arrow::Type::STRING) {
codes_ss << "\"" << gandiva::ToString(node.holder()) << "\"" << std::endl;
// The node holder can be number. So prefixing "_" will avoid compile issue in
// naming validity variable (generally by combining it with "_validity").
codes_ss << "_" << gandiva::ToString(node.holder());
} else if (node.return_type()->id() == arrow::Type::DECIMAL) {
auto scalar = arrow::util::get<gandiva::DecimalScalar128>(node.holder());
auto decimal = arrow::Decimal128(scalar.value());
Expand All @@ -1358,6 +1360,12 @@ arrow::Status ExpressionCodegenVisitor::Visit(const gandiva::LiteralNode& node)
check_str_ = node.is_null() ? "false" : "true";
real_codes_str_ = codes_str_;
real_validity_str_ = check_str_;
std::stringstream prepare_ss;
prepare_ss << " " << GetCTypeString(node.return_type()) << " " << codes_str_
<< ";" << std::endl;
prepare_ss << " bool " << GetValidityName(codes_str_)
<< " = " << check_str_ <<";" << std::endl;
prepare_str_ += prepare_ss.str();
field_type_ = literal;
return arrow::Status::OK();
}
Expand Down