Implementation:Apache Paimon TableType
| Knowledge Sources | |
|---|---|
| Domains | Catalog, Table Types |
| Last Updated | 2026-02-08 00:00 GMT |
Overview
TableType is an enumeration that defines the different types of tables supported by Apache Paimon.
Description
The TableType enum provides a comprehensive taxonomy of table types available in Apache Paimon. It implements the DescribedEnum interface, which allows each table type to provide a human-readable description of its purpose and characteristics.
Paimon supports six distinct table types: standard Paimon tables (TABLE), format-specific tables for CSV/Parquet/ORC files (FORMAT_TABLE), materialized tables that combine data with SQL definitions (MATERIALIZED_TABLE), object tables that link to external storage locations (OBJECT_TABLE), Lance tables for vector storage using the Lance format (LANCE_TABLE), and Iceberg tables for Apache Iceberg integration (ICEBERG_TABLE).
Each table type has a string representation used in configuration and metadata, along with a description explaining its use case. The enum provides conversion methods to parse string values back into enum constants, enabling flexible configuration and serialization.
Usage
Use TableType to specify the kind of table being created or queried in the catalog. This enum is essential when creating tables through the catalog API, as it determines which underlying implementation and storage format will be used. It's also used internally to route operations to the appropriate table handlers based on the table's type.
Code Reference
Source Location
- Repository: Apache_Paimon
- File: paimon-api/src/main/java/org/apache/paimon/TableType.java
Signature
public enum TableType implements DescribedEnum {
TABLE("table", "Normal Paimon table."),
FORMAT_TABLE("format-table", "A file format table refers to a directory that contains multiple files of the same format."),
MATERIALIZED_TABLE("materialized-table", "A materialized table combines normal Paimon table and materialized SQL."),
OBJECT_TABLE("object-table", "An object table combines normal Paimon table and object location."),
LANCE_TABLE("lance-table", "A lance table, see 'https://lancedb.github.io/lance/'."),
ICEBERG_TABLE("iceberg-table", "An iceberg table, see 'https://iceberg.apache.org/'.");
@Override public String toString()
@Override public InlineElement getDescription()
public static TableType fromString(String name)
}
Import
import org.apache.paimon.TableType;
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| name | String | Yes | String representation of the table type (for fromString method) |
Outputs
| Name | Type | Description |
|---|---|---|
| tableType | TableType | Enum constant representing the table type |
| value | String | String representation of the table type |
| description | InlineElement | Human-readable description of the table type |
Usage Examples
// Creating a standard Paimon table
TableType type = TableType.TABLE;
System.out.println(type.toString()); // Outputs: "table"
// Creating a Lance table for vector storage
TableType lanceType = TableType.LANCE_TABLE;
String lanceValue = lanceType.toString(); // "lance-table"
// Parsing table type from configuration
String configValue = options.get("table.type");
TableType parsedType = TableType.fromString(configValue);
// Using table type in catalog operations
if (tableType == TableType.FORMAT_TABLE) {
// Handle format table operations
return new FormatTableImpl(path, fileFormat);
} else if (tableType == TableType.MATERIALIZED_TABLE) {
// Handle materialized table with SQL
return new MaterializedTableImpl(schema, sql);
}
// Checking table type capabilities
switch (tableType) {
case TABLE:
case MATERIALIZED_TABLE:
// Full Paimon feature support
break;
case FORMAT_TABLE:
// Limited to read/write operations
break;
case LANCE_TABLE:
// Vector-optimized operations
break;
case ICEBERG_TABLE:
// Iceberg compatibility layer
break;
}