Skip to content
Closed
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
2 changes: 1 addition & 1 deletion cpp/src/arrow/dataset/expression.cc
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ Result<Expression> FoldConstants(Expression expr) {
if (std::all_of(call->arguments.begin(), call->arguments.end(),
[](const Expression& argument) { return argument.literal(); })) {
// all arguments are literal; we can evaluate this subexpression *now*
static const Datum ignored_input;
static const Datum ignored_input = Datum{};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps we can give Datum a default constructor?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uh.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

precisely

ARROW_ASSIGN_OR_RAISE(Datum constant,
ExecuteScalarExpression(expr, ignored_input));

Expand Down
9 changes: 5 additions & 4 deletions cpp/src/arrow/util/future.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ struct is_future<Future<T>> : std::true_type {};
template <typename Signature>
using result_of_t = typename std::result_of<Signature>::type;

constexpr struct ContinueFuture {
struct ContinueFuture {
template <typename Return>
struct ForReturnImpl;

Expand Down Expand Up @@ -99,7 +99,7 @@ constexpr struct ContinueFuture {

signal_to_complete_next.AddCallback(MarkNextFinished{std::move(next)});
}
} Continue;
};

template <>
struct ContinueFuture::ForReturnImpl<void> {
Expand Down Expand Up @@ -438,13 +438,14 @@ class ARROW_MUST_USE_TYPE Future {

struct Callback {
void operator()(const Result<T>& result) && {
detail::ContinueFuture continue_future;
if (ARROW_PREDICT_TRUE(result.ok())) {
// move on_failure to a(n immediately destroyed) temporary to free its resources
ARROW_UNUSED(OnFailure(std::move(on_failure)));
detail::Continue(std::move(next), std::move(on_success), result.ValueOrDie());
continue_future(std::move(next), std::move(on_success), result.ValueOrDie());
} else {
ARROW_UNUSED(OnSuccess(std::move(on_success)));
detail::Continue(std::move(next), std::move(on_failure), result.status());
continue_future(std::move(next), std::move(on_failure), result.status());
}
}

Expand Down
4 changes: 2 additions & 2 deletions cpp/src/arrow/util/thread_pool.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ class ARROW_EXPORT Executor {
Result<FutureType> Submit(TaskHints hints, Function&& func, Args&&... args) {
auto future = FutureType::Make();

auto task = std::bind(::arrow::detail::Continue, future, std::forward<Function>(func),
std::forward<Args>(args)...);
auto task = std::bind(::arrow::detail::ContinueFuture{}, future,
std::forward<Function>(func), std::forward<Args>(args)...);
ARROW_RETURN_NOT_OK(SpawnReal(hints, std::move(task)));

return future;
Expand Down