Checks if the string occurs in the table, and if it does, returns the names of the columns
        under which it occurs. If it does not, returns an empty list.
342763
def _string_in_table(self, candidate: str) -> List[str]:
        
        candidate_column_names: List[str] = []
        # First check if the entire candidate occurs as a cell.
        if candidate in self._string_column_mapping:
            candidate_column_names = self._string_column_mapping[candidate]
        # If not, check if it is a substring pf any cell value.
        if not candidate_column_names:
            for cell_value, column_names in self._string_column_mapping.items():
                if candidate in cell_value:
                    candidate_column_names.extend(column_names)
        candidate_column_names = list(set(candidate_column_names))
        return candidate_column_names
656412
def _getColumnList(self):
        
        columnList = []
        for columnName in self.columnNames:
            column = self.columns[columnName]
            type = column.getType()
            if type is None:
                type = 'text'
            columnList.append(
                {u'name': columnName,
                 u'type': type.decode('ascii')})
        return columnList
331501
HashSet<String> checkDupColumnNames() {
    HashSet<String> conflictingNames = new HashSet<>();
    if( null==_column_names ) return conflictingNames;
    HashSet<String> uniqueNames = new HashSet<>();
    for( String n : _column_names)
      if( !uniqueNames.add(n) ) conflictingNames.add(n);
    return conflictingNames;
  }
1325211
public boolean hasTableOrColumnCaseSensitive(String table, String column) {

        boolean result = false;
        ResultSet set = null;

        try {
            if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(column)) {
                // Check if the column is given
                set = m_con.getMetaData().getColumns(null, null, table, column);
                if (set.next()) {
                    String colname = set.getString("COLUMN_NAME");
                    if (colname.equalsIgnoreCase(column)) {
                        result = true; // The column is available
                    }
                }
            } else if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(table)) {
                // Check the table
                set = m_con.getMetaData().getTables(null, null, table, null);
                if (set.next()) {
                    String tablename = set.getString("TABLE_NAME");
                    if (tablename.equalsIgnoreCase(table)) {
                        result = true;
                    }
                }
            }
        } catch (SQLException e) {
            e.printStackTrace();
            result = false;
        } finally {
            try {
                if (set != null) {
                    set.close();
                }
            } catch (SQLException e) {
                e.printStackTrace();
            }
        }
        return result;
    }
629428
def get_column_names(engine: Engine, tablename: str) -> List[str]:
    
    return [info.name for info in gen_columns_info(engine, tablename)]
406754
def required(cls):
        
        columns = []
        for column in cls.__table__.columns:  # pylint: disable=no-member
            is_autoincrement = 'int' in str(column.type).lower() and column.autoincrement
            if (not column.nullable and not column.primary_key) or (column.primary_key and not is_autoincrement):
                columns.append(column.name)
        return columns
405588
def getInstNamesByIndex(self, *indices):
        """"""
        instNames = []
        for columnName in self._vars.keys():
            instNames.append(
                self.getInstNameByIndex(*(columnName[-1],) + indices)
            )

        return tuple(instNames)
264412
def has_column(self, table, column):
        
        column = column.lower()

        return column in list(map(lambda x: x.lower(), self.get_column_listing(table)))
610866
public Collection<String> listColumns(String table) throws SQLException {
	Collection<String> result = new ArrayList<String>();
	DatabaseMetaData dbm = connection.getMetaData();
	ResultSet rs = dbm.getColumns(null, null, table, null);
	while (rs.next()) {
	    result.add(rs.getString("COLUMN_NAME"));
	}
	return result;
    }
245073
def get_table_names(self, connection, schema=None, **kw):
        
        return self._get_table_or_view_names('r', connection, schema, **kw)
134390
private static Set<String> getIndexedColumnSetForTable(Table table) {
        HashSet<String> columns = new HashSet<>();

        for (Index index : table.getIndexes()) {
            for (ColumnRef colRef : index.getColumns()) {
                columns.add(colRef.getColumn().getTypeName());
            }
        }

        return columns;
    }
853045
protected List<String> getAllColumns(String tableName) {
        List<String> columns = new ArrayList<String>();
        try {
            // Lower-case table names are required for PostgreSQL; we might need to
            // alter this if we use another comparison database (besides HSQL) someday
            ResultSet rs = dbconn.getMetaData().getColumns(null, null, tableName.toLowerCase(), null);
            while (rs.next()) {
                columns.add(rs.getString(4));
            }
        } catch (SQLException e) {
            printCaughtException("In NonVoltDBBackend.getAllColumns, caught SQLException: " + e);
        }
        return columns;
    }
218200
public static CSTable extractColumns(CSTable table, String... colNames) {
        int[] idx = {};

        for (String name : colNames) {
            idx = add(idx, columnIndexes(table, name));
        }

        if (idx.length == 0) {
            throw new IllegalArgumentException("No such column names: " + Arrays.toString(colNames));
        }

        List<String> cols = new ArrayList<String>();
        for (String name : colNames) {
            cols.addAll(columnNames(table, name));
        }

        MemoryTable t = new MemoryTable();
        t.setName(table.getName());
        t.getInfo().putAll(table.getInfo());

        // header
        t.setColumns(cols.toArray(new String[0]));
        for (int i = 0; i < idx.length; i++) {
            t.getColumnInfo(i + 1).putAll(table.getColumnInfo(idx[i]));
        }

        String[] r = new String[idx.length];
        for (String[] row : table.rows()) {
            rowStringValues(row, idx, r);
            t.addRow((Object[]) r);
        }

        return t;
    }
880338
private Object[] findIdsByColumn(String tableName, String columnName, Object columnValue)
    {
        Object connection = null;

        try
        {
            connection = getConnection();
            String valueAsStr = PropertyAccessorHelper.getString(columnValue);

            Set<String> results = null;

            if (resource != null && resource.isActive())
            {
                Response response = ((Transaction) connection).zrangeByScore(getHashKey(tableName, columnName),
                        getDouble(valueAsStr), getDouble(valueAsStr));
                // ((Transaction) connection).exec();
                ((RedisTransaction) resource).onExecute(((Transaction) connection));

                results = (Set<String>) response.get();
            }
            else
            {
                results = ((Jedis) connection).zrangeByScore(getHashKey(tableName, columnName), getDouble(valueAsStr),
                        getDouble(valueAsStr));

            }
            if (results != null)
            {
                return results.toArray(new Object[0]);
            }

        }
        finally
        {
            onCleanup(connection);
        }

        return null;
    }
672769
public boolean containsColumn(String columnName) {
        return columns.stream()
            .map(DbColumn::getName)
            .anyMatch(listColName -> listColName.equals(columnName));
    }
798062
def get_column_names(self, X):
        
        if isinstance(X, pd.DataFrame):
            return X.columns

        return range(X.shape[1])
992238
def columns_exist(inspect_dataset):
    

    # Attempt to get column names. For pandas, columns is just a list of strings
    if not hasattr(inspect_dataset, "columns"):
        warnings.warn(
            "No columns list found in dataset; no autoinspection performed.")
        return
    elif isinstance(inspect_dataset.columns[0], string_types):
        columns = inspect_dataset.columns
    elif isinstance(inspect_dataset.columns[0], dict) and "name" in inspect_dataset.columns[0]:
        columns = [col['name'] for col in inspect_dataset.columns]
    else:
        raise AutoInspectError(
            "Unable to determine column names for this dataset.")

    create_multiple_expectations(
        inspect_dataset, columns, "expect_column_to_exist")