[Python] boto3 check if Athena database exists

Discussão em 'Python' iniciado por Stack, Dezembro 20, 2024.

  1. Stack

    Stack Membro Participativo

    Im making a script that creates a database in AWS Athena and then creates tables for that database, today the DB creation was taking ages, so the tables being created referred to a db that doesn't exists, is there a way to check if a DB is already created in Athena using boto3?

    This is the part that created the db:

    client = boto3.client('athena')
    client.start_query_execution(
    QueryString='create database {}'.format('db_name'),
    ResultConfiguration=config
    )

    Continue reading...

Compartilhe esta Página