Skip to content

Commit

Permalink
Move equality_comparable checks inline.
Browse files Browse the repository at this point in the history
  • Loading branch information
mythrocks committed Sep 17, 2021
1 parent f1f9893 commit 783a8be
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 36 deletions.
1 change: 0 additions & 1 deletion cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,6 @@ add_library(cudf
src/filling/repeat.cu
src/filling/sequence.cu
src/groupby/groupby.cu
src/groupby/common/utils.cpp
src/groupby/hash/groupby.cu
src/groupby/sort/aggregate.cpp
src/groupby/sort/group_argmax.cu
Expand Down
31 changes: 0 additions & 31 deletions cpp/src/groupby/common/utils.cpp

This file was deleted.

6 changes: 4 additions & 2 deletions cpp/src/groupby/groupby.cu
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@
#include <cudf/detail/nvtx/ranges.hpp>
#include <cudf/dictionary/dictionary_column_view.hpp>
#include <cudf/groupby.hpp>
#include <cudf/strings/string_view.hpp>
#include <cudf/table/table.hpp>
#include <cudf/table/table_view.hpp>
#include <cudf/types.hpp>
#include <cudf/utilities/error.hpp>
#include <cudf/utilities/traits.hpp>
#include <groupby/common/utils.hpp>
#include <structs/utilities.hpp>

#include <rmm/cuda_stream_view.hpp>
Expand Down Expand Up @@ -78,7 +78,9 @@ std::pair<std::unique_ptr<table>, std::vector<aggregation_result>> groupby::disp
// Optionally flatten nested key columns.
auto [flattened_keys, _, __, ___] =
flatten_nested_columns(_keys, {}, {}, column_nullability::FORCE);
cudf::groupby::detail::assert_keys_equality_comparable(flattened_keys);
auto is_supported_key_type = [](auto col) { return cudf::is_equality_comparable(col.type()); };
CUDF_EXPECTS(std::all_of(flattened_keys.begin(), flattened_keys.end(), is_supported_key_type),
"Unsupported groupby key type does not support equality comparison");
auto [grouped_keys, results] =
detail::hash::groupby(flattened_keys, requests, _include_null_keys, stream, mr);
return std::make_pair(unflatten_nested_columns(std::move(grouped_keys), _keys),
Expand Down
7 changes: 5 additions & 2 deletions cpp/src/groupby/sort/sort_helper.cu
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@
#include <cudf/detail/iterator.cuh>
#include <cudf/detail/scatter.hpp>
#include <cudf/detail/sorting.hpp>
#include <cudf/strings/string_view.hpp>
#include <cudf/table/row_operators.cuh>
#include <cudf/table/table_device_view.cuh>
#include <groupby/common/utils.hpp>
#include <cudf/utilities/traits.hpp>
#include <structs/utilities.hpp>

#include <rmm/cuda_stream_view.hpp>
Expand Down Expand Up @@ -103,7 +104,9 @@ sort_groupby_helper::sort_groupby_helper(table_view const& keys,

auto [flattened_keys, _, __, struct_null_vectors] =
flatten_nested_columns(keys, {}, {}, column_nullability::FORCE);
cudf::groupby::detail::assert_keys_equality_comparable(flattened_keys);
auto is_supported_key_type = [](auto col) { return cudf::is_equality_comparable(col.type()); };
CUDF_EXPECTS(std::all_of(flattened_keys.begin(), flattened_keys.end(), is_supported_key_type),
"Unsupported groupby key type does not support equality comparison");
_struct_null_vectors = std::move(struct_null_vectors);
_keys = flattened_keys;

Expand Down

0 comments on commit 783a8be

Please sign in to comment.