Makes a table, if it doesn't already exist.
547658
def make_table(self,
                   tablename: str,
                   fieldspeclist: FIELDSPECLIST_TYPE,
                   dynamic: bool = False,
                   compressed: bool = False) -> Optional[int]:
        """"""
        if self.table_exists(tablename):
            log.info("Skipping creation of table " + tablename +
                     " (already exists)")
            return None
        if not self.is_mysql():
            dynamic = False
            compressed = False
        # http://dev.mysql.com/doc/refman/5.5/en/innodb-compression-usage.html
        sql = """
            CREATE TABLE IF NOT EXISTS {tablename}
            ({fieldspecs})
            {dynamic}
            {compressed}
        """.format(
            tablename=tablename,
            fieldspecs=self.fielddefsql_from_fieldspeclist(fieldspeclist),
            dynamic="ROW_FORMAT=DYNAMIC" if dynamic else "",
            compressed="ROW_FORMAT=COMPRESSED" if compressed else "",
        )
        log.info("Creating table " + tablename)
        return self.db_exec_literal(sql)
1294926
def rename_table(self, from_table: str, to_table: str) -> Optional[int]:
        """"""
        if not self.table_exists(from_table):
            log.info("Skipping renaming of table " + from_table +
                     " (doesn't exist)")
            return None
        if self.table_exists(to_table):
            raise RuntimeError("Can't rename table {} to {}: destination "
                               "already exists!".format(from_table, to_table))
        log.info("Renaming table {} to {}", from_table, to_table)
        sql = "RENAME TABLE {} TO {}".format(from_table, to_table)
        return self.db_exec_literal(sql)
446147
def create(self, ex):
    ""
    if ex.name in self:
      if ex.nexists: return
      raise ValueError('table_exists',ex.name)
    if any(c.pkey for c in ex.cols):
      if ex.pkey:
        raise sqparse2.SQLSyntaxError("don't mix table-level and column-level pkeys",ex)
      # todo(spec): is multi pkey permitted when defined per column?
      ex.pkey = sqparse2.PKeyX([c.name for c in ex.cols if c.pkey])
    if ex.inherits:
      # todo: what if child table specifies constraints etc? this needs work.
      if len(ex.inherits) > 1: raise NotImplementedError('todo: multi-table inherit')
      parent = self[ex.inherits[0]] = copy.deepcopy(self[ex.inherits[0]]) # copy so rollback works
      child = self[ex.name] = table.Table(ex.name, parent.fields, parent.pkey)
      parent.child_tables.append(child)
      child.parent_table = parent
    else:
      self[ex.name]=table.Table(ex.name,ex.cols,ex.pkey.fields if ex.pkey else [])
154208
public boolean tableExists(String table)
		throws SQLException
	{

		PreparedStatement statement = null;
		ResultSet result = null;
		try {
			statement = this.connection.prepareStatement("SHOW TABLES;");
			result = execute(statement);

			if (result == null) {
				return false;
			}
			boolean found = false;
			while(result.next()){
					if(table.equalsIgnoreCase(result.getString(1))){
						found = true;
					}
			}
			return found;

		}
		finally {
			if (statement != null) {
				statement.close();
			}
			if (result != null) {
				result.close();
			}
		}

	}
1208236
def step_table_made(self):
        """"""
        try:
            empty = self.step_table.empty
        except AttributeError:
            empty = True
        return not empty
1050333
function createTable (db, name) {
  return r.db(db).tableCreate(name).run().then(function () {
    console.log('RETHINKDB: Created Table', name, 'on', db)
  }).catch(function (err) {
    console.log('RETHINKDB: Table', name, 'on', db, 'exists')
  })
}
1055410
public void createTable() {
    // [START bigtable_hw_create_table_veneer]
    // Checks if table exists, creates table if does not exist.
    if (!adminClient.exists(tableId)) {
      System.out.println("Creating table: " + tableId);
      CreateTableRequest createTableRequest =
          CreateTableRequest.of(tableId).addFamily(COLUMN_FAMILY);
      adminClient.createTable(createTableRequest);
      System.out.printf("Table %s created successfully%n", tableId);
    }
    // [END bigtable_hw_create_table_veneer]
  }
