| 1432 | } |
| 1433 | |
| 1434 | func (m *SqlSource) findFromAliases() (string, string) { |
| 1435 | from1, from2 := m.alias, "" |
| 1436 | if m.JoinExpr != nil { |
| 1437 | switch nt := m.JoinExpr.(type) { |
| 1438 | case *expr.BinaryNode: |
| 1439 | if in, ok := nt.Args[0].(*expr.IdentityNode); ok { |
| 1440 | if left, _, ok := in.LeftRight(); ok { |
| 1441 | from1 = left |
| 1442 | } |
| 1443 | } |
| 1444 | if in, ok := nt.Args[1].(*expr.IdentityNode); ok { |
| 1445 | if left, _, ok := in.LeftRight(); ok { |
| 1446 | from2 = left |
| 1447 | } |
| 1448 | } |
| 1449 | default: |
| 1450 | u.Warnf("%T node types are not suppored yet for join rewrite", m.JoinExpr) |
| 1451 | } |
| 1452 | } |
| 1453 | return from1, from2 |
| 1454 | } |
| 1455 | |
| 1456 | // Get a list of Un-Aliased Columns, ie columns with column |
| 1457 | // names that have NOT yet been aliased |