Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GLUTEN-1632][CH]Daily Update Clickhouse Version (20231117) #3756

Merged
merged 2 commits into from
Nov 17, 2023
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
4 changes: 2 additions & 2 deletions cpp-ch/clickhouse.version
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
CH_ORG=Kyligence
CH_BRANCH=rebase_ch/20231114
CH_COMMIT=274cf420c07
CH_BRANCH=rebase_ch/20231117
CH_COMMIT=61782b56dc4
4 changes: 3 additions & 1 deletion cpp-ch/local-engine/Common/CHUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,9 @@ std::map<std::string, std::string> BackendInitializerUtil::getBackendConfMap(std
namespace pb_util = google::protobuf::util;
pb_util::JsonOptions options;
std::string json;
pb_util::MessageToJsonString(*plan_ptr, &json, options);
auto s = pb_util::MessageToJsonString(*plan_ptr, &json, options);
if (!s.ok())
throw Exception(ErrorCodes::LOGICAL_ERROR, "Can not convert Substrait Plan to Json");
LOG_DEBUG(&Poco::Logger::get("CHUtil"), "Update Config Map Plan:\n{}", json);
}

Expand Down
8 changes: 6 additions & 2 deletions cpp-ch/local-engine/Parser/SerializedPlanParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,9 @@ QueryPlanPtr SerializedPlanParser::parse(std::unique_ptr<substrait::Plan> plan)
namespace pb_util = google::protobuf::util;
pb_util::JsonOptions options;
std::string json;
pb_util::MessageToJsonString(*plan, &json, options);
auto s = pb_util::MessageToJsonString(*plan, &json, options);
if (!s.ok())
throw Exception(ErrorCodes::LOGICAL_ERROR, "Can not convert Substrait Plan to Json");
LOG_DEBUG(&Poco::Logger::get("SerializedPlanParser"), "substrait plan:\n{}", json);
}
parseExtensions(plan->extensions());
Expand Down Expand Up @@ -1849,7 +1851,9 @@ QueryPlanPtr SerializedPlanParser::parse(const std::string & plan)
QueryPlanPtr SerializedPlanParser::parseJson(const std::string & json_plan)
{
auto plan_ptr = std::make_unique<substrait::Plan>();
google::protobuf::util::JsonStringToMessage(google::protobuf::stringpiece_internal::StringPiece(json_plan.c_str()), plan_ptr.get());
auto s = google::protobuf::util::JsonStringToMessage(absl::string_view(json_plan.c_str()), plan_ptr.get());
if (!s.ok())
throw Exception(ErrorCodes::CANNOT_PARSE_PROTOBUF_SCHEMA, "Parse substrait::Plan from json string failed: {}", s.ToString());
return parse(std::move(plan_ptr));
}

Expand Down
23 changes: 16 additions & 7 deletions cpp-ch/local-engine/proto/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,27 @@ FOREACH(FIL ${protobuf_files})
LIST(APPEND SUBSTRAIT_HEADERS "${CMAKE_CURRENT_BINARY_DIR}/${FILE_NAME}.pb.h")
ENDFOREACH()

add_custom_target(
generate_substrait
COMMAND ${CMAKE_CURRENT_BINARY_DIR}/../../../contrib/google-protobuf-cmake/protoc -I${CMAKE_CURRENT_SOURCE_DIR} -I${ClickHouse_SOURCE_DIR}/contrib/google-protobuf/src --cpp_out=${CMAKE_CURRENT_BINARY_DIR}/ ${protobuf_files}
DEPENDS protoc
# Generate Substrait headers
add_custom_command(
OUTPUT ${SUBSTRAIT_SRCS} ${SUBSTRAIT_HEADERS}
COMMAND
$<TARGET_FILE:protoc> --cpp_out ${CMAKE_CURRENT_BINARY_DIR}
--proto_path ${CMAKE_CURRENT_SOURCE_DIR}
--proto_path ${ClickHouse_SOURCE_DIR}/contrib/google-protobuf/src
${protobuf_files}
DEPENDS ${protobuf_files}
COMMENT "Running cpp protocol buffer compiler"
VERBATIM )

VERBATIM)
add_custom_target(generate_substrait ALL DEPENDS ${SUBSTRAIT_SRCS} ${SUBSTRAIT_HEADERS})
set_source_files_properties(${SUBSTRAIT_SRCS} PROPERTIES GENERATED TRUE)

add_library(substrait ${SUBSTRAIT_SRCS})
add_dependencies(substrait generate_substrait)
target_compile_options(substrait PUBLIC -fPIC -Wno-reserved-identifier -Wno-deprecated)
target_compile_options(substrait PUBLIC -fPIC
-Wno-reserved-identifier
-Wno-deprecated
-Wno-extra-semi-stmt
-Wno-used-but-marked-unused)
target_include_directories(substrait SYSTEM BEFORE PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
target_link_libraries(substrait ch_contrib::protobuf)

Loading