public static class TableSchema.Builder extends Object
Modifier and Type | Method and Description |
---|---|
TableSchema.Builder |
addColumn(String name,
SemanticType semanticType,
DataType dataType)
Add column schema.
|
TableSchema.Builder |
addColumn(String name,
SemanticType semanticType,
DataType dataType,
DataType.DecimalTypeExtension decimalTypeExtension)
Add column schema.
|
TableSchema.Builder |
addField(String name,
DataType dataType)
Add field schema.
|
TableSchema.Builder |
addTag(String name,
DataType dataType)
Add tag schema.
|
TableSchema.Builder |
addTimestamp(String name,
DataType dataType)
Add timestamp schema.
|
TableSchema |
build()
Build the table schema.
|
public Builder(String tableName)
public TableSchema.Builder addTag(String name, DataType dataType)
It is strongly recommended to use snake case naming convention and avoid using camel case. This is because GreptimeDB treats column names as case-insensitive, which can cause confusion when querying with camel case.
name
- the name of this tagdataType
- the data type of this tagpublic TableSchema.Builder addTimestamp(String name, DataType dataType)
It is strongly recommended to use snake case naming convention and avoid using camel case. This is because GreptimeDB treats column names as case-insensitive, which can cause confusion when querying with camel case.
name
- the name of this timestampdataType
- the data type of this timestamppublic TableSchema.Builder addField(String name, DataType dataType)
It is strongly recommended to use snake case naming convention and avoid using camel case. This is because GreptimeDB treats column names as case-insensitive, which can cause confusion when querying with camel case.
name
- the name of this fielddataType
- the data type of this fieldpublic TableSchema.Builder addColumn(String name, SemanticType semanticType, DataType dataType)
It is strongly recommended to use snake case naming convention and avoid using camel case. This is because GreptimeDB treats column names as case-insensitive, which can cause confusion when querying with camel case.
name
- the name of this columnsemanticType
- the semantic type of this column (`Tag`, `Field` or `Timestamp`)dataType
- the data type of this columnpublic TableSchema.Builder addColumn(String name, SemanticType semanticType, DataType dataType, DataType.DecimalTypeExtension decimalTypeExtension)
It is strongly recommended to use snake case naming convention and avoid using camel case. This is because GreptimeDB treats column names as case-insensitive, which can cause confusion when querying with camel case.
name
- the name of this columnsemanticType
- the semantic type of this column (`Tag`, `Field` or `Timestamp`)dataType
- the data type of this columndecimalTypeExtension
- the decimal type extension of this column(only for `DataType.Decimal128`)public TableSchema build()
Copyright © 2025. All rights reserved.