TableHandleManager and TableHandle

TableHandleManager is one of two ways to get TableHandle resources in the system.

TableHandleManager is used to access existing tables in the system (e.g. via fetchTable) or create new tables (e.g. via emptyTable or timeTable). It is also that place that (in a future version) you can set attributes that affect a related group of tables, such as whether they are resolved synchronously or asynchronously.

On the other hand, the methods on TableHandle are used to create tables derived from other tables. Some examples are where and sort).

These are used to create tables derived from other tables. A typical pattern might be

TableHandle t1 = ...;
TableHandle t2 = t1.where(...).sort(...).tail(5);
class deephaven::client::highlevel::TableHandleManager

This class is the main way to get access to new TableHandle objects, via methods like emptyTable() and fetchTable(). A TableHandleManager is created by Client::getManager(). You can have more than one TableHandleManager for a given client. The reason you’d want more than one is that (in the future) you will be able to set parameters here that will apply to all TableHandles created by this class, such as flags that control asynchronous behavior. This class is move-only.

Public Functions

explicit TableHandleManager(std::shared_ptr<impl::TableHandleManagerImpl> impl)

Constructor. Used internally.

TableHandleManager(TableHandleManager &&other) noexcept

Move constructor

TableHandleManager &operator=(TableHandleManager &&other) noexcept

Move assigment operator.

~TableHandleManager()

Destructor

TableHandle emptyTable(int64_t size) const

Creates a “zero-width” table on the server. Such a table knows its number of rows but has no columns.

Parameters

size – Number of rows in the empty table.

TableHandle fetchTable(std::string tableName) const

Looks up an existing table by name.

Parameters

tableName – The name of the table.

TableHandle timeTable(int64_t startTimeNanos, int64_t periodNanos) const

Creates a ticking table.

Parameters
  • startTimeNanos – When the table should start ticking (in units of nanoseconds since the epoch).

  • periodNanos – Table ticking frequency (in nanoseconds).

Returns

The TableHandle of the new table.

TableHandle timeTable(std::chrono::system_clock::time_point startTime, std::chrono::system_clock::duration period) const

Creates a ticking table. This is an overload of timeTable(int64_t, int64_t) const that takes different parameter types.

Parameters
  • startTime – When the table should start ticking.

  • periodNanos – Table ticking frequency.

Returns

The TableHandle of the new table.

std::tuple<TableHandle, arrow::flight::FlightDescriptor> newTableHandleAndFlightDescriptor() const

Allocate a fresh TableHandle and return both it and its corresponding Arrow FlightDescriptor. This is used when the caller wants to do an Arrow DoPut operation.

Returns

A TableHandle and Arrow FlightDescriptor referring to the new table.

FlightWrapper createFlightWrapper() const

Creates a FlightWrapper that is used for Arrow Flight integration. Arrow Flight is the primary way to push data into or pull data out of the system.

Returns

A FlightWrapper object.

class deephaven::client::highlevel::TableHandle

Holds an reference to a server resource representing a table. TableHandle objects have shared ownership semantics so they can be copied freely. When the last TableHandle pointing to a server resource is destructed, the resource will be released.

Public Functions

explicit TableHandle(std::shared_ptr<impl::TableHandleImpl> impl)

Constructor. Used internally.

TableHandle(const TableHandle &other)

Copy constructor.

TableHandle &operator=(const TableHandle &other)

Copy assignment.

TableHandle(TableHandle &&other) noexcept

Move constructor.

TableHandle &operator=(TableHandle &&other) noexcept

Move assignment.

~TableHandle()

Destructor

TableHandleManager getManager() const

Get the TableHandlerManager that is managing this TableHandle.

Returns

the TableHandleManager.

template<typename ...Args>
TableHandle select(Args&&... args) const

A variadic form of select(std::vector<std::string>) const that takes a combination of argument types.

Template Parameters

Args – Any combination of std::string, std::string_view, const char *, or SelectColumn.

Parameters

args – The arguments to select

Returns

