-
-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Duplicate index entries #86
Comments
As of right now, no, |
Thank you for the information. I will think about a workaround. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have a question about using Ascend with CreateSortIndex. In the result duplicate entries are not output. Is there a way that these are returned?
In this case only one Alice is returned:
package main
import (
"github.com/kelindar/column"
)
func main() {
// Erstellen einer neuen Tabelle
table := column.NewCollection()
table.CreateColumn("name", column.ForString())
table.CreateColumn("age", column.ForInt())
table.CreateColumn("country", column.ForString())
table.Insert(func(r column.Row) error {
r.SetString("name", "Charlie")
r.SetInt("age", 20)
r.SetString("country", "Großbritannien")
return nil
})
table.Insert(func(r column.Row) error {
r.SetString("name", "Alice")
r.SetInt("age", 25)
r.SetString("country", "USA")
return nil
})
table.Insert(func(r column.Row) error {
r.SetString("name", "Alice")
r.SetInt("age", 34)
r.SetString("country", "Österreich")
return nil
})
table.Insert(func(r column.Row) error {
r.SetString("name", "Bob")
r.SetInt("age", 30)
r.SetString("country", "Kanada")
return nil
})
table.Insert(func(r column.Row) error {
r.SetString("name", "David")
r.SetInt("age", 35)
r.SetString("country", "Australien")
return nil
})
table.CreateSortIndex("index1", "name")
table.Query(func(txn *column.Txn) error {
name := txn.String("name")
age := txn.Int("age")
country := txn.String("country")
return txn.With("name").Ascend("index1", func(idx uint32) {
print("idx: ", idx)
valueName, _ := name.Get()
print(" name: ", valueName)
valueAge, _ := age.Get()
print(" age: ", valueAge)
valueCountry, _ := country.Get()
println(" contry: ", valueCountry)
})
})
}
The text was updated successfully, but these errors were encountered: