Catalog Table Args
data class CatalogTableArgs(val catalogId: Output<String>? = null, val databaseName: Output<String>? = null, val description: Output<String>? = null, val name: Output<String>? = null, val openTableFormatInput: Output<CatalogTableOpenTableFormatInputArgs>? = null, val owner: Output<String>? = null, val parameters: Output<Map<String, String>>? = null, val partitionIndices: Output<List<CatalogTablePartitionIndexArgs>>? = null, val partitionKeys: Output<List<CatalogTablePartitionKeyArgs>>? = null, val retention: Output<Int>? = null, val storageDescriptor: Output<CatalogTableStorageDescriptorArgs>? = null, val tableType: Output<String>? = null, val targetTable: Output<CatalogTableTargetTableArgs>? = null, val viewExpandedText: Output<String>? = null, val viewOriginalText: Output<String>? = null) : ConvertibleToJava<CatalogTableArgs>
Provides a Glue Catalog Table Resource. You can refer to the Glue Developer Guide for a full explanation of the Glue Data Catalog functionality.
Example Usage
Basic Table
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const awsGlueCatalogTable = new aws.glue.CatalogTable("aws_glue_catalog_table", {
name: "MyCatalogTable",
databaseName: "MyCatalogDatabase",
});Content copied to clipboard
import pulumi
import pulumi_aws as aws
aws_glue_catalog_table = aws.glue.CatalogTable("aws_glue_catalog_table",
name="MyCatalogTable",
database_name="MyCatalogDatabase")Content copied to clipboard
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var awsGlueCatalogTable = new Aws.Glue.CatalogTable("aws_glue_catalog_table", new()
{
Name = "MyCatalogTable",
DatabaseName = "MyCatalogDatabase",
});
});Content copied to clipboard
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/glue"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := glue.NewCatalogTable(ctx, "aws_glue_catalog_table", &glue.CatalogTableArgs{
Name: pulumi.String("MyCatalogTable"),
DatabaseName: pulumi.String("MyCatalogDatabase"),
})
if err != nil {
return err
}
return nil
})
}Content copied to clipboard
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.glue.CatalogTable;
import com.pulumi.aws.glue.CatalogTableArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var awsGlueCatalogTable = new CatalogTable("awsGlueCatalogTable", CatalogTableArgs.builder()
.name("MyCatalogTable")
.databaseName("MyCatalogDatabase")
.build());
}
}Content copied to clipboard
resources:
awsGlueCatalogTable:
type: aws:glue:CatalogTable
name: aws_glue_catalog_table
properties:
name: MyCatalogTable
databaseName: MyCatalogDatabaseContent copied to clipboard
Parquet Table for Athena
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const awsGlueCatalogTable = new aws.glue.CatalogTable("aws_glue_catalog_table", {
name: "MyCatalogTable",
databaseName: "MyCatalogDatabase",
tableType: "EXTERNAL_TABLE",
parameters: {
EXTERNAL: "TRUE",
"parquet.compression": "SNAPPY",
},
storageDescriptor: {
location: "s3://my-bucket/event-streams/my-stream",
inputFormat: "org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat",
outputFormat: "org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat",
serDeInfo: {
name: "my-stream",
serializationLibrary: "org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe",
parameters: {
"serialization.format": "1",
},
},
columns: [
{
name: "my_string",
type: "string",
},
{
name: "my_double",
type: "double",
},
{
name: "my_date",
type: "date",
comment: "",
},
{
name: "my_bigint",
type: "bigint",
comment: "",
},
{
name: "my_struct",
type: "struct<my_nested_string:string>",
comment: "",
},
],
},
});Content copied to clipboard
import pulumi
import pulumi_aws as aws
aws_glue_catalog_table = aws.glue.CatalogTable("aws_glue_catalog_table",
name="MyCatalogTable",
database_name="MyCatalogDatabase",
table_type="EXTERNAL_TABLE",
parameters={
"EXTERNAL": "TRUE",
"parquet.compression": "SNAPPY",
},
storage_descriptor=aws.glue.CatalogTableStorageDescriptorArgs(
location="s3://my-bucket/event-streams/my-stream",
input_format="org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat",
output_format="org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat",
ser_de_info=aws.glue.CatalogTableStorageDescriptorSerDeInfoArgs(
name="my-stream",
serialization_library="org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe",
parameters={
"serialization.format": "1",
},
),
columns=[
aws.glue.CatalogTableStorageDescriptorColumnArgs(
name="my_string",
type="string",
),
aws.glue.CatalogTableStorageDescriptorColumnArgs(
name="my_double",
type="double",
),
aws.glue.CatalogTableStorageDescriptorColumnArgs(
name="my_date",
type="date",
comment="",
),
aws.glue.CatalogTableStorageDescriptorColumnArgs(
name="my_bigint",
type="bigint",
comment="",
),
aws.glue.CatalogTableStorageDescriptorColumnArgs(
name="my_struct",
type="struct<my_nested_string:string>",
comment="",
),
],
))Content copied to clipboard
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var awsGlueCatalogTable = new Aws.Glue.CatalogTable("aws_glue_catalog_table", new()
{
Name = "MyCatalogTable",
DatabaseName = "MyCatalogDatabase",
TableType = "EXTERNAL_TABLE",
Parameters =
{
{ "EXTERNAL", "TRUE" },
{ "parquet.compression", "SNAPPY" },
},
StorageDescriptor = new Aws.Glue.Inputs.CatalogTableStorageDescriptorArgs
{
Location = "s3://my-bucket/event-streams/my-stream",
InputFormat = "org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat",
OutputFormat = "org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat",
SerDeInfo = new Aws.Glue.Inputs.CatalogTableStorageDescriptorSerDeInfoArgs
{
Name = "my-stream",
SerializationLibrary = "org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe",
Parameters =
{
{ "serialization.format", "1" },
},
},
Columns = new[]
{
new Aws.Glue.Inputs.CatalogTableStorageDescriptorColumnArgs
{
Name = "my_string",
Type = "string",
},
new Aws.Glue.Inputs.CatalogTableStorageDescriptorColumnArgs
{
Name = "my_double",
Type = "double",
},
new Aws.Glue.Inputs.CatalogTableStorageDescriptorColumnArgs
{
Name = "my_date",
Type = "date",
Comment = "",
},
new Aws.Glue.Inputs.CatalogTableStorageDescriptorColumnArgs
{
Name = "my_bigint",
Type = "bigint",
Comment = "",
},
new Aws.Glue.Inputs.CatalogTableStorageDescriptorColumnArgs
{
Name = "my_struct",
Type = "struct<my_nested_string:string>",
Comment = "",
},
},
},
});
});Content copied to clipboard
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/glue"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := glue.NewCatalogTable(ctx, "aws_glue_catalog_table", &glue.CatalogTableArgs{
Name: pulumi.String("MyCatalogTable"),
DatabaseName: pulumi.String("MyCatalogDatabase"),
TableType: pulumi.String("EXTERNAL_TABLE"),
Parameters: pulumi.StringMap{
"EXTERNAL": pulumi.String("TRUE"),
"parquet.compression": pulumi.String("SNAPPY"),
},
StorageDescriptor: &glue.CatalogTableStorageDescriptorArgs{
Location: pulumi.String("s3://my-bucket/event-streams/my-stream"),
InputFormat: pulumi.String("org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat"),
OutputFormat: pulumi.String("org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat"),
SerDeInfo: &glue.CatalogTableStorageDescriptorSerDeInfoArgs{
Name: pulumi.String("my-stream"),
SerializationLibrary: pulumi.String("org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe"),
Parameters: pulumi.StringMap{
"serialization.format": pulumi.String("1"),
},
},
Columns: glue.CatalogTableStorageDescriptorColumnArray{
&glue.CatalogTableStorageDescriptorColumnArgs{
Name: pulumi.String("my_string"),
Type: pulumi.String("string"),
},
&glue.CatalogTableStorageDescriptorColumnArgs{
Name: pulumi.String("my_double"),
Type: pulumi.String("double"),
},
&glue.CatalogTableStorageDescriptorColumnArgs{
Name: pulumi.String("my_date"),
Type: pulumi.String("date"),
Comment: pulumi.String(""),
},
&glue.CatalogTableStorageDescriptorColumnArgs{
Name: pulumi.String("my_bigint"),
Type: pulumi.String("bigint"),
Comment: pulumi.String(""),
},
&glue.CatalogTableStorageDescriptorColumnArgs{
Name: pulumi.String("my_struct"),
Type: pulumi.String("struct<my_nested_string:string>"),
Comment: pulumi.String(""),
},
},
},
})
if err != nil {
return err
}
return nil
})
}Content copied to clipboard
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.glue.CatalogTable;
import com.pulumi.aws.glue.CatalogTableArgs;
import com.pulumi.aws.glue.inputs.CatalogTableStorageDescriptorArgs;
import com.pulumi.aws.glue.inputs.CatalogTableStorageDescriptorSerDeInfoArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var awsGlueCatalogTable = new CatalogTable("awsGlueCatalogTable", CatalogTableArgs.builder()
.name("MyCatalogTable")
.databaseName("MyCatalogDatabase")
.tableType("EXTERNAL_TABLE")
.parameters(Map.ofEntries(
Map.entry("EXTERNAL", "TRUE"),
Map.entry("parquet.compression", "SNAPPY")
))
.storageDescriptor(CatalogTableStorageDescriptorArgs.builder()
.location("s3://my-bucket/event-streams/my-stream")
.inputFormat("org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat")
.outputFormat("org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat")
.serDeInfo(CatalogTableStorageDescriptorSerDeInfoArgs.builder()
.name("my-stream")
.serializationLibrary("org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe")
.parameters(Map.of("serialization.format", 1))
.build())
.columns(
CatalogTableStorageDescriptorColumnArgs.builder()
.name("my_string")
.type("string")
.build(),
CatalogTableStorageDescriptorColumnArgs.builder()
.name("my_double")
.type("double")
.build(),
CatalogTableStorageDescriptorColumnArgs.builder()
.name("my_date")
.type("date")
.comment("")
.build(),
CatalogTableStorageDescriptorColumnArgs.builder()
.name("my_bigint")
.type("bigint")
.comment("")
.build(),
CatalogTableStorageDescriptorColumnArgs.builder()
.name("my_struct")
.type("struct<my_nested_string:string>")
.comment("")
.build())
.build())
.build());
}
}Content copied to clipboard
resources:
awsGlueCatalogTable:
type: aws:glue:CatalogTable
name: aws_glue_catalog_table
properties:
name: MyCatalogTable
databaseName: MyCatalogDatabase
tableType: EXTERNAL_TABLE
parameters:
EXTERNAL: TRUE
parquet.compression: SNAPPY
storageDescriptor:
location: s3://my-bucket/event-streams/my-stream
inputFormat: org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat
outputFormat: org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat
serDeInfo:
name: my-stream
serializationLibrary: org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe
parameters:
serialization.format: 1
columns:
- name: my_string
type: string
- name: my_double
type: double
- name: my_date
type: date
comment:
- name: my_bigint
type: bigint
comment:
- name: my_struct
type: struct<my_nested_string:string>
comment:Content copied to clipboard
Import
Using pulumi import, import Glue Tables using the catalog ID (usually AWS account ID), database name, and table name. For example:
$ pulumi import aws:glue/catalogTable:CatalogTable MyTable 123456789012:MyDatabase:MyTableContent copied to clipboard
Constructors
Link copied to clipboard
fun CatalogTableArgs(catalogId: Output<String>? = null, databaseName: Output<String>? = null, description: Output<String>? = null, name: Output<String>? = null, openTableFormatInput: Output<CatalogTableOpenTableFormatInputArgs>? = null, owner: Output<String>? = null, parameters: Output<Map<String, String>>? = null, partitionIndices: Output<List<CatalogTablePartitionIndexArgs>>? = null, partitionKeys: Output<List<CatalogTablePartitionKeyArgs>>? = null, retention: Output<Int>? = null, storageDescriptor: Output<CatalogTableStorageDescriptorArgs>? = null, tableType: Output<String>? = null, targetTable: Output<CatalogTableTargetTableArgs>? = null, viewExpandedText: Output<String>? = null, viewOriginalText: Output<String>? = null)
Functions
Properties
Link copied to clipboard
Link copied to clipboard
Configuration block for information about the physical storage of this table. For more information, refer to the Glue Developer Guide. See storage_descriptor below.