parameters: (client, table, drop=False)
return_statement: return client.table(table)
docstring: Based on the default dstat column names create a new table indexed by a timstamp col
docstring_summary: Based on the default dstat column names create a new table indexed by a timstamp col
docstring_tokens: Based on the default dstat column names create a new table indexed by a timstamp col
function: 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:
      # Create the schema for the table, basically all float cols
      builder = kudu.schema_builder()
      builder.add_column("ts", kudu.int64, nullable=False, primary_key=True)
      for col in DSTAT_COL_NAMES:
        builder.add_column(col, kudu.float_)
      schema = builder.build()
  
      # Create hash partitioning buckets
      partitioning = Partitioning().add_hash_partitions('ts', 2)
  
      client.create_table(table, schema, partitioning)
  
    return client.table(table)
function_tokens: def open_or_create_table ( client , table , drop = False ) : exists = False if client . table_exists ( table ) : exists = True if drop : client . delete_table ( table ) exists = False if not exists : # Create the schema for the table, basically all float cols builder = kudu . schema_builder ( ) builder . add_column ( "ts" , kudu . int64 , nullable = False , primary_key = True ) for col in DSTAT_COL_NAMES : builder . add_column ( col , kudu . float_ ) schema = builder . build ( ) # Create hash partitioning buckets partitioning = Partitioning ( ) . add_hash_partitions ( 'ts' , 2 ) client . create_table ( table , schema , partitioning ) return client . table ( table )