interface ExternalTableProps
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.Glue.Alpha.ExternalTableProps |
![]() | github.com/aws/aws-cdk-go/awscdkgluealpha/v2#ExternalTableProps |
![]() | software.amazon.awscdk.services.glue.alpha.ExternalTableProps |
![]() | aws_cdk.aws_glue_alpha.ExternalTableProps |
![]() | @aws-cdk/aws-glue-alpha ยป ExternalTableProps |
Example
declare const myConnection: glue.Connection;
declare const myDatabase: glue.Database;
new glue.ExternalTable(this, 'MyTable', {
connection: myConnection,
externalDataLocation: 'default_db_public_example', // A table in Redshift
// ...
database: myDatabase,
columns: [{
name: 'col1',
type: glue.Schema.STRING,
}],
dataFormat: glue.DataFormat.JSON,
});
Properties
Name | Type | Description |
---|---|---|
columns | Column [] | Columns of the table. |
connection | IConnection | The connection the table will use when performing reads and writes. |
data | Data | Storage type of the table's data. |
database | IDatabase | Database in which to store the table. |
external | string | The data source location of the glue table, (e.g. default_db_public_example for Redshift). |
compressed? | boolean | Indicates whether the table's data is compressed or not. |
description? | string | Description of the table. |
enable | boolean | Enables partition filtering. |
parameters? | { [string]: string } | The key/value pairs define properties associated with the table. |
partition | Partition [] | Partition indexes on the table. |
partition | Column [] | Partition columns of the table. |
storage | Storage [] | The user-supplied properties for the description of the physical storage of this table. |
stored | boolean | Indicates whether the table data is stored in subdirectories. |
table | string | Name of the table. |
columns
Type:
Column
[]
Columns of the table.
connection
Type:
IConnection
The connection the table will use when performing reads and writes.
dataFormat
Type:
Data
Storage type of the table's data.
database
Type:
IDatabase
Database in which to store the table.
externalDataLocation
Type:
string
The data source location of the glue table, (e.g. default_db_public_example
for Redshift).
If this property is set, it will override both bucket
and s3Prefix
.
compressed?
Type:
boolean
(optional, default: false)
Indicates whether the table's data is compressed or not.
description?
Type:
string
(optional, default: generated)
Description of the table.
enablePartitionFiltering?
Type:
boolean
(optional, default: The parameter is not defined)
Enables partition filtering.
parameters?
Type:
{ [string]: string }
(optional, default: The parameter is not defined)
The key/value pairs define properties associated with the table.
The key/value pairs that are allowed to be submitted are not limited, however their functionality is not guaranteed.
partitionIndexes?
Type:
Partition
[]
(optional, default: table has no partition indexes)
Partition indexes on the table.
A maximum of 3 indexes are allowed on a table. Keys in the index must be part of the table's partition keys.
partitionKeys?
Type:
Column
[]
(optional, default: table is not partitioned)
Partition columns of the table.
storageParameters?
Type:
Storage
[]
(optional, default: The parameter is not defined)
The user-supplied properties for the description of the physical storage of this table.
These properties help describe the format of the data that is stored within the crawled data sources.
The key/value pairs that are allowed to be submitted are not limited, however their functionality is not guaranteed.
Some keys will be auto-populated by glue crawlers, however, you can override them by specifying the key and value in this property.
See also: [https://docs.aws.amazon.com/redshift/latest/dg/r_CREATE_EXTERNAL_TABLE.html#r_CREATE_EXTERNAL_TABLE-parameters - under "TABLE PROPERTIES"](https://docs.aws.amazon.com/redshift/latest/dg/r_CREATE_EXTERNAL_TABLE.html#r_CREATE_EXTERNAL_TABLE-parameters - under "TABLE PROPERTIES") Example
declare const glueDatabase: glue.IDatabase;
const table = new glue.Table(this, 'Table', {
storageParameters: [
glue.StorageParameter.skipHeaderLineCount(1),
glue.StorageParameter.compressionType(glue.CompressionType.GZIP),
glue.StorageParameter.custom('foo', 'bar'), // Will have no effect
glue.StorageParameter.custom('separatorChar', ','), // Will describe the separator char used in the data
glue.StorageParameter.custom(glue.StorageParameters.WRITE_PARALLEL, 'off'),
],
// ...
database: glueDatabase,
columns: [{
name: 'col1',
type: glue.Schema.STRING,
}],
dataFormat: glue.DataFormat.CSV,
});
storedAsSubDirectories?
Type:
boolean
(optional, default: false)
Indicates whether the table data is stored in subdirectories.
tableName?
Type:
string
(optional, default: generated by CDK.)
Name of the table.