diff --git a/packages/@aws-cdk/aws-glue/lib/schema.ts b/packages/@aws-cdk/aws-glue/lib/schema.ts index 3b256db5e7bfe..cbbad9a50c974 100644 --- a/packages/@aws-cdk/aws-glue/lib/schema.ts +++ b/packages/@aws-cdk/aws-glue/lib/schema.ts @@ -72,7 +72,7 @@ export class Schema { */ public static readonly integer: Type = { isPrimitive: true, - inputString: 'integer' + inputString: 'int' }; /** diff --git a/packages/@aws-cdk/aws-glue/lib/table.ts b/packages/@aws-cdk/aws-glue/lib/table.ts index 7546c289c51f1..9fca439772d35 100644 --- a/packages/@aws-cdk/aws-glue/lib/table.ts +++ b/packages/@aws-cdk/aws-glue/lib/table.ts @@ -179,6 +179,11 @@ export class Table extends Resource implements ITable { */ public readonly database: IDatabase; + /** + * Indicates whether the table's data is compressed or not. + */ + public readonly compressed: boolean; + /** * The type of encryption enabled for the table. */ @@ -235,6 +240,7 @@ export class Table extends Resource implements ITable { this.columns = props.columns; this.partitionKeys = props.partitionKeys; + this.compressed = props.compressed === undefined ? false : props.compressed; const {bucket, encryption, encryptionKey} = createBucket(this, props); this.bucket = bucket; this.encryption = encryption; @@ -256,7 +262,7 @@ export class Table extends Resource implements ITable { }, storageDescriptor: { location: `s3://${this.bucket.bucketName}/${this.s3Prefix}`, - compressed: props.compressed === undefined ? false : props.compressed, + compressed: this.compressed, storedAsSubDirectories: props.storedAsSubDirectories === undefined ? false : props.storedAsSubDirectories, columns: renderColumns(props.columns), inputFormat: props.dataFormat.inputFormat.className, @@ -271,7 +277,11 @@ export class Table extends Resource implements ITable { }); this.tableName = tableResource.tableName; - this.tableArn = `${this.database.databaseArn}/${this.tableName}`; + this.tableArn = this.node.stack.formatArn({ + service: 'glue', + resource: 'table', + resourceName: `${this.database.databaseName}/${this.tableName}` + }); } /** diff --git a/packages/@aws-cdk/aws-glue/test/integ.table.expected.json b/packages/@aws-cdk/aws-glue/test/integ.table.expected.json index 93c91ebc24e5c..8d4f6a7793ea8 100644 --- a/packages/@aws-cdk/aws-glue/test/integ.table.expected.json +++ b/packages/@aws-cdk/aws-glue/test/integ.table.expected.json @@ -296,7 +296,7 @@ { "Ref": "AWS::AccountId" }, - ":database/", + ":table/", { "Ref": "MyDatabase1E2517DB" }, @@ -373,7 +373,7 @@ { "Ref": "AWS::AccountId" }, - ":database/", + ":table/", { "Ref": "MyDatabase1E2517DB" }, diff --git a/packages/@aws-cdk/aws-glue/test/test.schema.ts b/packages/@aws-cdk/aws-glue/test/test.schema.ts index 25d17f936efc2..c333eb780cc1b 100644 --- a/packages/@aws-cdk/aws-glue/test/test.schema.ts +++ b/packages/@aws-cdk/aws-glue/test/test.schema.ts @@ -34,7 +34,7 @@ export = { }, 'integer type'(test: Test) { - test.equals(Schema.integer.inputString, 'integer'); + test.equals(Schema.integer.inputString, 'int'); test.equals(Schema.integer.isPrimitive, true); test.done(); }, @@ -167,12 +167,12 @@ export = { test.done(); }, - 'map'(test: Test) { + 'map'(test: Test) { const type = Schema.map( Schema.integer, Schema.string ); - test.equals(type.inputString, 'map'); + test.equals(type.inputString, 'map'); test.equals(type.isPrimitive, false); test.done(); }, diff --git a/packages/@aws-cdk/aws-glue/test/test.table.ts b/packages/@aws-cdk/aws-glue/test/test.table.ts index bb5914013f759..a0c4b7c430797 100644 --- a/packages/@aws-cdk/aws-glue/test/test.table.ts +++ b/packages/@aws-cdk/aws-glue/test/test.table.ts @@ -1097,7 +1097,7 @@ export = { { Ref: "AWS::AccountId" }, - ":database/", + ":table/", { Ref: "DatabaseB269D8BB" }, @@ -1201,7 +1201,7 @@ export = { { Ref: "AWS::AccountId" }, - ":database/", + ":table/", { Ref: "DatabaseB269D8BB" }, @@ -1312,7 +1312,7 @@ export = { { Ref: "AWS::AccountId" }, - ":database/", + ":table/", { Ref: "DatabaseB269D8BB" },