Skip to content

Commit

Permalink
clean
Browse files Browse the repository at this point in the history
  • Loading branch information
andyfengHKU committed Jun 14, 2023
1 parent d81215e commit 92e1a6f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
3 changes: 1 addition & 2 deletions src/binder/bind_expression/bind_function_expression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ std::shared_ptr<Expression> ExpressionBinder::bindScalarFunctionExpression(
ScalarFunctionExpression::getUniqueName(function->name, childrenAfterCast);
auto result = make_shared<ScalarFunctionExpression>(functionName, FUNCTION, std::move(bindData),
std::move(childrenAfterCast), function->execFunc, function->selectFunc,
uniqueExpressionName);
result->compileFunc = function->compileFunc;
function->compileFunc, uniqueExpressionName);
return result;
}

Expand Down
10 changes: 4 additions & 6 deletions src/function/vector_map_operation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,8 @@ std::unique_ptr<FunctionBindData> MapExtractVectorOperations::bindFunc(
}

vector_operation_definitions MapKeysVectorOperations::getDefinitions() {
auto execFunc =
VectorListOperations::UnaryExecListStructFunction<common::list_entry_t,
common::list_entry_t, operation::MapKeys>;
auto execFunc = VectorListOperations::UnaryExecListStructFunction<common::list_entry_t,
common::list_entry_t, operation::MapKeys>;
vector_operation_definitions definitions;
definitions.push_back(make_unique<VectorOperationDefinition>(common::MAP_KEYS_FUNC_NAME,
std::vector<common::LogicalTypeID>{common::LogicalTypeID::MAP},
Expand All @@ -86,9 +85,8 @@ std::unique_ptr<FunctionBindData> MapKeysVectorOperations::bindFunc(
}

vector_operation_definitions MapValuesVectorOperations::getDefinitions() {
auto execFunc =
VectorListOperations::UnaryExecListStructFunction<common::list_entry_t,
common::list_entry_t, operation::MapValues>;
auto execFunc = VectorListOperations::UnaryExecListStructFunction<common::list_entry_t,
common::list_entry_t, operation::MapValues>;
vector_operation_definitions definitions;
definitions.push_back(make_unique<VectorOperationDefinition>(common::MAP_VALUES_FUNC_NAME,
std::vector<common::LogicalTypeID>{common::LogicalTypeID::MAP},
Expand Down
13 changes: 11 additions & 2 deletions src/include/binder/expression/function_expression.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,27 @@ class ScalarFunctionExpression : public FunctionExpression {
std::unique_ptr<function::FunctionBindData> bindData, expression_vector children,
function::scalar_exec_func execFunc, function::scalar_select_func selectFunc,
const std::string& uniqueName)
: ScalarFunctionExpression{std::move(functionName), expressionType, std::move(bindData),
std::move(children), std::move(execFunc), std::move(selectFunc), nullptr,
uniqueName} {}

ScalarFunctionExpression(std::string functionName, common::ExpressionType expressionType,
std::unique_ptr<function::FunctionBindData> bindData, expression_vector children,
function::scalar_exec_func execFunc, function::scalar_select_func selectFunc,
function::scalar_compile_func compileFunc, const std::string& uniqueName)
: FunctionExpression{std::move(functionName), expressionType, std::move(bindData),
std::move(children), uniqueName},
compileFunc{nullptr}, execFunc{std::move(execFunc)}, selectFunc{std::move(selectFunc)} {}
execFunc{std::move(execFunc)}, selectFunc{std::move(selectFunc)}, compileFunc{std::move(
compileFunc)} {}

static std::string getUniqueName(const std::string& functionName, expression_vector& children);

std::string toString() const override;

public:
function::scalar_compile_func compileFunc;
function::scalar_exec_func execFunc;
function::scalar_select_func selectFunc;
function::scalar_compile_func compileFunc;
};

class AggregateFunctionExpression : public FunctionExpression {
Expand Down

0 comments on commit 92e1a6f

Please sign in to comment.