Skip to content

Commit

Permalink
Remove thrust::optional from expression evaluator (#16604)
Browse files Browse the repository at this point in the history
This PR follows up on a request from @davidwendt in #15091 (comment).

Authors:
  - Bradley Dice (https://github.com/bdice)

Approvers:
  - Vyas Ramasubramani (https://github.com/vyasr)
  - David Wendt (https://github.com/davidwendt)

URL: #16604
  • Loading branch information
bdice authored Aug 20, 2024
1 parent 1cccf3e commit 555734d
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions cpp/include/cudf/ast/detail/expression_evaluator.cuh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021-2023, NVIDIA CORPORATION.
* Copyright (c) 2021-2024, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -29,8 +29,6 @@

#include <rmm/cuda_stream_view.hpp>

#include <thrust/optional.h>

namespace cudf {

namespace ast {
Expand Down Expand Up @@ -278,7 +276,7 @@ struct expression_evaluator {
detail::device_data_reference const& input_reference,
IntermediateDataType<has_nulls>* thread_intermediate_storage,
cudf::size_type left_row_index,
thrust::optional<cudf::size_type> right_row_index = {}) const
cudf::size_type right_row_index = {}) const
{
// TODO: Everywhere in the code assumes that the table reference is either
// left or right. Should we error-check somewhere to prevent
Expand All @@ -291,7 +289,7 @@ struct expression_evaluator {
// any case where input_reference.table_source == table_reference::RIGHT.
// Otherwise, behavior is undefined.
auto const row_index =
(input_reference.table_source == table_reference::LEFT) ? left_row_index : *right_row_index;
(input_reference.table_source == table_reference::LEFT) ? left_row_index : right_row_index;
if constexpr (has_nulls) {
return table.column(input_reference.data_index).is_valid(row_index)
? ReturnType(table.column(input_reference.data_index).element<Element>(row_index))
Expand Down Expand Up @@ -329,7 +327,7 @@ struct expression_evaluator {
detail::device_data_reference const& device_data_reference,
IntermediateDataType<has_nulls>* thread_intermediate_storage,
cudf::size_type left_row_index,
thrust::optional<cudf::size_type> right_row_index = {}) const
cudf::size_type right_row_index = {}) const
{
CUDF_UNREACHABLE("Unsupported type in resolve_input.");
}
Expand Down

0 comments on commit 555734d

Please sign in to comment.