updateColumnStatisticsForTable method

Future<UpdateColumnStatisticsForTableResponse> updateColumnStatisticsForTable({
  1. required List<ColumnStatistics> columnStatisticsList,
  2. required String databaseName,
  3. required String tableName,
  4. String? catalogId,
})

Creates or updates table statistics of columns.

The Identity and Access Management (IAM) permission required for this operation is UpdateTable.

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

Parameter columnStatisticsList : A list of the column statistics.

Parameter databaseName : The name of the catalog database where the partitions reside.

Parameter tableName : The name of the partitions' table.

Parameter catalogId : The ID of the Data Catalog where the partitions in question reside. If none is supplied, the AWS account ID is used by default.

Implementation

Future<UpdateColumnStatisticsForTableResponse>
    updateColumnStatisticsForTable({
  required List<ColumnStatistics> columnStatisticsList,
  required String databaseName,
  required String tableName,
  String? catalogId,
}) async {
  ArgumentError.checkNotNull(columnStatisticsList, 'columnStatisticsList');
  ArgumentError.checkNotNull(databaseName, 'databaseName');
  _s.validateStringLength(
    'databaseName',
    databaseName,
    1,
    255,
    isRequired: true,
  );
  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.UpdateColumnStatisticsForTable'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ColumnStatisticsList': columnStatisticsList,
      'DatabaseName': databaseName,
      'TableName': tableName,
      if (catalogId != null) 'CatalogId': catalogId,
    },
  );

  return UpdateColumnStatisticsForTableResponse.fromJson(jsonResponse.body);
}