updatePartition method
Updates a partition.
May throw EntityNotFoundException. May throw InvalidInputException. May throw InternalServiceException. May throw OperationTimeoutException. May throw GlueEncryptionException.
Parameter databaseName
:
The name of the catalog database in which the table in question resides.
Parameter partitionInput
:
The new partition object to update the partition to.
The Values
property can't be changed. If you want to change
the partition key values for a partition, delete and recreate the
partition.
Parameter partitionValueList
:
List of partition key values that define the partition to update.
Parameter tableName
:
The name of the table in which the partition to be updated is located.
Parameter catalogId
:
The ID of the Data Catalog where the partition to be updated resides. If
none is provided, the AWS account ID is used by default.
Implementation
Future<void> updatePartition({
required String databaseName,
required PartitionInput partitionInput,
required List<String> partitionValueList,
required String tableName,
String? catalogId,
}) async {
ArgumentError.checkNotNull(databaseName, 'databaseName');
_s.validateStringLength(
'databaseName',
databaseName,
1,
255,
isRequired: true,
);
ArgumentError.checkNotNull(partitionInput, 'partitionInput');
ArgumentError.checkNotNull(partitionValueList, 'partitionValueList');
ArgumentError.checkNotNull(tableName, 'tableName');
_s.validateStringLength(
'tableName',
tableName,
1,
255,
isRequired: true,
);
_s.validateStringLength(
'catalogId',
catalogId,
1,
255,
);
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'AWSGlue.UpdatePartition'
};
await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'DatabaseName': databaseName,
'PartitionInput': partitionInput,
'PartitionValueList': partitionValueList,
'TableName': tableName,
if (catalogId != null) 'CatalogId': catalogId,
},
);
}