deephaven_enterprise.table_tools

This module defines a convenience function for reading and writing tables in Deephaven format.

read_bin(paths, schema=None, table_def=None, buffer_size=None, batch_size=None)[source]

Loads binary log file(s) to an in-memory Deephaven format table. All binary log files must have an identical schema.

Parameters:
  • paths (Union[str, Sequence[str]]) – A full path (or list of full paths) to the binlog(s) which should be read.

  • schema (Optional[SchemaLike) – Identifies the schema to use for listener generation. Required if the Namespace and TableName cannot be determined by the first file in paths.

  • table_def (Optional[TableDefinitionLike]) – An optional table definition, used to limit the desired columns.

  • buffer_size (Optional[int]) – The buffer size used for reading from binlog file(s). Defaults to None, which will use the system default.

  • batch_size (Optional[int]) – The number of rows to batch while reading from binlog file(s). Defaults to None, which will use the system default.

Return type:

Table

Returns:

a Table object

Raises:

DHError

read_bin_dir(path, glob, schema, table_def=None, buffer_size=None, batch_size=None)[source]
Loads binary log file(s) from a directory to an in-memory Deephaven format table. All binary log files must have

an identical schema.

Parameters:
  • path (str) – A full path to the directory which should be read.

  • glob (str) – The globbing pattern used to discover the binary log files in the specified path.

  • schema (SchemaLike) – Identifies the schema to use for listener generation.

  • table_def (Optional[TableDefinitionLike]) – An optional table definition, used to limit the desired columns.

  • buffer_size (Optional[int]) – The buffer size used for reading from binlog file(s). Defaults to None, which will use the system default.

  • batch_size (Optional[int]) – The number of rows to batch while reading from binlog file(s). Defaults to None, which will use the system default.

Return type:

Table

Returns:

Table

Raises:

DHError

read_table(path)[source]

Reads a Deephaven format table at the specified path.

Parameters:

path (str) – the path to the table

Return type:

Table

Returns:

a Table object

write_table(table, path, table_definition=None)[source]

Writes a table to the specified path in Deephaven format.

This method allows you to provide a separate table definition so that users may specify different column attributes (grouping, for example) than that of the source table to write. If provided, the definition must be compatible with the source table. If not provided, the source table’s definition is used.

Parameters:
  • table (Table) – the table to write

  • path (str) – the path to write to

  • table_definition (JTableDefinition) – the table definition to use, defaults to None

Return type:

None