// Get a list of Un-Aliased Columns, ie columns with column
//  names that have NOT yet been aliased
490237
func (m *SqlSource) UnAliasedColumns() map[string]*Column {
	//u.Warnf("un-aliased %d", len(m.Source.Columns))
	if len(m.cols) > 0 || m.Source != nil && len(m.Source.Columns) == 0 {
		return m.cols
	}

	cols := make(map[string]*Column, len(m.Source.Columns))
	for _, col := range m.Source.Columns {
		_, right, hasLeft := col.LeftRight()
		//u.Debugf("aliasing: l:%q r:%q hasLeft?%v", left, right, hasLeft)
		if hasLeft {
			cols[right] = col
		} else {
			cols[right] = col
		}
	}
	return cols
}
915619
func (m SessionMock) Columns(keyspace, table string) (map[string]gocql.TypeInfo, error) {
	var r = m.Called(keyspace, table)

	return r.Get(0).(map[string]gocql.TypeInfo), r.Error(1)
}
320093
func getPrimaryKeyColumns(table *schema.Table) []*schema.TableColumn {
	result := make([]*schema.TableColumn, 0, len(table.PKColumns))
	for _, pkColIndex := range table.PKColumns {
		result = append(result, &table.Columns[pkColIndex])
	}
	return result
}
1116682
func (r *Row) Columns() ([]string, error) {
	if r.err != nil {
		return nil, r.err
	}
	return r.rows.Columns()
}
1034970
func (rows *OCI8Rows) Columns() []string {
	names := make([]string, len(rows.defines))
	for i, define := range rows.defines {
		names[i] = define.name
	}
	return names
}
325837
func (d *Database) Columns(src interface{}, includePk bool) ([]string, error) {
	data, err := getFields(reflect.TypeOf(src))
	if err != nil {
		return nil, err
	}

	var names []string
	for _, elt := range data.columns {
		if !includePk && elt == data.pk {
			continue
		}
		names = append(names, elt)
	}

	return names, nil
}
1181346
func (table *Table) GetColumnIdx(name string, idx int) *Column {
	if c, ok := table.columnsMap[strings.ToLower(name)]; ok {
		if idx < len(c) {
			return c[idx]
		}
	}
	return nil
}
109476
func SqTableColumns(db models.XODB, schema string, table string) ([]*models.Column, error) {
	var err error

	// grab
	rows, err := models.SqTableColumns(db, table)
	if err != nil {
		return nil, err
	}

	// fix columns
	var cols []*models.Column
	for _, row := range rows {
		cols = append(cols, &models.Column{
			FieldOrdinal: row.FieldOrdinal,
			ColumnName:   row.ColumnName,
			DataType:     row.DataType,
			NotNull:      row.NotNull,
			DefaultValue: row.DefaultValue,
			IsPrimaryKey: row.PkColIndex != 0,
		})
	}

	return cols, nil
}
390601
func (s *Schema) ColumnsIndices(cols []*Column) (ret []int) {
	ret = make([]int, 0, len(cols))
	for _, col := range cols {
		pos := s.ColumnIndex(col)
		if pos != -1 {
			ret = append(ret, pos)
		} else {
			return nil
		}
	}
	return
}
932044
func (f *Function) GetAliases() (*lambda.ListAliasesOutput, error) {
	f.Log.Debug("fetching aliases")
	return f.Service.ListAliases(&lambda.ListAliasesInput{
		FunctionName: &f.FunctionName,
	})
}
1196364
func (p *DataSource) PruneColumns(parentUsedCols []*expression.Column) {
	used := getUsedList(parentUsedCols, p.schema)
	for i := len(used) - 1; i >= 0; i-- {
		if !used[i] {
			p.schema.Columns = append(p.schema.Columns[:i], p.schema.Columns[i+1:]...)
			p.Columns = append(p.Columns[:i], p.Columns[i+1:]...)
		}
	}
}
1233723
func (t *Table) Get(columns ...string) (stmt string, names []string) {
	if len(columns) == 0 {
		return t.get.stmt, t.get.names
	}

	return qb.Select(t.metadata.Name).
		Columns(columns...).
		Where(t.primaryKeyCmp...).
		ToCql()
}
280622
func (self *AliasTypeDef) UnmarshalJSON(b []byte) error {
	var m rawAliasTypeDef
	err := json.Unmarshal(b, &m)
	if err == nil {
		o := AliasTypeDef(m)
		*self = o
		err = self.Validate()
	}
	return err
}
371274
func (p *Union) PruneColumns(parentUsedCols []*expression.Column) {
	used := getUsedList(parentUsedCols, p.GetSchema())
	for i := len(used) - 1; i >= 0; i-- {
		if !used[i] {
			p.schema.Columns = append(p.schema.Columns[:i], p.schema.Columns[i+1:]...)
		}
	}
	for _, c := range p.GetChildren() {
		child := c.(LogicalPlan)
		schema := child.GetSchema()
		var newCols []*expression.Column
		for i, use := range used {
			if use {
				newCols = append(newCols, schema.Columns[i])
			}
		}
		child.PruneColumns(newCols)
	}
}
1144895
func (row *Row) GetUpdateColumns() []string {
	escapedColumns := make([]string, len(row.updateColumns))
	for i, updateColumn := range row.updateColumns {
		escapedColumns[i] = fmt.Sprintf("\"%s\"", updateColumn)
	}
	return escapedColumns
}
1305144
func (s *rowSegment) Columns() []uint64 {
	a := make([]uint64, 0, s.Count())
	itr := s.data.Iterator()
	for v, eof := itr.Next(); !eof; v, eof = itr.Next() {
		a = append(a, v)
	}
	return a
}
866151
func (b *InsertBuilder) Columns(columns ...string) *InsertBuilder {
	b.lock.Lock()
	b.columns = columns
	b.query = fmt.Sprintf(`%s(`, b.query)
	for i, column := range columns {
		b.query = fmt.Sprintf(`%s%s`, b.query, column)
		if i < len(columns)-1 {
			b.query = fmt.Sprintf(`%s,`, b.query)
		}
	}
	b.query = fmt.Sprintf(`%s)`, b.query)
	b.lock.Unlock()
	return b
}