| 11 | } |
| 12 | |
| 13 | func (table *Table) isEqual(secondTable *Table) bool { |
| 14 | if len(table.Columns) != len(secondTable.Columns) { |
| 15 | return false |
| 16 | } |
| 17 | |
| 18 | for i := range table.Columns { |
| 19 | if table.Columns[i].Name != secondTable.Columns[i].Name { |
| 20 | return false |
| 21 | } |
| 22 | if table.Columns[i].Type.Literal != secondTable.Columns[i].Type.Literal { |
| 23 | return false |
| 24 | } |
| 25 | if table.Columns[i].Type.Type != secondTable.Columns[i].Type.Type { |
| 26 | return false |
| 27 | } |
| 28 | if len(table.Columns[i].Values) != len(secondTable.Columns[i].Values) { |
| 29 | return false |
| 30 | } |
| 31 | for j := range table.Columns[i].Values { |
| 32 | if table.Columns[i].Values[j].ToString() != secondTable.Columns[i].Values[j].ToString() { |
| 33 | return false |
| 34 | } |
| 35 | } |
| 36 | } |
| 37 | |
| 38 | return true |
| 39 | } |
| 40 | |
| 41 | // getDistinctTable - Takes input table, and returns new one without any duplicates |
| 42 | func (table *Table) getDistinctTable() *Table { |