Skip to main content
Version: Python

IcebergInstructions

The IcebergInstructions class specifies the instructions for reading Iceberg tables into Deephaven. These include column renames, table definitions, and special instructions for loading files from cloud storage.

Syntax

IcebergInstructions(
table_definition: Union[Dict[str, DType], List[Column]] = None,
data_instructions: S3Instructions = None,
column_renames: Dict[str, str] = None,
)

Parameters

ParameterTypeDescription
table_definitionUnion[Dict[str, DType], List[Column]]

The table definition. If not given, the definition is inferred from the Iceberg schema. Setting a definition guarantees the returned table has the given definition. Mostly used to specify a subset of Iceberg schema columns.

data_instructionsS3Instructions

Special instructions for reading data files from S3 cloud storage.

column_renamesDict[str, str]

A mapping of old to new column names for the table. If not given, the column names are the same as the Iceberg schema.

Methods

None.

Constructors

An IcebergInstructions is constructed directly from the class.

Examples

The following example creates an IcebergInstructions object that renames Iceberg columns region and item_type to Area and Category in Deephaven, respectively:

from deephaven.experimental import iceberg

custom_instructions = iceberg.IcebergInstructions(
column_renames={"region": "Area", "item_type": "Category"}
)

The following example creates an IcebergInstructions object that renames columns as well as specifies the table definition:

custom_instructions = iceberg.IcebergInstructions(
column_renames={"region": "Area", "item_type": "Category", "unit_price": "Price"},
table_definition={
"Area": dtypes.string,
"Category": dtypes.string,
"Price": dtypes.double,
},
)