class Schema
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.Glue.Alpha.Schema |
Go | github.com/aws/aws-cdk-go/awscdkgluealpha/v2#Schema |
Java | software.amazon.awscdk.services.glue.alpha.Schema |
Python | aws_cdk.aws_glue_alpha.Schema |
TypeScript (source) | @aws-cdk/aws-glue-alpha ยป Schema |
See also: https://docs.aws.amazon.com/athena/latest/ug/data-types.html
Example
declare const myDatabase: glue.Database;
new glue.S3Table(this, 'MyTable', {
database: myDatabase,
columns: [{
name: 'col1',
type: glue.Schema.STRING,
}],
partitionKeys: [{
name: 'year',
type: glue.Schema.SMALL_INT,
}, {
name: 'month',
type: glue.Schema.SMALL_INT,
}],
dataFormat: glue.DataFormat.JSON,
});
Initializer
new Schema()
Properties
Name | Type | Description |
---|---|---|
static BIG_INT | Type | A 64-bit signed INTEGER in twoโs complement format, with a minimum value of -2^63 and a maximum value of 2^63-1. |
static BINARY | Type | |
static BOOLEAN | Type | |
static DATE | Type | Date type. |
static DOUBLE | Type | |
static FLOAT | Type | |
static INTEGER | Type | A 32-bit signed INTEGER in twoโs complement format, with a minimum value of -2^31 and a maximum value of 2^31-1. |
static SMALL_INT | Type | A 16-bit signed INTEGER in twoโs complement format, with a minimum value of -2^15 and a maximum value of 2^15-1. |
static STRING | Type | Arbitrary-length string type. |
static TIMESTAMP | Type | Timestamp type (date and time). |
static TINY_INT | Type | A 8-bit signed INTEGER in twoโs complement format, with a minimum value of -2^7 and a maximum value of 2^7-1. |
static BIG_INT
Type:
Type
A 64-bit signed INTEGER in twoโs complement format, with a minimum value of -2^63 and a maximum value of 2^63-1.
static BINARY
Type:
Type
static BOOLEAN
Type:
Type
static DATE
Type:
Type
Date type.
static DOUBLE
Type:
Type
static FLOAT
Type:
Type
static INTEGER
Type:
Type
A 32-bit signed INTEGER in twoโs complement format, with a minimum value of -2^31 and a maximum value of 2^31-1.
static SMALL_INT
Type:
Type
A 16-bit signed INTEGER in twoโs complement format, with a minimum value of -2^15 and a maximum value of 2^15-1.
static STRING
Type:
Type
Arbitrary-length string type.
static TIMESTAMP
Type:
Type
Timestamp type (date and time).
static TINY_INT
Type:
Type
A 8-bit signed INTEGER in twoโs complement format, with a minimum value of -2^7 and a maximum value of 2^7-1.
Methods
Name | Description |
---|---|
static array(itemType) | Creates an array of some other type. |
static char(length) | Fixed length character data, with a specified length between 1 and 255. |
static decimal(precision, scale?) | Creates a decimal type. |
static map(keyType, valueType) | Creates a map of some primitive key type to some value type. |
static struct(columns) | Creates a nested structure containing individually named and typed columns. |
static varchar(length) | Variable length character data, with a specified length between 1 and 65535. |
static array(itemType)
public static array(itemType: Type): Type
Parameters
- itemType
Type
โ type contained by the array.
Returns
Creates an array of some other type.
static char(length)
public static char(length: number): Type
Parameters
- length
number
โ length between 1 and 255.
Returns
Fixed length character data, with a specified length between 1 and 255.
static decimal(precision, scale?)
public static decimal(precision: number, scale?: number): Type
Parameters
- precision
number
โ the total number of digits. - scale
number
โ the number of digits in fractional part, the default is 0.
Returns
Creates a decimal type.
TODO: Bounds
static map(keyType, valueType)
public static map(keyType: Type, valueType: Type): Type
Parameters
- keyType
Type
โ type of key, must be a primitive. - valueType
Type
โ type fo the value indexed by the key.
Returns
Creates a map of some primitive key type to some value type.
static struct(columns)
public static struct(columns: Column[]): Type
Parameters
- columns
Column
[]
โ the columns of the structure.
Returns
Creates a nested structure containing individually named and typed columns.
static varchar(length)
public static varchar(length: number): Type
Parameters
- length
number
โ length between 1 and 65535.
Returns
Variable length character data, with a specified length between 1 and 65535.