Table Classes#
- group table_classes
-
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::mr::device_memory_resource *mr = rmm::mr::get_current_device_resource())#
Construct a new table by copying the contents of another table.
Uses the specified
stream
and 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_ptr
s to columns to construct a new table.- Parameters:
columns – The vector of
unique_ptr
s 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::mr::device_memory_resource *mr = rmm::mr::get_current_device_resource())#
Copy the contents of a
table_view
to construct a newtable
.- Parameters:
view – The view whose contents will be copied to create a new
table
stream – 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
-
table_view view() const#
Returns an immutable, non-owning
table_view
of the contents of thistable
.- Returns:
An immutable, non-owning
table_view
of the contents of thistable
-
inline operator table_view() const#
Conversion operator to an immutable, non-owning
table_view
of the contents of thistable
.
-
mutable_table_view mutable_view()#
Returns a mutable, non-owning
mutable_table_view
of the contents of thistable
.- Returns:
A mutable, non-owning
mutable_table_view
of the contents of thistable
-
inline operator mutable_table_view()#
Conversion operator to a mutable, non-owning
mutable_table_view
of the contents of thistable
.
-
std::vector<std::unique_ptr<column>> release()#
Releases ownership of the
column
s by returning a vector ofunique_ptr
s to the constituent columns.After
release()
,num_columns() == 0
andnum_rows() == 0
- Returns:
A vector of
unique_ptr
s 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_indices
is 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::mr::device_memory_resource *mr = rmm::mr::get_current_device_resource())#
-
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::vector
is 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_indices
is 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_view
s 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_view
of 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::vector
is 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#
-
class table#