Class TableProps
Inheritance
Namespace: Amazon.CDK.AWS.Glue.Alpha
Assembly: Amazon.CDK.AWS.Glue.Alpha.dll
Syntax (csharp)
public class TableProps : Object, ITableProps, IS3TableProps, ITableBaseProps
Syntax (vb)
Public Class TableProps
Inherits Object
Implements ITableProps, IS3TableProps, ITableBaseProps
Remarks
Stability: Experimental
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Glue.Alpha;
using Amazon.CDK.AWS.KMS;
using Amazon.CDK.AWS.S3;
Bucket bucket;
Database database;
DataFormat dataFormat;
Key key;
StorageParameter storageParameter;
var tableProps = new TableProps {
Columns = new [] { new Column {
Name = "name",
Type = new Type {
InputString = "inputString",
IsPrimitive = false
},
// the properties below are optional
Comment = "comment"
} },
Database = database,
DataFormat = dataFormat,
// the properties below are optional
Bucket = bucket,
Compressed = false,
Description = "description",
EnablePartitionFiltering = false,
Encryption = TableEncryption.S3_MANAGED,
EncryptionKey = key,
Parameters = new Dictionary<string, string> {
{ "parametersKey", "parameters" }
},
PartitionIndexes = new [] { new PartitionIndex {
KeyNames = new [] { "keyNames" },
// the properties below are optional
IndexName = "indexName"
} },
PartitionKeys = new [] { new Column {
Name = "name",
Type = new Type {
InputString = "inputString",
IsPrimitive = false
},
// the properties below are optional
Comment = "comment"
} },
S3Prefix = "s3Prefix",
StorageParameters = new [] { storageParameter },
StoredAsSubDirectories = false,
TableName = "tableName"
};
Synopsis
Constructors
TableProps() |
Properties
Bucket | (experimental) S3 bucket in which to store data. |
Columns | (experimental) Columns of the table. |
Compressed | (experimental) Indicates whether the table's data is compressed or not. |
Database | (experimental) Database in which to store the table. |
DataFormat | (experimental) Storage type of the table's data. |
Description | (experimental) Description of the table. |
EnablePartitionFiltering | (experimental) Enables partition filtering. |
Encryption | (experimental) The kind of encryption to secure the data with. |
EncryptionKey | (experimental) External KMS key to use for bucket encryption. |
Parameters | (experimental) The key/value pairs define properties associated with the table. |
PartitionIndexes | (experimental) Partition indexes on the table. |
PartitionKeys | (experimental) Partition columns of the table. |
S3Prefix | (experimental) S3 prefix under which table objects are stored. |
StorageParameters | (experimental) The user-supplied properties for the description of the physical storage of this table. |
StoredAsSubDirectories | (experimental) Indicates whether the table data is stored in subdirectories. |
TableName | (experimental) Name of the table. |
Constructors
TableProps()
public TableProps()
Properties
Bucket
(experimental) S3 bucket in which to store data.
public IBucket Bucket { get; set; }
Property Value
Remarks
Default: one is created for you
Stability: Experimental
Columns
(experimental) Columns of the table.
public IColumn[] Columns { get; set; }
Property Value
IColumn[]
Remarks
Stability: Experimental
Compressed
(experimental) Indicates whether the table's data is compressed or not.
public Nullable<bool> Compressed { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: false
Stability: Experimental
Database
(experimental) Database in which to store the table.
public IDatabase Database { get; set; }
Property Value
Remarks
Stability: Experimental
DataFormat
(experimental) Storage type of the table's data.
public DataFormat DataFormat { get; set; }
Property Value
Remarks
Stability: Experimental
Description
(experimental) Description of the table.
public string Description { get; set; }
Property Value
System.String
Remarks
Default: generated
Stability: Experimental
EnablePartitionFiltering
(experimental) Enables partition filtering.
public Nullable<bool> EnablePartitionFiltering { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: - The parameter is not defined
Stability: Experimental
Encryption
(experimental) The kind of encryption to secure the data with.
public Nullable<TableEncryption> Encryption { get; set; }
Property Value
System.Nullable<TableEncryption>
Remarks
You can only provide this option if you are not explicitly passing in a bucket.
If you choose SSE-KMS
, you can provide an un-managed KMS key with encryptionKey
.
If you choose CSE-KMS
, you must provide an un-managed KMS key with encryptionKey
.
Default: BucketEncryption.S3_MANAGED
Stability: Experimental
EncryptionKey
(experimental) External KMS key to use for bucket encryption.
public IKey EncryptionKey { get; set; }
Property Value
Remarks
The encryption
property must be SSE-KMS
or CSE-KMS
.
Default: key is managed by KMS.
Stability: Experimental
Parameters
(experimental) The key/value pairs define properties associated with the table.
public IDictionary<string, string> Parameters { get; set; }
Property Value
System.Collections.Generic.IDictionary<System.String, System.String>
Remarks
The key/value pairs that are allowed to be submitted are not limited, however their functionality is not guaranteed.
Default: - The parameter is not defined
Stability: Experimental
PartitionIndexes
(experimental) Partition indexes on the table.
public IPartitionIndex[] PartitionIndexes { get; set; }
Property Value
Remarks
A maximum of 3 indexes are allowed on a table. Keys in the index must be part of the table's partition keys.
Default: table has no partition indexes
Stability: Experimental
PartitionKeys
(experimental) Partition columns of the table.
public IColumn[] PartitionKeys { get; set; }
Property Value
IColumn[]
Remarks
Default: table is not partitioned
Stability: Experimental
S3Prefix
(experimental) S3 prefix under which table objects are stored.
public string S3Prefix { get; set; }
Property Value
System.String
Remarks
Default: - No prefix. The data will be stored under the root of the bucket.
Stability: Experimental
StorageParameters
(experimental) The user-supplied properties for the description of the physical storage of this table.
public StorageParameter[] StorageParameters { get; set; }
Property Value
Remarks
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.
Default: - The parameter is not defined
Stability: Experimental
See: https://docs.aws.amazon.com/redshift/latest/dg/r_CREATE_EXTERNAL_TABLE.html#r_CREATE_EXTERNAL_TABLE-parameters - under "TABLE PROPERTIES"
Examples
IDatabase glueDatabase;
var table = new Table(this, "Table", new S3TableProps {
StorageParameters = new [] { StorageParameter.SkipHeaderLineCount(1), StorageParameter.CompressionType(CompressionType.GZIP), StorageParameter.Custom("foo", "bar"), StorageParameter.Custom("separatorChar", ","), StorageParameter.Custom(StorageParameters.WRITE_PARALLEL, "off") },
// ...
Database = glueDatabase,
Columns = new [] { new Column {
Name = "col1",
Type = Schema.STRING
} },
DataFormat = DataFormat.CSV
});
StoredAsSubDirectories
(experimental) Indicates whether the table data is stored in subdirectories.
public Nullable<bool> StoredAsSubDirectories { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: false
Stability: Experimental
TableName
(experimental) Name of the table.
public string TableName { get; set; }
Property Value
System.String
Remarks
Default: - generated by CDK.
Stability: Experimental