Get the column indexes for a given column name.
(e.g. use tmin to fetch tmin[0], tmin[1]...)
@param table
@param name
@return
188130
public static int[] columnIndexes(CSTable table, String name) {
        List<Integer> l = new ArrayList<Integer>();
        for (int i = 1; i <= table.getColumnCount(); i++) {
            if (table.getColumnName(i).startsWith(name)) {
                l.add(i);
            }
        }
        if (l.isEmpty()) {
            return null;
        }
        int[] idx = new int[l.size()];
        for (int i = 0; i < idx.length; i++) {
            idx[i] = l.get(i);
        }
        return idx;
    }
610880
private List<Row> getTable(String name)
   {
      List<Row> result = m_tables.get(name);
      if (result == null)
      {
         result = Collections.emptyList();
      }
      return result;
   }
1357480
public IndexInfo getColumnToBeIndexed(String columnName)
    {
        IndexInfo idxInfo = new IndexInfo(columnName);
        if (columnToBeIndexed.contains(idxInfo))
        {
            int index = columnToBeIndexed.indexOf(idxInfo);
            return getColumnsToBeIndexed().get(index);
        }
        return idxInfo;
    }
418814
public function addIndex($table, $column, $name)
    {
        $sql = sprintf('ALTER TABLE %s ADD INDEX %s(%s)', $table, $name, $column);

        // Execute query
        $stmt = $this->connection->prepare($sql);
        return $stmt->execute();
    }
543499
public static String[] getColumnNames(DataSource ds, String tableName) {
		List<String> columnNames = new ArrayList<String>();
		Connection conn = null;
		ResultSet rs = null;
		try {
			conn = ds.getConnection();
			final DatabaseMetaData metaData = conn.getMetaData();
			rs = metaData.getColumns(conn.getCatalog(), null, tableName, null);
			while (rs.next()) {
				columnNames.add(rs.getString("COLUMN_NAME"));
			}
			return columnNames.toArray(new String[columnNames.size()]);
		} catch (Exception e) {
			throw new DbRuntimeException("Get columns error!", e);
		} finally {
			DbUtil.close(rs, conn);
		}
	}
73217
public static function buildIndexDeclare($name, $columns, $table = null)
    {
        $query = static::getQuery();
        $cols = [];

        foreach ((array) $columns as $key => $val) {
            if (is_numeric($key)) {
                $vals = explode('(', $val);
                $key = $query->quoteName($vals[0]);

                if (isset($vals[1])) {
                    $key .= '(' . trim($vals[1], '()') . ')';
                }

                $cols[] = $key;
            } else {
                if (!is_numeric($val)) {
                    $string = is_string($val) ? ' ' . $query->quote($val) : '';

                    throw new \InvalidArgumentException(
                        sprintf(
                            'Index length should be number, (%s)%s given.',
                            gettype($val),
                            $string
                        )
                    );
                }

                $cols[] = $query->quoteName($key) . '(' . $val . ')';
            }
        }

        $cols = '(' . implode(', ', $cols) . ')';

        return static::build(
            $name ? $query->quoteName($name) : null,
            $table ? 'ON ' . $query->quoteName($table) : null,
            $cols
        );
    }
540666
public List<String> getTableColumn(final By tableBy, final int columnNumber) {
		List<String> result = new ArrayList<String>();
		List<List<String>> table = this.getTableAsList(tableBy);

		for (List<String> line : table) {
			result.add(line.get(columnNumber));
		}
		return result;
	}
1307577
def getColumnByColumnAlias(self, name):
        
        result = None
        for column in self.__columns:
            columnAlias = column.getColumnAlias()
            if columnAlias == name:
                result = column
                break
        return result
668981
public static <T extends UserColumn> T getColumn(UserTable<T> table,
			DublinCoreType type) {

		T column = null;

		if (table.hasColumn(type.getName())) {
			column = table.getColumn(type.getName());
		} else {
			for (String synonym : type.getSynonyms()) {
				if (table.hasColumn(synonym)) {
					column = table.getColumn(synonym);
					break;
				}
			}
		}

		return column;
	}
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;
    }
1006643
def _columns_for_table(table_name):
    
    return {cname: col
            for (tname, cname), col in _COLUMNS.items()
            if tname == table_name}
390115
public static function addIndex($table, $type, $columns, $name)
    {
        $cols = static::buildIndexDeclare($name, $columns, $table);

        return static::build(
            'CREATE',
            strtoupper($type),
            $cols
        );
    }
235921
private int getTableIndex(String tableName) {

        int index;

        // System.out.println("begin searching for "+tableName);
        for (index = 0; index < vHoldTableNames.size(); index++) {

            // System.out.println("in getTableIndex searching for "+tableName+", index: "+index);
            if (tableName.equals((String) vHoldTableNames.elementAt(index))) {
                return index;
            }    // end of if (tableName.equals(vHoldTableNames.elementAt(index)))
        }        // end of for (index = 0; index < vHoldTableNames.size(); index ++)

        return -1;
    }
256383
private int getIndex(CharSequence name) {
        if (length() == 0 || name == null) {
            return -1;
        }
        int h = AsciiString.hashCode(name);
        int i = index(h);
        for (HeaderEntry e = headerFields[i]; e != null; e = e.next) {
            if (e.hash == h && equalsConstantTime(name, e.name) != 0) {
                return getIndex(e.index);
            }
        }
        return -1;
    }
536975
@NotNull
    public List<Integer> getIndexes(String name) {
        List<Integer> indexes = parametersMapping.get(name);
        if (indexes == null) {
            throw new IllegalArgumentException("Parameter not found: " + name);
        }
        return indexes;
    }
315732
@SuppressWarnings("unchecked")
	public <T> T get(String column) {
		return (T)getColumns().get(column);
	}
167274
public TableKraken loadTable(String name)
  {
    ResultFuture<TableKraken> future = new ResultFuture<>();
    
    loadTable(name, future);
    
    TableKraken table = future.get(10, TimeUnit.SECONDS);
    
    return table;
  }