A TableHandle referencing the new table

TableHandle select(std::vector<std::string> columnSpecs) const

Select columnSpecs from a table. The columnSpecs can be column names or formulas like “NewCol = A + 12”. See the Deephaven documentation for the difference between “select” and “view”.

Parameters

columnSpecs – The columnSpecs

Returns

A TableHandle referencing the new table

template<typename ...Args>
TableHandle view(Args&&... args) const

A variadic form of view(std::vector<std::string>) const that takes a combination of argument types.

Template Parameters

Args – Any combination of std::string, std::string_view, const char *, or SelectColumn.

Parameters

args – The arguments to view

Returns

A TableHandle referencing the new table

TableHandle view(std::vector<std::string> columnSpecs) const

View columnSpecs from a table. The columnSpecs can be column names or formulas like “NewCol = A + 12”. See the Deephaven documentation for the difference between select() and view().

Parameters

columnSpecs – The columnSpecs to view

Returns

A TableHandle referencing the new table

template<typename ...Args>
TableHandle dropColumns(Args&&... args) const

A variadic form of dropColumns(std::vector<std::string>) const that takes a combination of argument types.

Template Parameters

Args – Any combination of std::string, std::string_view, const char *, or SelectColumn.

Parameters

args – The columns to drop

Returns

A TableHandle referencing the new table

TableHandle dropColumns(std::vector<std::string> columnSpecs) const

Creates a new table from this table where the specified columns have been excluded.

Parameters

columnSpecs – The columns to exclude.

Returns

template<typename ...Args>
TableHandle update(Args&&... args) const

A variadic form of update(std::vector<std::string>) const that takes a combination of argument types.

Template Parameters

Args – Any combination of std::string, std::string_view, const char *, or SelectColumn.

Parameters

args – The columns to update

Returns

A TableHandle referencing the new table

TableHandle update(std::vector<std::string> columnSpecs) const

Creates a new table from this table, but including the additional specified columns.

Parameters

columnSpecs – The columnSpecs to add. For exampe, {“X = A + 5”, “Y = X * 2”}. See the Deephaven documentation for the difference between update() and updateView().

Returns

A TableHandle referencing the new table

template<typename ...Args>
TableHandle updateView(Args&&... args) const

A variadic form of updateView(std::vector<std::string>) const that takes a combination of argument types.

Template Parameters

Args – Any combination of std::string, std::string_view, const char *, or SelectColumn.

Parameters

args – The columns to updateView

Returns

A TableHandle referencing the new table

TableHandle updateView(std::vector<std::string> columnSpecs) const

Creates a new view from this table, but including the additional specified columns.

Parameters

columnSpecs – The columnSpecs to add. For exampe, {“X = A + 5”, “Y = X * 2”}. See the Deephaven documentation for the difference between update() and updateView().

Returns

A TableHandle referencing the new table

TableHandle where(const BooleanExpression &condition) const

A structured form of where(std::string) const, but which takes the Fluent syntax.

Parameters

condition – A Deephaven fluent BooleanExpression such as Price > 100 or Col3 == Col1 * Col2

Returns

A TableHandle referencing the new table

TableHandle where(std::string condition) const

Creates a new table from this table, filtered by condition. Consult the Deephaven documentation for more information about valid conditions.

Parameters

condition – A Deephaven boolean expression such as “Price > 100” or “Col3 == Col1 * Col2”.

Returns

A TableHandle referencing the new table

TableHandle sort(std::vector<SortPair> sortPairs) const

Creates a new table from this table, sorted by sortPairs.

Parameters

sortPairs – A vector of SortPair objects describing the sort. Each SortPair refers to a column, a sort direction, and whether the sort should consider to the value’s regular or absolute value when doing comparisons.

Returns

A TableHandle referencing the new table

template<typename ...Args>
TableHandle by(Args&&... args) const

A variadic form of by(std::vector<std::string>) const that takes a combination of argument types.

Template Parameters

Args – Any combination of std::string, std::string_view, const char *, or SelectColumn.

