@Internal public class TableSchemaUtils extends Object
TableSchema
.Constructor and Description |
---|
TableSchemaUtils() |
Modifier and Type | Method and Description |
---|---|
static TableSchema.Builder |
builderWithGivenSchema(TableSchema oriSchema)
Creates a builder with given table schema.
|
static TableSchema |
checkNoGeneratedColumns(TableSchema schema)
Throws exception if the given
TableSchema contains any generated columns. |
static boolean |
containsGeneratedColumns(TableSchema schema)
Returns true if there are any generated columns in the given
TableColumn . |
static TableSchema |
dropConstraint(TableSchema oriSchema,
String constraintName)
Creates a new schema but drop the constraint with given name.
|
static TableSchema |
getPhysicalSchema(TableSchema tableSchema)
Return
TableSchema which consists of all physical columns. |
static int[] |
getPrimaryKeyIndices(TableSchema schema)
Returns the field indices of primary key in the physical columns of this schema (not include
computed columns).
|
static TableSchema |
projectSchema(TableSchema tableSchema,
int[][] projectedFields)
Creates a new
TableSchema with the projected fields from another TableSchema . |
public static TableSchema getPhysicalSchema(TableSchema tableSchema)
TableSchema
which consists of all physical columns. That means, the computed
columns are filtered out.
Readers(or writers) such as TableSource
and TableSink
should use this
physical schema to generate TableSource.getProducedDataType()
and TableSource.getTableSchema()
rather than using the raw TableSchema which may contains
computed columns.
public static TableSchema projectSchema(TableSchema tableSchema, int[][] projectedFields)
TableSchema
with the projected fields from another TableSchema
.
The new TableSchema
doesn't contain any primary key or watermark information.SupportsProjectionPushDown
public static boolean containsGeneratedColumns(TableSchema schema)
TableColumn
.public static TableSchema checkNoGeneratedColumns(TableSchema schema)
TableSchema
contains any generated columns.public static int[] getPrimaryKeyIndices(TableSchema schema)
public static TableSchema.Builder builderWithGivenSchema(TableSchema oriSchema)
oriSchema
- Original schemapublic static TableSchema dropConstraint(TableSchema oriSchema, String constraintName)
Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.