2
client = boto3.client('redshift-data')

# this seems asynchronous 
response = client.execute_statement(
    ClusterIdentifier='xyz',
    Database='dev',
    DbUser='user1',
    Sql='select * from table1;',
    StatementName='test1',
    WithEvent=False
)

describe = client.describe_statement(Id=response['Id'])
print(describe['Status'])  # PICKED, SUBMITTED

After executing a sql, it takes some time to get the final response.

Especially when sql = vacuum table1; Without any waiting mechanism, the status returned is PICKED or SUBMITTED.

Are there any redshift waiters like these , or do I need to manually wait until the status changes to FAILED or SUCCESS

Aseem
  • 5,848
  • 7
  • 45
  • 69
  • The waiters are nothing else then a loop which pulls for status with 15 seconds intervals. You have to implement it yourself for your use-case. – Marcin Oct 26 '21 at 22:34

0 Answers0