JavaScript is disabled on your browser.
public class Indexes
extends Object
Helper methods to create index to pass into Apache Gravitino.
Nested Class Summary
Nested Classes
static final class
The user side implementation of the index.
Field Summary
Fields
Name of the default primary key.
An empty array of indexes.
Method Summary
All Methods Static Methods Concrete Methods
To create a MySQL primary key, you need to use the default primary key name.
Create a primary index on columns.
Create a unique index on columns.
Methods inherited from class java.lang.Object
clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait
Field Details
EMPTY_INDEXES
public static final Index [] EMPTY_INDEXES
An empty array of indexes.
DEFAULT_PRIMARY_KEY_NAME
public static final String DEFAULT_PRIMARY_KEY_NAME
Name of the default primary key. MySQL, ClickHouse, OceanBase and many other databases supports
setting the name of the primary key and use it as primary key name.
See Also:
Method Details
unique
Create a unique index on columns. Like unique (a) or unique (a, b), for complex like unique
Parameters:
name - The name of the index
fieldNames - The field names under the table contained in the index.
Returns:
The unique index
createMysqlPrimaryKey
public static Index createMysqlPrimaryKey (String [][] fieldNames)
To create a MySQL primary key, you need to use the default primary key name.
Parameters:
fieldNames - The field names under the table contained in the index.
Returns:
The primary key index
primary
Create a primary index on columns. Like primary (a), for complex like primary
Parameters:
name - The name of the index
fieldNames - The field names under the table contained in the index.
Returns:
The primary index
of
Parameters:
indexType - The type of the index
name - The name of the index
fieldNames - The field names under the table contained in the index.
Returns:
The index