Parameters

args – The columns to group by

Returns

A TableHandle referencing the new table

TableHandle by(std::vector<std::string> columnSpecs) const

Creates a new table from this table, grouped by columnSpecs with the column content grouped into arrays.

Parameters

columnSpecs – Columns to group by.

Returns

A TableHandle referencing the new table

template<typename ...Args>
TableHandle minBy(Args&&... args) const

A variadic form of minBy(std::vector<std::string>) const that takes a combination of argument types.

Template Parameters

Args – Any combination of std::string, std::string_view, const char *, or SelectColumn.

Parameters

args – The columns to group by

Returns

A TableHandle referencing the new table

TableHandle minBy(std::vector<std::string> columnSpecs) const

Creates a new table from this table, grouped by columnSpecs, with the “min” aggregate operation applied to the remaining columns.

Parameters

columnSpecs – Columns to group by.

Returns

A TableHandle referencing the new table

template<typename ...Args>
TableHandle maxBy(Args&&... args) const

A variadic form of maxBy(std::vector<std::string>) const that takes a combination of argument types.

Template Parameters

Args – Any combination of std::string, std::string_view, const char *, or SelectColumn.

Parameters

args – The columns to group by

Returns

A TableHandle referencing the new table

TableHandle maxBy(std::vector<std::string> columnSpecs) const

Creates a new table from this table, grouped by columnSpecs, with the “max” aggregate operation applied to the remaining columns.

Parameters

columnSpecs – Columns to group by.

Returns

A TableHandle referencing the new table

template<typename ...Args>
TableHandle sumBy(Args&&... args) const

A variadic form of sumBy(std::vector<std::string>) const that takes a combination of argument types.

Template Parameters

Args – Any combination of std::string, std::string_view, const char *, or SelectColumn.

Parameters

args – The columns to group by

Returns

A TableHandle referencing the new table

TableHandle sumBy(std::vector<std::string> columnSpecs) const

Creates a new table from this table, grouped by columnSpecs, with the “sum” aggregate operation applied to the remaining columns.

Parameters

columnSpecs – Columns to group by.

Returns

A TableHandle referencing the new table

template<typename ...Args>
TableHandle absSumBy(Args&&... args) const

A variadic form of absSumBy(std::vector<std::string>) const that takes a combination of argument types.

Template Parameters

Args – Any combination of std::string, std::string_view, const char *, or SelectColumn.

Parameters

args – The columns to group by

Returns

A TableHandle referencing the new table

TableHandle absSumBy(std::vector<std::string> columnSpecs) const

Creates a new table from this table, grouped by columnSpecs, with the “absSum” aggregate operation applied to the remaining columns.

Parameters

columnSpecs – Columns to group by.

Returns

A TableHandle referencing the new table

template<typename ...Args>
TableHandle varBy(Args&&... args) const

A variadic form of varBy(std::vector<std::string>) const that takes a combination of argument types.

Template Parameters

Args – Any combination of std::string, std::string_view, const char *, or SelectColumn.

Parameters

columnSpecs – Columns to group by.

Returns

A TableHandle referencing the new table

TableHandle varBy(std::vector<std::string> columnSpecs) const

Creates a new table from this table, grouped by columnSpecs, with the “var” aggregate operation applied to the remaining columns.

Parameters

columnSpecs – Columns to group by.

Returns

A TableHandle referencing the new table

template<typename ...Args>
TableHandle stdBy(Args&&... args) const

A variadic form of stdBy(std::vector<std::string>) const that takes a combination of argument types.

Template Parameters

Args – Any combination of std::string, std::string_view, const char *, or SelectColumn.

Parameters

columnSpecs – Columns to group by.

Returns

A TableHandle referencing the new table

TableHandle stdBy(std::vector<std::string> columnSpecs) const

Creates a new table from this table, grouped by columnSpecs, with the “std” aggregate operation applied to the remaining columns.

Parameters

columnSpecs – Columns to group by.

