Get a list of Un-Aliased Columns, ie columns with column names that have NOT yet been aliased
()
| 1456 | // Get a list of Un-Aliased Columns, ie columns with column |
| 1457 | // names that have NOT yet been aliased |
| 1458 | func (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 |
| 1478 | func (m *SqlSource) ColumnPositions() map[string]int { |