Schema

class aws_cdk.aws_glue_alpha.Schema

Bases: object

See:

https://docs.aws.amazon.com/athena/latest/ug/data-types.html

Stability:

experimental

ExampleMetadata:

infused

Example:

# my_database: glue.Database

glue.S3Table(self, "MyTable",
    database=my_database,
    columns=[glue.Column(
        name="col1",
        type=glue.Schema.STRING
    )],
    partition_keys=[glue.Column(
        name="year",
        type=glue.Schema.SMALL_INT
    ), glue.Column(
        name="month",
        type=glue.Schema.SMALL_INT
    )],
    data_format=glue.DataFormat.JSON
)
Stability:

experimental

Attributes

BIG_INT = Type(input_string='bigint', is_primitive=True)
BINARY = Type(input_string='binary', is_primitive=True)
BOOLEAN = Type(input_string='boolean', is_primitive=True)
DATE = Type(input_string='date', is_primitive=True)
DOUBLE = Type(input_string='double', is_primitive=True)
FLOAT = Type(input_string='float', is_primitive=True)
INTEGER = Type(input_string='int', is_primitive=True)
SMALL_INT = Type(input_string='smallint', is_primitive=True)
STRING = Type(input_string='string', is_primitive=True)
TIMESTAMP = Type(input_string='timestamp', is_primitive=True)
TINY_INT = Type(input_string='tinyint', is_primitive=True)

Static Methods

classmethod array(*, input_string, is_primitive)

(experimental) Creates an array of some other type.

Parameters:
  • input_string (str) – (experimental) Glue InputString for this type.

  • is_primitive (bool) – (experimental) Indicates whether this type is a primitive data type.

Stability:

experimental

Return type:

Type

classmethod char(length)

(experimental) Fixed length character data, with a specified length between 1 and 255.

Parameters:

length (Union[int, float]) – length between 1 and 255.

Stability:

experimental

Return type:

Type

classmethod decimal(precision, scale=None)

(experimental) Creates a decimal type.

TODO: Bounds

Parameters:
  • precision (Union[int, float]) – the total number of digits.

  • scale (Union[int, float, None]) – the number of digits in fractional part, the default is 0.

Stability:

experimental

Return type:

Type

classmethod map(key_type, *, input_string, is_primitive)

(experimental) Creates a map of some primitive key type to some value type.

Parameters:
  • key_type (Union[Type, Dict[str, Any]]) – type of key, must be a primitive.

  • input_string (str) – (experimental) Glue InputString for this type.

  • is_primitive (bool) – (experimental) Indicates whether this type is a primitive data type.

Stability:

experimental

Return type:

Type

classmethod struct(columns)

(experimental) Creates a nested structure containing individually named and typed columns.

Parameters:

columns (Sequence[Union[Column, Dict[str, Any]]]) – the columns of the structure.

Stability:

experimental

Return type:

Type

classmethod varchar(length)

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

Parameters:

length (Union[int, float]) – length between 1 and 65535.

Stability:

experimental

Return type:

Type