Skip to content

Commit

Permalink
Merge branch 'master' into lock_service
Browse files Browse the repository at this point in the history
  • Loading branch information
flowbehappy authored Feb 28, 2023
2 parents a11ad95 + b991f30 commit 994c65b
Show file tree
Hide file tree
Showing 13 changed files with 33 additions and 344 deletions.
16 changes: 5 additions & 11 deletions contrib/boost-cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,20 @@
# Important boost patch: 094c18b
#

set (LIBRARY_DIR ${TiFlash_SOURCE_DIR}/contrib/boost)
set(LIBRARY_DIR ${TiFlash_SOURCE_DIR}/contrib/boost)

if (NOT MSVC)
add_definitions(-Wno-unused-variable -Wno-deprecated-declarations)
endif ()

include(context.cmake)
include(fiber.cmake)

file(GLOB BOOST_INTERNAL_SRC
${LIBRARY_DIR}/libs/filesystem/src/*.cpp
${LIBRARY_DIR}/libs/program_options/src/*.cpp
${LIBRARY_DIR}/libs/serialization/src/*.cpp)
${LIBRARY_DIR}/libs/filesystem/src/*.cpp
${LIBRARY_DIR}/libs/program_options/src/*.cpp
${LIBRARY_DIR}/libs/serialization/src/*.cpp)

add_library(boost_internal STATIC ${BOOST_INTERNAL_SRC})

target_include_directories (boost_internal BEFORE PUBLIC ${Boost_INCLUDE_DIRS})
target_include_directories(boost_internal BEFORE PUBLIC ${Boost_INCLUDE_DIRS})

target_compile_definitions (boost_internal PUBLIC BOOST_SYSTEM_NO_DEPRECATED)

Expand All @@ -37,6 +34,3 @@ target_compile_definitions (boost_internal PUBLIC BOOST_BIND_GLOBAL_PLACEHOLDERS
target_no_warning(boost_internal unused-but-set-variable)
target_no_warning(boost_internal deprecated-builtins)
target_no_warning(boost_internal non-virtual-dtor)

target_link_libraries (boost_internal boost_fiber boost_context)

180 changes: 0 additions & 180 deletions contrib/boost-cmake/context.cmake

This file was deleted.

95 changes: 0 additions & 95 deletions contrib/boost-cmake/fiber.cmake

This file was deleted.

21 changes: 9 additions & 12 deletions dbms/src/Flash/Coprocessor/DAGExpressionAnalyzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -679,16 +679,16 @@ String DAGExpressionAnalyzer::applyFunction(

String DAGExpressionAnalyzer::buildFilterColumn(
const ExpressionActionsPtr & actions,
const std::vector<const tipb::Expr *> & conditions)
const google::protobuf::RepeatedPtrField<tipb::Expr> & conditions)
{
String filter_column_name;
if (conditions.size() == 1)
{
filter_column_name = getActions(*conditions[0], actions, true);
if (isColumnExpr(*conditions[0])
&& (!exprHasValidFieldType(*conditions[0])
filter_column_name = getActions(conditions[0], actions, true);
if (isColumnExpr(conditions[0])
&& (!exprHasValidFieldType(conditions[0])
/// if the column is not UInt8 type, we already add some convert function to convert it ot UInt8 type
|| isUInt8Type(getDataTypeByFieldTypeForComputingLayer(conditions[0]->field_type()))))
|| isUInt8Type(getDataTypeByFieldTypeForComputingLayer(conditions[0].field_type()))))
{
/// FilterBlockInputStream will CHANGE the filter column inplace, so
/// filter column should never be a columnRef in DAG request, otherwise
Expand All @@ -700,8 +700,8 @@ String DAGExpressionAnalyzer::buildFilterColumn(
else
{
Names arg_names;
for (const auto * condition : conditions)
arg_names.push_back(getActions(*condition, actions, true));
for (const auto & condition : conditions)
arg_names.push_back(getActions(condition, actions, true));
// connect all the conditions by logical and
filter_column_name = applyFunction("and", arg_names, actions, nullptr);
}
Expand All @@ -710,7 +710,7 @@ String DAGExpressionAnalyzer::buildFilterColumn(

String DAGExpressionAnalyzer::appendWhere(
ExpressionActionsChain & chain,
const std::vector<const tipb::Expr *> & conditions)
const google::protobuf::RepeatedPtrField<tipb::Expr> & conditions)
{
auto & last_step = initAndGetLastStep(chain);

Expand Down Expand Up @@ -1054,10 +1054,7 @@ bool DAGExpressionAnalyzer::appendJoinKeyAndJoinFilters(
if (!filters.empty())
{
ret = true;
std::vector<const tipb::Expr *> filter_vector;
for (const auto & c : filters)
filter_vector.push_back(&c);
filter_column_name = appendWhere(chain, filter_vector);
filter_column_name = appendWhere(chain, filters);
}
/// remove useless columns to avoid duplicate columns
/// as when compiling the key/filter expression, the origin
Expand Down
4 changes: 2 additions & 2 deletions dbms/src/Flash/Coprocessor/DAGExpressionAnalyzer.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class DAGExpressionAnalyzer : private boost::noncopyable

String appendWhere(
ExpressionActionsChain & chain,
const std::vector<const tipb::Expr *> & conditions);
const google::protobuf::RepeatedPtrField<tipb::Expr> & conditions);

GroupingSets buildExpandGroupingColumns(const tipb::Expand & expand, const ExpressionActionsPtr & actions);

Expand Down Expand Up @@ -175,7 +175,7 @@ class DAGExpressionAnalyzer : private boost::noncopyable

String buildFilterColumn(
const ExpressionActionsPtr & actions,
const std::vector<const tipb::Expr *> & conditions);
const google::protobuf::RepeatedPtrField<tipb::Expr> & conditions);

void buildAggFuncs(
const tipb::Aggregation & aggregation,
Expand Down
Loading

0 comments on commit 994c65b

Please sign in to comment.