From 555734dee7a8fb10f50c8609a8e4fb2c025e6305 Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Tue, 20 Aug 2024 09:32:59 -0500 Subject: [PATCH] Remove thrust::optional from expression evaluator (#16604) This PR follows up on a request from @davidwendt in https://github.com/rapidsai/cudf/pull/15091#discussion_r1722183142. Authors: - Bradley Dice (https://github.com/bdice) Approvers: - Vyas Ramasubramani (https://github.com/vyasr) - David Wendt (https://github.com/davidwendt) URL: https://github.com/rapidsai/cudf/pull/16604 --- cpp/include/cudf/ast/detail/expression_evaluator.cuh | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/cpp/include/cudf/ast/detail/expression_evaluator.cuh b/cpp/include/cudf/ast/detail/expression_evaluator.cuh index 105d87ff96f..9d8762555d7 100644 --- a/cpp/include/cudf/ast/detail/expression_evaluator.cuh +++ b/cpp/include/cudf/ast/detail/expression_evaluator.cuh @@ -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. @@ -29,8 +29,6 @@ #include -#include - namespace cudf { namespace ast { @@ -278,7 +276,7 @@ struct expression_evaluator { detail::device_data_reference const& input_reference, IntermediateDataType* thread_intermediate_storage, cudf::size_type left_row_index, - thrust::optional 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 @@ -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(row_index)) @@ -329,7 +327,7 @@ struct expression_evaluator { detail::device_data_reference const& device_data_reference, IntermediateDataType* thread_intermediate_storage, cudf::size_type left_row_index, - thrust::optional right_row_index = {}) const + cudf::size_type right_row_index = {}) const { CUDF_UNREACHABLE("Unsupported type in resolve_input."); }