def _insert_rows(session, table_name, insert_stmt, values):
    prepared_insert = session.prepare(insert_stmt)
    values = list(values)
    execute_concurrent(session, ((prepared_insert, x) for x in values), concurrency=500, raise_on_first_error=True)
    data_loaded = rows_to_list(session.execute(('SELECT * FROM ' + table_name)))
    logger.debug('{n} rows inserted into {table_name}'.format(n=len(data_loaded), table_name=table_name))
    assert (len(values) == len(data_loaded))
    return data_loaded
def _insert_rows(session, table_name, insert_stmt, values):
    prepared_insert = session.prepare(insert_stmt)
    values = list(values)
    execute_concurrent(session, ((prepared_insert, x) for x in values), concurrency=500, raise_on_first_error=True)
    data_loaded = rows_to_list(session.execute(('SELECT * FROM ' + table_name)))
    logger.debug('{n} rows inserted into {table_name}'.format(n=len(data_loaded), table_name=table_name))
    assert (len(values) == len(data_loaded))
    return data_loaded