UpdateTableCommand

Updates a metadata table in the Data Catalog.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { GlueClient, UpdateTableCommand } from "@aws-sdk/client-glue"; // ES Modules import
// const { GlueClient, UpdateTableCommand } = require("@aws-sdk/client-glue"); // CommonJS import
const client = new GlueClient(config);
const input = { // UpdateTableRequest
  CatalogId: "STRING_VALUE",
  DatabaseName: "STRING_VALUE", // required
  TableInput: { // TableInput
    Name: "STRING_VALUE", // required
    Description: "STRING_VALUE",
    Owner: "STRING_VALUE",
    LastAccessTime: new Date("TIMESTAMP"),
    LastAnalyzedTime: new Date("TIMESTAMP"),
    Retention: Number("int"),
    StorageDescriptor: { // StorageDescriptor
      Columns: [ // ColumnList
        { // Column
          Name: "STRING_VALUE", // required
          Type: "STRING_VALUE",
          Comment: "STRING_VALUE",
          Parameters: { // ParametersMap
            "<keys>": "STRING_VALUE",
          },
        },
      ],
      Location: "STRING_VALUE",
      AdditionalLocations: [ // LocationStringList
        "STRING_VALUE",
      ],
      InputFormat: "STRING_VALUE",
      OutputFormat: "STRING_VALUE",
      Compressed: true || false,
      NumberOfBuckets: Number("int"),
      SerdeInfo: { // SerDeInfo
        Name: "STRING_VALUE",
        SerializationLibrary: "STRING_VALUE",
        Parameters: {
          "<keys>": "STRING_VALUE",
        },
      },
      BucketColumns: [ // NameStringList
        "STRING_VALUE",
      ],
      SortColumns: [ // OrderList
        { // Order
          Column: "STRING_VALUE", // required
          SortOrder: Number("int"), // required
        },
      ],
      Parameters: "<ParametersMap>",
      SkewedInfo: { // SkewedInfo
        SkewedColumnNames: [
          "STRING_VALUE",
        ],
        SkewedColumnValues: [ // ColumnValueStringList
          "STRING_VALUE",
        ],
        SkewedColumnValueLocationMaps: { // LocationMap
          "<keys>": "STRING_VALUE",
        },
      },
      StoredAsSubDirectories: true || false,
      SchemaReference: { // SchemaReference
        SchemaId: { // SchemaId
          SchemaArn: "STRING_VALUE",
          SchemaName: "STRING_VALUE",
          RegistryName: "STRING_VALUE",
        },
        SchemaVersionId: "STRING_VALUE",
        SchemaVersionNumber: Number("long"),
      },
    },
    PartitionKeys: [
      {
        Name: "STRING_VALUE", // required
        Type: "STRING_VALUE",
        Comment: "STRING_VALUE",
        Parameters: "<ParametersMap>",
      },
    ],
    ViewOriginalText: "STRING_VALUE",
    ViewExpandedText: "STRING_VALUE",
    TableType: "STRING_VALUE",
    Parameters: "<ParametersMap>",
    TargetTable: { // TableIdentifier
      CatalogId: "STRING_VALUE",
      DatabaseName: "STRING_VALUE",
      Name: "STRING_VALUE",
      Region: "STRING_VALUE",
    },
    ViewDefinition: { // ViewDefinitionInput
      IsProtected: true || false,
      Definer: "STRING_VALUE",
      Representations: [ // ViewRepresentationInputList
        { // ViewRepresentationInput
          Dialect: "REDSHIFT" || "ATHENA" || "SPARK",
          DialectVersion: "STRING_VALUE",
          ViewOriginalText: "STRING_VALUE",
          ValidationConnection: "STRING_VALUE",
          ViewExpandedText: "STRING_VALUE",
        },
      ],
      SubObjects: [ // ViewSubObjectsList
        "STRING_VALUE",
      ],
    },
  },
  SkipArchive: true || false,
  TransactionId: "STRING_VALUE",
  VersionId: "STRING_VALUE",
  ViewUpdateAction: "ADD" || "REPLACE" || "ADD_OR_REPLACE" || "DROP",
  Force: true || false,
};
const command = new UpdateTableCommand(input);
const response = await client.send(command);
// {};

UpdateTableCommand Input

See UpdateTableCommandInput for more details

Parameter
Type
Description
DatabaseName
Required
string | undefined

The name of the catalog database in which the table resides. For Hive compatibility, this name is entirely lowercase.

TableInput
Required
TableInput | undefined

An updated TableInput object to define the metadata table in the catalog.

CatalogId
string | undefined

The ID of the Data Catalog where the table resides. If none is provided, the Amazon Web Services account ID is used by default.

Force
boolean | undefined

A flag that can be set to true to ignore matching storage descriptor and subobject matching requirements.

SkipArchive
boolean | undefined

By default, UpdateTable always creates an archived version of the table before updating it. However, if skipArchive is set to true, UpdateTable does not create the archived version.

TransactionId
string | undefined

The transaction ID at which to update the table contents.

VersionId
string | undefined

The version ID at which to update the table contents.

ViewUpdateAction
ViewUpdateAction | undefined

The operation to be performed when updating the view.

UpdateTableCommand Output

See UpdateTableCommandOutput for details

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.

Throws

Name
Fault
Details
AlreadyExistsException
client

A resource to be created or added already exists.

ConcurrentModificationException
client

Two processes are trying to modify a resource simultaneously.

EntityNotFoundException
client

A specified entity does not exist

FederationSourceException
client

A federation source failed.

FederationSourceRetryableException
client

A federation source failed, but the operation may be retried.

GlueEncryptionException
client

An encryption operation failed.

InternalServiceException
server

An internal service error occurred.

InvalidInputException
client

The input provided was not valid.

OperationTimeoutException
client

The operation timed out.

ResourceNotReadyException
client

A resource was not ready for a transaction.

ResourceNumberLimitExceededException
client

A resource numerical limit was exceeded.

GlueServiceException
Base exception class for all service exceptions from Glue service.