getTableMetadata method

Future<GetTableMetadataOutput> getTableMetadata({
  1. required String catalogName,
  2. required String databaseName,
  3. required String tableName,
})

Returns table metadata for the specified catalog, database, and table.

May throw InternalServerException. May throw InvalidRequestException. May throw MetadataException.

Parameter catalogName : The name of the data catalog that contains the database and table metadata to return.

Parameter databaseName : The name of the database that contains the table metadata to return.

Parameter tableName : The name of the table for which metadata is returned.

Implementation

Future<GetTableMetadataOutput> getTableMetadata({
  required String catalogName,
  required String databaseName,
  required String tableName,
}) async {
  ArgumentError.checkNotNull(catalogName, 'catalogName');
  _s.validateStringLength(
    'catalogName',
    catalogName,
    1,
    256,
    isRequired: true,
  );
  ArgumentError.checkNotNull(databaseName, 'databaseName');
  _s.validateStringLength(
    'databaseName',
    databaseName,
    1,
    128,
    isRequired: true,
  );
  ArgumentError.checkNotNull(tableName, 'tableName');
  _s.validateStringLength(
    'tableName',
    tableName,
    1,
    128,
    isRequired: true,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AmazonAthena.GetTableMetadata'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'CatalogName': catalogName,
      'DatabaseName': databaseName,
      'TableName': tableName,
    },
  );

  return GetTableMetadataOutput.fromJson(jsonResponse.body);
}