Table Classes#
- group Table
Functions
-
bool tables_equal(table_view const &left, table_view const &right, null_equality nulls_equal = null_equality::EQUAL, rmm::cuda_stream_view stream = cudf::get_default_stream())#
Check if two tables are equal.
Returns true if the input tables have the same number of rows, the same number of columns, matching column types, and every row in
leftcompares equal to the row at the same index inright. Null equality is controlled bynulls_equal. Floating point NaN values compare equal.- Throws:
cudf::logic_error – if the tables contain
EMPTYtypes.- Parameters:
left – The first table to compare
right – The second table to compare
nulls_equal – Flag to denote if null elements should be considered equal
stream – CUDA stream used for device memory operations and kernel launches
- Returns:
true if the tables are equal, false otherwise
-
class table#
- #include <table.hpp>
A set of cudf::column’s of the same size.
Public Functions
-
explicit table(table const &other, rmm::cuda_stream_view stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref())#
Construct a new table by copying the contents of another table.
Uses the specified
streamand device memory resource for all allocations and copies.- Parameters:
other – The table to copy
stream – CUDA stream used for device memory operations.
mr – Device memory resource to use for all device memory allocations
-
table(std::vector<std::unique_ptr<column>> &&columns)#
Moves the contents from a vector of
unique_ptrs to columns to construct a new table.- Parameters:
columns – The vector of
unique_ptrs to columns whose contents will be moved into the new table.
-
table(table_view view, rmm::cuda_stream_view stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref())#
Copy the contents of a
table_viewto construct a newtable.- Parameters:
view – The view whose contents will be copied to create a new
tablestream – CUDA stream used for device memory operations.
mr – Device memory resource used for allocating the device memory for the new columns
-
inline size_type num_columns() const noexcept#
Returns the number of columns in the table.
- Returns:
The number of columns in the table
-
std::size_t alloc_size() const#
Returns the total device allocation size of the table’s columns in bytes.
See also
- Returns:
The total allocation size in bytes
-
table_view view() const#
Returns an immutable, non-owning
table_viewof the contents of thistable.- Returns:
An immutable, non-owning
table_viewof the contents of thistable
-
inline operator table_view() const#
Conversion operator to an immutable, non-owning
table_viewof the contents of thistable.
-
mutable_table_view mutable_view()#
Returns a mutable, non-owning
mutable_table_viewof the contents of thistable.- Returns:
A mutable, non-owning
mutable_table_viewof the contents of thistable
-
inline operator mutable_table_view()#
Conversion operator to a mutable, non-owning
mutable_table_viewof the contents of thistable.
-
std::vector<std::unique_ptr<column>> release()#
Releases ownership of the
columns by returning a vector ofunique_ptrs to the constituent columns.After
release(),num_columns() == 0andnum_rows() == 0- Returns:
A vector of
unique_ptrs to the constituent columns
-
template<typename InputIterator>
inline table_view select(InputIterator begin, InputIterator end) const# Returns a table_view built from a range of column indices.
- Throws:
std::out_of_range – If any index is outside [0, num_columns())
- Parameters:
begin – Beginning of the range
end – Ending of the range
- Returns:
A table_view consisting of columns from the original table specified by the elements of
column_indices
-
inline table_view select(std::vector<cudf::size_type> const &column_indices) const#
Returns a table_view with set of specified columns.
- Throws:
std::out_of_range – If any element in
column_indicesis outside [0, num_columns())- Parameters:
column_indices – Indices of columns in the table
- Returns:
A table_view consisting of columns from the original table specified by the elements of
column_indices
-
explicit table(table const &other, rmm::cuda_stream_view stream = cudf::get_default_stream(), rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref())#
-
class table_view : public cudf::detail::table_view_base<column_view>#
- #include <table_view.hpp>
A set of cudf::column_view’s of the same size.
All public member functions and constructors are inherited from
table_view_base<column_view>.Public Types
-
using ColumnView = column_view#
The type of column view the table contains.
Public Functions
-
table_view(std::vector<table_view> const &views)#
Construct a table from a vector of table views.
Note
Because a
std::vectoris constructible from astd::initializer_list, this constructor also supports the following usage:table_view t0, t1, t2; ... table_view t{{t0,t1,t2}}; // Creates a `table` from the columns of t0, t1, t2- Throws:
cudf::logic_error – If number of rows mismatch
- Parameters:
views – The vector of table views to construct the table from
-
template<typename InputIterator>
inline table_view select(InputIterator begin, InputIterator end) const# Returns a table_view built from a range of column indices.
- Throws:
std::out_of_range – If any index is outside [0, num_columns())
- Parameters:
begin – Beginning of the range
end – Ending of the range
- Returns:
A table_view consisting of columns from the original table specified by the elements of
column_indices
-
table_view select(std::vector<size_type> const &column_indices) const#
Returns a table_view with set of specified columns.
- Throws:
std::out_of_range – If any element in
column_indicesis outside [0, num_columns())- Parameters:
column_indices – Indices of columns in the table
- Returns:
A table_view consisting of columns from the original table specified by the elements of
column_indices
-
using ColumnView = column_view#
-
class mutable_table_view : public cudf::detail::table_view_base<mutable_column_view>#
- #include <table_view.hpp>
A set of
mutable_column_views of the same size.All public member functions and constructors are inherited from
table_view_base<mutable_column_view>.Public Types
-
using ColumnView = mutable_column_view#
The type of column views in the table.
Public Functions
-
inline mutable_column_view &column(size_type column_index) const#
Returns column at specified index.
- Parameters:
column_index – The index of the desired column
- Returns:
A mutable column view reference to the desired column
-
operator table_view()#
Creates an immutable
table_viewof the columns.
-
mutable_table_view(std::vector<mutable_table_view> const &views)#
Construct a table from a vector of table views.
Note
Because a
std::vectoris constructible from astd::initializer_list, this constructor also supports the following usage:table_view t0, t1, t2; ... table_view t{{t0,t1,t2}}; // Creates a `table` from the columns of t0, t1, t2- Throws:
cudf::logic_error – If number of rows mismatch
- Parameters:
views – The vector of table views to construct the table from
-
using ColumnView = mutable_column_view#
-
bool tables_equal(table_view const &left, table_view const &right, null_equality nulls_equal = null_equality::EQUAL, rmm::cuda_stream_view stream = cudf::get_default_stream())#