Returns

A TableHandle referencing the new table

template<typename ...Args>
TableHandle avgBy(Args&&... args) const

A variadic form of avgBy(std::vector<std::string>) const that takes a combination of argument types.

Template Parameters

Args – Any combination of std::string, std::string_view, const char *, or SelectColumn.

Parameters

columnSpecs – Columns to group by.

Returns

A TableHandle referencing the new table

TableHandle avgBy(std::vector<std::string> columnSpecs) const

Creates a new table from this table, grouped by columnSpecs, with the “avg” aggregate operation applied to the remaining columns.

Parameters

columnSpecs – Columns to group by.

Returns

A TableHandle referencing the new table

template<typename ...Args>
TableHandle firstBy(Args&&... args) const

A variadic form of firstBy(std::vector<std::string>) const that takes a combination of argument types.

Template Parameters

Args – Any combination of std::string, std::string_view, const char *, or SelectColumn.

Parameters

columnSpecs – Columns to group by.

Returns

A TableHandle referencing the new table

TableHandle firstBy(std::vector<std::string> columnSpecs) const

Creates a new table from this table, grouped by columnSpecs, with the “first” aggregate operation applied to the remaining columns.

Parameters

columnSpecs – Columns to group by.

Returns

A TableHandle referencing the new table

template<typename ...Args>
TableHandle lastBy(Args&&... args) const

A variadic form of lastBy(std::vector<std::string>) const that takes a combination of argument types.

Template Parameters

Args – Any combination of std::string, std::string_view, const char *, or SelectColumn.

Parameters

columnSpecs – Columns to group by.

Returns

A TableHandle referencing the new table

TableHandle lastBy(std::vector<std::string> columnSpecs) const

Creates a new table from this table, grouped by columnSpecs, with the “last” aggregate operation applied to the remaining columns.

Parameters

columnSpecs – Columns to group by.

Returns

A TableHandle referencing the new table

template<typename ...Args>
TableHandle medianBy(Args&&... args) const

A variadic form of medianBy(std::vector<std::string>) const that takes a combination of argument types.

Template Parameters

Args – Any combination of std::string, std::string_view, const char *, or SelectColumn.

Parameters

columnSpecs – Columns to group by.

Returns

A TableHandle referencing the new table

TableHandle medianBy(std::vector<std::string> columnSpecs) const

Creates a new table from this table, grouped by columnSpecs, with the “median” aggregate operation applied to the remaining columns.

Parameters

columnSpecs – Columns to group by.

Returns

A TableHandle referencing the new table

template<typename ...Args>
TableHandle percentileBy(double percentile, bool avgMedian, Args&&... args) const

A variadic form of percentileBy(double, bool, std::vector<std::string>) const that takes a combination of argument types.

Template Parameters

Args – Any combination of std::string, std::string_view, const char *, or SelectColumn.

Parameters

columnSpecs – Columns to group by.

Returns

A TableHandle referencing the new table

TableHandle percentileBy(double percentile, bool avgMedian, std::vector<std::string> columnSpecs) const

Creates a new table from this table, grouped by columnSpecs, with the “percentile” aggregate operation applied to the remaining columns.

Parameters
  • percentile – The designated percentile

  • columnSpecs – Columns to group by.

Returns

A TableHandle referencing the new table

template<typename ...Args>
TableHandle percentileBy(double percentile, Args&&... args) const

A variadic form of percentileBy(double, std::vector<std::string>) const that takes a combination of argument types.

Template Parameters

Args – Any combination of std::string, std::string_view, const char *, or SelectColumn.

Parameters

columnSpecs – Columns to group by.

Returns

A TableHandle referencing the new table

TableHandle percentileBy(double percentile, std::vector<std::string> columnSpecs) const

Creates a new table from this table, grouped by columnSpecs, with the “percentile” aggregate operation applied to the remaining columns.

Parameters
  • percentile – The designated percentile

  • columnSpecs – Columns to group by.

Returns

A TableHandle referencing the new table

