MCPcopy Create free account
hub / github.com/araddon/qlbridge / UnAliasedColumns

Method UnAliasedColumns

rel/sql.go:1458–1475  ·  view source on GitHub ↗

Get a list of Un-Aliased Columns, ie columns with column names that have NOT yet been aliased

()

Source from the content-addressed store, hash-verified

1456// Get a list of Un-Aliased Columns, ie columns with column
1457// names that have NOT yet been aliased
1458func (m *SqlSource) UnAliasedColumns() map[string]*Column {
1459 //u.Warnf("un-aliased %d", len(m.Source.Columns))
1460 if len(m.cols) > 0 || m.Source != nil && len(m.Source.Columns) == 0 {
1461 return m.cols
1462 }
1463
1464 cols := make(map[string]*Column, len(m.Source.Columns))
1465 for _, col := range m.Source.Columns {
1466 _, right, hasLeft := col.LeftRight()
1467 //u.Debugf("aliasing: l:%q r:%q hasLeft?%v", left, right, hasLeft)
1468 if hasLeft {
1469 cols[right] = col
1470 } else {
1471 cols[right] = col
1472 }
1473 }
1474 return cols
1475}
1476
1477// Get a list of Column names to position
1478func (m *SqlSource) ColumnPositions() map[string]int {

Callers

nothing calls this directly

Calls 1

LeftRightMethod · 0.45

Tested by

no test coverage detected