def create_batch_tables(cluster, session):
 logging.info('Trying to create batches')
 create_table = '\n    CREATE TABLE IF NOT EXISTS batches (\n      app text,\n      transaction int,\n      namespace text,\n      path blob,\n      old_value blob,\n      new_value blob,\n      exclude_indices text,\n      PRIMARY KEY ((app, transaction), namespace, path)\n    )\n  '
 statement = SimpleStatement(create_table, retry_policy=NO_RETRIES)
 try:
  session.execute(statement)
 except cassandra.OperationTimedOut:
  logging.warning('Encountered an operation timeout while creating batches table. Waiting 1 minute for schema to settle.')
  time.sleep(60)
  raise
 logging.info('Trying to create batch_status')
 create_table = '\n    CREATE TABLE IF NOT EXISTS batch_status (\n      app text,\n      transaction int,\n      applied boolean,\n      PRIMARY KEY ((app), transaction)\n    )\n  '
 statement = SimpleStatement(create_table, retry_policy=NO_RETRIES)
 try:
  session.execute(statement)
 except cassandra.OperationTimedOut:
  logging.warning('Encountered an operation timeout while creating batch_status table. Waiting 1 minute for schema to settle.')
  time.sleep(60)
  raise

def create_batch_tables ( cluster , session ) : logging . info ( 'Trying to create batches' ) create_table = '\n    CREATE TABLE IF NOT EXISTS batches (\n      app text,\n      transaction int,\n      namespace text,\n      path blob,\n      old_value blob,\n      new_value blob,\n      exclude_indices text,\n      PRIMARY KEY ((app, transaction), namespace, path)\n    )\n  ' statement = SimpleStatement ( create_table , retry_policy = NO_RETRIES ) try : session . execute ( statement ) except cassandra . OperationTimedOut : logging . warning ( 'Encountered an operation timeout while creating batches table. Waiting 1 minute for schema to settle.' ) time . sleep ( 60 ) raise logging . info ( 'Trying to create batch_status' ) create_table = '\n    CREATE TABLE IF NOT EXISTS batch_status (\n      app text,\n      transaction int,\n      applied boolean,\n      PRIMARY KEY ((app), transaction)\n    )\n  ' statement = SimpleStatement ( create_table , retry_policy = NO_RETRIES ) try : session . execute ( statement ) except cassandra . OperationTimedOut : logging . warning ( 'Encountered an operation timeout while creating batch_status table. Waiting 1 minute for schema to settle.' ) time . sleep ( 60 ) raise
create the tables required for large batches .