deephaven.TableManagementTools¶
Tools for managing and manipulating tables on disk.
Most users will need TableTools and not TableManagementTools.
-
addColumns
(*args)¶ - Adds new columns to a table definition and persists the result in path. If there is an exception, the current definition
is persisted.
- Overload 1
- param currentDefinition
(com.illumon.iris.db.tables.TableDefinition) - initial table definition.
- param rootDir
(java.io.File) - root directory where tables are found.
- param levels
(int) - levels below rootDir where table directories are found.
- param columnsToAdd
(java.lang.String…) - columns to add.
- return
(com.illumon.iris.db.tables.TableDefinition) new table definition.
- Overload 2
- param currentDefinition
(com.illumon.iris.db.tables.TableDefinition) - initial table definition. If null, the definition from the table loaded from path is used.
- param path
(java.io.File) - path of the table containing the columns to add.
- param columnsToAdd
(java.lang.String…) - columns to add.
- return
(com.illumon.iris.db.tables.TableDefinition) new table definition if successful; otherwise null.
-
addGroupingMetadata
(*args)¶ Add grouping metadata to a table on disk.
- Overload 1
- param tableDirectory
(java.io.File) - table directory
- Overload 2
- param tableDirectory
(java.io.File) - table directory
- param tableDefinition
(com.illumon.iris.db.tables.TableDefinition) - table definition
-
appendToTable
(tableToAppend, destDir)¶ Appends to an existing table on disk, or writes a new table if the target table does not exist.
- Parameters
tableToAppend – (com.illumon.iris.db.tables.Table) - table to append
destDir – (java.lang.String) - destination
-
appendToTables
(definitionToAppend, tablesToAppend, destinationDirectoryNames)¶ Appends to existing tables on disk, or writes a new table if the target table does not exist.
- Parameters
definitionToAppend – (com.illumon.iris.db.tables.TableDefinition) - table definition
tablesToAppend – (com.illumon.iris.db.tables.Table[]) - tables to append
destinationDirectoryNames – (java.lang.String[]) - destination directories
-
deleteTable
(path)¶ Deletes a table on disk.
- Parameters
path – (java.io.File) - path to delete
-
dropColumns
(*args)¶ Removes columns from a table definition and persists the result in path, potentially updating multiple persisted tables.
- Overload 1
- param currentDefinition
(com.illumon.iris.db.tables.TableDefinition) - initial table definition.
- param rootDir
(java.io.File) - root directory where tables are found.
- param levels
(int) - levels below rootDir where table directories are found.
- param columnsToRemove
(java.lang.String…) - columns to remove.
- return
(com.illumon.iris.db.tables.TableDefinition) new table definition if successful; otherwise null.
- Overload 2
- param currentDefinition
(com.illumon.iris.db.tables.TableDefinition) - initial table definition.
- param path
(java.io.File) - path of the table receiving the definition.
- param columnsToRemove
(java.lang.String…) - columns to remove.
- return
(com.illumon.iris.db.tables.TableDefinition) new table definition.
-
flushColumnData
()¶ Flush all previously written column data to disk.
-
getAllDbDirs
(tableName, rootDir, levelsDepth)¶ Gets all subtable directories.
- Parameters
tableName – (java.lang.String) - table name
rootDir – (java.io.File) - root directory where tables are found
levelsDepth – (int) - levels below rootDir where table directories are found
- Returns
(java.util.List<java.io.File>) all subtable directories for tableName
-
getFileObject
(input)¶ Helper function for easily creating a java file object from a path string :param input: path string, or list of path strings :return: java File object, or java array of File objects
-
getWorkspaceRoot
()¶ Helper function for extracting the root directory for the workspace configuration
-
readTable
(*args)¶ Reads in a table from disk.
- Overload 1
- param path
(java.io.File) - table location
- param tableDefinition
(com.illumon.iris.db.tables.TableDefinition) - table definition
- return
(com.illumon.iris.db.tables.Table) table
- Overload 2
- param path
(java.io.File) - table location
- return
(com.illumon.iris.db.tables.Table) table
-
renameColumns
(*args)¶ Renames columns in a table definition and persists the result in path, potentially updating multiple persisted tables.
- Overload 1
- param currentDefinition
(com.illumon.iris.db.tables.TableDefinition) - initial table definition.
- param rootDir
(java.io.File) - root directory where tables are found.
- param levels
(int) - levels below rootDir where table directories are found.
- param columnsToRename
(java.lang.String…) - columns to rename.
- return
(com.illumon.iris.db.tables.TableDefinition) new table definition.
- Overload 2
- param currentDefinition
(com.illumon.iris.db.tables.TableDefinition) - initial table definition.
- param path
(java.io.File) - path of the table receiving the definition.
- param columnsToRename
(java.lang.String…) - columns to rename.
- return
(com.illumon.iris.db.tables.TableDefinition) new table definition.
- Overload 3
- param currentDefinition
(com.illumon.iris.db.tables.TableDefinition) - initial table definition.
- param path
(java.io.File) - path of the table receiving the definition.
- param columnsToRename
(com.illumon.iris.db.tables.select.MatchPair…) - columns to rename.
- return
(com.illumon.iris.db.tables.TableDefinition) new table definition.
-
updateColumns
(currentDefinition, rootDir, levels, *updates)¶ Updates columns in a table definition and persists the result in path, potentially updating multiple persisted tables.
- Parameters
currentDefinition – (com.illumon.iris.db.tables.TableDefinition) - initial table definition.
rootDir – (java.io.File) - root directory where tables are found.
levels – (int) - levels below rootDir where table directories are found.
updates – (java.lang.String…) - columns to update.
- Returns
(com.illumon.iris.db.tables.TableDefinition) new table definition.
-
writeDeephavenTables
(sources, tableDefinition, destinations)¶ Write out tables to disk in the Deephaven format.
- Parameters
sources – (com.illumon.iris.db.tables.Table[]) - source tables
tableDefinition – (com.illumon.iris.db.tables.TableDefinition) - table definition
destinations – (java.io.File[]) - destinations
-
writeParquetTables
(sources, tableDefinition, codecName, destinations, groupingColumns)¶ - Writes tables to disk in parquet format under a given destinations. If you specify grouping columns, there
must already be grouping information for those columns in the sources. This can be accomplished with .by(<grouping columns>).ungroup() or .sort(<grouping column>).
- Parameters
sources – (com.illumon.iris.db.tables.Table[]) - The tables to write
tableDefinition – (com.illumon.iris.db.tables.TableDefinition) - The common schema for all the tables to write
codecName – (org.apache.parquet.hadoop.metadata.CompressionCodecName) - Compression codec to use. The only supported codecs are CompressionCodecName.SNAPPY and CompressionCodecName.UNCOMPRESSED.
destinations – (java.io.File[]) - The destinations path
groupingColumns – (java.lang.String[]) - List of columns the tables are grouped by (the write operation will store the grouping info)
-
writeTable
(*args)¶ Write out a table to disk.
- Overload 1
- param sourceTable
(com.illumon.iris.db.tables.Table) - source table
- param destDir
(java.lang.String) - destination
- Overload 2
- param sourceTable
(com.illumon.iris.db.tables.Table) - source table
- param destDir
(java.lang.String) - destination
- param storageFormat
(com.illumon.iris.db.tables.databases.Database.StorageFormat) - Format used for storage
- Overload 3
- param sourceTable
(com.illumon.iris.db.tables.Table) - source table
- param definition
(com.illumon.iris.db.tables.TableDefinition) - table definition
- param destDir
(java.io.File) - destination
- param storageFormat
(com.illumon.iris.db.tables.databases.Database.StorageFormat) - Format used for storage
- Overload 4
- param sourceTable
(com.illumon.iris.db.tables.Table) - source table
- param destDir
(java.io.File) - destination
- Overload 5
- param sourceTable
(com.illumon.iris.db.tables.Table) - source table
- param destDir
(java.io.File) - destination
- param storageFormat
(com.illumon.iris.db.tables.databases.Database.StorageFormat) - Format used for storage
-
writeTables
(*args)¶ Write out tables to disk.
- Overload 1
- param sources
(com.illumon.iris.db.tables.Table[]) - source tables
- param tableDefinition
(com.illumon.iris.db.tables.TableDefinition) - table definition
- param destinations
(java.io.File[]) - destinations
- Overload 2
- param sources
(com.illumon.iris.db.tables.Table[]) - source tables
- param tableDefinition
(com.illumon.iris.db.tables.TableDefinition) - table definition
- param destinations
(java.io.File[]) - destinations
- param storageFormat
(com.illumon.iris.db.tables.databases.Database.StorageFormat) - Format used for storage