template<typename CCol, typename ...Args>
TableHandle countBy(CCol &&countByColumn, Args&&... args) const

A variadic form of countBy(std::string, std::vector<std::string>) const that takes a combination of argument types.

Template Parameters
  • CCol – Any of std::string, std::string_view, const char *, or SelectColumn.

  • Args – Any combination of std::string, std::string_view, const char *, or SelectColumn.

Parameters
  • countByColumn – The output column

  • columnSpecs – Columns to group by.

Returns

A TableHandle referencing the new table

TableHandle countBy(std::string countByColumn, std::vector<std::string> columnSpecs) const

Creates a new table from this table, grouped by columnSpecs, having a new column named by countByColumn containing the size of each group.

Parameters
  • countByColumn – Name of the output column.

  • columnSpecs – Columns to group by.

Returns

A TableHandle referencing the new table

template<typename WCol, typename ...Args>
TableHandle wAvgBy(WCol &&weightColumn, Args&&... args) const

A variadic form of wAvgBy(std::string, std::vector<std::string>) const that takes a combination of argument types.

Template Parameters
  • CCol – Any of std::string, std::string_view, const char *, or SelectColumn.

  • Args – Any combination of std::string, std::string_view, const char *, or SelectColumn.

Parameters
  • weightColumn – The output column

  • columnSpecs – Columns to group by.

Returns

A TableHandle referencing the new table

TableHandle wAvgBy(std::string weightColumn, std::vector<std::string> columnSpecs) const

Creates a new table from this table, grouped by columnSpecs, having a new column named by weightColumn containing the weighted average of each group.

Parameters
  • countByColumn – Name of the output column.

  • columnSpecs – Columns to group by.

Returns

A TableHandle referencing the new table

template<typename ...Args>
TableHandle tailBy(int64_t n, Args&&... args) const

A variadic form of tailBy(int64_t, std::vector<std::string>) const that takes a combination of argument types.

Template Parameters

Args – Any combination of std::string, std::string_view, const char *, or SelectColumn.

Parameters
  • n – Number of rows

  • columnSpecs – Columns to group by.

Returns

A TableHandle referencing the new table

TableHandle tailBy(int64_t n, std::vector<std::string> columnSpecs) const

Creates a new table from this table, grouped by columnSpecs, containing the last n rows of each group.

Parameters
  • n – Number of rows

  • columnSpecs – Columns to group by.

Returns

A TableHandle referencing the new table

template<typename ...Args>
TableHandle headBy(int64_t n, Args&&... args) const

A variadic form of headBy(int64_t, std::vector<std::string>) const that takes a combination of argument types.

Template Parameters

Args – Any combination of std::string, std::string_view, const char *, or SelectColumn.

Parameters
  • n – Number of rows

  • columnSpecs – Columns to group by.

Returns

A TableHandle referencing the new table

TableHandle headBy(int64_t n, std::vector<std::string> columnSpecs) const

Creates a new table from this table, grouped by columnSpecs, containing the first n rows of each group.

Parameters
  • n – Number of rows

  • columnSpecs – Columns to group by.

Returns

A TableHandle referencing the new table

TableHandle head(int64_t n) const

Creates a new table from this table containing the first n rows of this table.

Parameters

n – Number of rows

Returns

A TableHandle referencing the new table

TableHandle tail(int64_t n) const

Creates a new table from this table containing the last n rows of this table.

Parameters

n – Number of rows

Returns

A TableHandle referencing the new table

template<typename ...Args>
TableHandle ungroup(bool nullFill, Args&&... args) const

A variadic form of ungroup(bool, std::vector<std::string>) const that takes a combination of argument types.

Template Parameters

Args – Any combination of std::string, std::string_view, const char *, or SelectColumn.

Parameters

columnSpecs – Columns to group by.

Returns

A TableHandle referencing the new table

TableHandle ungroup(bool nullFill, std::vector<std::string> groupByColumns) const

Creates a new table from this table with the column array data ungrouped. This is the inverse of the by(std::vector<std::string>) const operation.