1161523
def create_tables(c):
    """"""
    # auto_shape_types ---------------------
    c.execute(
        'DROP TABLE IF EXISTS auto_shape_types'
    )
    c.execute(
        'CREATE TABLE auto_shape_types (\n'
        '    id         integer,\n'
        '    prst       text,\n'
        '    const_name text,\n'
        '    base_name  text,\n'
        '    ms_name    text,\n'
        '    desc       text\n'
        ')\n'
    )
    c.execute(
        'DROP TABLE IF EXISTS adjustment_values'
    )
    c.execute(
        'CREATE TABLE adjustment_values (\n'
        '    prst     text,\n'
        '    seq_nmbr integer,\n'
        '    name     text,\n'
        '    val      integer\n'
        ')\n'
    )
871184
def create_or_open_table_at index
      t = self[index]
      t = self[index] = Workbook::Table.new if t == nil
      t.sheet = self
      t
    end
521585
def copy_table(tbl, start=0, stop=None, blen=None, storage=None,
               create='table', **kwargs):
    """"""

    # setup
    names, columns = _util.check_table_like(tbl)
    storage = _util.get_storage(storage)
    blen = _util.get_blen_table(tbl, blen)
    if stop is None:
        stop = len(columns[0])
    else:
        stop = min(stop, len(columns[0]))
    length = stop - start
    if length < 0:
        raise ValueError('invalid stop/start')

    # copy block-wise
    out = None
    for i in range(start, stop, blen):
        j = min(i+blen, stop)
        res = [c[i:j] for c in columns]
        if out is None:
            out = getattr(storage, create)(res, names=names,
                                           expectedlen=length, **kwargs)
        else:
            out.append(res)

    return out
638196
def create_table(unique_keys):
    
    _State.new_transaction()
    _State.table.create(bind=_State.engine, checkfirst=True)
    if unique_keys != []:
        create_index(unique_keys, unique=True)
    _State.table_pending = False
    _State.reflect_metadata()
757300
function Table(type, length) {
    if (!(this instanceof Table))
        return new Table(type, length);
    this.type = type;
    this.length = length;
}
1311857
def table_exists(self, table):
        
        if not self.dataset_exists(table.dataset):
            return False

        try:
            self.client.tables().get(projectId=table.project_id,
                                     datasetId=table.dataset_id,
                                     tableId=table.table_id).execute()
        except http.HttpError as ex:
            if ex.resp.status == 404:
                return False
            raise

        return True
1332652
async def create_table(**data):
    

    table = data.get('table')

    try:
        clickhouse_queries.create_table(table, data)
        return 'Table was successfully created'

    except ServerException as e:
        exception_code = int(str(e)[5:8].strip())

        if exception_code == 57:
            return 'Table already exists'
        elif exception_code == 50:
            return 'Invalid params'
969582
def create_table(self, table_name, obj=None, **kwargs):
        
        return self.client.create_table(
            table_name, obj=obj, database=self.name, **kwargs
        )
859875
def make_table(headers=None, rows=None):
    """"""
    if callable(headers):
        headers = headers()
    if callable(rows):
        rows = rows()
    assert isinstance(headers, list)
    assert isinstance(rows, list)
    assert all(len(row) == len(headers) for row in rows)

    plain_headers = [strip_ansi(six.text_type(v)) for v in headers]
    plain_rows = [row for row in [strip_ansi(six.text_type(v)) for v in rows]]

    plain_headers = []
    column_widths = []

    for k, v in enumerate(headers):
        v = six.text_type(v)
        plain = strip_ansi(v)
        plain_headers.append(plain)
        column_widths.append(len(plain))

        if len(v) == len(plain):
            # Value was unstyled, make it bold
            v = click.style(v, bold=True)

        headers[k] = v

    plain_rows = []
    for row in rows:
        plain_row = []
        for k, v in enumerate(row):
            v = six.text_type(v)
            plain = strip_ansi(v)
            plain_row.append(plain)
            column_widths[k] = max(column_widths[k], len(plain))

        plain_rows.append(plain_row)

    return Table(
        headers=headers,
        plain_headers=plain_headers,
        rows=rows,
        plain_rows=plain_rows,
        column_widths=column_widths,
    )
897727
@Override
    protected void create(List<TableInfo> tableInfos)
    {

        for (TableInfo tableInfo : tableInfos)
        {
            try
            {
                if (client.tableExists(tableInfo.getTableName()))
                {
                    client.deleteTable(tableInfo.getTableName());
                }
            }
            catch (Exception e)
            {
                logger.error("Cannot check table existence for table " + tableInfo.getTableName() + ". Caused By: " + e);
                throw new KunderaException("Cannot check table existence for table " + tableInfo.getTableName()
                        + ". Caused By: " + e);
            }
            createKuduTable(tableInfo);
        }
    }