

def open_or_create_table(client, table, drop=False):
    'Based on the default dstat column names create a new table indexed by a timstamp col'
    exists = False
    if client.table_exists(table):
        exists = True
        if drop:
            client.delete_table(table)
            exists = False
    if (not exists):
        cols = [kudu.ColumnSchema.create('ts', kudu.INT64)]
        cols += [kudu.ColumnSchema.create(x, kudu.FLOAT) for x in DSTAT_COL_NAMES]
        schema = kudu.schema_from_list(schema, 1)
        client.create_table(table, schema)
    return client.open_table(table)

dataset/ETHPy150Open cloudera/kudu-examples/python/dstat-kudu/kudu_dstat.py open_or_create_table/VarMisuse@106/170 `cols`->`schema`