Parameters

groupByColumns – Columns to ungroup.

Returns

A TableHandle referencing the new table

template<typename ...Args>
inline TableHandle ungroup(Args&&... args) const

A variadic form of ungroup(std::vector<std::string>) const that takes a combination of argument types.

Template Parameters

Args – Any combination of std::string, std::string_view, const char *, or SelectColumn.

Parameters

columnSpecs – Columns to group by.

Returns

A TableHandle referencing the new table

inline TableHandle ungroup(std::vector<std::string> groupByColumns) const

Creates a new table from this table with the column array data ungrouped. This is the inverse of the by(std::vector<std::string>) const operation.

Parameters

groupByColumns – Columns to ungroup.

Returns

A TableHandle referencing the new table

TableHandle merge(std::string keyColumn, std::vector<TableHandle> sources) const

Creates a new table by merging sources together. The tables are essentially stacked on top of each other.

Parameters

sources – The tables to merge.

Returns

A TableHandle referencing the new table

inline TableHandle merge(std::vector<TableHandle> sources) const

Creates a new table by merging sources together. The tables are essentially stacked on top of each other.

Parameters

sources – The tables to merge.

Returns

A TableHandle referencing the new table

TableHandle crossJoin(const TableHandle &rightSide, std::vector<std::string> columnsToMatch, std::vector<std::string> columnsToAdd) const

Creates a new table by cross joining this table with rightSide. The tables are joined by the columns in columnsToMatch, and columns from rightSide are brought in and optionally renamed by columnsToAdd. Example:

t1.crossJoin({"Col1", "Col2"}, {"Col3", "NewCol=Col4"})

Parameters
  • rightSide – The table to join with this table

  • columnsToMatch – The columns to join on

  • columnsToAdd – The columns from the right side to add, and possibly rename.

Returns

A TableHandle referencing the new table

TableHandle crossJoin(const TableHandle &rightSide, std::vector<MatchWithColumn> columnsToMatch, std::vector<SelectColumn> columnsToAdd) const

The fluent version of crossJoin(const TableHandle &, std::vector<std::string>, std::vector<std::string>) const.

t1.crossJoin(col1, col2}, {col3, col4.as("NewCol"})

Parameters
  • rightSide – The table to join with this table

  • columnsToMatch – The columns to join on

  • columnsToAdd – The columns from the right side to add, and possibly rename.

Returns

TableHandle naturalJoin(const TableHandle &rightSide, std::vector<std::string> columnsToMatch, std::vector<std::string> columnsToAdd) const

Creates a new table by natural joining this table with rightSide. The tables are joined by the columns in columnsToMatch, and columns from rightSide are brought in and optionally renamed by columnsToAdd. Example:

t1.naturalJoin({"Col1", "Col2"}, {"Col3", "NewCol=Col4"})

Parameters
  • rightSide – The table to join with this table

  • columnsToMatch – The columns to join on

  • columnsToAdd – The columns from the right side to add, and possibly rename.

Returns

A TableHandle referencing the new table

TableHandle naturalJoin(const TableHandle &rightSide, std::vector<MatchWithColumn> columnsToMatch, std::vector<SelectColumn> columnsToAdd) const

The fluent version of naturalJoin(const TableHandle &, std::vector<std::string>, std::vector<std::string>) const.

t1.naturalJoin(col1, col2}, {col3, col4.as("NewCol"})

Parameters
  • rightSide – The table to join with this table

  • columnsToMatch – The columns to join on

  • columnsToAdd – The columns from the right side to add, and possibly rename.

Returns

TableHandle exactJoin(const TableHandle &rightSide, std::vector<std::string> columnsToMatch, std::vector<std::string> columnsToAdd) const

Creates a new table by exact joining this table with rightSide. The tables are joined by the columns in columnsToMatch, and columns from rightSide are brought in and optionally renamed by columnsToAdd. Example:

t1.naturalJoin({"Col1", "Col2"}, {"Col3", "NewCol=Col4"})

