@aws-cdk_aws-glue-alpha.Schema

class Schema ๐Ÿ”น

LanguageType name
.NETAmazon.CDK.AWS.Glue.Alpha.Schema
Gogithub.com/aws/aws-cdk-go/awscdkgluealpha/v2#Schema
Javasoftware.amazon.awscdk.services.glue.alpha.Schema
Pythonaws_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.Table(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

NameTypeDescription
static BIG_INT๐Ÿ”นTypeA 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๐Ÿ”นTypeDate type.
static DOUBLE๐Ÿ”นType
static FLOAT๐Ÿ”นType
static INTEGER๐Ÿ”นTypeA 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๐Ÿ”นTypeA 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๐Ÿ”นTypeArbitrary-length string type.
static TIMESTAMP๐Ÿ”นTypeTimestamp type (date and time).
static TINY_INT๐Ÿ”นTypeA 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

NameDescription
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

  • Type

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

  • Type

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

  • Type

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

  • Type

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

  • Type

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

  • Type

Variable length character data, with a specified length between 1 and 65535.