createPartition method

Future<void> createPartition({
  1. required String databaseName,
  2. required PartitionInput partitionInput,
  3. required String tableName,
  4. String? catalogId,
})

Creates a new partition.

May throw InvalidInputException. May throw AlreadyExistsException. May throw ResourceNumberLimitExceededException. May throw InternalServiceException. May throw EntityNotFoundException. May throw OperationTimeoutException. May throw GlueEncryptionException.

Parameter databaseName : The name of the metadata database in which the partition is to be created.

Parameter partitionInput : A PartitionInput structure defining the partition to be created.

Parameter tableName : The name of the metadata table in which the partition is to be created.

Parameter catalogId : The AWS account ID of the catalog in which the partition is to be created.

Implementation

Future<void> createPartition({
  required String databaseName,
  required PartitionInput partitionInput,
  required String tableName,
  String? catalogId,
}) async {
  ArgumentError.checkNotNull(databaseName, 'databaseName');
  _s.validateStringLength(
    'databaseName',
    databaseName,
    1,
    255,
    isRequired: true,
  );
  ArgumentError.checkNotNull(partitionInput, 'partitionInput');
  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.CreatePartition'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'DatabaseName': databaseName,
      'PartitionInput': partitionInput,
      'TableName': tableName,
      if (catalogId != null) 'CatalogId': catalogId,
    },
  );
}