Parameters
  • rightSide – The table to join with this table

  • columnsToMatch – The columns to join on

  • columnsToAdd – The columns from the right side to add, and possibly rename.

Returns

A TableHandle referencing the new table

TableHandle exactJoin(const TableHandle &rightSide, std::vector<MatchWithColumn> columnsToMatch, std::vector<SelectColumn> columnsToAdd) const

The fluent version of exactJoin(const TableHandle &, std::vector<std::string>, std::vector<std::string>) const.

t1.exactJoin(col1, col2}, {col3, col4.as("NewCol"})

Parameters
  • rightSide – The table to join with this table

  • columnsToMatch – The columns to join on

  • columnsToAdd – The columns from the right side to add, and possibly rename.

Returns

TableHandle leftJoin(const TableHandle &rightSide, std::vector<std::string> columnsToMatch, std::vector<std::string> columnsToAdd) const

Creates a new table by left joining this table with rightSide. The tables are joined by the columns in columnsToMatch, and columns from rightSide are brought in and optionally renamed by columnsToAdd. Example:

t1.naturalJoin({"Col1", "Col2"}, {"Col3", "NewCol=Col4"})

Parameters
  • rightSide – The table to join with this table

  • columnsToMatch – The columns to join on

  • columnsToAdd – The columns from the right side to add, and possibly rename.

Returns

A TableHandle referencing the new table

TableHandle leftJoin(const TableHandle &rightSide, std::vector<MatchWithColumn> columnsToMatch, std::vector<SelectColumn> columnsToAdd) const

The fluent version of leftJoin(const TableHandle &, std::vector<std::string>, std::vector<std::string>) const.

t1.leftJoin(col1, col2}, {col3, col4.as("NewCol"})

Parameters
  • rightSide – The table to join with this table

  • columnsToMatch – The columns to join on

  • columnsToAdd – The columns from the right side to add, and possibly rename.

Returns

void bindToVariable(std::string variable) const

Binds this table to a variable name in the QueryScope.

Parameters

variable

void bindToVariableAsync(std::string variable, std::shared_ptr<SFCallback<>> callback) const

The async version of bindToVariable(std::string variable) const.

Parameters
  • The – QueryScope variable to bind to.

  • callback – The asynchronous callback.

std::vector<Column> getAllCols() const

Get all the table’s columns.

Returns

A vector of the table’s columns.

StrCol getStrCol(std::string columnName) const

Get a column that is of string type. Used in the fluent interface. Example:

auto symbol = table.getStrCol("Symbol")
auto t2 = table.where(symbol == "IBM");

Parameters

columnName – The name of the column

Returns

The specified StrCol.

NumCol getNumCol(std::string columnName) const

Get a column that is of numeric type. Used in the fluent interface. Example:

auto volume = table.getNumCol("Volume")
auto t2 = table.where(volume < 1000);

Parameters

columnName – The name of the column

Returns

The specified NumCol.

DateTimeCol getDateTimeCol(std::string columnName) const

Get a column that is of DateTime type. Used in the fluent interface.

Parameters

columnName – The name of the column

Returns

The specified DateTimeCol.

template<typename ...Cols>
std::tuple<Cols...> getCols(internal::StringHolder<Cols>... names)

Convenience function to get several columns at once. Example:

auto [symbol, volume] = table.getCols<StrCol, NumCol>("Symbol", "Volume");

Template Parameters

ColsColumn types

Parameters

namesColumn names

Returns

A tuple of columns.

internal::TableHandleStreamAdaptor stream(bool wantHeaders) const

Create an ostream adpator that prints a human-readable representation of the table to a C++ stream. Example:

std::cout << table.stream(true) << std::endl;

Parameters

wantHeaders – Include column headers.

Returns

std::shared_ptr<arrow::flight::FlightStreamReader> getFlightStreamReader() const

Construct an arrow FlightStreamReader bound to this table

Returns

the Arrow FlightStreamReader.